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

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

Introduction

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

Prototype

int BUTTON_MARGIN

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

Click Source Link

Document

Button margin in dialog units (value 4).

Usage

From source file:com.sympedia.genfw.presentation.MultiLineDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    Composite mainArea = (Composite) super.createDialogArea(parent);

    Composite control = new Composite(mainArea, SWT.NONE);
    control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    GridLayout layout = new GridLayout();
    layout.marginLeft = IDialogConstants.BUTTON_MARGIN;
    layout.marginTop = IDialogConstants.BUTTON_MARGIN;
    layout.marginRight = IDialogConstants.BUTTON_MARGIN;
    layout.marginBottom = IDialogConstants.BUTTON_MARGIN;
    control.setLayout(layout);/* w  w  w .  j av a 2  s  . co m*/

    initializeDialogUnits(control);

    textArea = createTextControl(control);
    textArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    setTitle(displayName);
    setMessage("Edit the " + displayName + " property of the " + object.eClass().getName() + ".");

    Dialog.applyDialogFont(mainArea);
    return mainArea;
}

From source file:org.carrot2.workbench.core.ui.SearchEditorSaveAsDialog.java

License:Open Source License

private void createControls(Composite root) {
    final GridLayout parentLayout = (GridLayout) root.getLayout();

    parentLayout.numColumns = 3;/*from w  w  w.j av  a  2s  .com*/

    root.setLayout(parentLayout);
    {
        Label fileNameLabel = new Label(root, SWT.NONE);
        fileNameLabel.setText("Location:");
    }
    {
        GridData fileNameTextLData = new GridData();
        fileNameTextLData.horizontalAlignment = GridData.FILL;
        fileNameTextLData.grabExcessHorizontalSpace = true;
        fileNameTextLData.verticalAlignment = GridData.FILL;
        fileNameTextLData.horizontalIndent = 5;
        fileNameTextLData.minimumWidth = 280;
        fileNameTextLData.widthHint = 280;
        fileNameText = new Text(root, SWT.BORDER);
        fileNameText.setLayoutData(fileNameTextLData);
    }
    {
        browseButton = new Button(root, SWT.NONE);
        GridData dialogButtonLData = new GridData();
        dialogButtonLData.horizontalAlignment = GridData.FILL;
        dialogButtonLData.verticalAlignment = GridData.FILL;
        browseButton.setText("Browse...");
        dialogButtonLData.widthHint = browseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT).x
                + 2 * IDialogConstants.BUTTON_MARGIN;
        browseButton.setLayoutData(dialogButtonLData);
    }

    docOption = createCheckbox(root, "Include documents", editorOptions.includeDocuments);
    clusterOption = createCheckbox(root, "Include clusters", editorOptions.includeClusters);
    attributesOption = createCheckbox(root, "Include other attributes", editorOptions.includeAttributes);
}

From source file:org.eclipse.ui.ide.markers.compatibility.internal.SeverityAndDescriptionConfigurationArea.java

License:Open Source License

/**
 * Create a group for the severity selection.
 * //from  ww w .  ja  v a2s .c o m
 * @param parent
 */
private void createSeverityGroup(Composite parent) {

    Composite severityComposite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(4, false);
    layout.horizontalSpacing = IDialogConstants.BUTTON_MARGIN;
    severityComposite.setLayout(layout);
    severityComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));

    Label label = new Label(severityComposite, SWT.NONE);
    label.setText(MarkerMessages.filtersDialog_severityLabel);

    errorButton = new Button(severityComposite, SWT.CHECK);
    errorButton.setText(MarkerMessages.filtersDialog_severityError);
    errorButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_ERROR, errorButton.getSelection());
        }
    });
    GridData data = new GridData();
    data.horizontalIndent = IDialogConstants.BUTTON_MARGIN;
    errorButton.setLayoutData(data);

    warningButton = new Button(severityComposite, SWT.CHECK);
    warningButton.setText(MarkerMessages.filtersDialog_severityWarning);
    warningButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_WARNING, warningButton.getSelection());
        }
    });

    infoButton = new Button(severityComposite, SWT.CHECK);
    infoButton.setText(MarkerMessages.filtersDialog_severityInfo);
    infoButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_INFO, infoButton.getSelection());
        }
    });
}

From source file:org.eclipse.ui.internal.views.markers.SeverityAndDescriptionConfigurationArea.java

License:Open Source License

/**
 * Create a group for the severity selection.
 * /*  w  w w .j a  v  a 2  s . com*/
 * @param parent
 * @return {@link Composite}
 */
Composite createSeverityGroup(Composite parent) {

    Composite severityComposite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(4, false);
    layout.horizontalSpacing = IDialogConstants.BUTTON_MARGIN;
    severityComposite.setLayout(layout);
    severityComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));

    label = new Label(severityComposite, SWT.NONE);
    label.setText(MarkerMessages.filtersDialog_severityLabel);

    errorButton = new Button(severityComposite, SWT.CHECK);
    errorButton.setText(MarkerMessages.filtersDialog_severityError);
    errorButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_ERROR, errorButton.getSelection());
        }
    });
    GridData data = new GridData();
    data.horizontalIndent = IDialogConstants.BUTTON_MARGIN;
    errorButton.setLayoutData(data);

    warningButton = new Button(severityComposite, SWT.CHECK);
    warningButton.setText(MarkerMessages.filtersDialog_severityWarning);
    warningButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_WARNING, warningButton.getSelection());
        }
    });

    infoButton = new Button(severityComposite, SWT.CHECK);
    infoButton.setText(MarkerMessages.filtersDialog_severityInfo);
    infoButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            updateSeverities(SeverityAndDescriptionFieldFilter.SEVERITY_INFO, infoButton.getSelection());
        }
    });
    return severityComposite;
}

From source file:org.jboss.tools.common.model.ui.wizards.query.AbstractQueryDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    CommandBar commandBar = view.getCommandBar();
    commandBar.addCommandBarListener(view);
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 0;//  ww  w  .  j  a v  a 2  s .  c o m
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    composite.setLayoutData(gd);

    Label titleBarSeparator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    titleBarSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    CommandBarLayout cbl = new CommandBarLayout();
    cbl.buttonHeight = convertHorizontalDLUsToPixels(20);
    cbl.buttonWidth = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    cbl.gap = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_MARGIN);
    cbl.left = 10;
    cbl.right = 10;
    cbl.top = 11;
    cbl.bottom = 10;
    commandBar.setLayout(cbl);
    commandBar.setCommands(getCommands());
    commandBar.setDefaultCommand(view.getDefaultCommand());
    Control control = commandBar.createControl(composite);
    commandBar.getLayout().alignment = SWT.RIGHT;
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = commandBar.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
    control.setLayoutData(gd);
    if (view.getHelpKey() == null)
        commandBar.setEnabled(AbstractQueryWizardView.HELP, false);
    view.updateBar();
    return composite;
}

From source file:org.jboss.tools.common.model.ui.wizards.special.DefaultSpecialWizardDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 0;/*w w w .  ja v a  2  s .co m*/
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    //gd.heightHint = commandBarHeight;
    composite.setLayoutData(gd);

    // Build the separator line
    Label titleBarSeparator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    titleBarSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Build the command bar
    commandBar = new CommandBar();
    CommandBarLayout cbl = new CommandBarLayout();
    cbl.buttonHeight = convertHorizontalDLUsToPixels(20);
    cbl.buttonWidth = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    cbl.gap = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_MARGIN);
    cbl.left = 10;
    cbl.right = 10;
    cbl.top = 11;
    cbl.bottom = 10;
    commandBar.setLayout(cbl);
    Control control = commandBar.createControl(composite);
    commandBar.addCommandBarListener(this);
    commandBar.getLayout().alignment = SWT.RIGHT;
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = commandBar.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
    control.setLayoutData(gd);

    return composite;
}

From source file:org.jboss.tools.common.verification.ui.vrules.wizard.runtime2.VerifyDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    CommandBar commandBar = view.getCommandBar();
    commandBar.addCommandBarListener(view);
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 0;//from  ww  w  . ja v a  2s  .  co  m
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    composite.setLayoutData(gd);

    Label titleBarSeparator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    titleBarSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    CommandBarLayout cbl = new CommandBarLayout();
    cbl.buttonHeight = convertHorizontalDLUsToPixels(20);
    cbl.buttonWidth = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    cbl.gap = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_MARGIN);
    cbl.left = 10;
    cbl.right = 10;
    cbl.top = 11;
    cbl.bottom = 10;
    commandBar.setLayout(cbl);
    commandBar.setCommands(getCommands());
    commandBar.setDefaultCommand(view.getDefaultCommand());
    Control control = commandBar.createControl(composite);
    commandBar.getLayout().alignment = SWT.RIGHT;
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = commandBar.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
    control.setLayoutData(gd);
    if (view.getHelpKey() == null)
        commandBar.setEnabled(AbstractQueryWizardView.HELP, false);

    return composite;
}