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

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

Introduction

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

Prototype

int HORIZONTAL_MARGIN

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

Click Source Link

Document

Horizontal margin in dialog units (value 7).

Usage

From source file:org.eclipse.php.internal.ui.wizards.PHPProjectWizardFirstPage.java

License:Open Source License

/**
 * Initialize a grid layout with the default Dialog settings.
 *//*from   www. ja v a 2  s . co  m*/
public GridLayout initGridLayout(GridLayout layout, boolean margins) {
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    if (margins) {
        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    } else {
        layout.marginWidth = 0;
        layout.marginHeight = 0;
    }
    return layout;
}

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);//from   w  w w.  j  a va 2s. 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  ww w.  j a  va2s .  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   w w w .  ja va  2s  .com*/
    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}/*from w w w .j  a  v a2  s  . com*/
 * 
 * @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.tcf.te.ui.jface.dialogs.OptionalMessageDialog.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 = 0;/*  www  . ja  v a  2  s  .co  m*/
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
    composite.setLayout(layout);
    GridData gd = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
    if (parent.getLayout() instanceof GridLayout) {
        gd.horizontalSpan = ((GridLayout) parent.getLayout()).numColumns;
    }
    composite.setLayoutData(gd);
    composite.setFont(parent.getFont());

    // create help control if needed
    if (contextHelpId != null) {
        Control helpControl = createHelpControl(composite);
        ((GridData) helpControl.getLayoutData()).horizontalIndent = convertHorizontalDLUsToPixels(
                IDialogConstants.HORIZONTAL_MARGIN);
    }

    Control buttonSection = super.createButtonBar(composite);
    ((GridData) buttonSection.getLayoutData()).grabExcessHorizontalSpace = true;
    return composite;
}

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)
 *//*from  w ww .  j  a v a2  s.  co 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;//from  w  w w  .  ja v  a 2  s  . c  o  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;/*from  w w w.ja v  a 2  s .  co 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);/*www.ja  v  a2s  .  c o 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;
}