Search in sources :

Example 91 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class OutputTablesZoneView method initLayout.

@Override
public Layout initLayout() {
    FormLayout formLayout = new FormLayout();
    formLayout.marginLeft = 40;
    formLayout.marginRight = 10;
    formLayout.marginTop = MARGIN_TOP_ZONE_WITHOUT_ACTION_BAR;
    formLayout.marginBottom = 10;
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    formLayout.spacing = 10;
    setLayout(formLayout);
    return formLayout;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout)

Example 92 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class DebugProcessTosComposite method createLineLimitedControl.

private void createLineLimitedControl(Composite container) {
    Composite composite = new Composite(container, SWT.NONE);
    FormData layouData = new FormData();
    layouData.left = new FormAttachment(0, 10);
    layouData.right = new FormAttachment(100, 0);
    layouData.top = new FormAttachment(100, -30);
    layouData.bottom = new FormAttachment(100, -3);
    composite.setLayoutData(layouData);
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 7;
    formLayout.marginHeight = 4;
    formLayout.spacing = 7;
    composite.setLayout(formLayout);
    enableLineLimitButton = new Button(composite, SWT.CHECK);
    //$NON-NLS-1$
    enableLineLimitButton.setText(Messages.getString("ProcessComposite.lineLimited"));
    FormData formData = new FormData();
    enableLineLimitButton.setLayoutData(formData);
    enableLineLimitButton.setEnabled(false);
    enableLineLimitButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            lineLimitText.setEditable(enableLineLimitButton.getSelection());
            RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.ENABLE_CONSOLE_LINE_LIMIT, enableLineLimitButton.getSelection());
        }
    });
    lineLimitText = new Text(composite, SWT.BORDER);
    formData = new FormData();
    formData.width = 120;
    formData.left = new FormAttachment(enableLineLimitButton, 0, SWT.RIGHT);
    lineLimitText.setLayoutData(formData);
    lineLimitText.setEnabled(false);
    lineLimitText.addListener(SWT.Verify, new Listener() {

        // this text only receive number here.
        @Override
        public void handleEvent(Event e) {
            String s = e.text;
            if (!s.equals("")) {
                //$NON-NLS-1$
                try {
                    Integer.parseInt(s);
                    RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT, lineLimitText.getText() + s);
                } catch (Exception ex) {
                    e.doit = false;
                }
            }
        }
    });
    lineLimitText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            RunProcessPlugin.getDefault().getPluginPreferences().setValue(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT, lineLimitText.getText());
        }
    });
    boolean enable = RunProcessPlugin.getDefault().getPluginPreferences().getBoolean(RunprocessConstants.ENABLE_CONSOLE_LINE_LIMIT);
    enableLineLimitButton.setSelection(enable);
    lineLimitText.setEditable(enable);
    String count = RunProcessPlugin.getDefault().getPluginPreferences().getString(RunprocessConstants.CONSOLE_LINE_LIMIT_COUNT);
    if (count.equals("")) {
        //$NON-NLS-1$
        //$NON-NLS-1$
        count = "100";
    }
    lineLimitText.setText(count);
}
Also used : FormData(org.eclipse.swt.layout.FormData) FormLayout(org.eclipse.swt.layout.FormLayout) IStreamListener(org.eclipse.debug.core.IStreamListener) PropertyChangeListener(java.beans.PropertyChangeListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) KeyListener(org.eclipse.swt.events.KeyListener) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) StyledText(org.eclipse.swt.custom.StyledText) Text(org.eclipse.swt.widgets.Text) DebugException(org.eclipse.debug.core.DebugException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ProcessorException(org.talend.designer.runprocess.ProcessorException) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Event(org.eclipse.swt.widgets.Event) PropertyChangeEvent(java.beans.PropertyChangeEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 93 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class BasicNotePropertyComposite method createControl.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.designer.core.ui.editor.properties.notes.AbstractNotePropertyComposite#createControl(org.eclipse.swt
     * .widgets.Composite)
     */
@Override
public void createControl(Composite parent) {
    composite = getWidgetFactory().createFlatFormComposite(parent);
    if (composite.getLayout() instanceof FormLayout) {
        FormLayout formLayout = (FormLayout) composite.getLayout();
        formLayout.spacing = 0;
    }
    FormData data;
    //$NON-NLS-1$
    check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
    check.setLayoutData(data);
    //$NON-NLS-1$
    CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
    data = new FormData();
    data.left = new FormAttachment(check);
    data.top = new FormAttachment(check, 0, SWT.TOP);
    labelLabel.setLayoutData(data);
    check.setSelection(note.isOpaque());
    check.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (check.getSelection() != (note.isOpaque())) {
                ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
                getCommandStack().execute(command);
            }
        }
    });
    createFontsAndColorsGroups(composite);
    createAlignGroups(composite);
    createTextControl(composite);
    refresh();
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) CLabel(org.eclipse.swt.custom.CLabel) ChangeNoteOpacityCommand(org.talend.designer.core.ui.editor.cmd.ChangeNoteOpacityCommand) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 94 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class OpaqueNotePropertySection method createControls.

@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    Composite composite = getWidgetFactory().createFlatFormComposite(parent);
    if (composite.getLayout() instanceof FormLayout) {
        FormLayout formLayout = (FormLayout) composite.getLayout();
        formLayout.spacing = 0;
    }
    FormData data;
    //$NON-NLS-1$
    check = getWidgetFactory().createButton(composite, "", SWT.CHECK);
    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
    check.setLayoutData(data);
    //$NON-NLS-1$
    CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("OpaqueNoteSection.Label"));
    data = new FormData();
    data.left = new FormAttachment(check);
    data.top = new FormAttachment(check, 0, SWT.TOP);
    labelLabel.setLayoutData(data);
    check.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            if (check.getSelection() != (note.isOpaque())) {
                ChangeNoteOpacityCommand command = new ChangeNoteOpacityCommand(note, check.getSelection());
                getCommandStack().execute(command);
            }
        }
    });
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) CLabel(org.eclipse.swt.custom.CLabel) ChangeNoteOpacityCommand(org.talend.designer.core.ui.editor.cmd.ChangeNoteOpacityCommand) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 95 with FormLayout

use of org.eclipse.swt.layout.FormLayout in project tdi-studio-se by Talend.

the class FooterComposite method createComponents.

private void createComponents() {
    GridData footerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    this.setLayoutData(footerCompositeGridData);
    FormLayout formLayout = new FormLayout();
    this.setLayout(formLayout);
    Button okButton = new Button(this, SWT.NONE);
    //$NON-NLS-1$
    okButton.setText(Messages.getString("FooterComposite.0"));
    FormData okFormData = new FormData();
    Point minSize = okButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    okFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
    okButton.setLayoutData(okFormData);
    okButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            // if (hl7Manager.getUiManager().validateRootElement()) {
            hl7Manager.getUiManager().closeHL7(SWT.OK);
        // } else {
        // MessageDialog warningMessageDialog = new MessageDialog(composite.getShell(), Messages
        //                            .getString("FooterComposite.RootElementError.Title"), null, //$NON-NLS-1$
        //                            Messages.getString("FooterComposite.RootElementError.Message"), MessageDialog.ERROR, //$NON-NLS-1$
        //                            new String[] { Messages.getString("FooterComposite.0") }, 0); //$NON-NLS-1$
        // warningMessageDialog.open();
        // }
        }
    });
    Button cancelButton = new Button(this, SWT.NONE);
    //$NON-NLS-1$
    cancelButton.setText(Messages.getString("FooterComposite.1"));
    cancelButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            hl7Manager.getUiManager().closeHL7(SWT.CANCEL);
        }
    });
    FormData cancelFormData = new FormData();
    minSize = cancelButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    cancelFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
    cancelButton.setLayoutData(cancelFormData);
    Button autoMapButton = new Button(this, SWT.NONE);
    if (hl7Manager != null) {
        boolean canModify = hl7Manager.getHl7Component().getProcess().isReadOnly();
        if (hl7Manager.getHl7Component().getOriginalNode().getJobletNode() != null) {
            canModify = hl7Manager.getHl7Component().getOriginalNode().isReadOnly();
        }
        if (canModify) {
            autoMapButton.setEnabled(false);
        }
    }
    //$NON-NLS-1$
    autoMapButton.setToolTipText(Messages.getString("FooterComposite.AutoMapTip"));
    //$NON-NLS-1$
    autoMapButton.setText(Messages.getString("FooterComposite.AutoMap"));
    autoMapButton.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            hl7Manager.getUiManager().autoMap(hl7Manager.getCurrentSchema(false));
        }
    });
    FormData autoMapFormData = new FormData();
    minSize = autoMapButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    autoMapFormData.width = Math.max(IDialogConstants.BUTTON_WIDTH, minSize.x);
    autoMapButton.setLayoutData(autoMapFormData);
    cancelFormData.right = new FormAttachment(100, -5);
    okFormData.right = new FormAttachment(cancelButton, -5);
// autoMapFormData.left = new FormAttachment(0, 5);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Point(org.eclipse.swt.graphics.Point) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

FormLayout (org.eclipse.swt.layout.FormLayout)127 FormData (org.eclipse.swt.layout.FormData)97 FormAttachment (org.eclipse.swt.layout.FormAttachment)93 Composite (org.eclipse.swt.widgets.Composite)82 Button (org.eclipse.swt.widgets.Button)54 Label (org.eclipse.swt.widgets.Label)53 SelectionEvent (org.eclipse.swt.events.SelectionEvent)39 Point (org.eclipse.swt.graphics.Point)33 Group (org.eclipse.swt.widgets.Group)31 GridData (org.eclipse.swt.layout.GridData)30 Text (org.eclipse.swt.widgets.Text)30 GridLayout (org.eclipse.swt.layout.GridLayout)29 SelectionListener (org.eclipse.swt.events.SelectionListener)27 Combo (org.eclipse.swt.widgets.Combo)25 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)19 FillLayout (org.eclipse.swt.layout.FillLayout)19 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)17 StyledText (org.eclipse.swt.custom.StyledText)13 ModifyListener (org.eclipse.swt.events.ModifyListener)12 ModifyEvent (org.eclipse.swt.events.ModifyEvent)11