Search in sources :

Example 11 with ManagedForm

use of org.eclipse.ui.forms.ManagedForm in project yamcs-studio by yamcs.

the class StyleEditor method createPartControl.

@Override
public void createPartControl(Composite parent) {
    tk = new FormToolkit(parent.getDisplay());
    Composite formWrapper = tk.createComposite(parent);
    GridLayout gl = new GridLayout();
    formWrapper.setLayout(gl);
    form = tk.createScrolledForm(formWrapper);
    form.setText("Style Editor");
    form.setLayoutData(new GridData(GridData.FILL_BOTH));
    gl = new GridLayout();
    form.getBody().setLayout(gl);
    Section section = tk.createSection(form.getBody(), Section.TITLE_BAR);
    section.setText("Colors");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    StyleDefinition def = loadData(parent.getDisplay());
    ManagedForm managedForm = new ManagedForm(tk, form);
    resourceManager = new LocalResourceManager(JFaceResources.getResources());
    new ThemeColorBlock(def, parent.getDisplay(), resourceManager).createContent(managedForm);
    ManagedForm fontsMForm = new ManagedForm(tk, form);
    section = tk.createSection(form.getBody(), Section.TITLE_BAR);
    section.setText("Fonts");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    new ThemeColorBlock(def, parent.getDisplay(), resourceManager).createContent(fontsMForm);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) LocalResourceManager(org.eclipse.jface.resource.LocalResourceManager) ManagedForm(org.eclipse.ui.forms.ManagedForm) GridData(org.eclipse.swt.layout.GridData) Section(org.eclipse.ui.forms.widgets.Section)

Aggregations

ManagedForm (org.eclipse.ui.forms.ManagedForm)11 GridLayout (org.eclipse.swt.layout.GridLayout)10 GridData (org.eclipse.swt.layout.GridData)9 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)9 Composite (org.eclipse.swt.widgets.Composite)8 Button (org.eclipse.swt.widgets.Button)7 Label (org.eclipse.swt.widgets.Label)7 Text (org.eclipse.swt.widgets.Text)7 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Combo (org.eclipse.swt.widgets.Combo)3 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)2 TabFolder (org.eclipse.swt.widgets.TabFolder)2 TabItem (org.eclipse.swt.widgets.TabItem)2 URL (java.net.URL)1 LocalResourceManager (org.eclipse.jface.resource.LocalResourceManager)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1