Search in sources :

Example 96 with Button

use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.

the class JSONFileOutputStep2Form method addSchemaViewer.

private void addSchemaViewer(final Composite mainComposite, final int width, final int height) {
    final Group group = Form.createGroup(mainComposite, 1, "Linker Source", height);
    // group.setBackgroundMode(SWT.INHERIT_FORCE);
    schemaButton = new Button(group, SWT.PUSH);
    schemaButton.setText("Schema Management");
    schemaButton.setToolTipText("You can add or edit schema and save in 'Schema List' viewer");
    schemaViewer = new TableViewer(group);
    JSONFileTableViewerProvider provider = new JSONFileTableViewerProvider();
    schemaViewer.setContentProvider(provider);
    schemaViewer.setLabelProvider(provider);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    Table table = schemaViewer.getTable();
    if (isReadOnly()) {
        table.setEnabled(false);
    }
    table.setHeaderVisible(true);
    org.eclipse.swt.widgets.TableColumn column = new org.eclipse.swt.widgets.TableColumn(table, SWT.LEFT);
    column.setText("Schema List");
    column.setWidth(100);
    table.setLayoutData(gridData);
}
Also used : Group(org.eclipse.swt.widgets.Group) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) Table(org.eclipse.swt.widgets.Table) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) Button(org.eclipse.swt.widgets.Button) MoveUpTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.MoveUpTreeNodeButton) MoveDownTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.MoveDownTreeNodeButton) RemoveTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.RemoveTreeNodeButton) AddTreeNodeButton(org.talend.repository.json.ui.wizards.buttons.AddTreeNodeButton) GridData(org.eclipse.swt.layout.GridData) JSONFileTableViewerProvider(org.talend.repository.json.ui.wizards.view.JSONFileTableViewerProvider) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 97 with Button

use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.

the class JSONFileOutputStep1Form method createOutputSettingArea.

private void createOutputSettingArea() {
    Group group = Form.createGroup(this, 1, "Output Setting", 80);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = 150;
    group.setLayoutData(data);
    Composite compositeButton = Form.startNewDimensionnedGridLayout(group, 1, WIDTH_GRIDDATA_PIXEL, 20);
    noFileButton = new Button(compositeButton, SWT.RADIO);
    noFileButton.setText("Create manually");
    useFileButton = new Button(compositeButton, SWT.RADIO);
    useFileButton.setText("Create from a file");
    Composite compositeOutput = Form.startNewDimensionnedGridLayout(group, 3, WIDTH_GRIDDATA_PIXEL, 20);
    String[] extensions = new String[] { "*.JSON", "*.*", "*" };
    jsonFilePath = new LabelledFileField(compositeOutput, "JSON File", extensions);
    jsonFilePath.setText("");
    EMetadataEncoding[] values = EMetadataEncoding.values();
    String[] encodingData = new String[values.length];
    for (int j = 0; j < values.length; j++) {
        encodingData[j] = values[j].getName();
    }
    encodingCombo = new LabelledCombo(compositeOutput, "Encording", "Encording", encodingData, 1, true, SWT.NONE);
    encodingCombo.setText("");
    Composite limitation = new Composite(compositeOutput, SWT.NONE);
    limitation.setLayout(new GridLayout(2, false));
    labelLimitation = new Label(limitation, SWT.LEFT);
    labelLimitation.setText("Limit");
    commonNodesLimitation = new Text(limitation, SWT.BORDER);
    GridData gd = new GridData(18, 12);
    commonNodesLimitation.setLayoutData(gd);
    commonNodesLimitation.setText(String.valueOf(TreePopulator.getLimit()));
    labelLimitation.setToolTipText(MessageFormat.format(Messages.JSONLimitToolTip, commonNodesLimitation.getText()));
    if (!noFileButton.getSelection() && !useFileButton.getSelection()) {
        noFileButton.setSelection(true);
    }
}
Also used : LabelledCombo(org.talend.commons.ui.swt.formtools.LabelledCombo) Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) LabelledFileField(org.talend.commons.ui.swt.formtools.LabelledFileField) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) EMetadataEncoding(org.talend.core.model.metadata.EMetadataEncoding)

Example 98 with Button

use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.

the class AbstractLoginActionPage method instantiateNavigatorArea.

protected void instantiateNavigatorArea(Composite container) {
    // Navigate Area
    navigateArea = new Composite(container, SWT.NONE);
    navigatorSeperatorLine = new Label(navigateArea, SWT.SEPARATOR | SWT.HORIZONTAL);
    alwaysAsk = new Button(navigateArea, SWT.CHECK);
    alwaysAsk.setFont(LoginDialogV2.fixedFont);
    alwaysAsk.setBackground(backgroundColor);
    //$NON-NLS-1$
    alwaysAsk.setText(Messages.getString("LoginProjectPage.alwaysAskMe"));
    //$NON-NLS-1$
    alwaysAsk.setToolTipText(Messages.getString("LoginProjectPage.alwaysAskMe.toolTip"));
    previousButton = new Button(navigateArea, SWT.NONE);
    previousButton.setFont(LoginDialogV2.fixedFont);
    previousButton.setBackground(backgroundColor);
    //$NON-NLS-1$
    previousButton.setText(Messages.getString("LoginProjectPage.previous"));
    finishButton = new Button(navigateArea, SWT.NONE);
    finishButton.setFont(LoginDialogV2.fixedFont);
    finishButton.setBackground(backgroundColor);
    //$NON-NLS-1$
    finishButton.setText(Messages.getString("LoginProjectPage.finish"));
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label)

Example 99 with Button

use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.

the class LoginAgreementPage method createControl.

@Override
public void createControl(Composite parentCtrl) {
    Composite container = new Composite(parentCtrl, SWT.NONE);
    container.setLayout(new FormLayout());
    Label titleLabel = new Label(container, SWT.WRAP);
    titleLabel.setFont(LoginDialogV2.fixedFont);
    //$NON-NLS-1$
    titleLabel.setText(Messages.getString("LoginAgreementPage.title"));
    FormData titleLabelFormData = new FormData();
    titleLabelFormData.left = new FormAttachment(0, 0);
    titleLabelFormData.top = new FormAttachment(0, 0);
    titleLabel.setLayoutData(titleLabelFormData);
    acceptButton = new Button(container, SWT.CENTER);
    acceptButton.setBackground(backgroundColor);
    acceptButton.setFont(LoginDialogV2.fixedFont);
    //$NON-NLS-1$
    acceptButton.setText(Messages.getString("LoginAgreementPage.accept"));
    FormData acceptButtonFormLayoutData = new FormData();
    acceptButtonFormLayoutData.bottom = new FormAttachment(100, 0);
    acceptButtonFormLayoutData.right = new FormAttachment(100, 0);
    acceptButtonFormLayoutData.left = new FormAttachment(100, -1 * LoginDialogV2.getNewButtonSize(acceptButton).x);
    acceptButton.setLayoutData(acceptButtonFormLayoutData);
    boolean haveHtmlDesc = false;
    FileInputStream licenseInputStream = null;
    String licenseFileBasePath = Platform.getInstallLocation().getURL().getPath();
    if (Boolean.parseBoolean(System.getProperty("USE_BROWSER"))) {
        //$NON-NLS-1$
        File htmlFile = new File(licenseFileBasePath + LICENSE_FILE_PATH_HTML);
        if (htmlFile.exists()) {
            try {
                licenseInputStream = new FileInputStream(htmlFile);
                if (licenseInputStream != null) {
                    haveHtmlDesc = true;
                }
            } catch (FileNotFoundException e) {
                CommonExceptionHandler.process(e);
            }
        }
    }
    if (licenseInputStream == null) {
        try {
            licenseInputStream = new FileInputStream(licenseFileBasePath + LICENSE_FILE_PATH);
        } catch (FileNotFoundException e) {
            CommonExceptionHandler.process(e);
        }
    }
    FormData clufLayoutData = new FormData();
    clufLayoutData.top = new FormAttachment(titleLabel, LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.BOTTOM);
    clufLayoutData.left = new FormAttachment(0, 0);
    clufLayoutData.right = new FormAttachment(100, 0);
    clufLayoutData.bottom = new FormAttachment(acceptButton, -1 * LoginDialogV2.TAB_VERTICAL_PADDING_LEVEL_1, SWT.TOP);
    if (haveHtmlDesc) {
        clufBrowser = new Browser(container, SWT.BORDER);
        clufBrowser.setText(getLicense(licenseInputStream));
        clufBrowser.setLayoutData(clufLayoutData);
    } else {
        clufText = new Text(container, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT | SWT.BORDER);
        clufText.setBackground(new Color(null, 255, 255, 255));
        //$NON-NLS-1$
        Font font = new Font(DisplayUtils.getDisplay(), "courier", 10, SWT.NONE);
        clufText.setFont(font);
        clufText.setEditable(false);
        clufText.setText(getLicense(licenseInputStream));
        clufText.setLayoutData(clufLayoutData);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Composite(org.eclipse.swt.widgets.Composite) Color(org.eclipse.swt.graphics.Color) Label(org.eclipse.swt.widgets.Label) FileNotFoundException(java.io.FileNotFoundException) Text(org.eclipse.swt.widgets.Text) FileInputStream(java.io.FileInputStream) Font(org.eclipse.swt.graphics.Font) Button(org.eclipse.swt.widgets.Button) File(java.io.File) FormAttachment(org.eclipse.swt.layout.FormAttachment) Browser(org.eclipse.swt.browser.Browser)

Example 100 with Button

use of org.eclipse.swt.widgets.Button in project tdi-studio-se by Talend.

the class UseDynamicJobSelectionDialog method createSelectionButton.

/**
     * DOC hcw Comment method "createSelectionButton".
     * 
     * @param itemComposite
     */
private void createSelectionButton(Composite itemComposite) {
    Composite buttonComposite = new Composite(itemComposite, SWT.NONE);
    GridLayoutFactory.swtDefaults().margins(0, 25).applyTo(buttonComposite);
    GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).applyTo(buttonComposite);
    Button selectAll = new Button(buttonComposite, SWT.PUSH);
    // selectAll.setText(DataTransferMessages.DataTransfer_selectAll);
    //$NON-NLS-1$
    selectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_selectAll"));
    selectAll.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
            exportItemsTreeViewer.setAllChecked(true);
        }
    });
    setButtonLayoutData(selectAll);
    Button deselectAll = new Button(buttonComposite, SWT.PUSH);
    // deselectAll.setText(DataTransferMessages.DataTransfer_deselectAll);
    //$NON-NLS-1$
    deselectAll.setText(Messages.getString("DataTransferMessages.DataTransfer_deselectAll"));
    deselectAll.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
            exportItemsTreeViewer.setAllChecked(false);
        }
    });
    setButtonLayoutData(deselectAll);
    Button expandBtn = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    expandBtn.setText(Messages.getString("UseDynamicJobSelectionDialog.expandBtnText"));
    expandBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
            exportItemsTreeViewer.expandAll();
        }
    });
    setButtonLayoutData(expandBtn);
    Button collapseBtn = new Button(buttonComposite, SWT.PUSH);
    //$NON-NLS-1$
    collapseBtn.setText(Messages.getString("UseDynamicJobSelectionDialog.collapseBtnText"));
    collapseBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CheckboxTreeViewer exportItemsTreeViewer = getItemsTreeViewer();
            exportItemsTreeViewer.collapseAll();
        }
    });
    setButtonLayoutData(collapseBtn);
}
Also used : CheckboxTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Aggregations

Button (org.eclipse.swt.widgets.Button)3255 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1941 GridData (org.eclipse.swt.layout.GridData)1738 Composite (org.eclipse.swt.widgets.Composite)1720 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1611 Label (org.eclipse.swt.widgets.Label)1533 GridLayout (org.eclipse.swt.layout.GridLayout)1532 Text (org.eclipse.swt.widgets.Text)1087 Group (org.eclipse.swt.widgets.Group)783 ModifyListener (org.eclipse.swt.events.ModifyListener)619 ModifyEvent (org.eclipse.swt.events.ModifyEvent)608 FormAttachment (org.eclipse.swt.layout.FormAttachment)542 FormData (org.eclipse.swt.layout.FormData)541 Shell (org.eclipse.swt.widgets.Shell)515 Event (org.eclipse.swt.widgets.Event)498 FormLayout (org.eclipse.swt.layout.FormLayout)489 SelectionListener (org.eclipse.swt.events.SelectionListener)486 Listener (org.eclipse.swt.widgets.Listener)471 Display (org.eclipse.swt.widgets.Display)418 ShellEvent (org.eclipse.swt.events.ShellEvent)348