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

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

Introduction

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

Prototype

int VERTICAL_SPACING

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

Click Source Link

Document

Vertical spacing in dialog units (value 4).

Usage

From source file:com.cisco.yangide.ext.model.editor.dialog.AddImportDialog.java

License:Open Source License

private void createPrefixArea(Composite 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;//from w ww .  j av  a 2  s . co 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);
    prefixModifyListener = new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            updateStatus(getOverallStatus());
        }
    };
    prefix.addModifyListener(prefixModifyListener);
    prefix.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}

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;/*from   www  .ja v a2 s  .  c  om*/
    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);// w w  w.  j av a 2 s.c  o  m
    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.bytecodevisualizer.actions.DebugFunctionalityInfoDialog.java

License:Apache License

@Override
protected Control createMessageArea(Composite composite) {
    Composite result = (Composite) super.createMessageArea(composite);

    Composite area = new Composite(result, SWT.NONE);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false)
            .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT)
            .applyTo(area);/*from  w w w. j  a  v  a  2s  .  c  o  m*/

    GridLayout layout = new GridLayout();
    layout.marginWidth = layout.marginHeight = 0;
    layout.numColumns = 1;
    area.setLayout(layout);

    Label lbl = null;
    Link link = null;

    lbl = new Label(area, SWT.NONE);
    lbl.setText(
            BytecodeVisualizerMessages.ToggleBreakpointAction_tooltipText_Debug_functionality_is_unavailable_in_this_context_);
    lbl.setLayoutData(new GridData(GridData.FILL_BOTH));
    JFaceUtils.toBold(lbl);

    lbl = new Label(area, SWT.NONE);
    lbl.setText(BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_Your_class_or_jar_file_needs_);
    lbl.setLayoutData(new GridData(GridData.FILL_BOTH));

    ListPanel lp = new ListPanel(area, SWT.NONE, SWT.WRAP);
    lp.setNumbered(true);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.BEGINNING;
    gd.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN * 2;

    lp.getControl().setLayoutData(gd);
    //lp.getControl().setBackground(infoBg);

    lp.addText(
            BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_i_included_in_some_java_projects_build_path_and);

    String msg = MessageFormat.format(
            BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_ii_opened_using_0_1_or_similar_feature_of_2_,
            new Object[] { CoreMessages.lbl_Package_Explorer, CoreMessages.lbl_Open_Declaration,
                    CoreMessages.lbl_Java_Development_Tools_JDT_Plugin });
    lp.addText(msg);

    msg = MessageFormat.format(
            BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_link_Please_read_0_this_tutorial_for_more_details_,
            new Object[] { Links.HOW_TO_DEBUG_BYTECODE_WITH_BYTECODE_VISUALIZER });
    link = LinkFactory.createHttpPathLink(area, SWT.NONE);
    link.setText(msg);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.BEGINNING;
    gd.verticalIndent = IDialogConstants.VERTICAL_SPACING;
    link.setLayoutData(gd);

    return result;
}

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;//from w  ww.j  av  a  2 s .com
    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.drgarbage.core.jface.ListPanel.java

License:Apache License

protected Label createBullet() {
    Label lbl = createTextItem();

    if (numbered) {
        lbl.setText(String.valueOf(index++) + ".");
    } else {/*w  w w  .ja  v  a 2s  .c om*/
        lbl.setText(BULL);
    }

    GridData gd = new GridData();
    gd.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN;
    gd.verticalAlignment = SWT.BEGINNING;
    gd.verticalIndent = IDialogConstants.VERTICAL_SPACING;
    lbl.setLayoutData(gd);
    return lbl;
}

From source file:com.drgarbage.core.jface.ListPanel.java

License:Apache License

protected GridLayout createControlLayout() {
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;//from w w w.  j a  v  a2  s .  c o m
    gl.marginWidth = 0;
    gl.marginHeight = 0;
    gl.horizontalSpacing = IDialogConstants.HORIZONTAL_SPACING;
    gl.verticalSpacing = IDialogConstants.VERTICAL_SPACING;
    return gl;
}

From source file:com.drgarbage.core.jface.ListPanel.java

License:Apache License

protected GridData createItemGridData() {
    GridData gd = new GridData();
    gd.horizontalIndent = SWT.FILL;/* w  ww .ja  va  2 s  . com*/
    gd.verticalAlignment = SWT.BEGINNING;
    gd.verticalIndent = IDialogConstants.VERTICAL_SPACING;
    gd.widthHint = itemWidthHint;

    return gd;
}

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>/*from  ww w. ja v  a2 s . co  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.ModifyDialogTabPage.java

License:Open Source License

protected Group createGroup(int numColumns, Composite parent, String text) {
    final Group group = new Group(parent, SWT.NONE);
    group.setFont(parent.getFont());//from  w  w w  . jav a 2  s. com
    group.setLayoutData(createGridData(numColumns, GridData.FILL_HORIZONTAL, SWT.DEFAULT));

    final GridLayout layout = new GridLayout(numColumns, false);
    layout.verticalSpacing = fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = fPixelConverter
            .convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.marginHeight = fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);

    //layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    //layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);

    group.setLayout(layout);//createGridLayout(numColumns, true));
    group.setText(text);
    return group;
}