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:org.talend.repository.json.ui.wizards.view.BRMSSchemaOutputDialog.java

License:Open Source License

protected Control createDialogArea(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.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);/*from   ww  w  . ja v  a  2 s .  c  o m*/
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);

    // Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayout(new FillLayout());

    tableEditor = new MetadataEmfTableEditor("");
    MetadataTable metadataTable = form.getMetadataOutputTable();
    tableEditor.setMetadataTable(metadataTable);
    tableEditor.removeAll();
    // List<MetadataColumn> list = (List<MetadataColumn>) metadataTable.getColumns();
    // tableEditor.addAll(list);
    // if (list.size() > 0) {
    // for (MetadataColumn column : list) {
    // boolean toAdd = true;
    // for (int i = 0; i < list.size(); i++) {
    // String label = column.getLabel();
    // String curLabel = list.get(i).getLabel();
    // if (label.equals(curLabel)) {
    // toAdd = false;
    // break;
    // }
    // }
    // if (toAdd) {
    // tableEditor.add(column);
    // }
    // }
    // }
    tableEditorView = new MetadataEmfTableEditorView(composite, SWT.NONE);
    tableEditorView.setMetadataEditor(tableEditor);
    addListeners();
    return composite;
}

From source file:org.talend.repository.viewer.dialog.RepositoryFilterSettingDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    SashForm sash = new SashForm(parent, SWT.HORIZONTAL | SWT.SMOOTH);
    sash.setLayoutData(new GridData(GridData.FILL_BOTH));
    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;
    sash.setLayout(layout);/*from   w w  w.ja v  a 2s .co m*/
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.widthHint = WIDTH;
    layoutData.heightHint = HEIGHT;
    sash.setLayoutData(layoutData);
    applyDialogFont(sash);

    Composite leftPart = new Composite(sash, SWT.NONE);
    leftPart.setLayout(new GridLayout());
    leftPart.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(leftPart);
    createLeftContent(leftPart);

    Composite rightPart = new Composite(sash, SWT.NONE);
    rightPart.setLayout(new GridLayout());
    rightPart.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(rightPart);
    createRightContent(rightPart);
    addListeners();
    sash.setWeights(new int[] { 1, 1 });
    return sash;
}

From source file:org.tigris.subversion.subclipse.ui.dialogs.AddToVersionControlDialog.java

License:Open Source License

/**
 * @see org.eclipse.team.internal.ui.DetailsDialog#createDropDownDialogArea(org.eclipse.swt.widgets.Composite)
 *//*from  w  w  w. j  a  va  2  s.  c  om*/
protected Composite createDropDownDialogArea(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());

    addUnaddedResourcesArea(composite);

    // set F1 help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.ADD_TO_VERSION_CONTROL_DIALOG);

    return composite;
}

From source file:org.tigris.subversion.subclipse.ui.subscriber.CommitSetDialog.java

License:Open Source License

private void createNameArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;/*from   w  w w.  j  a v a2  s  .  co m*/
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 2;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setFont(parent.getFont());

    Label label = new Label(composite, SWT.NONE);
    label.setText(Policy.bind("CommitSetDialog_0"));
    label.setLayoutData(new GridData(GridData.BEGINNING));

    nameText = new Text(composite, SWT.BORDER);
    nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    nameText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            updateEnablements();
        }
    });
}

From source file:org.tigris.subversion.subclipse.ui.util.DetailsDialog.java

License:Open Source License

final protected Control createDialogArea(Composite parent) {
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);

    // create image
    if (image != null) {
        // create a composite to split the dialog area in two
        Composite top = new Composite(composite, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.marginHeight = 0;//from  w w w .j a  v  a 2s.c o m
        layout.marginWidth = 0;
        layout.verticalSpacing = 0;
        layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
        layout.numColumns = 2;
        top.setLayout(layout);
        top.setLayoutData(new GridData(GridData.FILL_BOTH));
        top.setFont(parent.getFont());

        // add the image to the left of the composite
        Label label = new Label(top, 0);
        image.setBackground(label.getBackground());
        label.setImage(image);
        label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER));

        // add a composite to the right to contain the custom components
        Composite right = new Composite(top, SWT.NONE);
        layout = new GridLayout();
        layout.marginHeight = 0;
        layout.marginWidth = 0;
        layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
        layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
        right.setLayout(layout);
        right.setLayoutData(new GridData(GridData.FILL_BOTH));
        right.setFont(parent.getFont());
        createMainDialogArea(right);
    } else {
        createMainDialogArea(composite);
    }

    errorMessageLabel = new Label(composite, SWT.NONE);
    errorMessageLabel.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageLabel.setFont(parent.getFont());
    errorMessageLabel.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_RED));

    return composite;
}

From source file:org.tigris.subversion.subclipse.ui.util.DetailsDialogWithProjects.java

License:Open Source License

/**
 * @see DetailsDialog#createDropDownDialogArea(Composite)
 *//*from www  . j a  v a  2  s. c  om*/
protected Composite createDropDownDialogArea(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());

    detailsList = new org.eclipse.swt.widgets.List(composite,
            SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    GridData data = new GridData();
    data.heightHint = 75;
    data.horizontalAlignment = GridData.FILL;
    data.grabExcessHorizontalSpace = true;
    detailsList.setLayoutData(data);

    if (detailsTitle != null) {
        detailsList.add(detailsTitle);
    }

    for (int i = 0; i < projects.length; i++) {

        detailsList.add(projects[i].getName()); //$NON-NLS-1$
    }
    return composite;
}

From source file:org.xmind.ui.internal.print.multipage.MultipageSetupDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite1 = new Composite(parent, SWT.NONE);
    composite1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    GridLayout layout2 = new GridLayout(2, false);
    layout2.marginWidth = 0;/*from  w w  w.  j a va2s.co  m*/
    layout2.marginHeight = 0;
    layout2.horizontalSpacing = 0;
    composite1.setLayout(layout2);

    leftButtonBar = new Composite(composite1, SWT.NONE);
    leftButtonBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    GridLayout layout3 = new GridLayout(0, false);
    layout3.marginWidth = 12;
    layout3.marginHeight = 0;
    leftButtonBar.setLayout(layout3);

    Composite composite = new Composite(composite1, 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(SWT.RIGHT, SWT.CENTER, false, false);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

    // Add the buttons to the button bar.
    createButtonsForButtonBar(composite);
    return composite;
}

From source file:ummisco.gama.ui.viewers.image.SaveImageAsDialog.java

@Override
protected Control createDialogArea(final Composite parent) {
    final Composite parentComposite = (Composite) super.createDialogArea(parent);

    // create a composite with standard margins and spacing to put
    // out image specific stuff
    final Group composite = new Group(parentComposite, SWT.NONE);
    composite.setText("Image Information");
    final GridLayout layout = new GridLayout();
    // TODO: this isn't leaving any margin around the edge of the Group
    // in the dialog
    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 av  a 2s . c o  m
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    composite.setFont(parentComposite.getFont());

    final Label l = new Label(composite, SWT.RIGHT);
    l.setText("Type:");
    GridData gd = new GridData();
    l.setLayoutData(gd);
    imageTypeCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN);
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    imageTypeCombo.setLayoutData(gd);

    // initialize the imageType drop-down
    // TODO: filter by what's actually going to work when saving
    for (final String element : IMAGE_LABELS) {
        imageTypeCombo.add(element);
    }
    if (initialImageTypeIndex >= 0 && initialImageTypeIndex < IMAGE_TYPES.length) {
        imageTypeCombo.select(initialImageTypeIndex);
        selectedImageTypeIndex = initialImageTypeIndex;
    } else {
        imageTypeCombo.select(0);
        selectedImageTypeIndex = 0;
    }
    // change the filename extension when the imageType is changed
    imageTypeCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(final SelectionEvent e) {
            final int index = imageTypeCombo.getSelectionIndex();
            IPath path = Path.fromPortableString(getFileName());
            path = path.removeFileExtension().addFileExtension(IMAGE_EXTS[index]);
            setFileName(path.toPortableString());
        }
    });

    return parentComposite;
}