Example usage for org.eclipse.jface.layout LayoutConstants getIndent

List of usage examples for org.eclipse.jface.layout LayoutConstants getIndent

Introduction

In this page you can find the example usage for org.eclipse.jface.layout LayoutConstants getIndent.

Prototype

public static final int getIndent() 

Source Link

Document

Returns the indent of dependent controls, in pixels.

Usage

From source file:net.certiv.fluentmark.util.SwtUtil.java

License:Open Source License

/**
 * Returns the indent of dependent controls, in pixels.
 * <p>//www.  j  ava  2s  .c  om
 * <strong>Note:</strong> Use this method instead of {@link LayoutConstants#getIndent()} for
 * compatibility reasons.
 * </p>
 * 
 * @return the indent of dependent controls, in pixels.
 * @since 3.9
 */
public static final int getIndent() {
    return LayoutConstants.getIndent();
}

From source file:org.eclipse.editorconfig.ui.internal.preferences.SyntaxColoringPreferencePage.java

License:Open Source License

private int getIndent() {
    return LayoutConstants.getIndent();
}

From source file:org.eclipse.ui.internal.dialogs.GlobalizationPreferencePage.java

License:Open Source License

private void createBidiPreferencesGroup(Composite composite) {

    layoutDirectionCombo = addComboBox(composite, WorkbenchMessages.GlobalizationPreference_layoutDirection, 0);
    layoutDirectionCombo.setItems(new String[] { DEFAULT_DIR, LTR_DIR, RTL_DIR });
    layoutDirectionCombo.select(getLayoutDirectionIndex(layoutDirection));
    layoutDirectionCombo.addSelectionListener(new SelectionAdapter() {
        @Override//from  w  w  w.ja v  a 2s  . co m
        public void widgetSelected(SelectionEvent e) {
            layoutDirection = getLayoutDirectionInteger(layoutDirectionCombo.getSelectionIndex());
        }
    });

    createSpace(composite);

    bidiSupportClickButton = new Button(composite, SWT.CHECK | SWT.LEFT);
    bidiSupportClickButton.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
    bidiSupportClickButton.setText(WorkbenchMessages.GlobalizationPreference_bidiSupport);
    bidiSupportClickButton.setSelection(bidiSupport);
    bidiSupportClickButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            selectClickMode(bidiSupportClickButton.getSelection());
        }
    });

    textDirectionCombo = addComboBox(composite, WorkbenchMessages.GlobalizationPreference_textDirection,
            LayoutConstants.getIndent());
    textDirectionCombo.setItems(new String[] { DEFAULT_DIR, LTR_DIR, AUTO_DIR, RTL_DIR });
    textDirectionCombo.setEnabled(bidiSupport);
    textDirectionCombo.select(getTextDirectionIndex(textDirection));
    textDirectionCombo.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            textDirection = getTextDirectionString(textDirectionCombo.getSelectionIndex());
        }
    });

    createSpace(composite);

    Font font = composite.getFont();
    Composite note = createNoteComposite(font, composite, WorkbenchMessages.Preference_note,
            WorkbenchMessages.GlobalizationPreference_restartWidget);
    note.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
}

From source file:org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage.java

License:Open Source License

protected void createOpenModeGroup(Composite composite) {

    Font font = composite.getFont();

    Group buttonComposite = new Group(composite, SWT.LEFT);
    GridLayout layout = new GridLayout();
    buttonComposite.setLayout(layout);//w w  w  .j ava2  s . c  o  m
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
    buttonComposite.setLayoutData(data);
    buttonComposite.setText(WorkbenchMessages.WorkbenchPreference_openMode);

    String label = WorkbenchMessages.WorkbenchPreference_doubleClick;
    doubleClickButton = createRadioButton(buttonComposite, label);
    doubleClickButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            selectClickMode(singleClickButton.getSelection());
        }
    });
    doubleClickButton.setSelection(!openOnSingleClick);

    label = WorkbenchMessages.WorkbenchPreference_singleClick;
    singleClickButton = createRadioButton(buttonComposite, label);
    singleClickButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            selectClickMode(singleClickButton.getSelection());
        }
    });
    singleClickButton.setSelection(openOnSingleClick);

    label = WorkbenchMessages.WorkbenchPreference_singleClick_SelectOnHover;
    selectOnHoverButton = new Button(buttonComposite, SWT.CHECK | SWT.LEFT);
    selectOnHoverButton.setText(label);
    selectOnHoverButton.setEnabled(openOnSingleClick);
    selectOnHoverButton.setSelection(selectOnHover);
    selectOnHoverButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            selectOnHover = selectOnHoverButton.getSelection();
        }
    });
    data = new GridData();
    data.horizontalIndent = LayoutConstants.getIndent();
    selectOnHoverButton.setLayoutData(data);

    label = WorkbenchMessages.WorkbenchPreference_singleClick_OpenAfterDelay;
    openAfterDelayButton = new Button(buttonComposite, SWT.CHECK | SWT.LEFT);
    openAfterDelayButton.setText(label);
    openAfterDelayButton.setEnabled(openOnSingleClick);
    openAfterDelayButton.setSelection(openAfterDelay);
    openAfterDelayButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            openAfterDelay = openAfterDelayButton.getSelection();
        }
    });
    data = new GridData();
    data.horizontalIndent = LayoutConstants.getIndent();
    openAfterDelayButton.setLayoutData(data);

    createNoteComposite(font, buttonComposite, WorkbenchMessages.Preference_note,
            WorkbenchMessages.WorkbenchPreference_noEffectOnAllViews);
}

From source file:org.eclipse.ui.internal.wizards.preferences.WizardPreferencesPage.java

License:Open Source License

/**
 * @param composite/*from  w w  w . j ava  2  s.c om*/
 */
protected void createTransfersList(Composite composite) {

    transferAllButton = new Button(composite, SWT.CHECK);
    transferAllButton.setText(getAllButtonText());

    group = new Group(composite, SWT.NONE);
    GridData groupData = new GridData(GridData.FILL_BOTH);
    groupData.horizontalSpan = 2;
    groupData.horizontalIndent = LayoutConstants.getIndent();
    Object compositeLayout = composite.getLayout();
    if (compositeLayout instanceof GridLayout) {
        groupData.horizontalIndent -= ((GridLayout) compositeLayout).marginWidth;
        groupData.horizontalIndent -= ((GridLayout) compositeLayout).marginLeft;
    }
    group.setLayoutData(groupData);

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

    transfersTree = createFilteredTree(group);

    transfersTree.setLayoutData(new GridData(GridData.FILL_BOTH));

    viewer = (CheckboxTreeViewer) transfersTree.getViewer();
    viewer.setContentProvider(new PreferencesContentProvider());
    viewer.setLabelProvider(new WorkbenchLabelProvider());

    Label description = new Label(group, SWT.NONE);
    description.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    description.setText(PreferencesMessages.WizardPreferences_description);

    descText = new Text(group, SWT.V_SCROLL | SWT.READ_ONLY | SWT.BORDER | SWT.WRAP);
    GridData descriptionData = new GridData(GridData.FILL_BOTH);
    descriptionData.heightHint = convertHeightInCharsToPixels(3);
    descText.setLayoutData(descriptionData);

    transferAllButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            if (transferAllButton.getSelection()) {
                viewer.setAllChecked(false);
            }
            updateEnablement();
            updatePageCompletion();
        }
    });

    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            updateDescription();
        }
    });

    viewer.addCheckStateListener(new ICheckStateListener() {
        public void checkStateChanged(CheckStateChangedEvent event) {
            transferAllButton.setSelection(false);
            updateEnablement();
            updatePageCompletion();
        }
    });

    addSelectionButtons(group);

}