Example usage for org.eclipse.jface.resource JFaceResources DEFAULT_FONT

List of usage examples for org.eclipse.jface.resource JFaceResources DEFAULT_FONT

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources DEFAULT_FONT.

Prototype

String DEFAULT_FONT

To view the source code for org.eclipse.jface.resource JFaceResources DEFAULT_FONT.

Click Source Link

Document

The symbolic font name for the standard font (value "org.eclipse.jface.defaultfont").

Usage

From source file:org.gumtree.gumnix.sics.ui.widgets.SynopticsStatusWidget.java

License:Open Source License

protected void createUI() {
    /*********************************************************************
     * Initialise//from ww w  .ja v  a2 s . co m
     *********************************************************************/
    for (Control child : this.getChildren()) {
        child.dispose();
    }
    setLayout(new FormLayout());
    /*********************************************************************
     * Devices
     *********************************************************************/
    for (int i = 0; i < deviceURIs.size(); i++) {
        Label label = getToolkit().createLabel(this, "");
        label.setData(PROP_LABEL, labelList.get(i));
        label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
        FormData formData = new FormData();
        formData.left = new FormAttachment(xCoordinateList.get(i), 0);
        formData.top = new FormAttachment(yCoordinateList.get(i), 0);
        label.setLayoutData(formData);

        // Register control
        uriMap.put(deviceURIs.get(i), label);
        URI nameURI = URI.create(deviceURIs.get(i).toString() + "?sicsdev");
        uriMap.put(nameURI, label);
        URI unitURI = URI.create(deviceURIs.get(i).toString() + "?units");
        uriMap.put(unitURI, label);
        URI statusURI = URI.create(deviceURIs.get(i).toString() + "?status");
        uriMap.put(statusURI, label);

        // Fetch initial value
        getDataAccessManager().get(nameURI, String.class, new DataHandler<String>());
        getDataAccessManager().get(unitURI, String.class, new DataHandler<String>());
        getDataAccessManager().get(statusURI, ControllerStatus.class, new DataHandler<ControllerStatus>());
        getDataAccessManager().get(deviceURIs.get(i), String.class, new DataHandler<String>());
    }
    /*********************************************************************
     * Background
     *********************************************************************/
    Label imageLabel = getToolkit().createLabel(this, "");
    if (backgroundImage != null) {
        backgroundImage.dispose();
    }
    backgroundImage = getDataAccessManager().get(URI.create(imageURI), Image.class);
    imageLabel.setImage(backgroundImage);
    FormData formData = new FormData();
    formData.left = new FormAttachment(0, 0);
    formData.top = new FormAttachment(0, 0);
    imageLabel.setLayoutData(formData);
    /*********************************************************************
     * Final preparation
     *********************************************************************/
    setEnabled(true);
    getParent().getParent().layout(true, true);
}

From source file:org.gumtree.widgets.swt.util.UIResources.java

License:Open Source License

public static Font getDefaultFont(int style) {
    if ((style & SWT.BOLD) == SWT.BOLD) {
        return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
    } else if ((style & SWT.ITALIC) == SWT.ITALIC) {
        return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
    } else {//w  w w .  j av a  2 s . c  om
        return getDefaultFont();
    }
}

From source file:org.jboss.tools.openshift.internal.ui.preferences.OpenShiftPreferencePage.java

License:Open Source License

@Override
public void createFieldEditors() {
    Link link = new Link(getFieldEditorParent(), SWT.WRAP);
    link.setText(//from   ww w.  ja  v a  2 s.c  o  m
            "The OpenShift client binary (oc) is required for features such as Port Forwarding or Log Streaming. "
                    + "You can find more information about how to install it from <a>here</a>.");
    GridDataFactory.fillDefaults().span(3, 1).hint(1, 60).grab(true, false).applyTo(link);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            new BrowserUtility().checkedCreateExternalBrowser(DOWNLOAD_INSTRUCTIONS_URL,
                    OpenShiftUIActivator.PLUGIN_ID, OpenShiftUIActivator.getDefault().getLog());
        }
    });
    this.cliLocationEditor = new CliFileEditor();
    cliLocationEditor.setFilterPath(SystemUtils.getUserHome());
    cliLocationEditor.setFileExtensions(ocBinary.getExtensions());
    cliLocationEditor.setValidateStrategy(FileFieldEditor.VALIDATE_ON_KEY_STROKE);
    addField(cliLocationEditor);

    ocVersionLabel = new Label(getFieldEditorParent(), SWT.WRAP);
    ocVersionLabel.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));
    GridDataFactory.fillDefaults().span(3, 1).applyTo(ocVersionLabel);
    ocMessageComposite = new Composite(getFieldEditorParent(), SWT.NONE);
    GridDataFactory.fillDefaults().span(3, 1).applyTo(ocMessageComposite);
    GridLayoutFactory.fillDefaults().numColumns(2).applyTo(ocMessageComposite);
    Label label = new Label(ocMessageComposite, SWT.NONE);
    label.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));
    GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(label);
    ocMessageLabel = new Label(ocMessageComposite, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(ocMessageLabel);
    ocMessageComposite.setVisible(false);
}

From source file:org.jkiss.dbeaver.ext.mockdata.MockDataWizardPageSettings.java

License:Apache License

public void createControl(Composite parent) {
    Composite composite = UIUtils.createPlaceholder(parent, 1);

    {//from w  w w  .  j a v a 2 s .  c om
        SelectionListener changeListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                updateState();
            }
        };

        Composite entityPlaceholder = UIUtils.createPlaceholder(composite, 2);
        this.entityNameText = UIUtils.createLabelText(entityPlaceholder,
                MockDataMessages.tools_mockdata_wizard_page_settings_text_entity, "", SWT.NONE | SWT.READ_ONLY);
        GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
        gd.widthHint = 230;
        gd.verticalIndent = 5;
        gd.horizontalIndent = 9;
        entityPlaceholder.setLayoutData(gd);

        Group settingsGroup = UIUtils.createControlGroup(composite,
                MockDataMessages.tools_mockdata_wizard_page_settings_group_settings, 4,
                GridData.FILL_HORIZONTAL, 0);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.verticalIndent = 5;
        settingsGroup.setLayoutData(gd);

        this.removeOldDataCheck = UIUtils.createCheckbox(settingsGroup,
                MockDataMessages.tools_mockdata_wizard_page_settings_checkbox_remove_old_data, null,
                mockDataSettings.isRemoveOldData(), 4);
        removeOldDataCheck.addSelectionListener(changeListener);

        this.rowsText = UIUtils.createLabelText(settingsGroup,
                MockDataMessages.tools_mockdata_wizard_page_settings_combo_rows,
                String.valueOf(mockDataSettings.getRowsNumber()), SWT.BORDER, new GridData(110, SWT.DEFAULT));
        rowsText.addSelectionListener(changeListener);
        rowsText.addVerifyListener(UIUtils.getLongVerifyListener(rowsText));
        rowsText.addModifyListener(new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {
                updateState();
            }
        });
    }

    {
        Group generatorsGroup = UIUtils.createControlGroup(composite,
                MockDataMessages.tools_mockdata_wizard_page_settings_group_generators, 5, GridData.FILL_BOTH,
                0);
        GridData gd = new GridData(GridData.FILL_BOTH);
        gd.verticalIndent = 5;
        generatorsGroup.setLayoutData(gd);

        Composite placeholder = UIUtils.createPlaceholder(generatorsGroup, 1);
        gd = new GridData(GridData.FILL_VERTICAL);
        gd.widthHint = 250;
        placeholder.setLayoutData(gd);

        Button autoAssignButton = new Button(placeholder, SWT.PUSH);
        autoAssignButton.setText(MockDataMessages.tools_mockdata_wizard_page_settings_button_autoassign);
        autoAssignButton.setImage(DBeaverIcons.getImage(UIIcon.OBJ_REFRESH));
        autoAssignButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                if (UIUtils.confirmAction(getShell(), MockDataMessages.tools_mockdata_wizard_title,
                        MockDataMessages.tools_mockdata_wizard_page_settings_button_autoassign_confirm)) {
                    autoAssignGenerators();
                }
            }
        });
        gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
        //            gd.horizontalIndent = 5;
        autoAssignButton.setLayoutData(gd);

        generatorsTableViewer = new TableViewer(placeholder, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
        final Table table = generatorsTableViewer.getTable();

        gd = new GridData(GridData.FILL_BOTH);
        gd.verticalIndent = 5;
        table.setLayoutData(gd);
        table.setHeaderVisible(true);
        table.setLinesVisible(true);

        generatorsTableViewer.setContentProvider(new IStructuredContentProvider() {
            @Override
            public void dispose() {
            }

            @Override
            public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
            }

            @Override
            public Object[] getElements(Object inputElement) {
                if (inputElement instanceof Collection) {
                    return ((Collection<?>) inputElement).toArray();
                }
                return new Object[0];
            }
        });

        CellLabelProvider labelProvider = new CellLabelProvider() {
            @Override
            public void update(ViewerCell cell) {
                DBSAttributeBase attribute = (DBSAttributeBase) cell.getElement();
                AttributeGeneratorProperties attributeGeneratorProperties = mockDataSettings
                        .getAttributeGeneratorProperties(attribute);
                if (cell.getColumnIndex() == 0) {
                    cell.setImage(DBeaverIcons.getImage(DBValueFormatting.getTypeImage(attribute)));
                    cell.setText(attribute.getName());
                    try {
                        if (DBUtils.checkUnique(mockDataSettings.getMonitor(), mockDataSettings.getEntity(),
                                attribute) != null) {
                            cell.setFont(boldFont);
                        }
                    } catch (DBException e) {
                        log.error("Error checking the attribute '" + attribute.getName() + "' properties", e);
                    }
                    if (attributeGeneratorProperties != null && attributeGeneratorProperties.isEmpty()) {
                        cell.setForeground(table.getDisplay().getSystemColor(SWT.COLOR_RED));
                        noGeneratorInfoLabel.setVisible(true);
                    }
                } else {
                    if (attributeGeneratorProperties != null && !attributeGeneratorProperties.isEmpty()) {
                        String selectedGeneratorId = attributeGeneratorProperties.getSelectedGeneratorId();
                        String label = mockDataSettings.getGeneratorDescriptor(selectedGeneratorId).getLabel();
                        cell.setText(label.trim());
                    }
                }
            }
        };

        TableViewerColumn attributeColumn = new TableViewerColumn(generatorsTableViewer, SWT.LEFT);
        attributeColumn.setLabelProvider(labelProvider);
        attributeColumn.getColumn()
                .setText(MockDataMessages.tools_mockdata_wizard_page_settings_generatorselector_attribute);

        TableViewerColumn generatorColumn = new TableViewerColumn(generatorsTableViewer, SWT.LEFT);
        generatorColumn.setLabelProvider(labelProvider);
        TableColumn column = generatorColumn.getColumn();
        column.setText(MockDataMessages.tools_mockdata_wizard_page_settings_generatorselector_generator);

        generatorColumn.setEditingSupport(new EditingSupport(generatorsTableViewer) {
            @Override
            protected CellEditor getCellEditor(Object element) {
                DBSAttributeBase attribute = (DBSAttributeBase) element;

                AttributeGeneratorProperties attributeGenerators = mockDataSettings
                        .getAttributeGeneratorProperties(attribute);
                Set<String> generators = new LinkedHashSet<>();
                if (attributeGenerators.isEmpty()) {
                    noGeneratorInfoLabel.setVisible(true);
                    TextCellEditor textCellEditor = new TextCellEditor(generatorsTableViewer.getTable());
                    textCellEditor.getControl().setEnabled(false);
                    return textCellEditor;
                } else {
                    for (String generatorId : attributeGenerators.getGenerators()) {
                        generators.add(mockDataSettings.getGeneratorDescriptor(generatorId).getLabel());
                    }

                    CustomComboBoxCellEditor customComboBoxCellEditor = new CustomComboBoxCellEditor(
                            generatorsTableViewer, generatorsTableViewer.getTable(),
                            generators.toArray(new String[generators.size()]), SWT.BORDER | SWT.READ_ONLY);
                    return customComboBoxCellEditor;
                }
            }

            @Override
            protected boolean canEdit(Object element) {
                return true;
            } // disable the generator selection

            @Override
            protected Object getValue(Object element) {
                DBSAttributeBase attribute = (DBSAttributeBase) element;
                String selectedGenerator = mockDataSettings.getAttributeGeneratorProperties(attribute)
                        .getSelectedGeneratorId();
                if (selectedGenerator != null) {
                    return mockDataSettings.getGeneratorDescriptor(selectedGenerator).getLabel();
                } else {
                    return "";
                }
            }

            @Override
            protected void setValue(Object element, Object value) {
                DBSAttributeBase attribute = (DBSAttributeBase) element;
                selectGenerator(attribute, (String) value);
            }
        });

        table.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                saveGeneratorProperties();
                reloadProperties((DBSAttributeBase) e.item.getData(), null);
            }
        });

        // generator properties
        placeholder = UIUtils.createPlaceholder(generatorsGroup, 1);
        placeholder.setLayoutData(new GridData(GridData.FILL_BOTH));

        Composite labelCombo = UIUtils.createPlaceholder(placeholder, 5);
        gd = new GridData(GridData.FILL_HORIZONTAL);
        labelCombo.setLayoutData(gd);

        generatorCombo = new Combo(labelCombo, SWT.READ_ONLY | SWT.DROP_DOWN);
        gd = new GridData();
        gd.widthHint = 80;
        generatorCombo.setLayoutData(gd);
        generatorCombo.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                selectGenerator(selectedAttribute, generatorCombo.getText());
            }
        });

        Composite descriptionCombo = UIUtils.createPlaceholder(labelCombo, 2);
        gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
        descriptionCombo.setLayoutData(gd);

        generatorDescriptionLabel = new Label(descriptionCombo, SWT.NONE);
        generatorDescriptionLabel
                .setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));
        generatorDescriptionLabel.setText("");
        gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
        gd.horizontalIndent = 5;
        generatorDescriptionLabel.setLayoutData(gd);

        generatorDescriptionLink = UIUtils.createLink(descriptionCombo, "", new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                if (!CommonUtils.isEmpty(generatorLinkUrl)) {
                    IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
                    try {
                        support.getExternalBrowser().openURL(new URL(generatorLinkUrl));
                    } catch (Exception ex) {
                    }
                }
            }
        });
        gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
        gd.horizontalIndent = 5;
        generatorDescriptionLink.setLayoutData(gd);

        Button resetButton = new Button(labelCombo, SWT.PUSH);
        resetButton.setText(MockDataMessages.tools_mockdata_wizard_page_settings_button_reset);
        resetButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                for (Object key : propertySource.getProperties().keySet()) {
                    propertySource.resetPropertyValueToDefault(key);
                }
                propsEditor.loadProperties(propertySource);
                generatorsTableViewer.refresh(true, true);
            }
        });
        gd = new GridData();
        gd.horizontalIndent = 5;
        resetButton.setLayoutData(gd);

        propsEditor = new PropertyTreeViewer(placeholder, SWT.BORDER);
        gd = new GridData(GridData.FILL_BOTH);
        gd.verticalIndent = 5;
        propsEditor.getControl().setLayoutData(gd);

        noGeneratorInfoLabel = UIUtils.createInfoLabel(composite,
                MockDataMessages.tools_mockdata_wizard_page_settings_button_info_notfound);
        //noGeneratorInfoLabel.setForeground(generatorsTableViewer.getDisplay().getSystemColor(SWT.COLOR_RED));
        gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
        gd.horizontalSpan = 2;
        gd.verticalIndent = 5;
        noGeneratorInfoLabel.setLayoutData(gd);
        noGeneratorInfoLabel.setVisible(false);

        table.addControlListener(new ControlAdapter() {
            @Override
            public void controlResized(ControlEvent e) {
                UIUtils.packColumns(table);
                UIUtils.maxTableColumnsWidth(table);
                table.removeControlListener(this);
            }
        });
    }

    setControl(composite);

    boldFont = UIUtils.makeBoldFont(generatorsTableViewer.getControl().getFont());
}

From source file:org.kalypso.afgui.ui.workflow.WorkflowBreadCrumbLabelProvider.java

License:Open Source License

@Override
public Font getFont(final Object element) {
    final IScenario currentScenario = KalypsoAFGUIFrameworkPlugin.getActiveWorkContext().getCurrentCase();
    if (element.equals(currentScenario))
        return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);

    return null;/* w w w  . ja  v a 2s .  c  o  m*/
}

From source file:org.kalypso.ui.rrm.internal.scenarios.ScenariosColumnLabelProvider.java

License:Open Source License

/**
 * @see org.eclipse.jface.viewers.ColumnLabelProvider#getFont(java.lang.Object)
 *//*from  w  ww.j av  a 2 s  .  c o m*/
@Override
public Font getFont(final Object element) {
    if (element.equals(m_targetScenario))
        return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);

    return null;
}

From source file:org.locationtech.udig.tutorials.rcp.View.java

License:Open Source License

public void createPartControl(Composite parent) {
    Composite top = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;/*  w  ww .j  av a 2 s  .c  om*/
    layout.marginWidth = 0;
    top.setLayout(layout);
    // top banner
    Composite banner = new Composite(top, SWT.NONE);
    banner.setLayoutData(
            new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
    layout = new GridLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 10;
    layout.numColumns = 2;
    banner.setLayout(layout);

    // setup bold font
    Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);

    Label l = new Label(banner, SWT.WRAP);
    l.setText("Subject:");
    l.setFont(boldFont);
    l = new Label(banner, SWT.WRAP);
    l.setText("This is a message about the cool Eclipse RCP!");

    l = new Label(banner, SWT.WRAP);
    l.setText("From:");
    l.setFont(boldFont);

    final Link link = new Link(banner, SWT.NONE);
    link.setText("<a>nicole@mail.org</a>");
    link.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            MessageDialog.openInformation(getSite().getShell(), "Not Implemented",
                    "Imagine the address book or a new message being created now.");
        }
    });

    l = new Label(banner, SWT.WRAP);
    l.setText("Date:");
    l.setFont(boldFont);
    l = new Label(banner, SWT.WRAP);
    l.setText("10:34 am");
    // message contents
    Text text = new Text(top, SWT.MULTI | SWT.WRAP);
    text.setText(
            "This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"
                    + "- add a top-level menu and toolbar with actions\n" + "- add keybindings to actions\n"
                    + "- create views that can't be closed and\n" + "  multiple instances of the same view\n"
                    + "- perspectives with placeholders for new views\n" + "- use the default about dialog\n"
                    + "- create a product definition\n");
    text.setLayoutData(new GridData(GridData.FILL_BOTH));

    IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
}

From source file:org.marketcetera.photon.notification.DesktopNotificationPopup.java

/**
 * Provides the label font. Default is to the bold version of the JFace
 * default font.//from  ww  w.j ava2  s . c  o  m
 * 
 * Subclasses can override to provide a different font.
 * 
 * @return the font to use for heading labels
 */
protected Font getLabelFont() {
    return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
}

From source file:org.multicore_association.shim.edit.gui.swt.viewer.ShimObjectTableLabelProvider.java

License:MIT License

/**
 * @see org.eclipse.jface.viewers.ITableFontProvider#getFont(java.lang.Object,
 *      int)//from  ww w .ja  v a  2s  . c  o m
 */
@Override
public Font getFont(Object element, int columnIndex) {
    ShimObject so = (ShimObject) element;
    Object obj = so.getObj();

    Font result = JFaceResources.getFont(JFaceResources.DEFAULT_FONT);

    if (obj == null || apiClass.equals(obj.getClass())) {
        ShimObjectColumnFormat format = formatList.get(columnIndex);
        ColumnType type = format.getType();

        switch (type) {
        case INT:
        case FLOAT:
        case HEX:
            // memo. JFaceResources.TEXT_FONT is monospace font.
            result = JFaceResources.getFont(JFaceResources.TEXT_FONT);
            break;

        default:
            break;
        }
    }
    return result;
}

From source file:org.netxms.ui.eclipse.epp.views.EventProcessingPolicyEditor.java

License:Open Source License

@Override
public void createPartControl(Composite parent) {
    session = (NXCSession) ConsoleSharedData.getSession();

    IDialogSettings settings = Activator.getDefault().getDialogSettings();
    filterEnabled = settings.getBoolean("EventProcessingPolicyEditor.filterEnabled"); //$NON-NLS-1$

    // Initiate loading of required plugins if they was not loaded yet
    try {/*from   ww w  .j av a 2  s  .co m*/
        Platform.getAdapterManager().loadAdapter(new EventTemplate(0),
                "org.eclipse.ui.model.IWorkbenchAdapter"); //$NON-NLS-1$
        Platform.getAdapterManager().loadAdapter(new ServerAction(0), "org.eclipse.ui.model.IWorkbenchAdapter"); //$NON-NLS-1$
        Platform.getAdapterManager().loadAdapter(session.getTopLevelObjects()[0],
                "org.eclipse.ui.model.IWorkbenchAdapter"); //$NON-NLS-1$
    } catch (Exception e) {
    }

    imageStop = Activator.getImageDescriptor("icons/stop.png").createImage(); //$NON-NLS-1$
    imageAlarm = Activator.getImageDescriptor("icons/alarm.png").createImage(); //$NON-NLS-1$
    imageSituation = Activator.getImageDescriptor("icons/situation.gif").createImage(); //$NON-NLS-1$
    imageExecute = Activator.getImageDescriptor("icons/execute.png").createImage(); //$NON-NLS-1$
    imageTerminate = Activator.getImageDescriptor("icons/terminate.png").createImage(); //$NON-NLS-1$
    imageCollapse = SharedIcons.COLLAPSE.createImage();
    imageExpand = SharedIcons.EXPAND.createImage();
    imageEdit = SharedIcons.EDIT.createImage();

    parent.setLayout(new FormLayout());

    // Create filter area
    filterControl = new FilterText(parent, SWT.NONE);
    filterControl.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent e) {
            onFilterModify();
        }
    });
    filterControl.setCloseAction(new Action() {
        @Override
        public void run() {
            enableFilter(false);
        }
    });

    scroller = new ScrolledComposite(parent, SWT.V_SCROLL);

    dataArea = new Composite(scroller, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    dataArea.setLayout(layout);
    dataArea.setBackground(BACKGROUND_COLOR);

    scroller.setContent(dataArea);
    scroller.setExpandVertical(true);
    scroller.setExpandHorizontal(true);
    scroller.addControlListener(new ControlAdapter() {
        public void controlResized(ControlEvent e) {
            Rectangle r = scroller.getClientArea();
            scroller.setMinSize(dataArea.computeSize(r.width, SWT.DEFAULT));
        }
    });

    // Setup layout
    FormData fd = new FormData();
    fd.left = new FormAttachment(0, 0);
    fd.top = new FormAttachment(filterControl);
    fd.right = new FormAttachment(100, 0);
    fd.bottom = new FormAttachment(100, 0);
    scroller.setLayoutData(fd);

    fd = new FormData();
    fd.left = new FormAttachment(0, 0);
    fd.top = new FormAttachment(0, 0);
    fd.right = new FormAttachment(100, 0);
    filterControl.setLayoutData(fd);

    normalFont = JFaceResources.getDefaultFont();
    boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);

    sessionListener = new SessionListener() {
        @Override
        public void notificationHandler(SessionNotification n) {
            processSessionNotification(n);
        }
    };
    session.addListener(sessionListener);

    selection = new TreeSet<RuleEditor>(new Comparator<RuleEditor>() {
        @Override
        public int compare(RuleEditor arg0, RuleEditor arg1) {
            return arg0.getRuleNumber() - arg1.getRuleNumber();
        }
    });

    createActions();
    contributeToActionBars();

    openEventProcessingPolicy();
    activateContext();

    // Set initial focus to filter input line
    if (filterEnabled)
        filterControl.setFocus();
    else
        enableFilter(false); // Will hide filter area correctly
}