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.jst.server.tomcat.ui.internal.TerminationDialog.java

License:Open Source License

/**
 * Creates and returns the contents of the upper part 
 * of this dialog (above the button bar).
 *
 * @param parent the parent composite to contain the dialog area
 * @return the dialog area control//from ww w. j  a  v  a2 s .c o  m
 */
protected Control createDialogArea(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));
    composite.setFont(parent.getFont());
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, ContextIds.SERVER_CLEAN_WORK_DIR_TERMINATE);

    Label label = new Label(composite, SWT.WRAP);
    label.setText(message);
    GridData data = new GridData();
    data.widthHint = 400;
    label.setLayoutData(data);

    Dialog.applyDialogFont(composite);

    return composite;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.AddEditFilterMappingDialog.java

License:Open Source License

/**
 * Creates and returns the contents of this dialog's 
 * button bar.//from  ww w.  j  a v a2s  . com
 * <p>
 * The <code>Dialog</code> implementation of this framework method
 * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
 * framework method to populate it. Subclasses may override.
 * </p>
 *
 * @param parent the parent composite to contain the button bar
 * @return the button bar control
 */
@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();

    layout.numColumns = 2;

    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite composite2 = new Composite(composite, SWT.NONE);

    // create a layout with spacing and margins appropriate for the font size.
    layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);

    composite2.setLayout(layout);

    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite2.setLayoutData(data);

    composite2.setFont(parent.getFont());

    // Add the buttons to the button bar.
    super.createButtonsForButtonBar(composite2);

    return composite;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.AddEditFilterMappingDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    GridData gd = new GridData();

    fChild = new Composite(parent, SWT.NONE);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;/*ww w . j  av a2  s .  com*/
    gl.marginHeight = 0;
    fChild.setLayout(gl);

    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    fChild.setLayoutData(gd);

    // Create the Web Type radio buttons and text fields.
    fServletButton = new Button(fChild, SWT.RADIO);
    fServletButton.setText(WebAppEditResourceHandler.getString("Servlet_UI_")); //$NON-NLS-1$ = Servlet
    gd = new GridData();
    fServletButton.setLayoutData(gd);
    fServletButton.addSelectionListener(this);

    fURLPatternButton = new Button(fChild, SWT.RADIO);
    fURLPatternButton.setText(WebAppEditResourceHandler.getString("URL_pattern_UI_")); //$NON-NLS-1$
    gd = new GridData();
    fURLPatternButton.setLayoutData(gd);
    fURLPatternButton.addSelectionListener(this);

    //Create URL Pattern page 
    fPageBook = new PageBook(fChild, SWT.NONE);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = 2;
    fPageBook.setLayoutData(gd);

    Composite composite = new Composite(fPageBook, 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));
    composite.setFont(parent.getFont());

    Label messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(URL_PATTERN_LABEL);

    fURLText = new Text(composite, SWT.BORDER);
    GridData spec = new GridData();
    spec.grabExcessVerticalSpace = false;
    spec.grabExcessHorizontalSpace = true;
    spec.horizontalAlignment = GridData.FILL;
    spec.verticalAlignment = GridData.BEGINNING;
    fURLText.setLayoutData(spec);
    Listener l = new Listener() {
        public void handleEvent(Event evt) {
            updateOkState();
        }
    };
    fURLText.addListener(SWT.Modify, l);
    fURLPatternControl = composite;

    //Create Servlet page
    composite = new Composite(fPageBook, SWT.NONE);
    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));
    composite.setFont(parent.getFont());

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_servlet__1")); //$NON-NLS-1$

    fUpperList = createUpperList(composite);

    fServletControl = composite;

    //Create Dispatchers control
    Group dispatchers = new Group(fChild, SWT.SHADOW_IN);
    dispatchers.setText(WebAppEditResourceHandler.getString("Select_Dispatchers_UI_")); //$NON-NLS-1$
    dispatchers.setLayout(new CellLayout(2).setMargins(10, 10).setSpacing(5, 5));
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
    gridData.horizontalSpan = 2;
    dispatchers.setLayoutData(gridData);
    fRequest = new Button(dispatchers, SWT.CHECK);
    fRequest.setText(REQUEST);
    fForward = new Button(dispatchers, SWT.CHECK);
    fForward.setText(FORWARD);
    fInclude = new Button(dispatchers, SWT.CHECK);
    fInclude.setText(INCLUDE);
    fErorr = new Button(dispatchers, SWT.CHECK);
    fErorr.setText(ERROR);

    if (selectedItem != null) {
        if (selectedItem.isUrlPatternType()) {
            fSelection = URL_PATTERN;
        } else {
            fSelection = SERVLET;
        }
    } else {
        if (fServletNames == null || fServletNames.length == 0) {
            fSelection = URL_PATTERN;
        }
    }
    updateUpperListWidget();

    fServletButton.setEnabled(true);
    if (fSelection == URL_PATTERN) {
        fURLPatternButton.setSelection(true);
        fPageBook.showPage(fURLPatternControl);
        fServletButton.setSelection(false);
        if (fServletNames == null || fServletNames.length == 0) {
            fServletButton.setEnabled(false);
        }
        if (selectedItem != null) {
            fURLText.setText(selectedItem.getName());
            setDispatchers(selectedItem.getDispatchers());
        }
    } else {
        fServletButton.setSelection(true);
        fPageBook.showPage(fServletControl);
        if (selectedItem != null) {
            fUpperList.setSelection(getServletIndex(fUpperList, selectedItem.getName()));
            setDispatchers(selectedItem.getDispatchers());
        }
    }
    updateOkState();
    return parent;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.MultiSelectFilteredFileSelectionDialog.java

License:Open Source License

/**
 * Creates and returns the contents of this dialog's 
 * button bar.//from   w ww.j  a  va  2  s  .  c o  m
 * <p>
 * The <code>Dialog</code> implementation of this framework method
 * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
 * framework method to populate it. Subclasses may override.
 * </p>
 *
 * @param parent the parent composite to contain the button bar
 * @return the button bar control
 */
@Override
protected Control createButtonBar(Composite parent) {

    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();

    layout.numColumns = 2;

    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite composite2 = new Composite(composite, SWT.NONE);

    // create a layout with spacing and margins appropriate for the font size.
    layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(
            org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);

    composite2.setLayout(layout);

    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite2.setLayoutData(data);

    composite2.setFont(parent.getFont());

    // Add the buttons to the button bar.
    super.createButtonsForButtonBar(composite2);

    return composite;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.MultiSelectFilteredFileSelectionDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    GridData gd = new GridData();

    fChild = new Composite(parent, SWT.NONE);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;//www  .j a  v  a2  s  .  c om
    gl.marginHeight = 0;
    fChild.setLayout(gl);

    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    fChild.setLayoutData(gd);

    // Create the Web Type radio buttons and text fields.
    fServletButton = new Button(fChild, SWT.RADIO);
    fServletButton.setText(WebAppEditResourceHandler.getString("Servlet_UI_")); //$NON-NLS-1$ = Servlet
    gd = new GridData();
    fServletButton.setLayoutData(gd);
    fServletButton.addSelectionListener(this);

    fJSPButton = new Button(fChild, SWT.RADIO);
    fJSPButton.setText(WebAppEditResourceHandler.getString("JSP_UI_")); //$NON-NLS-1$ = JSP
    gd = new GridData();
    fJSPButton.setLayoutData(gd);
    fJSPButton.addSelectionListener(this);

    if (fSelection == JSP)
        fJSPButton.setSelection(true);
    else {
        fServletButton.setSelection(true);
        fSelection = SERVLET;
    }

    fPageBook = new PageBook(fChild, SWT.NONE);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = 2;
    fPageBook.setLayoutData(gd);
    fJspControl = super.createDialogArea(fPageBook);

    Composite composite = new Composite(fPageBook, 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));
    composite.setFont(parent.getFont());

    Label messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_servlet__1")); //$NON-NLS-1$

    fText = createText(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Matching_servlets__2")); //$NON-NLS-1$

    fUpperList = createUpperList(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$

    fLowerList = createLowerList(composite);

    fServletControl = composite;

    if (fSelection == JSP)
        fPageBook.showPage(fJspControl);
    else
        fPageBook.showPage(fServletControl);
    return parent;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.MultiSelectFilteredFilterFileSelectionDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    GridData gd = new GridData();

    fChild = new Composite(parent, SWT.NONE);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;/*w  ww.  j  av a2s . com*/
    gl.marginHeight = 5;
    fChild.setLayout(gl);

    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    fChild.setLayoutData(gd);

    fPageBook = new PageBook(fChild, SWT.NONE);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = 2;
    fPageBook.setLayoutData(gd);
    super.createDialogArea(fPageBook);

    Composite composite = new Composite(fPageBook, 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));
    composite.setFont(parent.getFont());

    Label messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_filter__1")); //$NON-NLS-1$

    fText = createText(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Matching_filters__2")); //$NON-NLS-1$

    fUpperList = createUpperList(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$

    fLowerList = createLowerList(composite);

    fServletControl = composite;

    fPageBook.showPage(fServletControl);
    return parent;
}

From source file:org.eclipse.jst.servlet.ui.internal.wizard.MultiSelectFilteredListenerFileSelectionDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    GridData gd = new GridData();

    fChild = new Composite(parent, SWT.NONE);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;//from  ww w  .j  a v a  2  s. c  om
    gl.marginHeight = 5;
    fChild.setLayout(gl);

    gd.verticalAlignment = GridData.FILL;
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    fChild.setLayoutData(gd);

    fPageBook = new PageBook(fChild, SWT.NONE);
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.horizontalSpan = 2;
    fPageBook.setLayoutData(gd);
    super.createDialogArea(fPageBook);

    Composite composite = new Composite(fPageBook, 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));
    composite.setFont(parent.getFont());

    Label messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Choose_a_listener__1")); //$NON-NLS-1$ 

    fText = createText(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Matching_listener__2")); //$NON-NLS-1$ 

    fUpperList = createUpperList(composite);

    messageLabel = new Label(composite, SWT.NONE);
    gd = new GridData();
    messageLabel.setLayoutData(gd);
    messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$

    fLowerList = createLowerList(composite);

    fServletControl = composite;

    fPageBook.showPage(fServletControl);
    return parent;
}

From source file:org.eclipse.koneki.ldt.debug.ui.internal.interpreters.AddLuaInterpreterDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {

    Composite container = new Composite(parent, SWT.NONE);
    Point margin = new Point(0, 0);
    margin.x = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    margin.y = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    Point spacing = new Point(0, 0);
    spacing.x = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    spacing.y = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    GridLayoutFactory.swtDefaults().spacing(spacing).margins(margin).numColumns(3).applyTo(container);
    GridDataFactory.swtDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(container);

    createLabel(container, InterpretersMessages.addInterpreterDialog_InterpreterEnvironmentType);
    typesCombo = new ComboViewer(container);
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).span(2, 1)
            .applyTo(typesCombo.getControl());

    createLabel(container, InterpretersMessages.addInterpreterDialog_InterpreterExecutableName);
    pathText = new Text(container, SWT.SINGLE | SWT.BORDER);
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(300, SWT.DEFAULT)
            .applyTo(pathText);/*from w  ww.jav a2  s .  c o  m*/
    browseButton = new Button(container, SWT.PUSH);
    browseButton.setText(InterpretersMessages.addInterpreterDialog_browse1);
    GridDataFactory.swtDefaults().hint(SWTUtil.getButtonWidthHint(browseButton), -1).applyTo(browseButton);

    createLabel(container, InterpretersMessages.addInterpreterDialog_InterpreterEnvironmentName);
    nameText = new Text(container, SWT.SINGLE | SWT.BORDER);
    GridDataFactory.swtDefaults().grab(true, false).span(2, 1).align(SWT.FILL, SWT.CENTER).applyTo(nameText);

    createLabel(container, InterpretersMessages.AddInterpreterDialog_iArgs);
    argsText = new Text(container, SWT.SINGLE | SWT.BORDER);
    GridDataFactory.swtDefaults().grab(true, false).span(2, 1).align(SWT.FILL, SWT.CENTER).applyTo(argsText);

    environementVariableBlock = new LuaInterpreterEnvironmentVariablesBlock(new AddInterpreterDialogAdapter(
            requestor, getShell(), interpreterInstallTypes, currentInterperter));
    final Composite environmentComposite = (Composite) environementVariableBlock.createControl(container);
    GridLayoutFactory.swtDefaults().margins(0, 0).numColumns(2).applyTo(environmentComposite);
    GridDataFactory.swtDefaults().grab(true, true).span(3, 1).align(SWT.FILL, SWT.FILL)
            .applyTo(environmentComposite);

    // Interpreter Capabilities
    capabilitiesGroup = new Group(container, SWT.None);
    capabilitiesGroup.setText(Messages.AddLuaInterpreterDialog_CapabilitesGroupLabel);
    GridLayoutFactory.swtDefaults().margins(0, 0).numColumns(1).applyTo(capabilitiesGroup);
    GridDataFactory.swtDefaults().grab(true, false).span(3, 1).align(SWT.FILL, SWT.FILL)
            .applyTo(capabilitiesGroup);

    capabilitiesDesctiptionLabel = new Label(capabilitiesGroup, SWT.NONE);
    toItalic(capabilitiesDesctiptionLabel);
    GridDataFactory.swtDefaults().span(3, 1).grab(true, false).align(SWT.FILL, SWT.FILL)
            .applyTo(capabilitiesDesctiptionLabel);

    handlesExecutionOption = new Button(capabilitiesGroup, SWT.CHECK);
    handlesExecutionOption.setText(Messages.AddLuaInterpreterDialog_ExecutionOption);

    handlesFilesAsArguments = new Button(capabilitiesGroup, SWT.CHECK);
    handlesFilesAsArguments.setText(Messages.AddLuaInterpreterDialog_FilesAsArguments);

    applyDialogFont(container);
    hookListeners();
    init();

    return container;
}

From source file:org.eclipse.launchbar.ui.internal.dialogs.LaunchConfigurationEditDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    // Clone super's implementation, removes the monitor since we don't run from here
    // And adds in the left button bar.
    Font font = parent.getFont();
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*from  w ww .  j av a2 s.c  o  m*/
    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);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setFont(font);

    // create help control if needed
    if (isHelpAvailable()) {
        createHelpControl(composite);
    }

    Composite leftButtonComp = new Composite(composite, SWT.NULL);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.numColumns = 0;
    leftButtonComp.setLayout(layout);
    leftButtonComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    leftButtonComp.setFont(parent.getFont());

    createButton(leftButtonComp, DELETE_ID, Messages.LaunchConfigurationEditDialog_0, false);
    createButton(leftButtonComp, DUPLICATE_ID, Messages.LaunchConfigurationEditDialog_1, false);
    // launch button text same as in eclipse LaunchConfigurationDialog - mode name
    createButton(leftButtonComp, LAUNCH_ID, getLaunchButtonText(), false);

    Composite mainButtonComp = new Composite(composite, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.numColumns = 0;
    mainButtonComp.setLayout(layout);
    mainButtonComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    mainButtonComp.setFont(parent.getFont());

    createButton(mainButtonComp, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(mainButtonComp, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    return composite;
}

From source file:org.eclipse.libra.framework.ui.internal.TerminationDialog.java

License:Open Source License

/**
 * Creates and returns the contents of the upper part 
 * of this dialog (above the button bar).
 *
 * @param parent the parent composite to contain the dialog area
 * @return the dialog area control//from   w  w w.j a  v  a2s  .c  om
 */
protected Control createDialogArea(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));
    composite.setFont(parent.getFont());
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            ContextIds.FRAMEWORK_INSTANCE_CLEAN_WORK_DIR_TERMINATE);

    Label label = new Label(composite, SWT.WRAP);
    label.setText(message);
    GridData data = new GridData();
    data.widthHint = 400;
    label.setLayoutData(data);

    Dialog.applyDialogFont(composite);

    return composite;
}