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

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

Introduction

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

Prototype

int INDENT

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

Click Source Link

Document

Indent in dialog units (value 21).

Usage

From source file:de.femodeling.e4.ui.progress.internal.ProgressInfoItem.java

License:Open Source License

/**
 * Create the progress bar and apply any style bits from style.
 * //from  w  ww  . j  a  v a2s. c  om
 * @param style
 */
void createProgressBar(int style) {

    FormData buttonData = new FormData();
    buttonData.top = new FormAttachment(progressLabel, 0);
    buttonData.right = new FormAttachment(100, IDialogConstants.HORIZONTAL_SPACING * -1);

    actionBar.setLayoutData(buttonData);

    progressBar = new ProgressBar(this, SWT.HORIZONTAL | style);
    FormData barData = new FormData();
    barData.top = new FormAttachment(actionBar, IDialogConstants.VERTICAL_SPACING, SWT.TOP);
    barData.left = new FormAttachment(progressLabel, 0, SWT.LEFT);
    barData.right = new FormAttachment(actionBar, IDialogConstants.HORIZONTAL_SPACING * -1);
    barData.height = MAX_PROGRESS_HEIGHT;
    barData.width = 0;// default is too large
    progressBar.setLayoutData(barData);

    if (taskEntries.size() > 0) {
        // Reattach the link label if there is one
        FormData linkData = new FormData();
        linkData.top = new FormAttachment(progressBar, IDialogConstants.VERTICAL_SPACING);
        linkData.left = new FormAttachment(progressBar, 0, SWT.LEFT);
        linkData.right = new FormAttachment(progressBar, 0, SWT.RIGHT);
        // Give an initial value so as to constrain the link shortening
        linkData.width = IDialogConstants.INDENT;

        ((Link) taskEntries.get(0)).setLayoutData(linkData);
    }
}

From source file:de.femodeling.e4.ui.progress.internal.ProgressInfoItem.java

License:Open Source License

/**
 * Set the text of the link to the taskString.
 * /* www .j  av  a 2 s.com*/
 * @param taskString
 */
void setLinkText(Job linkJob, String taskString, int index) {

    if (index >= taskEntries.size()) {// Is it new?
        link = new Link(this, SWT.NONE);

        FormData linkData = new FormData();
        if (index == 0 || taskEntries.size() == 0) {
            Control top = progressBar;
            if (top == null) {
                top = progressLabel;
            }
            linkData.top = new FormAttachment(top, IDialogConstants.VERTICAL_SPACING);
            linkData.left = new FormAttachment(top, 0, SWT.LEFT);
            linkData.right = new FormAttachment(top, 0, SWT.RIGHT);
            // Give an initial value so as to constrain the link shortening
            linkData.width = IDialogConstants.INDENT;
        } else {
            Link previous = (Link) taskEntries.get(index - 1);
            linkData.top = new FormAttachment(previous, IDialogConstants.VERTICAL_SPACING);
            linkData.left = new FormAttachment(previous, 0, SWT.LEFT);
            linkData.right = new FormAttachment(previous, 0, SWT.RIGHT);
            // Give an initial value so as to constrain the link shortening
            linkData.width = IDialogConstants.INDENT;
        }

        link.setLayoutData(linkData);

        link.addSelectionListener(new SelectionAdapter() {
            /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
            public void widgetSelected(SelectionEvent e) {
                executeTrigger();
            }
        });

        link.addListener(SWT.Resize, new Listener() {
            /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
             */
            public void handleEvent(Event event) {

                Object text = link.getData(TEXT_KEY);
                if (text == null)
                    return;

                updateText((String) text, link);

            }
        });
        taskEntries.add(link);
    } else {
        link = (Link) taskEntries.get(index);
    }

    // check for action property
    Object actionProperty = linkJob.getProperty(IProgressConstants.ACTION_PROPERTY);
    Object commandProperty = linkJob.getProperty(IProgressConstants2.COMMAND_PROPERTY);

    if (actionProperty != null && commandProperty != null) {
        // if both are specified, then use neither
        updateTrigger(null, link);
    } else {
        Object property = actionProperty != null ? actionProperty : commandProperty;
        updateTrigger(property, link);
    }

    if (link.getData(TRIGGER_KEY) == null && (taskString == null || taskString.equals(getMainTitle()))) {
        // workaround for https://bugs.eclipse.org/383570
        taskString = ""; //$NON-NLS-1$
    }
    link.setToolTipText(taskString);
    link.setData(TEXT_KEY, taskString);

    updateText(taskString, link);

}

From source file:net.sf.eclipsensis.help.commands.NSISCommandDialog.java

License:Open Source License

@Override
protected void createControlAndMessageArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = layout.marginWidth = layout.verticalSpacing = layout.horizontalSpacing = 0;
    composite.setLayout(layout);//from  ww w.j a  v a2  s. c  om
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    Composite composite2 = new Composite(composite, SWT.NONE);
    composite2.setLayout(new GridLayout(1, false));
    composite2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    Color white = composite2.getDisplay().getSystemColor(SWT.COLOR_WHITE);
    composite2.setBackground(white);

    Label titleHeader = new Label(composite2, SWT.NONE);
    titleHeader.setBackground(white);
    makeBold(titleHeader);
    titleHeader.setText(EclipseNSISPlugin.getResourceString("nsis.command.wizard.title")); //$NON-NLS-1$
    titleHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    Label titleSubHeader = new Label(composite2, SWT.WRAP);
    titleSubHeader.setBackground(white);
    titleSubHeader.setText(EclipseNSISPlugin.getResourceString("nsis.command.wizard.subtitle")); //$NON-NLS-1$
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.INDENT);
    titleSubHeader.setLayoutData(data);

    Label titleImage = new Label(composite, SWT.NONE);
    titleImage.setBackground(white);
    titleImage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
    titleImage.setImage(EclipseNSISPlugin.getImageManager()
            .getImage(EclipseNSISPlugin.getResourceString("command.wizard.title.image"))); //$NON-NLS-1$

    Label titleSeparator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
    data = new GridData(SWT.FILL, SWT.FILL, true, false);
    data.horizontalSpan = 2;
    titleSeparator.setLayoutData(data);

    super.createControlAndMessageArea(parent);
}

From source file:org.eclipse.e4.ui.internal.progress.ProgressInfoItem.java

License:Open Source License

/**
 * Set the text of the link to the taskString.
 * /*ww  w .  j  a v a  2 s  . com*/
 * @param taskString
 */
void setLinkText(Job linkJob, String taskString, int index) {

    if (index >= taskEntries.size()) {// Is it new?
        link = new Link(this, SWT.NONE);

        FormData linkData = new FormData();
        if (index == 0 || taskEntries.size() == 0) {
            Control top = progressBar;
            if (top == null) {
                top = progressLabel;
            }
            linkData.top = new FormAttachment(top, IDialogConstants.VERTICAL_SPACING);
            linkData.left = new FormAttachment(top, 0, SWT.LEFT);
            linkData.right = new FormAttachment(top, 0, SWT.RIGHT);
            // Give an initial value so as to constrain the link shortening
            linkData.width = IDialogConstants.INDENT;
        } else {
            Link previous = (Link) taskEntries.get(index - 1);
            linkData.top = new FormAttachment(previous, IDialogConstants.VERTICAL_SPACING);
            linkData.left = new FormAttachment(previous, 0, SWT.LEFT);
            linkData.right = new FormAttachment(previous, 0, SWT.RIGHT);
            // Give an initial value so as to constrain the link shortening
            linkData.width = IDialogConstants.INDENT;
        }

        link.setLayoutData(linkData);

        link.addSelectionListener(new SelectionAdapter() {
            /*
             * (non-Javadoc)
             * 
             * @see
             * org.eclipse.swt.events.SelectionListener#widgetSelected(org
             * .eclipse.swt.events.SelectionEvent)
             */
            public void widgetSelected(SelectionEvent e) {
                executeTrigger();
            }
        });

        link.addListener(SWT.Resize, new Listener() {
            /*
             * (non-Javadoc)
             * 
             * @see
             * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.
             * swt.widgets.Event)
             */
            public void handleEvent(Event event) {

                Object text = link.getData(TEXT_KEY);
                if (text == null)
                    return;

                updateText((String) text, link);

            }
        });
        taskEntries.add(link);
    } else {
        link = (Link) taskEntries.get(index);
    }

    // check for action property
    Object actionProperty = linkJob.getProperty(IProgressConstants.ACTION_PROPERTY);
    Object commandProperty = linkJob.getProperty(IProgressConstants2.COMMAND_PROPERTY);

    if (actionProperty != null && commandProperty != null) {
        // if both are specified, then use neither
        updateTrigger(null, link);
    } else {
        Object property = actionProperty != null ? actionProperty : commandProperty;
        updateTrigger(property, link);
    }

    if (link.getData(TRIGGER_KEY) == null && (taskString == null || taskString.equals(getMainTitle()))) {
        // workaround for https://bugs.eclipse.org/383570
        taskString = ""; //$NON-NLS-1$
    }
    link.setToolTipText(taskString);
    link.setData(TEXT_KEY, taskString);

    updateText(taskString, link);

}

From source file:org.eclipse.ui.internal.views.markers.AllMarkersSeverityAndDescriptionConfigurationArea.java

License:Open Source License

public void createContents(Composite parent) {

    super.createContents(parent);

    Composite severityComposite = new Composite(parent, SWT.NONE);
    severityComposite.setLayout(new GridLayout(1, false));
    severityComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));

    enablementButton = new Button(severityComposite, SWT.CHECK);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    enablementButton.setLayoutData(data);
    enablementButton.setSelection(filterOnSeverity);
    enablementButton.setText(MarkerMessages.filtersDialog_filterOnSeverity);

    final Composite buttons = createSeverityGroup(severityComposite);
    GridData buttonData = new GridData();
    buttonData.horizontalIndent = IDialogConstants.INDENT;
    buttons.setLayoutData(buttonData);//  w ww  .  j  av  a2 s .  c  o  m

    enablementButton.addSelectionListener(new SelectionAdapter() {
        /*
         * (non-Javadoc)
         * 
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            setFilterOnSeverity(enablementButton.getSelection());
        }
    });

}

From source file:org.nabucco.framework.exporting.ui.rcp.wizard.ExportWizardPage.java

License:Open Source License

/**
 * Layout the export configuration group
 * //from w  w  w.j a  v  a 2 s . c o m
 * @param toolkit
 *            the toolkit
 * @param parent
 *            the parent composite
 * 
 * @return the layouted group
 */
private Group layoutConfigGroup(NabuccoFormToolkit toolkit, Composite parent) {

    Button exportAll = this.layoutExportAll(parent);

    Group group = new Group(parent, SWT.NONE);

    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 2;
    data.horizontalIndent = IDialogConstants.INDENT;

    Object compositeLayout = parent.getLayout();
    if (compositeLayout instanceof GridLayout) {
        data.horizontalIndent -= ((GridLayout) compositeLayout).marginWidth;
        data.horizontalIndent -= ((GridLayout) compositeLayout).marginLeft;
    }

    group.setLayoutData(data);

    GridLayout layout = new GridLayout();
    group.setLayout(layout);

    ExportConfigurationTree tree = this.layoutTree(group);
    CheckboxTreeViewer viewer = tree.getViewer();

    exportAll.addSelectionListener(new ExportSelectionListener(viewer, false));

    this.layoutDescription(toolkit, group);
    this.layoutSelectionButtons(group, viewer);

    viewer.setInput(this.configurations);

    return group;
}

From source file:org.nabucco.framework.importing.ui.rcp.wizard.ImportWizardPage.java

License:Open Source License

/**
 * Layout the import configuration group
 * /* w w  w.j  a va2s .c  om*/
 * @param toolkit
 *            the toolkit
 * @param parent
 *            the parent composite
 * 
 * @return the layouted group
 */
private Group layoutConfigGroup(NabuccoFormToolkit toolkit, Composite parent) {

    Button importAll = this.layoutImportAll(parent);

    Group group = new Group(parent, SWT.NONE);

    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 2;
    data.horizontalIndent = IDialogConstants.INDENT;

    Object compositeLayout = parent.getLayout();
    if (compositeLayout instanceof GridLayout) {
        data.horizontalIndent -= ((GridLayout) compositeLayout).marginWidth;
        data.horizontalIndent -= ((GridLayout) compositeLayout).marginLeft;
    }

    group.setLayoutData(data);

    GridLayout layout = new GridLayout();
    group.setLayout(layout);

    ImportConfigurationTree tree = this.layoutTree(group);
    CheckboxTreeViewer viewer = tree.getViewer();

    importAll.addSelectionListener(new ImportSelectionListener(viewer, false));

    this.layoutDescription(toolkit, group);
    this.layoutSelectionButtons(group, viewer);

    viewer.setInput(this.configurations);

    return group;
}