Example usage for org.eclipse.jface.dialogs PopupDialog POPUP_MARGINWIDTH

List of usage examples for org.eclipse.jface.dialogs PopupDialog POPUP_MARGINWIDTH

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs PopupDialog POPUP_MARGINWIDTH.

Prototype

int POPUP_MARGINWIDTH

To view the source code for org.eclipse.jface.dialogs PopupDialog POPUP_MARGINWIDTH.

Click Source Link

Document

Margin width (in pixels) to be used in layouts inside popup dialogs (value is 0).

Usage

From source file:com.boothen.jsonedit.quickoutline.QuickOutlinePopup.java

License:Open Source License

@Override
protected void createContent(Composite parent) {
    parent.setLayout(GridLayoutFactory.fillDefaults()
            .margins(PopupDialog.POPUP_MARGINWIDTH, PopupDialog.POPUP_MARGINHEIGHT)
            .spacing(PopupDialog.POPUP_HORIZONTALSPACING, PopupDialog.POPUP_VERTICALSPACING).create());

    filterText = createFilterText(parent);

    final NamePatternFilter namePatternFilter = new NamePatternFilter(labelProvider); // use unstyled text
    filterText.addModifyListener(new ModifyListener() {

        @Override//from   ww w  .  j  ava  2  s  .c  om
        public void modifyText(ModifyEvent e) {
            String text = ((Text) e.widget).getText();
            pattern = Pattern.compile(text, Pattern.CASE_INSENSITIVE);
            namePatternFilter.setPattern(pattern);
            stringMatcherUpdated();
        }
    });

    Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    createTreeViewer(parent);

    treeViewer.addFilter(namePatternFilter);
}

From source file:org.eclipse.sapphire.ui.forms.swt.Popup.java

License:Open Source License

/**
 * Override to populate with notifications.
 * /*from   w w w .  ja v a2s. co m*/
 * @param parent
 */
protected Control createContentArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayoutFactory.fillDefaults().margins(PopupDialog.POPUP_MARGINWIDTH, PopupDialog.POPUP_MARGINHEIGHT)
            .spacing(PopupDialog.POPUP_HORIZONTALSPACING, PopupDialog.POPUP_VERTICALSPACING).applyTo(composite);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
    return composite;
}