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:de.babe.eclipse.plugins.quickREx.dialogs.OrganizeREsDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.getString("dialogs.OrganizeREsDialog.title")); //$NON-NLS-1$
    // create a composite with standard margins and spacing
    Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
    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);
    layout.numColumns = 2;/*from  ww  w .j  a  v  a 2  s.c o  m*/
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    messageLabel = new Label(composite, SWT.NULL);
    messageLabel.setText(Messages.getString("dialogs.OrganizeREsDialog.messageLabel1")); //$NON-NLS-1$
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    gd.widthHint = 400;
    messageLabel.setLayoutData(gd);
    Label nameLabel = new Label(composite, SWT.NULL);
    nameLabel.setText(Messages.getString("dialogs.OrganizeREsDialog.nameLabel1")); //$NON-NLS-1$
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = false;
    nameLabel.setLayoutData(gd);
    reList = new List(composite, SWT.MULTI | SWT.V_SCROLL);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.heightHint = 100;
    reList.setLayoutData(gd);
    reList.setItems(QuickRExPlugin.getDefault().getRegularExpressions());
    return composite;
}

From source file:de.babe.eclipse.plugins.quickREx.dialogs.OrganizeTestTextDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.getString("dialogs.OrganizeTestTextDialog.title")); //$NON-NLS-1$
    // create a composite with standard margins and spacing
    Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
    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);
    layout.numColumns = 2;//  w  w w. ja va  2s .co m
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    switch (type) {
    case TYPE_SAVE:
        return createDialogAreaContentsForSave(composite);
    case TYPE_LOAD:
        return createDialogAreaContentsForLoad(composite);
    case TYPE_ORGANIZE:
        return createDialogAreaContentsForOrganize(composite);
    default:
        throw new IllegalStateException(
                Messages.getString("dialogs.OrganizeTestTextDialog.errror.message1") + type); //$NON-NLS-1$
    }
}

From source file:de.babe.eclipse.plugins.quickREx.dialogs.REEditDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.getString("dialogs.REEditDialog.title")); //$NON-NLS-1$
    // create a composite with standard margins and spacing
    Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
    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);

    layout.numColumns = 3;//  w w w . j  a va 2  s  . com
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    createTextLine(composite);
    createSnippetControls(composite);

    updateMarkup();

    applyDialogFont(composite);
    return composite;
}

From source file:de.babe.eclipse.plugins.quickREx.dialogs.RESearchInputDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.getString("dialogs.RESearchInputDialog.title")); //$NON-NLS-1$
    // create a composite with standard margins and spacing
    Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
    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);
    layout.numColumns = 2;//from ww  w .  ja  v a  2  s.  c o m
    composite.setLayout(layout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = 250;
    composite.setLayoutData(gd);
    applyDialogFont(composite);
    Label searchForLabel = new Label(composite, SWT.NULL);
    searchForLabel.setText(Messages.getString("dialogs.RESearchInputDialog.label.searchFor.text")); //$NON-NLS-1$
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = false;
    searchForLabel.setLayoutData(gd);
    textField = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.LEAD | SWT.RESIZE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    textField.setLayoutData(gd);

    Label searchInLabel = new Label(composite, SWT.NULL);
    searchInLabel.setText(Messages.getString("dialogs.RESearchInputDialog.label.searchIn.text")); //$NON-NLS-1$
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = false;
    gd.verticalSpan = 5;
    searchInLabel.setLayoutData(gd);
    buttonTitle = new Button(composite, SWT.CHECK);
    buttonTitle.setText(Messages.getString("dialogs.RESearchInputDialog.checkbox.searchIn.title.text")); //$NON-NLS-1$
    buttonTitle.setSelection((QuickRExPlugin.getDefault().getLastSearchScope()
            & RESearchQuery.SCOPE_TITLE) == RESearchQuery.SCOPE_TITLE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    buttonTitle.setLayoutData(gd);

    buttonRE = new Button(composite, SWT.CHECK);
    buttonRE.setText(Messages.getString("dialogs.RESearchInputDialog.checkbox.searchIn.re.text")); //$NON-NLS-1$
    buttonRE.setSelection((QuickRExPlugin.getDefault().getLastSearchScope()
            & RESearchQuery.SCOPE_RE) == RESearchQuery.SCOPE_RE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    buttonRE.setLayoutData(gd);

    buttonTestText = new Button(composite, SWT.CHECK);
    buttonTestText.setText(Messages.getString("dialogs.RESearchInputDialog.checkbox.searchIn.testtext.text")); //$NON-NLS-1$
    buttonTestText.setSelection((QuickRExPlugin.getDefault().getLastSearchScope()
            & RESearchQuery.SCOPE_TESTTEXT) == RESearchQuery.SCOPE_TESTTEXT);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    buttonTestText.setLayoutData(gd);

    buttonDesc = new Button(composite, SWT.CHECK);
    buttonDesc.setText(Messages.getString("dialogs.RESearchInputDialog.checkbox.searchIn.desc.text")); //$NON-NLS-1$
    buttonDesc.setSelection((QuickRExPlugin.getDefault().getLastSearchScope()
            & RESearchQuery.SCOPE_DESC) == RESearchQuery.SCOPE_DESC);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    buttonDesc.setLayoutData(gd);

    buttonSource = new Button(composite, SWT.CHECK);
    buttonSource.setText(Messages.getString("dialogs.RESearchInputDialog.checkbox.searchIn.source.text")); //$NON-NLS-1$
    buttonSource.setSelection((QuickRExPlugin.getDefault().getLastSearchScope()
            & RESearchQuery.SCOPE_SOURCE) == RESearchQuery.SCOPE_SOURCE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    buttonSource.setLayoutData(gd);
    return composite;
}

From source file:de.babe.eclipse.plugins.quickREx.dialogs.SimpleTextDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    getShell().setText(title);/* ww  w.  j  a  v  a  2  s.c o  m*/
    // create a composite with standard margins and spacing
    Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
    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);
    layout.numColumns = 1;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    textField = new Text(composite,
            SWT.READ_ONLY | SWT.LEAD | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.RESIZE);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.heightHint = 250;
    gd.widthHint = 400;
    textField.setLayoutData(gd);
    textField.setBackground(new Color(getShell().getDisplay(), new RGB(255, 255, 255)));
    textField.setText(contents);

    return composite;
}

From source file:de.bht.fpa.mail.s000000.common.rcp.exception.ExceptionDetailsErrorDialog.java

License:Open Source License

/**
 * This implementation of the <code>Dialog</code> framework method creates and
 * lays out a composite and calls <code>createMessageArea</code> and
 * <code>createCustomArea</code> to populate it. Subclasses should override
 * <code>createCustomArea</code> to add contents below the message.
 *//*from  w ww . java  2s  .  c  o  m*/
@Override
protected Control createDialogArea(Composite parent) {
    createMessageArea(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);
    layout.numColumns = 2;
    composite.setLayout(layout);
    GridData childData = new GridData(GridData.FILL_BOTH);
    childData.horizontalSpan = 2;
    composite.setLayoutData(childData);
    composite.setFont(parent.getFont());
    return composite;
}

From source file:de.topicmapslab.tmcledit.diagram.preferences.ColorSchemeEditor.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite comp = new Composite(parent, SWT.NONE);
    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);
    comp.setLayout(layout);//  w  ww  . ja v a2s . c o  m
    comp.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(comp);

    Label l = new Label(comp, SWT.NONE);
    l.setText("Name:");

    nameText = new Text(comp, SWT.BORDER);
    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    nameText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            validateName();
            validateColors();

        }
    });

    l = new Label(comp, SWT.NONE);
    l.setText("Topic Color:");
    topicColor = new ColorSelector(comp);

    l = new Label(comp, SWT.NONE);
    l.setText("Comment Color:");
    commentColor = new ColorSelector(comp);

    l = new Label(comp, SWT.NONE);
    l.setText("Topic Font Color:");
    topicFontColor = new ColorSelector(comp);

    l = new Label(comp, SWT.NONE);
    l.setText("Comment Font Color:");
    commentFontColor = new ColorSelector(comp);

    useGradient = new Button(comp, SWT.CHECK);
    useGradient.setText("Use Gradient");
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    useGradient.setLayoutData(gd);

    l = new Label(comp, SWT.NONE);
    l.setText("Secondary Topic Color:");
    secTopicColor = new ColorSelector(comp);
    secTopicColor.addListener(new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            validateColors();
            validateName();
        }
    });

    l = new Label(comp, SWT.NONE);
    l.setText("Secondary Comment Color:");
    secCommentColor = new ColorSelector(comp);
    secCommentColor.addListener(new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            validateColors();
            validateName();
        }
    });

    useGradient.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            secTopicColor.setEnabled(useGradient.getSelection());
            secCommentColor.setEnabled(useGradient.getSelection());
            validateColors();
            validateName();
        }
    });

    initFields();

    return comp;
}

From source file:de.tub.tfs.henshin.editor.ui.dialog.resources.ResourcesDialog.java

License:Open Source 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 = 0;// 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);/* w w w .ja  v a  2 s  .  c om*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parentComposite.getFont());

    Listener listener = new Listener() {
        @Override
        public void handleEvent(Event event) {
            setDialogComplete(validate());
        }
    };

    resourceGroup = new FileSelectionGroup(composite, listener, type == SWT.SAVE, "File name:");

    return parentComposite;
}

From source file:de.tub.tfs.henshin.tggeditor.dialogs.resource.ResourcesDialog.java

License:Open Source License

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 = 0;// 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 av  a 2 s  .c o  m*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setFont(parentComposite.getFont());

    Listener listener = new Listener() {
        public void handleEvent(Event event) {
            setDialogComplete(validate());
        }
    };

    resourceGroup = new FileSelectionGroup(composite, listener, type == SWT.SAVE, "File name:");

    return parentComposite;
}

From source file:descent.internal.ui.dialogs.OptionalMessageDialog.java

License:Open Source License

protected Control createCustomArea(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.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);//from w w w . j  a  v  a  2  s .c o m
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    fHideDialogCheckBox = new Button(composite, SWT.CHECK | SWT.LEFT);
    fHideDialogCheckBox.setText(CHECKBOX_TEXT);
    fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            setDialogEnabled(fId, !((Button) e.widget).getSelection());
        }
    });
    applyDialogFont(fHideDialogCheckBox);
    return fHideDialogCheckBox;
}