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

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

Introduction

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

Prototype

int HORIZONTAL_SPACING

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

Click Source Link

Document

Horizontal spacing in dialog units (value 4).

Usage

From source file:org.nightlabs.eclipse.ui.dialog.ExpandableAreaDialog.java

License:Open Source License

/**
 * Override this method to return the Composite you want to be the client of the
 * ExpandableComposite.//  w  w w  .j av  a2 s  . c  o m
 * @param parent Add your Composite as child of this
 */
protected Composite createExpandableArea(Composite parent) {
    // create a composite with no margins and standard spacing
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    applyDialogFont(composite);
    return composite;
}

From source file:org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    setTitle(Messages.getString("org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.dialogMessageTitle")); //$NON-NLS-1$
    setMessage(//from  w ww  .  j  a  v  a  2 s  .  co m
            Messages.getString("org.nightlabs.eclipse.ui.fckeditor.file.FileListDialog.dialogMessageMessage")); //$NON-NLS-1$

    // create a composite with standard margins and spacing
    final 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));
    applyDialogFont(composite);

    BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
         */
        @Override
        public void run() {
            createTopArea(composite);
            createFileListArea(composite);
        }
    });

    return composite;

    //         final Composite c = (Composite)super.createDialogArea(parent);
    //         GridLayout gd = ((GridLayout)c.getLayout());
    //         gd.horizontalSpacing
    //         createFileListArea(c);
    //         return c;
}

From source file:org.obeonetwork.dsl.uml2.design.internal.dialogs.ImportMetaclassDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {

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

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

    compositeHeaderMessage.setLayout(layout);
    final Label headerMessage = new Label(compositeHeaderMessage, SWT.NONE);

    headerMessage.setText(headerMessageText);
    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 2;/*from  w w w  . j a  va 2 s  . c om*/
    headerMessage.setLayoutData(gridData);

    final Control dialogArea1 = super.createDialogArea(parent);
    dialogArea1.setEnabled(true);
    parent.getParent().getShell().setMinimumSize(600, 700);
    applyFilter();
    setDetailsLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
            String text = new String();
            if (element instanceof Class) {
                final Class myClass = (Class) element;
                for (final Comment comment : myClass.getOwnedComments()) {
                    if (text.isEmpty()) {
                        text = text + comment.getBody();
                    } else {
                        text = text + " " + comment.getBody(); //$NON-NLS-1$
                    }
                }
            }
            return text;
        }
    });
    return dialogArea1;
}

From source file:org.obeonetwork.dsl.uml2.design.internal.dialogs.InitProfilePluginDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {

    final Composite parentComposite = (Composite) super.createDialogArea(parent);

    setTitle("Information about profile versioning"); //$NON-NLS-1$

    // create a composite with standard margins and spacing.
    final Composite composite = new Composite(parentComposite, SWT.NONE);
    final GridLayout layout = new GridLayout(1, true);
    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  a  va  2  s  .  com
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    composite.setFont(parentComposite.getFont());

    GridData gd;
    final Composite commentArea = createExportArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
    commentArea.setLayoutData(gd);

    applyDialogFont(parentComposite);
    return parentComposite;
}

From source file:org.obeonetwork.dsl.uml2.design.internal.dialogs.ProfileVersionDialog.java

License:Open Source License

/**
 * {@inheritDoc}//  w  w  w  .  j av  a2s  .  c o  m
 */
@Override
protected Control createDialogArea(final Composite parent) {

    // top level composite.
    final Composite parentComposite = (Composite) super.createDialogArea(parent);

    setTitle("Information about profile versioning"); //$NON-NLS-1$

    // create a composite with standard margins and spacing.
    final Composite composite = new Composite(parentComposite, SWT.NONE);
    final GridLayout layout = new GridLayout(2, true);
    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(SWT.FILL, SWT.FILL, true, true));
    composite.setFont(parentComposite.getFont());

    // compute initial values for Profile version information
    computeVersionValues();

    // // fill composite with information about new version:
    // // 1. version
    // // 2. author
    // // 3. comment
    // // 4. date
    // // 5. copyright

    GridData gd;

    final Composite versionArea = createVersionArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    versionArea.setLayoutData(gd);

    final Composite infoArea = createInfoArea(composite);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    infoArea.setLayoutData(gd);

    final Composite commentArea = createCommentArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1);
    commentArea.setLayoutData(gd);

    final Composite copyrightArea = createCopyrightArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1);
    copyrightArea.setLayoutData(gd);

    applyDialogFont(parentComposite);
    return parentComposite;
}

From source file:org.obeonetwork.dsl.uml2.profile.design.dialogs.ImportMetaclassDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {

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

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

    compositeHeaderMessage.setLayout(layout);
    Label headerMessage = new Label(compositeHeaderMessage, SWT.NONE);

    headerMessage.setText(headerMessageText);
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 2;//w  w w . j av  a  2 s. com
    headerMessage.setLayoutData(gridData);

    final Control dialogArea = super.createDialogArea(parent);
    dialogArea.setEnabled(true);
    parent.getParent().getShell().setMinimumSize(600, 700);
    applyFilter();
    this.setDetailsLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
            String text = new String();
            if (element instanceof Class) {
                Class myClass = (Class) element;
                for (Comment comment : myClass.getOwnedComments()) {
                    if (text.isEmpty())
                        text = text + comment.getBody();
                    else
                        text = text + " " + comment.getBody();
                }
            }
            return text;
        }
    });
    return dialogArea;
}

From source file:org.obeonetwork.dsl.uml2.profile.design.dialogs.InitProfilePluginDialog.java

License:Open Source License

@Override
protected Control createDialogArea(final Composite parent) {

    final Composite parentComposite = (Composite) super.createDialogArea(parent);

    setTitle("Information about profile versioning");

    // create a composite with standard margins and spacing.
    final Composite composite = new Composite(parentComposite, SWT.NONE);
    final GridLayout layout = new GridLayout(1, true);
    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 . ja  va2s . co m*/
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    composite.setFont(parentComposite.getFont());

    GridData gd;
    final Composite commentArea = createExportArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
    commentArea.setLayoutData(gd);

    applyDialogFont(parentComposite);
    return parentComposite;
}

From source file:org.obeonetwork.dsl.uml2.profile.design.dialogs.ProfileVersionDialog.java

License:Open Source License

/**
 * {@inheritDoc}//from w  w w .j  a v a 2  s. com
 */
@Override
protected Control createDialogArea(final Composite parent) {

    // top level composite.
    final Composite parentComposite = (Composite) super.createDialogArea(parent);

    setTitle("Information about profile versioning");

    // create a composite with standard margins and spacing.
    final Composite composite = new Composite(parentComposite, SWT.NONE);
    final GridLayout layout = new GridLayout(2, true);
    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(SWT.FILL, SWT.FILL, true, true));
    composite.setFont(parentComposite.getFont());

    // compute initial values for Profile version information
    computeVersionValues();

    // // fill composite with information about new version:
    // // 1. version
    // // 2. author
    // // 3. comment
    // // 4. date
    // // 5. copyright

    GridData gd;

    final Composite versionArea = createVersionArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    versionArea.setLayoutData(gd);

    final Composite infoArea = createInfoArea(composite);
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    infoArea.setLayoutData(gd);

    final Composite commentArea = createCommentArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1);
    commentArea.setLayoutData(gd);

    final Composite copyrightArea = createCopyrightArea(composite);
    gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1);
    copyrightArea.setLayoutData(gd);

    applyDialogFont(parentComposite);
    return parentComposite;
}

From source file:org.openmaji.implementation.tool.eclipse.ui.dialog.CreateWorksheetDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 *//* www.  j  a  va2 s .  c om*/
protected Control createDialogArea(Composite parent) {
    setTitle("Create Worksheet");
    setMessage(
            "Enter the name of the new worksheet and select the subsystem it should use to create new Meems");

    Composite parentComposite = (Composite) super.createDialogArea(parent);

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

    layout.numColumns = 2;
    int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    //String defaultUserName = MajiPlugin.getDefault().getPreferenceStore().getString(MajiSystemPreferencePage.MAJI_USERNAME_PROPERTIES);

    Label label = new Label(composite, SWT.WRAP);
    label.setText("&Worksheet Name");

    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
            | GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    //data.widthHint = widthHint;

    label.setLayoutData(data);
    label.setFont(parent.getFont());

    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.widthHint = widthHint;
    txtWorksheetName = new Text(composite, SWT.SINGLE | SWT.BORDER);
    txtWorksheetName.setFocus();
    txtWorksheetName.setLayoutData(data);
    txtWorksheetName.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });

    label = new Label(composite, SWT.WRAP);
    label.setText("Subsystem");

    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_END
            | GridData.VERTICAL_ALIGN_CENTER);

    label.setLayoutData(data);
    label.setFont(parent.getFont());

    comboSubsystem = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);

    populateCombo();

    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.widthHint = widthHint;

    // horizontal bar
    Label bar = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    data = new GridData();
    data.horizontalSpan = 2;
    data.horizontalAlignment = GridData.FILL;
    bar.setLayoutData(data);
    return composite;
}

From source file:org.openmaji.implementation.tool.eclipse.ui.dialog.LoginDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 *//*w  w  w .j  a  va 2s  .c o m*/
protected Control createDialogArea(Composite parent) {
    Composite parentComposite = (Composite) super.createDialogArea(parent);

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

    layout.numColumns = 2;
    int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    String defaultUserName = MajiPlugin.getDefault().getPreferenceStore()
            .getString(MajiSystemPreferencePage.MAJI_USERNAME_PROPERTIES);

    // User name
    Label label = new Label(composite, SWT.WRAP);
    label.setText("&User Name");

    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
            | GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    //data.widthHint = widthHint;

    label.setLayoutData(data);
    label.setFont(parent.getFont());

    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.widthHint = widthHint;
    txtUserName = new Text(composite, SWT.SINGLE | SWT.BORDER);
    txtUserName.setLayoutData(data);
    txtUserName.setText(defaultUserName);

    // Password
    // User name
    label = new Label(composite, SWT.WRAP);
    label.setText("&Password");

    // Enable Quick-Password Feature for develper
    String quickPassword = System.getProperty(QUICK_PASSWORD);
    if ((quickPassword != null) && (quickPassword.equalsIgnoreCase("true"))) {
        label.addMouseListener(new MouseListener() {
            public void mouseDoubleClick(MouseEvent e) {
                txtPassword.setText(txtUserName.getText() + "99");
            }

            public void mouseDown(MouseEvent e) {
            }

            public void mouseUp(MouseEvent e) {
            }
        });
    }

    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_END
            | GridData.VERTICAL_ALIGN_CENTER);

    label.setLayoutData(data);
    label.setFont(parent.getFont());

    txtPassword = new Text(composite, SWT.SINGLE | SWT.BORDER);
    txtPassword.setEchoChar('*');
    data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.widthHint = widthHint;
    txtPassword.setLayoutData(data);
    if (defaultUserName.length() > 0)
        txtPassword.setFocus();

    // horizontal bar
    Label bar = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    data = new GridData();
    data.horizontalSpan = 2;
    data.horizontalAlignment = GridData.FILL;
    bar.setLayoutData(data);
    return composite;
}