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

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

Introduction

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

Prototype

int VERTICAL_MARGIN

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

Click Source Link

Document

Vertical margin in dialog units (value 7).

Usage

From source file:org.eclipse.php.refactoring.ui.prefereces.PHPCodeRefactorPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {

    initializeDialogUnits(parent);//from  w  ww . ja  v a  2  s  .c o m

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    Group refactoringGroup = new Group(result, SWT.NONE);
    refactoringGroup.setLayout(new GridLayout());
    refactoringGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    refactoringGroup.setText(Messages.PHPCodeRefactorPreferencePage_2);

    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);

    renameBtn = new Button(refactoringGroup, SWT.CHECK);
    renameBtn.setText(Messages.PHPCodeRefactorPreferencePage_3);
    renameBtn.setLayoutData(gd);

    renameBtn.setSelection(getPreferenceStore().getBoolean(PreferenceConstants.REFACTOR_LIGHTWEIGHT));

    Dialog.applyDialogFont(result);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
            IPHPHelpContextIds.CODE_REFACTOR_PREFERENCES);
    return result;
}

From source file:org.eclipse.ptp.internal.rdt.sync.ui.properties.SyncPropertyPage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    Composite controls = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, 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);
    controls.setLayout(layout);//www .  ja  v a  2 s  .  c o  m
    controls.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    fWidget = new ManageConfigurationWidget(controls, SWT.NONE);
    fWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fWidget.setProject(getProject());

    return controls;
}

From source file:org.eclipse.qvt.declarative.editor.ui.paged.PagedSaveAsDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite contents = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout(2, 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);
    Composite inner = new Composite(contents, SWT.NULL);
    inner.setLayout(layout);//from   w  w w. j a  v  a 2  s . c  om
    //      inner.setFont(parent.getFont());
    inner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    createSaveTypeCombo(inner);
    return contents;
}

From source file:org.eclipse.search.internal.ui.SearchDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // create
    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   ww  w. jav  a2s  .c  o m*/
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // create help control if needed
    if (isHelpAvailable()) {
        createHelpControl(composite);
    }
    fCustomizeButton = createButton(composite, CUSTOMIZE_ID, SearchMessages.SearchDialog_customize, true);

    Label filler = new Label(composite, SWT.NONE);
    filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
    layout.numColumns++;

    fReplaceButton = createActionButton(composite, REPLACE_ID, SearchMessages.SearchDialog_replaceAction, true);
    fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage);
    Button searchButton = createActionButton(composite, SEARCH_ID, SearchMessages.SearchDialog_searchAction,
            true);
    searchButton.setEnabled(fDescriptors.size() > 0);
    super.createButtonsForButtonBar(composite); // cancel button

    return composite;
}

From source file:org.eclipse.sirius.common.ui.tools.api.dialog.NewFileDialog.java

License:Open Source License

/**
 * {@inheritDoc}// w w  w  . j  ava2 s.  c o  m
 * 
 * @see org.eclipse.sirius.common.ui.tools.api.dialog.FolderSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createDialogArea(final Composite parent) {
    final Control result = super.createDialogArea(parent);
    final Composite composite = new Composite(parent, SWT.NONE);
    final 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);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    final Label label = new Label(composite, SWT.NULL);
    label.setText("File"); //$NON-NLS-1$
    newFileNameText = new Text(composite, SWT.BORDER);
    final GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
    data.heightHint = newFileNameText.getLineHeight();
    data.widthHint = newFileNameText.getLineHeight() * 30;
    newFileNameText.setLayoutData(data);
    newFileNameText.setText(newFileName);
    newFileNameText.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
            updateOKStatus();
        }
    });
    return result;
}

From source file:org.eclipse.team.internal.ccvs.ui.AddToVersionControlDialog.java

License:Open Source License

/**
 * @see org.eclipse.team.internal.ui.DetailsDialog#createDropDownDialogArea(org.eclipse.swt.widgets.Composite)
 *//* ww  w  .  ja v  a2  s . c  o  m*/
protected Composite createDropDownDialogArea(Composite parent) {
    // create a composite with standard margins and spacing
    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);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    addUnaddedResourcesArea(composite);

    return composite;
}

From source file:org.eclipse.team.internal.ccvs.ui.CVSHistoryFilterDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite topLevel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;// w w  w  .ja v a2  s  .  co m
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    topLevel.setLayout(layout);

    //"and" and "or" search radio buttons
    Label label = new Label(topLevel, SWT.NONE);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    label.setLayoutData(data);
    label.setText(CVSUIMessages.HistoryFilterDialog_showMatching);

    andRadio = new Button(topLevel, SWT.RADIO);
    andRadio.setText(CVSUIMessages.HistoryFilterDialog_matchingAll);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    andRadio.setLayoutData(data);
    andRadio.setSelection(true);

    orRadio = new Button(topLevel, SWT.RADIO);
    orRadio.setText(CVSUIMessages.HistoryFilterDialog_matchingAny);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    orRadio.setLayoutData(data);

    //branch name
    label = new Label(topLevel, SWT.NONE);
    label.setText(CVSUIMessages.HistoryFilterDialog_branchName);
    branchName = new Text(topLevel, SWT.BORDER);
    branchName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    //author
    label = new Label(topLevel, SWT.NONE);
    label.setText(CVSUIMessages.HistoryFilterDialog_author);
    author = new Text(topLevel, SWT.BORDER);
    author.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    //comment
    label = new Label(topLevel, SWT.NONE);
    label.setText(CVSUIMessages.HistoryFilterDialog_comment);
    comment = new Text(topLevel, SWT.BORDER);
    comment.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    //"from" date
    label = new Label(topLevel, SWT.NONE);
    label.setText(CVSUIMessages.HistoryFilterDialog_fromDate);
    fromDate = new DateTime(topLevel, SWT.DATE | SWT.BORDER);

    //"to" date   
    label = new Label(topLevel, SWT.NONE);
    label.setText(CVSUIMessages.HistoryFilterDialog_toDate);
    toDate = new DateTime(topLevel, SWT.DATE | SWT.BORDER);

    initializeValues();

    Dialog.applyDialogFont(parent);
    return topLevel;
}

From source file:org.eclipse.team.internal.ccvs.ui.DateTagDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite topLevel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;//w ww .j  a v a  2s  . c o  m
    initializeDialogUnits(topLevel);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    topLevel.setLayout(layout);

    createDateArea(topLevel);
    createTimeArea(topLevel);
    initializeValues();
    updateWidgetEnablements();

    // set F1 help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(topLevel, IHelpContextIds.DATE_TAG_DIALOG);
    Dialog.applyDialogFont(parent);
    return topLevel;
}

From source file:org.eclipse.team.internal.ccvs.ui.IgnoreResourcesDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite top = new Composite((Composite) super.createDialogArea(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);
    top.setLayout(layout);//from w ww.  ja v a 2  s .co  m
    top.setLayoutData(new GridData(GridData.FILL_BOTH));

    PlatformUI.getWorkbench().getHelpSystem().setHelp(top, IHelpContextIds.ADD_TO_CVSIGNORE);

    Listener selectionListener = new Listener() {
        public void handleEvent(Event event) {
            updateEnablements();
        }
    };
    Listener modifyListener = new Listener() {
        public void handleEvent(Event event) {
            validate();
        }
    };

    addNameEntryButton = createRadioButton(top, CVSUIMessages.IgnoreResourcesDialog_addNameEntryButton);
    addNameEntryButton.addListener(SWT.Selection, selectionListener);
    addNameEntryButton.setSelection(selectedAction == ADD_NAME_ENTRY);
    Label addNameEntryLabel = createIndentedLabel(top, CVSUIMessages.IgnoreResourcesDialog_addNameEntryExample,
            LABEL_INDENT_WIDTH);

    addExtensionEntryButton = createRadioButton(top,
            CVSUIMessages.IgnoreResourcesDialog_addExtensionEntryButton);
    addExtensionEntryButton.addListener(SWT.Selection, selectionListener);
    addExtensionEntryButton.setSelection(selectedAction == ADD_EXTENSION_ENTRY);
    Label addExtensionEntryLabel = createIndentedLabel(top,
            CVSUIMessages.IgnoreResourcesDialog_addExtensionEntryExample, LABEL_INDENT_WIDTH);

    addCustomEntryButton = createRadioButton(top, CVSUIMessages.IgnoreResourcesDialog_addCustomEntryButton);
    addCustomEntryButton.addListener(SWT.Selection, selectionListener);
    addCustomEntryButton.setSelection(selectedAction == ADD_CUSTOM_ENTRY);
    createIndentedLabel(top, CVSUIMessages.IgnoreResourcesDialog_addCustomEntryExample, LABEL_INDENT_WIDTH);

    if (resourceWithSpaces) {
        customEntryText = createIndentedText(top, getResourceWithSpace().getName().replaceAll(" ", "?"), //$NON-NLS-1$//$NON-NLS-2$
                LABEL_INDENT_WIDTH);
        ControlDecoration customEntryTextDecoration = new ControlDecoration(customEntryText,
                SWT.TOP | SWT.LEAD);
        FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
        FieldDecoration infoDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);
        customEntryTextDecoration.setImage(infoDecoration.getImage());
        customEntryTextDecoration.setDescriptionText(CVSUIMessages.IgnoreResourcesDialog_filesWithSpaceWarning);
        customEntryTextDecoration.setShowOnlyOnFocus(false);
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        gridData.horizontalIndent = LABEL_INDENT_WIDTH
                + FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
        customEntryText.setLayoutData(gridData);
        customEntryText.setFocus();

        addNameEntryButton.setEnabled(false);
        addNameEntryLabel.setEnabled(false);
        // switch selection to "Custom pattern"
        if (!addCustomEntryButton.getSelection()) {
            addNameEntryButton.setSelection(false);
            addCustomEntryButton.setSelection(true);
            selectedAction = ADD_CUSTOM_ENTRY;
        }

        // when there is at least one resource without extension with spaces 
        // we should disable the "Wildcard extension" option
        if (!allResourcesWithSpacesHaveExtensions) {
            addExtensionEntryButton.setEnabled(false);
            addExtensionEntryLabel.setEnabled(false);
            // switch selection to "Custom pattern" which is always enabled
            addExtensionEntryButton.setSelection(false);
            addCustomEntryButton.setSelection(true);
            selectedAction = ADD_CUSTOM_ENTRY;
        }

    } else {
        customEntryText = createIndentedText(top, resources[0].getName(), LABEL_INDENT_WIDTH);
    }

    customEntryText.addListener(SWT.Modify, modifyListener);

    applyDialogFont(top);

    return top;
}

From source file:org.eclipse.team.internal.ccvs.ui.repo.RepositoriesFilterDialog.java

License:Open Source License

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);
    composite.setLayout(layout);//from  w w w . j a  va2s . co m

    fShowModules = new Button(composite, SWT.CHECK);
    fShowModules.setText(CVSUIMessages.RepositoryFilterDialog_showModules);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    fShowModules.setLayoutData(data);
    fShowModules.setSelection(true);

    initializeValues();

    // set F1 help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.REPOSITORY_FILTER_DIALOG);
    Dialog.applyDialogFont(parent);
    return composite;
}