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:com.cisco.yangide.ext.model.editor.dialog.ChooseParentModuleDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite content = new Composite(parent, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(content);
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(content);
    super.createDialogArea(content);

    Composite appendix = new Composite(content, 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;/* ww  w .  j  a va  2  s.  c o  m*/
    appendix.setLayout(layout);
    appendix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    CLabel label = new CLabel(appendix, SWT.NONE);
    label.setText("Prefix");
    prefix = new Text(appendix, SWT.BORDER);
    prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    init();

    return content;
}

From source file:com.drgarbage.bytecode.jdi.dialogs.ProjectBuildPathDialog.java

License:Apache License

protected Control createDialogArea(Composite parent) {
    /* create a composite with standard margins and spacing */
    getShell().setText(BytecodeVisualizerMessages.Buildpath_Dialog_Abr);

    setTitle(BytecodeVisualizerMessages.Buildpath_Dialog_Title);
    setMessage(BytecodeVisualizerMessages.Buildpath_Dialog_Message);
    setTitleImage(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png").createImage());

    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);/*from   w  w  w  . ja v a2 s.  c  om*/
    GridData data = new GridData(GridData.FILL_BOTH);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    /* create a tree viewer*/
    fPathViewer = new ProjectBuildPathViewer(composite, fJavaProject);
    fPathViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
    fPathViewer.getControl().setFont(parent.getFont());
    fPathViewer.setInput(fJavaProject.getResource().getWorkspace().getRoot());
    fPathViewer.expandAll();

    /*create a new folder button */
    Button button = new Button(composite, SWT.PUSH);
    button.setText(NewWizardMessages.FolderSelectionDialog_button);
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            newFolderButtonPressed();
        }
    });
    button.setFont(parent.getFont());

    /*set help ID */
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, null);

    return composite;
}

From source file:com.drgarbage.controlflowgraphfactory.dialogs.ExportGraphFileFolderSelectionDialog.java

License:Apache License

protected Control createButtonBar(Composite parent) {

    /* create options */
    Group optGroup = new Group(parent, SWT.NONE);
    GridLayout layout0 = new GridLayout();
    layout0.numColumns = 1;// w  w w  .j  av  a2 s . c o  m
    optGroup.setLayout(layout0);
    GridData data0 = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER);

    data0.horizontalIndent = 16;
    optGroup.setLayoutData(data0);

    final Combo exportFormatCombo = new Combo(optGroup, SWT.READ_ONLY);
    exportFormatCombo.setItems(GraphConstants.SUPPORTED_EXPORT_FORMAT_LABELS);
    exportFormatCombo.select(getGraphSpecification().getExportFormat());
    exportFormatCombo.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            int format = exportFormatCombo.getSelectionIndex();
            getGraphSpecification().setExportFormat(format);

            switch (format) {
            case GraphConstants.EXPORT_FORMAT_DRGARBAGE_GRAPH:

                /* disable properties */
                checkButton1.setEnabled(false);
                checkButton2.setEnabled(false);
                checkButton3.setEnabled(false);

                break;
            case GraphConstants.EXPORT_FORMAT_DOT:
            case GraphConstants.EXPORT_FORMAT_GRAPHXML:
            case GraphConstants.EXPORT_FORMAT_GRAPHML:

                /* enable properties */
                checkButton1.setEnabled(true);
                checkButton2.setEnabled(true);
                checkButton3.setEnabled(true);

                break;
            default:
                throw new IllegalStateException(
                        "Unexpected export format '" + getGraphSpecification().getExportFormat() + "'");
            }
        }
    });

    checkButton1 = new Button(optGroup, SWT.CHECK);
    checkButton1.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            getGraphSpecification().setExportDecorations(checkButton1.getSelection());
        }
    });
    checkButton1.setText(ControlFlowFactoryMessages.ExportGraphAction_checkBox1Text);

    checkButton2 = new Button(optGroup, SWT.CHECK);
    checkButton2.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            getGraphSpecification().setExportGeometry(checkButton2.getSelection());
        }
    });
    checkButton2.setText(ControlFlowFactoryMessages.ExportGraphAction_checkBox2Text);

    checkButton3 = new Button(optGroup, SWT.CHECK);
    checkButton3.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent event) {
            getGraphSpecification().setExportComments(checkButton3.getSelection());
        }
    });
    checkButton3.setText(ControlFlowFactoryMessages.ExportGraphAction_checkBox3Text);

    /* disable properties */
    checkButton1.setEnabled(false);
    checkButton2.setEnabled(false);
    checkButton3.setEnabled(false);

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

    // create a layout with spacing and margins appropriate for the font
    // size.
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    layout.makeColumnsEqualWidth = true;
    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);
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // Add the buttons to the button bar.
    return super.createButtonBar(parent);
}

From source file:com.dubture.composer.ui.wizard.AbstractWizardFirstPage.java

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 {/*www .  j a  va  2 s.  c om*/
        layout.marginWidth = 0;
        layout.marginHeight = 0;
    }
    return layout;
}

From source file:com.dubture.pdt.formatter.internal.ui.preferences.formatter.ModifyDialogTabPage.java

License:Open Source License

/**
 * Create the contents of this tab page.
 * <p>/* w w w  .j  av a  2s  .c  o  m*/
 * Subclasses should implement <code>doCreatePreferences</code> and <code>doCreatePreview</code>
 * may also be overridden as necessary.
 * </p>
 * 
 * @param parent The parent composite
 * @return Created content control
 */
public Composite createContents(Composite parent) {
    final int numColumns = 4;

    if (fPixelConverter == null) {
        fPixelConverter = new PixelConverter(parent);
    }

    final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
    sashForm.setFont(parent.getFont());

    Composite scrollContainer = new Composite(sashForm, SWT.NONE);

    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    scrollContainer.setLayoutData(gridData);

    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    scrollContainer.setLayout(layout);

    ScrolledComposite scroll = new ScrolledComposite(scrollContainer, SWT.V_SCROLL | SWT.H_SCROLL);
    scroll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scroll.setExpandHorizontal(true);
    scroll.setExpandVertical(true);

    final Composite settingsContainer = new Composite(scroll, SWT.NONE);
    settingsContainer.setFont(sashForm.getFont());

    scroll.setContent(settingsContainer);

    settingsContainer.setLayout(new PageLayout(scroll, 400, 400));
    settingsContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    Composite settingsPane = new Composite(settingsContainer, SWT.NONE);
    settingsPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    layout = new GridLayout(numColumns, false);
    layout.verticalSpacing = (int) (1.5
            * fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING));
    layout.horizontalSpacing = fPixelConverter
            .convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.marginHeight = fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    settingsPane.setLayout(layout);
    doCreatePreferences(settingsPane, numColumns);

    settingsContainer.setSize(settingsContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    scroll.addControlListener(new ControlListener() {

        public void controlMoved(ControlEvent e) {
        }

        public void controlResized(ControlEvent e) {
            settingsContainer.setSize(settingsContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        }
    });

    Label sashHandle = new Label(scrollContainer, SWT.SEPARATOR | SWT.VERTICAL);
    gridData = new GridData(SWT.RIGHT, SWT.FILL, false, true);
    sashHandle.setLayoutData(gridData);

    final Composite previewPane = new Composite(sashForm, SWT.NONE);
    previewPane.setLayout(createGridLayout(numColumns, true));
    previewPane.setFont(sashForm.getFont());
    doCreatePreviewPane(previewPane, numColumns);

    initializePage();

    sashForm.setWeights(new int[] { 3, 3 });
    return sashForm;
}

From source file:com.dubture.pdt.formatter.internal.ui.preferences.formatter.OffOnTagsTabPage.java

License:Open Source License

public final Composite createContents(Composite parent) {
    if (fPixelConverter == null)
        fPixelConverter = new PixelConverter(parent);

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData());

    final int numColumns = 2;
    GridLayout layout = new GridLayout(numColumns, false);
    layout.verticalSpacing = (int) (1.5
            * fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING));
    layout.horizontalSpacing = fPixelConverter
            .convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.marginHeight = fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    composite.setLayout(layout);/*from w w w  .  j  a va2s .c om*/
    doCreatePreferences(composite, numColumns);

    return composite;
}

From source file:com.dubture.symfony.ui.preferences.LibraryPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*from w  w w.  j  a v  a 2s .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);

    return super.createContents(parent);

}

From source file:com.dubture.symfony.ui.preferences.SymfonyPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);//from ww w .j a v a2s. 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);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            SymfonyUiPlugin.PLUGIN_ID + "." + "symfony_preferences");

    return super.createContents(parent);
}

From source file:com.dubture.symfony.ui.wizards.project.SymfonyProjectWizardSecondPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {

    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());

    GridLayout layout = new GridLayout(1, false);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);

    composite.setLayout(layout);/*from w  w  w . ja va 2  s . co m*/
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    overrideComposer = new SelectionButtonDialogField(SWT.CHECK);
    overrideComposer.setLabelText("Override composer.json values");
    overrideComposer.doFillIntoGrid(composite, 3);
    overrideComposer.setDialogFieldListener(new IDialogFieldListener() {
        @Override
        public void dialogFieldChanged(DialogField field) {
            settingsGroup.setEnabled(overrideComposer.isSelected());
        }
    });

    settingsGroup = new BasicSettingsGroup(composite, getShell());
    settingsGroup.addObserver(this);
    settingsGroup.setEnabled(false);

    setControl(composite);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
            SymfonyUiPlugin.PLUGIN_ID + "." + "newproject_secondpage");
}

From source file:com.dubture.twig.ui.preferences.TwigCodeassistPreferencePage.java

License:Open Source License

private void createMainBlock(Composite parent) {

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;/*  w ww  .ja v a2s  .c o m*/
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    Group doubleClickGroup = new Group(result, SWT.NONE);
    doubleClickGroup.setLayout(new GridLayout());
    doubleClickGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    doubleClickGroup.setText("Auto-close twig tags");

    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);

    autoclosePrintTags = new Button(doubleClickGroup, SWT.CHECK);
    autoclosePrintTags.setText("Print tags {{ }}"); //$NON-NLS-1$
    autoclosePrintTags.setLayoutData(gd);

    autocloseStatementTags = new Button(doubleClickGroup, SWT.CHECK);
    autocloseStatementTags.setText("Statement tags {% %}");
    autocloseStatementTags.setLayoutData(gd);

    autocreateStatementTags = new Button(doubleClickGroup, SWT.CHECK);
    autocreateStatementTags.setText("Autocreate Statements (%)");
    autocreateStatementTags.setLayoutData(gd);

    Group higlightGroup = new Group(result, SWT.NONE);

    higlightGroup.setLayout(new GridLayout());
    higlightGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    higlightGroup.setText("Highlighting");

    markOccurrences = new Button(higlightGroup, SWT.CHECK);
    markOccurrences.setText("Mark occurrences"); //$NON-NLS-1$
    markOccurrences.setLayoutData(gd);

}