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: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)
 */// w w  w.  j ava2  s.  c o m
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 www .  ja  v  a  2  s.  c o 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.DetailsDialogWithProjects.java

License:Open Source License

/**
 * @see DetailsDialog#createDropDownDialogArea(Composite)
 *///from www .  j  av  a  2 s .  c o  m
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.jav a2  s .c o  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;/*from   w w  w . j  ava  2  s . 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;
}