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:com.dubture.symfony.ui.preferences.SymfonyPreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);//from   w  ww .j a  v  a 2 s.c  o m

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
            SymfonyUiPlugin.PLUGIN_ID + "." + "symfony_preferences");

    return super.createContents(parent);
}

From source file:com.dubture.symfony.ui.wizards.project.SymfonyProjectWizardSecondPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {

    final Composite composite = new Composite(parent, SWT.NULL);
    composite.setFont(parent.getFont());

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

    composite.setLayout(layout);/*  w ww.  j av a2  s  .c om*/
    composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

    overrideComposer = new SelectionButtonDialogField(SWT.CHECK);
    overrideComposer.setLabelText("Override composer.json values");
    overrideComposer.doFillIntoGrid(composite, 3);
    overrideComposer.setDialogFieldListener(new IDialogFieldListener() {
        @Override
        public void dialogFieldChanged(DialogField field) {
            settingsGroup.setEnabled(overrideComposer.isSelected());
        }
    });

    settingsGroup = new BasicSettingsGroup(composite, getShell());
    settingsGroup.addObserver(this);
    settingsGroup.setEnabled(false);

    setControl(composite);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(composite,
            SymfonyUiPlugin.PLUGIN_ID + "." + "newproject_secondpage");
}

From source file:com.dubture.twig.ui.preferences.TwigCodeassistPreferencePage.java

License:Open Source License

private void createMainBlock(Composite parent) {

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;//  w ww . jav a2  s .  co  m
    layout.verticalSpacing = convertVerticalDLUsToPixels(10);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    result.setLayout(layout);

    Group doubleClickGroup = new Group(result, SWT.NONE);
    doubleClickGroup.setLayout(new GridLayout());
    doubleClickGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    doubleClickGroup.setText("Auto-close twig tags");

    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);

    autoclosePrintTags = new Button(doubleClickGroup, SWT.CHECK);
    autoclosePrintTags.setText("Print tags {{ }}"); //$NON-NLS-1$
    autoclosePrintTags.setLayoutData(gd);

    autocloseStatementTags = new Button(doubleClickGroup, SWT.CHECK);
    autocloseStatementTags.setText("Statement tags {% %}");
    autocloseStatementTags.setLayoutData(gd);

    autocreateStatementTags = new Button(doubleClickGroup, SWT.CHECK);
    autocreateStatementTags.setText("Autocreate Statements (%)");
    autocreateStatementTags.setLayoutData(gd);

    Group higlightGroup = new Group(result, SWT.NONE);

    higlightGroup.setLayout(new GridLayout());
    higlightGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    higlightGroup.setText("Highlighting");

    markOccurrences = new Button(higlightGroup, SWT.CHECK);
    markOccurrences.setText("Mark occurrences"); //$NON-NLS-1$
    markOccurrences.setLayoutData(gd);

}

From source file:com.elphel.vdt.ui.dialogs.VDTErrorDialog.java

License:Open Source License

protected Control createDialogArea(Composite parent) {
    createMessageArea(parent);// ww  w.  j  a v  a  2s.c o m

    // 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);
    layout.numColumns = 2;

    composite.setLayout(layout);

    GridData childData = new GridData(GridData.FILL_BOTH);
    childData.horizontalSpan = 2;

    composite.setLayoutData(childData);
    composite.setFont(parent.getFont());

    return composite;
}

From source file:com.github.lbroudoux.dsl.eip.bridge.core.ui.dialogs.EIPModelAndRouteSelectionDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite base) {
    Composite parent = (Composite) super.createDialogArea(base);
    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  2s .co m
    composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    // Manage dialog tree content.
    FilteredTree tree = new FilteredTree(composite, SWT.SINGLE | SWT.BORDER, new PatternFilter(), true);

    projectTree = tree.getViewer();
    projectTree.setLabelProvider(new EIPModelTreeLabelProvider());
    projectTree.setContentProvider(new EIPModelTreeContentProvider());
    projectTree.setInput(ResourcesPlugin.getWorkspace().getRoot());

    GridDataFactory.fillDefaults().grab(true, true).hint(500, 300).applyTo(tree);

    // Manage dialog tree events.
    projectTree.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof TreeSelection) {
                TreeSelection tSelection = (TreeSelection) event.getSelection();
                if (tSelection.getFirstElement() instanceof IResource) {
                    eipModel = (IResource) tSelection.getFirstElement();
                }
            }
        }
    });

    setTitle("Choose a target EIP model");
    setMessage("Select the EIP model for designing a new Route from Service");
    applyDialogFont(composite);

    return composite;
}

From source file:com.github.lbroudoux.dsl.eip.parser.core.ui.dialogs.CompareTargetSelectionDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite base) {
    Composite parent = (Composite) super.createDialogArea(base);
    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);//  w  w  w.  ja  va 2  s  .c  o m
    composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    // Manage dialog tree content.
    FilteredTree tree = new FilteredTree(composite, SWT.SINGLE | SWT.BORDER, new PatternFilter(), true);

    projectTree = tree.getViewer();
    projectTree.setLabelProvider(new RouteTreeLabelProvider());
    projectTree.setContentProvider(new RouteTreeContentProvider());
    projectTree.setInput(ResourcesPlugin.getWorkspace().getRoot());

    GridDataFactory.fillDefaults().grab(true, true).hint(500, 300).applyTo(tree);

    // Manage dialog tree events.
    projectTree.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof TreeSelection) {
                TreeSelection tSelection = (TreeSelection) event.getSelection();
                if (tSelection.getFirstElement() instanceof Route) {
                    selectedRoute = (Route) tSelection.getFirstElement();
                }
            }
        }
    });

    setTitle("Compare '" + fileName + "' with an EIP Route model");
    setMessage("Select an EIP Route to compare the resource with");
    applyDialogFont(composite);

    return composite;
}

From source file:com.github.lbroudoux.dsl.eip.parser.core.ui.dialogs.PersistTargetSelectionDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite base) {
    Composite parent = (Composite) super.createDialogArea(base);
    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   www .j av a 2 s  .c  o  m*/
    composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    // Manage dialog tree content.
    FilteredTree tree = new FilteredTree(composite, SWT.SINGLE | SWT.BORDER, new PatternFilter(), true);

    projectTree = tree.getViewer();
    projectTree.setLabelProvider(new EIPModelTreeLabelProvider());
    projectTree.setContentProvider(new EIPModelTreeContentProvider());
    projectTree.setInput(ResourcesPlugin.getWorkspace().getRoot());

    GridDataFactory.fillDefaults().grab(true, true).hint(500, 300).applyTo(tree);

    // Manage dialog tree events.
    projectTree.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof TreeSelection) {
                TreeSelection tSelection = (TreeSelection) event.getSelection();
                if (tSelection.getFirstElement() instanceof IResource) {
                    selectedEIPModel = (IResource) tSelection.getFirstElement();
                }
            }
        }
    });

    setTitle("Parse and merge '" + fileName + "' with an EIP Model");
    setMessage("Select an EIP Model to persist the parsed resource within");
    applyDialogFont(composite);

    return composite;
}

From source file:com.google.cloud.tools.eclipse.appengine.deploy.ui.DeployPreferencesDialog.java

License:Apache License

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

    Composite container = new Composite(dialogArea, SWT.NONE);
    content = new StandardDeployPreferencesPanel(container, project, loginService, getLayoutChangedHandler(),
            true /* requireValues */);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(content);

    // we pull in Dialog's content margins which are zeroed out by TitleAreaDialog
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
    GridLayoutFactory.fillDefaults()//from w w w . j  av  a2 s.  c  o  m
            .margins(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN),
                    convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN))
            .spacing(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING),
                    convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING))
            .generateLayout(container);

    TitleAreaDialogSupport.create(this, content.getDataBindingContext())
            .setValidationMessageProvider(new ValidationMessageProvider() {
                @Override
                public int getMessageType(ValidationStatusProvider statusProvider) {
                    int type = super.getMessageType(statusProvider);
                    setValid(type != IMessageProvider.ERROR);
                    return type;
                }
            });
    return dialogArea;
}

From source file:com.google.dart.tools.search.internal.ui.SearchDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // create
    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);/*ww  w.  jav  a  2 s .  c  o m*/
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // create help control if needed
    if (isHelpAvailable()) {
        createHelpControl(composite);
    }

    Label filler = new Label(composite, SWT.NONE);
    filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
    layout.numColumns++;

    fReplaceButton = createActionButton(composite, REPLACE_ID, SearchMessages.SearchDialog_replaceAction, true);
    fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage);

    Button searchButton = createActionButton(composite, SEARCH_ID, SearchMessages.SearchDialog_searchAction,
            true);
    searchButton.setEnabled(fDescriptors.size() > 0);
    super.createButtonsForButtonBar(composite); // cancel button

    return composite;
}

From source file:com.google.dart.tools.ui.feedback.FeedbackDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    //overriding to tweak layout

    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // this is incremented by createButton
    layout.makeColumnsEqualWidth = true;
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = 0; //convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    //put some padding at the bottom
    layout.marginBottom = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    composite.setLayout(layout);/*from w  ww  . ja v a 2s .c o  m*/
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
    composite.setLayoutData(data);
    composite.setFont(parent.getFont());

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