Search in sources :

Example 6 with LabelledFileField

use of org.talend.commons.ui.swt.formtools.LabelledFileField in project tdi-studio-se by Talend.

the class HeaderComposite method createComponents.

private void createComponents() {
    this.setLayout(new GridLayout(3, false));
    GridData headerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    this.setLayoutData(headerCompositeGridData);
    //$NON-NLS-N$
    String[] extensions = new String[] { "*.*" };
    fileField = new LabelledFileField(this, "File path:", extensions, 1, SWT.BORDER) {

        protected void setFileFieldValue(String result) {
            if (result != null) {
                getTextControl().setText(TalendTextUtils.addQuotes(PathUtils.getPortablePath(result)));
            }
        }
    };
    fileField.setText(filePath);
    fileField.setEditable(!isRepository);
    final Group group = Form.createGroup(this, 4, "File Setting", 30);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    group.setLayoutData(gridData);
    startChar = new LabelledText(group, "Start character");
    startChar.setText(startCharValue);
    startChar.setEditable(!isRepository);
    endChar = new LabelledText(group, "End character");
    endChar.setText(endCharValue);
    endChar.setEditable(!isRepository);
    addListeners();
}
Also used : LabelledText(org.talend.commons.ui.swt.formtools.LabelledText) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Example 7 with LabelledFileField

use of org.talend.commons.ui.swt.formtools.LabelledFileField in project tdi-studio-se by Talend.

the class JSONFileOutputStep1Form method createOutputFile.

private void createOutputFile(final Composite mainComposite, final int width, final int height) {
    Group group = Form.createGroup(mainComposite, 1, "Output File Path", height);
    GridData fileData = new GridData(GridData.FILL_HORIZONTAL);
    fileData.heightHint = 60;
    group.setLayoutData(fileData);
    Composite compositeFile = Form.startNewDimensionnedGridLayout(group, 3, WIDTH_GRIDDATA_PIXEL, height);
    String[] outputExtensions = new String[] { "*.JSON" };
    outputFilePath = new LabelledFileField(compositeFile, "Output file", outputExtensions);
    outputFilePath.setText("");
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Example 8 with LabelledFileField

use of org.talend.commons.ui.swt.formtools.LabelledFileField in project tdi-studio-se by Talend.

the class GenerateDocAsHTMLWizardPage method createCssDestinationGroup.

protected void createCssDestinationGroup(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    boolean isCheck = CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.USE_CSS_TEMPLATE);
    button = new Button(composite, SWT.CHECK);
    //$NON-NLS-1$
    button.setText(Messages.getString("GenerateDocAsHTMLWizardPage.custom_css"));
    button.setSelection(isCheck);
    //$NON-NLS-1$
    new Label(composite, SWT.NONE).setText(Messages.getString("GenerateDocAsHTMLWizardPage.default_css_template"));
    Composite composite1 = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    composite1.setLayout(layout);
    composite1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    String value = CorePlugin.getDefault().getPreferenceStore().getString(ITalendCorePrefConstants.CSS_FILE_PATH);
    if (isCheck && value != null && !value.equals("")) {
        //$NON-NLS-1$
        cssFilePath = value;
    }
    //$NON-NLS-1$ //$NON-NLS-2$
    String[] cssExtensions = { "*.css", "*.*" };
    //$NON-NLS-1$
    cssField = new LabelledFileField(composite1, Messages.getString("GenerateDocAsHTMLWizardPage.css_file"), cssExtensions);
    cssField.setEditable(button.getSelection());
    cssField.setText(value);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Example 9 with LabelledFileField

use of org.talend.commons.ui.swt.formtools.LabelledFileField in project tdi-studio-se by Talend.

the class MultiSchemasUI method createFileGroup.

private void createFileGroup(Composite fileGroup) {
    fileGroup.setLayout(new GridLayout(3, false));
    fileField = new LabelledFileField(fileGroup, ExternalMultiSchemasUIProperties.FILE_LABEL, ExternalMultiSchemasUIProperties.FILE_EXTENSIONS, 1, SWT.BORDER) {

        @Override
        protected void setFileFieldValue(String result) {
            if (result != null) {
                getTextControl().setText(TalendTextUtils.addQuotes(PathUtils.getPortablePath(result)));
            }
        }
    };
    Composite settings = new Composite(fileGroup, SWT.NONE);
    GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.horizontalSpan = 3;
    settings.setLayoutData(layoutData);
    settings.setLayout(new GridLayout(2, false));
    addGroupMultiSchemaSettings(settings);
    addGroupEscapeChar(settings);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) CommandStackForComposite(org.talend.commons.ui.command.CommandStackForComposite) GridData(org.eclipse.swt.layout.GridData) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField)

Aggregations

LabelledFileField (org.talend.commons.ui.swt.formtools.LabelledFileField)9 GridData (org.eclipse.swt.layout.GridData)8 GridLayout (org.eclipse.swt.layout.GridLayout)7 Composite (org.eclipse.swt.widgets.Composite)7 Button (org.eclipse.swt.widgets.Button)5 Group (org.eclipse.swt.widgets.Group)4 Label (org.eclipse.swt.widgets.Label)4 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 Text (org.eclipse.swt.widgets.Text)2 LabelledCombo (org.talend.commons.ui.swt.formtools.LabelledCombo)2 LabelledText (org.talend.commons.ui.swt.formtools.LabelledText)2 ArrayList (java.util.ArrayList)1 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)1 KeyAdapter (org.eclipse.swt.events.KeyAdapter)1 KeyEvent (org.eclipse.swt.events.KeyEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Table (org.eclipse.swt.widgets.Table)1