Example usage for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING

List of usage examples for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING.

Prototype

int HORIZONTAL_SPACING

To view the source code for org.eclipse.jface.dialogs IDialogConstants HORIZONTAL_SPACING.

Click Source Link

Document

Horizontal spacing in dialog units (value 4).

Usage

From source file:org.kalypso.contribs.eclipse.ui.dialogs.TreeSelectionDialog.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the dialog.
 *
 * @param composite/*  w ww.  j av  a 2s .co  m*/
 *          org.eclipse.swt.widgets.Composite
 */
private void addSelectionButtons(final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);

    final GridLayout layout = GridLayoutFactory.fillDefaults().create();
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);

    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false));

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    final Object inputElement = m_inputElement;
    SelectionListener listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            m_treeViewer.setSubtreeChecked(inputElement, true);
        }
    };
    selectButton.addSelectionListener(listener);

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);

    listener = new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            m_treeViewer.setSubtreeChecked(inputElement, false);
        }
    };
    deselectButton.addSelectionListener(listener);
}

From source file:org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.java

License:Open Source License

/**
 * Add the selection and deselection buttons to the page.
 *///  w  w w . j a v a2s.co m
private void addSelectionButtons(final CheckboxTableViewer checkboxViewer, final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true, false));

    addSpinner(m_resultProcessViewer, composite);

    final String SELECT_ALL_TITLE = Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.16");// WorkbenchMessages.SelectionDialog_selectLabel; //$NON-NLS-1$
    final String DESELECT_ALL_TITLE = Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.17");// WorkbenchMessages.SelectionDialog_deselectLabel; //$NON-NLS-1$

    final Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, SELECT_ALL_TITLE,
            false);

    selectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(true);
            updateSelection();
        }
    });

    final Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID,
            DESELECT_ALL_TITLE, false);

    deselectButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            checkboxViewer.setAllChecked(false);
            updateSelection();
        }
    });
}

From source file:org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.java

License:Open Source License

private void addSpinner(final CheckboxTableViewer resultProcessViewer, final Composite composite) {
    final Composite buttonComposite = new Composite(composite, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;//  w  w w .java2s.  com
    layout.marginWidth = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));

    final Label spinnerLabel = new Label(buttonComposite, SWT.NONE);
    spinnerLabel.setText(Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.11")); //$NON-NLS-1$
    final GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    spinnerLabel.setLayoutData(gridData);

    final Spinner spinNumStepProcessing = new Spinner(buttonComposite, SWT.BORDER);

    final GridData gridDataSpin = new GridData(SWT.RIGHT, SWT.CENTER, true, false);

    spinNumStepProcessing.setLayoutData(gridDataSpin);
    spinNumStepProcessing.setDigits(0);
    spinNumStepProcessing.setMinimum(1);
    spinNumStepProcessing.setMaximum(100);
    final Integer resultIncrement = m_parentWizard.getResultIntervalFromCalcPage();
    spinNumStepProcessing.setSelection(resultIncrement);
    updateTableSelection(resultProcessViewer, spinNumStepProcessing);
    updateSelection();

    spinNumStepProcessing
            .setToolTipText(Messages.getString("org.kalypso.kalypsomodel1d2d.sim.RMA10ResultPage.12")); //$NON-NLS-1$
    spinNumStepProcessing.addSelectionListener(new SelectionAdapter() {
        /**
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        @Override
        public void widgetSelected(final SelectionEvent e) {

            updateTableSelection(resultProcessViewer, spinNumStepProcessing);
            updateSelection();
        }
    });

}

From source file:org.locationtech.udig.style.sld.editor.StyleEditorDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    composite.setLayout(layout);/*  w w  w .  j  a  v  a 2  s  . c om*/
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // add import/export buttons
    addImportExportButtons(composite);

    // add apply/revert/close buttons
    addOkCancelRevertApplyButtons(parent, composite);

    return composite;
}

From source file:org.locationtech.udig.style.sld.editor.StyleEditorDialog.java

License:Open Source License

private void addOkCancelRevertApplyButtons(Composite parent, Composite composite) {
    GridLayout layout;//from   w w  w .  ja v  a  2s  .  c om
    GridData data;
    Composite compRight = new Composite(composite, SWT.NONE);
    layout = new GridLayout(0, true); // columns are set at end because createButton sets them but we want 2x2
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    compRight.setLayout(layout);
    data = new GridData(SWT.END, SWT.CENTER, true, false);
    compRight.setLayoutData(data);
    compRight.setFont(parent.getFont());

    Button defaultsButton = createButton(compRight, DEFAULTS_ID, Messages.StyleEditorDialog_defaults, false);
    defaultsButton.setEnabled(true);
    defaultsButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));

    Button revertButton = createButton(compRight, REVERT_ID, Messages.StyleEditor_revert, false);
    revertButton.setEnabled(false);
    revertButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));

    Button applyButton = createButton(compRight, APPLY_ID, Messages.StyleEditor_apply, false);
    applyButton.setEnabled(false);
    applyButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));

    new Label(compRight, SWT.None);

    Button closeButton = createButton(compRight, CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    closeButton.setEnabled(true);
    closeButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));

    Button okButton = createButton(compRight, OK_ID, IDialogConstants.OK_LABEL, false);
    okButton.setEnabled(true);
    okButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));

    layout.numColumns = 3;
}

From source file:org.locationtech.udig.style.sld.editor.StyleEditorDialog.java

License:Open Source License

private void addImportExportButtons(Composite composite) {
    GridLayout layout;/*  w  w  w .  j ava 2  s . c  o m*/
    Composite compLeft = new Composite(composite, SWT.NONE);
    layout = new GridLayout(0, true); // columns are incremented by createButton
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    compLeft.setLayout(layout);
    compLeft.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, false));

    Button importButton = createButton(compLeft, IMPORT_ID, Messages.StyleEditor_import, false);
    importButton.setEnabled(false);
    importButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));
    Button exportButton = createButton(compLeft, EXPORT_ID, Messages.StyleEditor_export, false);
    exportButton.setEnabled(false);
    exportButton.addListener(SWT.Selection, new StyleEditorButtonListener(this));
}

From source file:org.locationtech.udig.validation.ui.ValidationDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.FILL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/* w w w  .j ava2s .  c om*/
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = 0; // no spacing here, it's purely a container
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    composite.setLayout(layout);
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // create 2 composites in the composite with left and right aligns
    Composite leftComp = new Composite(composite, SWT.LEFT);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    leftComp.setLayout(layout);
    data = new GridData(SWT.LEFT, SWT.NONE, true, false);
    leftComp.setLayoutData(data);
    leftComp.setFont(parent.getFont());

    Composite rightComp = new Composite(composite, SWT.RIGHT);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    rightComp.setLayout(layout);
    data = new GridData(SWT.RIGHT, SWT.NONE, true, false);
    rightComp.setLayoutData(data);
    rightComp.setFont(parent.getFont());

    // Add the buttons
    importButton = new Button(leftComp, SWT.PUSH);
    importButton.setFont(parent.getFont());
    importButton.setText(Messages.ValidationDialog_import);
    importButton.setEnabled(true);
    importButton.addSelectionListener(new ImportSuiteListener());
    setButtonLayoutData(importButton);

    exportButton = new Button(leftComp, SWT.PUSH);
    exportButton.setFont(parent.getFont());
    exportButton.setText(Messages.ValidationDialog_export);
    exportButton.setEnabled(false);
    exportButton.addSelectionListener(new ExportSuiteListener());
    setButtonLayoutData(exportButton);

    runButton = new Button(rightComp, SWT.PUSH);
    runButton.setFont(parent.getFont());
    runButton.setText(Messages.ValidationDialog_run);
    runButton.setEnabled(false);
    runButton.addSelectionListener(new RunTestsListener());
    setButtonLayoutData(runButton);

    cancelButton = new Button(rightComp, SWT.PUSH);
    cancelButton.setText(IDialogConstants.CLOSE_LABEL);
    cancelButton.setFont(parent.getFont());
    cancelButton.setData(new Integer(IDialogConstants.CANCEL_ID));
    closeListener = new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            // nothing is happening and the user hit cancel (close)
            buttonPressed(((Integer) event.widget.getData()).intValue());
        }
    };
    //        cancelListener = new SelectionListener() {
    //
    //            public void widgetSelected( SelectionEvent e ) {
    //                // a test is running and the user just hit cancel
    //                // cancel the progress monitor
    //                progressMonitorPart.setCanceled(true);
    //                cancelButton.setEnabled(false);
    //            }
    //
    //            public void widgetDefaultSelected( SelectionEvent e ) {
    //                widgetSelected(e);
    //            }
    //            
    //        };
    cancelButton.addSelectionListener(closeListener);
    setButtonLayoutData(cancelButton);

    return composite;
}

From source file:org.neo4j.neoclipse.connection.dialogs.CreateAliasDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite parent) {

    // top level composite
    Composite parentComposite = (Composite) super.createDialogArea(parent);

    // create a composite with standard margins and spacing
    Composite composite = new Composite(parentComposite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);//from  w w  w . j a  v a2s . c  o m
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parentComposite.getFont());

    Composite nameGroup = new Composite(composite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 3;
    layout.marginWidth = 10;
    nameGroup.setLayout(layout);
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    nameGroup.setLayoutData(data);

    Label label = new Label(nameGroup, SWT.WRAP);
    label.setText(("Name *"));
    nameField = new Text(nameGroup, SWT.BORDER);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    nameField.setLayoutData(data);
    nameField.addKeyListener(new KeyListener() {

        @Override
        public void keyPressed(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };

        @Override
        public void keyReleased(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };
    });

    urlField = new DirectoryFieldEditor(Preferences.DATABASE_LOCATION, "URI *", nameGroup);
    urlField.getTextControl(nameGroup).addKeyListener(new KeyListener() {

        @Override
        public void keyReleased(KeyEvent arg0) {
            validate();
        }

        @Override
        public void keyPressed(KeyEvent arg0) {
            validate();
        }
    });
    urlField.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            validate();

        }
    });

    new Label(nameGroup, SWT.NONE);
    Label label3 = new Label(nameGroup, SWT.WRAP);
    label3.setText(("i.e http://localhost:7474/db/data/ or C:/neo4j/db "));
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    label3.setLayoutData(data);

    new Label(nameGroup, SWT.NONE);

    Composite connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE);
    connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 0;
    connectionPropertiesComposite.setLayout(gridLayout);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    connectionPropertiesComposite.setLayoutData(data);

    autoConnectButton = new Button(connectionPropertiesComposite, SWT.CHECK);
    GridData gd_autoLogonButton = new GridData(108, SWT.DEFAULT);
    autoConnectButton.setLayoutData(gd_autoLogonButton);
    autoConnectButton.setText("Auto Connect");

    allowUpgrade = new Button(connectionPropertiesComposite, SWT.CHECK);
    GridData gd_allowUpgrade = new GridData(128, SWT.DEFAULT);
    allowUpgrade.setLayoutData(gd_allowUpgrade);
    allowUpgrade.setText(GraphDatabaseSettings.allow_store_upgrade.name());
    allowUpgrade.setSelection(true);

    Label label4 = new Label(nameGroup, SWT.WRAP);
    label4.setText(("User"));
    userField = new Text(nameGroup, SWT.BORDER);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    userField.setLayoutData(data);

    Label label5 = new Label(nameGroup, SWT.WRAP);
    label5.setText(("Password"));
    passwordField = new Text(nameGroup, SWT.BORDER);
    passwordField.setEchoChar('*');
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    passwordField.setLayoutData(data);

    new Label(nameGroup, SWT.NONE);

    connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE);
    connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 0;
    connectionPropertiesComposite.setLayout(gridLayout);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    connectionPropertiesComposite.setLayoutData(data);

    return parentComposite;
}

From source file:org.neo4j.neoclipse.entitygen.GenerateEntityDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite parent) {

    // top level composite
    Composite parentComposite = (Composite) super.createDialogArea(parent);

    // create a composite with standard margins and spacing
    Composite composite = new Composite(parentComposite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);/*from   w  w w.j  a v a2  s .com*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parentComposite.getFont());

    Composite nameGroup = new Composite(composite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 3;
    layout.marginWidth = 10;
    nameGroup.setLayout(layout);
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    nameGroup.setLayoutData(data);

    Label label = new Label(nameGroup, SWT.WRAP);
    label.setText(("Package Name *"));
    packageName = new Text(nameGroup, SWT.BORDER);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    packageName.setText("com.example.neo4j.persistence");
    packageName.setLayoutData(data);
    packageName.addKeyListener(new KeyListener() {

        @Override
        public void keyPressed(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };

        @Override
        public void keyReleased(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };
    });

    Label label1 = new Label(nameGroup, SWT.WRAP);
    label1.setText(("Class Name Property*"));
    classNamePattern = new Text(nameGroup, SWT.BORDER);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    classNamePattern.setText("classname");
    classNamePattern.setLayoutData(data);
    classNamePattern.addKeyListener(new KeyListener() {

        @Override
        public void keyPressed(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };

        @Override
        public void keyReleased(org.eclipse.swt.events.KeyEvent e) {

            validate();
        };
    });

    directory = new DirectoryFieldEditor("Directory", "Directory *", nameGroup);
    directory.getTextControl(nameGroup).addKeyListener(new KeyListener() {

        @Override
        public void keyReleased(KeyEvent arg0) {
            validate();
        }

        @Override
        public void keyPressed(KeyEvent arg0) {
            validate();
        }
    });
    directory.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            validate();

        }
    });

    new Label(nameGroup, SWT.NONE);
    Label label3 = new Label(nameGroup, SWT.WRAP);
    label3.setText(("ex: C:/neo4j/stubs "));
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    label3.setLayoutData(data);

    new Label(nameGroup, SWT.NONE);

    Composite connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE);
    connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 0;
    connectionPropertiesComposite.setLayout(gridLayout);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    connectionPropertiesComposite.setLayoutData(data);

    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;

    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;

    new Label(nameGroup, SWT.NONE);

    connectionPropertiesComposite = new Composite(nameGroup, SWT.NONE);
    connectionPropertiesComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 0;
    connectionPropertiesComposite.setLayout(gridLayout);
    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    data.horizontalSpan = 2;
    connectionPropertiesComposite.setLayoutData(data);

    return parentComposite;
}

From source file:org.nightlabs.eclipse.ui.dialog.ExpandableAreaDialog.java

License:Open Source License

/**
 * Override this method to return the Composite you want to be visible in the
 * upper area of the Dialog.//from  w w w . j av a 2 s.com
 * @param parent Add your Composite as child of this
 */
protected Composite createStaticArea(Composite parent) {
    // create a composite with no margins and standard spacing
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    return composite;
}