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

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

Introduction

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

Prototype

int VERTICAL_SPACING

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

Click Source Link

Document

Vertical spacing in dialog units (value 4).

Usage

From source file:org.summer.sdt.internal.ui.preferences.EditTemplateDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite ancestor) {
    Composite parent = new Composite(ancestor, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;//from www  .j  a  va2 s  . c o  m
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);

    parent.setLayout(layout);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    ModifyListener listener = new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            doTextWidgetChanged(e.widget);
        }
    };

    if (fIsNameModifiable) {
        createLabel(parent, PreferencesMessages.EditTemplateDialog_name);

        Composite composite = new Composite(parent, SWT.NONE);
        composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        layout = new GridLayout();
        layout.numColumns = 4;
        layout.marginWidth = 0;
        layout.marginHeight = 0;
        composite.setLayout(layout);

        fNameText = createText(composite);
        fNameText.addFocusListener(new FocusListener() {

            public void focusGained(FocusEvent e) {
            }

            public void focusLost(FocusEvent e) {
                if (fSuppressError) {
                    fSuppressError = false;
                    updateStatusAndButtons();
                }
            }
        });
        BidiUtils.applyBidiProcessing(fNameText, BidiUtils.BTD_DEFAULT);

        createLabel(composite, PreferencesMessages.EditTemplateDialog_context);
        fContextCombo = new Combo(composite, SWT.READ_ONLY);
        SWTUtil.setDefaultVisibleItemCount(fContextCombo);

        for (int i = 0; i < fContextTypes.length; i++) {
            fContextCombo.add(fContextTypes[i][1]);
        }

        fContextCombo.addModifyListener(listener);

        fAutoInsertCheckbox = createCheckbox(composite, PreferencesMessages.EditTemplateDialog_autoinsert);
        fAutoInsertCheckbox.setSelection(fTemplate.isAutoInsertable());
    }

    createLabel(parent, PreferencesMessages.EditTemplateDialog_description);

    int descFlags = fIsNameModifiable ? SWT.BORDER : SWT.BORDER | SWT.READ_ONLY;
    fDescriptionText = new Text(parent, descFlags);
    fDescriptionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fDescriptionText.addModifyListener(listener);
    BidiUtils.applyBidiProcessing(fDescriptionText, BidiUtils.BTD_DEFAULT);

    Label patternLabel = createLabel(parent, PreferencesMessages.EditTemplateDialog_pattern);
    patternLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    fPatternEditor = createEditor(parent);

    Label filler = new Label(parent, SWT.NONE);
    filler.setLayoutData(new GridData());

    Composite composite = new Composite(parent, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData());

    fInsertVariableButton = new Button(composite, SWT.NONE);
    fInsertVariableButton.setLayoutData(getButtonGridData());
    fInsertVariableButton.setText(PreferencesMessages.EditTemplateDialog_insert_variable);
    fInsertVariableButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            fPatternEditor.getTextWidget().setFocus();
            fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
        }

        public void widgetDefaultSelected(SelectionEvent e) {
        }
    });

    fDescriptionText.setText(fTemplate.getDescription());
    if (fIsNameModifiable) {
        fNameText.setText(fTemplate.getName());
        fNameText.addModifyListener(listener);
        fContextCombo.select(getIndex(fTemplate.getContextTypeId()));
    } else {
        fPatternEditor.getControl().setFocus();
    }
    initializeActions();

    applyDialogFont(parent);
    return composite;
}

From source file:org.summer.sdt.internal.ui.refactoring.reorg.RenameTypeWizardSimilarElementsOptionsDialog.java

License:Open Source License

@Override
protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);// www .  j  av  a 2s  .  co m

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    Label infoLabel = new Label(messageComposite, SWT.WRAP);
    infoLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_select_strategy);
    GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false);
    gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    infoLabel.setLayoutData(gd);
    infoLabel.setFont(parent.getFont());

    fExactStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fExactStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_1);
    fExactStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fExactStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_EXACT);
    LayoutUtil.setHorizontalIndent(fExactStrategyRadio.getSelectionButton(null));

    fEmbeddedStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fEmbeddedStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_2);
    fEmbeddedStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fEmbeddedStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_EMBEDDED);
    LayoutUtil.setHorizontalIndent(fEmbeddedStrategyRadio.getSelectionButton(null));

    fSuffixStrategyRadio = new SelectionButtonDialogField(SWT.RADIO);
    fSuffixStrategyRadio
            .setLabelText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_strategy_3);
    fSuffixStrategyRadio.doFillIntoGrid(messageComposite, 1);
    fSuffixStrategyRadio.setSelection(fSelectedStrategy == RenamingNameSuggestor.STRATEGY_SUFFIX);
    LayoutUtil.setHorizontalIndent(fSuffixStrategyRadio.getSelectionButton(null));

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    fWarningImageLabel = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    fWarningImageLabel.setImage(image);
    fWarningImageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    fWarningLabel = new Label(warningComposite, SWT.WRAP);
    fWarningLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsOptionsDialog_warning_short_names);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    fWarningLabel.setLayoutData(gridData);
    fWarningLabel.setFont(warningComposite.getFont());

    fExactStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_EXACT;
        }
    });

    fEmbeddedStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_EMBEDDED;
        }
    });

    fSuffixStrategyRadio.setDialogFieldListener(new IDialogFieldListener() {

        public void dialogFieldChanged(DialogField field) {
            updateLabel();
            fSelectedStrategy = RenamingNameSuggestor.STRATEGY_SUFFIX;
        }
    });

    updateLabel();

    return messageComposite;
}

From source file:org.talend.core.repository.ui.dialog.DuplicateDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, 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   www  .j  a v  a2s .com*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    super.createMessageWidget(parent, composite);
    super.createInputWidget(composite);
    typeGroup = new Composite(composite, SWT.NONE);
    GridLayout typeLayout = new GridLayout();
    typeLayout.numColumns = 6;
    typeGroup.setLayout(typeLayout);
    typeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    jobTypeCombo = new LabelledCombo(typeGroup, "Job Type:", "job type", JobType.getJobTypeToDispaly(), 2, //$NON-NLS-1$//$NON-NLS-2$
            true);
    frameworkCombo = new LabelledCombo(typeGroup, "Framework:", "framework", new String[0], 2, true); //$NON-NLS-1$//$NON-NLS-2$
    super.createErrorMessageWidget(composite);
    applyDialogFont(composite);
    // add listener
    addListener();
    // init
    init();
    return parent;
}

From source file:org.talend.core.ui.workspace.ChooseWorkspaceDialog.java

License:Open Source License

/**
 * The main area of the dialog is just a row with the current selection information and a drop-down of the most
 * recently used workspaces./*from  w  ww .j av a 2  s  .c  o m*/
 */
private void createWorkspaceBrowseRow(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    panel.setLayout(layout);
    panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    panel.setFont(parent.getFont());

    Label label = new Label(panel, SWT.NONE);
    label.setText(Messages.getString("WorkspaceDlg.workspace.label")); //$NON-NLS-1$

    text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN);
    text.setFocus();
    text.setLayoutData(new GridData(400, SWT.DEFAULT));
    text.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            Button okButton = getButton(Window.OK);
            if (okButton != null && !okButton.isDisposed()) {
                boolean nonWhitespaceFound = false;
                String characters = getWorkspaceLocation();
                for (int i = 0; !nonWhitespaceFound && i < characters.length(); i++) {
                    if (!Character.isWhitespace(characters.charAt(i))) {
                        nonWhitespaceFound = true;
                    }
                }
                okButton.setEnabled(nonWhitespaceFound);
            }
        }
    });
    setInitialTextValues(text);

    Button browseButton = new Button(panel, SWT.PUSH);
    browseButton.setText(Messages.getString("WorkspaceDlg.browse.button")); //$NON-NLS-1$
    setButtonLayoutData(browseButton);
    GridData data = (GridData) browseButton.getLayoutData();
    data.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
    browseButton.setLayoutData(data);
    browseButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SHEET);
            dialog.setText(Messages.getString("WorkspaceDlg.browse.folder.title"));//$NON-NLS-1$
            dialog.setMessage(Messages.getString("WorkspaceDlg.browse.folder.title"));//$NON-NLS-1$
            dialog.setFilterPath(getInitialBrowsePath());
            String dir = dialog.open();
            if (dir != null) {
                text.setText(TextProcessor.process(dir));
            }
        }
    });
}

From source file:org.talend.designer.core.ui.dialog.HelpAvailableDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    // create a layout with spacing and margins appropriate for the font
    // size./*from w w  w. ja  v  a  2 s  .co m*/
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    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);
    composite.setLayout(layout);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // Add the buttons to the button bar.
    createButtonsForButtonBar(composite);
    return composite;
}

From source file:org.talend.designer.filemultischemas.ui.dialog.MultiSchemaDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite panel = new Composite(parent, 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);
    panel.setLayout(layout);//from  www .ja  v a  2s .co  m
    panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(panel);

    multiSchemaUI = new MultiSchemasUI(panel, this.multiSchemasMain.getMultiSchemaManager());
    multiSchemaUI.addListener(this);
    multiSchemaUI.init();

    return panel;
}

From source file:org.talend.designer.neo4j.ui.dialogs.Neo4jDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite panel = new Composite(parent, 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);
    panel.setLayout(layout);//from w  w  w  .ja  va  2 s . c o m
    panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(panel);

    neo4jMain.createUI(panel, true);

    return panel;
}

From source file:org.talend.designer.rowgenerator.ui.dialogs.RowGeneratorDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite panel = new Composite(parent, 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);
    panel.setLayout(layout);//  ww  w  .j a  va2  s. co  m
    panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(panel);

    rowGenMain.createUI(panel, true);
    rowGenMain.updateTableTitleColumn();
    rowGenMain.updateComponentsSize();

    return panel;
}

From source file:org.talend.expressionbuilder.ui.PigExpressionBuilderDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    container = new Composite(parent, 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);
    container.setLayout(layout);/*w  w w  .  ja v  a 2  s.  co  m*/
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(container);

    final SashForm sashForm = new SashForm(container, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);

    final Composite upperComposite = new Composite(sashForm, SWT.NONE);
    upperComposite.setLayout(new FillLayout());

    final SashForm upperSashform = new SashForm(upperComposite, SWT.NONE);

    expressionComposite = new PigExpressionComposite(this, upperSashform, SWT.NONE, dataBean);
    expressionComposite.setExpression(defaultExpression, true);

    testComposite = new PigInputTableComposite(upperSashform, SWT.NONE);
    testComposite.addVariables(defaultVariables);
    upperSashform.setWeights(new int[] { 3, 2 });

    final Composite lowerComposite = new Composite(sashForm, SWT.NONE);
    lowerComposite.setLayout(new FillLayout());

    categoryComposite = new PigCategoryComposite(lowerComposite, SWT.NONE, manager);
    final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    sashForm.setLayoutData(gridData);
    sashForm.setWeights(new int[] { 3, 2 });
    return container;
}

From source file:org.talend.registration.wizards.register.RegisterWizardPage1.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(3, true);
    // layout.numColumns = 0; // this is incremented by createButton
    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);
    composite.setLayout(layout);/* w  w  w . java  2 s .  co  m*/
    GridData data = new GridData();// GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_END
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // Add the buttons to the button bar.
    createButtonsForButtonBar(composite);
    return composite;
}