use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class VagrantBoxView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
form = toolkit.createForm(parent);
form.setText(DVMessages.getString(DaemonMissing));
final Composite container = form.getBody();
GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).applyTo(container);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
createTableViewer(container);
hookContextMenu();
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class VagrantVMView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
form = toolkit.createForm(parent);
form.setText(DVMessages.getString(DaemonMissing));
final Composite container = form.getBody();
GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).applyTo(container);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
createTableViewer(container);
getSite().registerContextMenu(new MenuManager(), null);
hookContextMenu();
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class DockerContainersView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
form = toolkit.createForm(parent);
form.setText(DVMessages.getString(NoConnectionSelected));
final Composite container = form.getBody();
GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).applyTo(container);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
createTableViewer(container);
getSite().registerContextMenu(new MenuManager(), null);
// track selection changes in the Docker Explorer view (only)
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(DockerExplorerView.VIEW_ID, this);
hookContextMenu();
hookToolBarItems();
// Look at stored preference to determine if all containers should be
// shown or just running/paused containers. By default, only show
// running/paused containers
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
boolean showAll = preferences.getBoolean(SHOW_ALL_CONTAINERS_PREFERENCE, true);
showAllContainers(showAll);
final ICommandService service = getViewSite().getWorkbenchWindow().getService(ICommandService.class);
service.getCommand(SHOW_ALL_CONTAINERS_COMMAND_ID).getState(TOGGLE_STATE).setValue(showAll);
service.refreshElements(SHOW_ALL_CONTAINERS_COMMAND_ID, null);
boolean filterByLabels = preferences.getBoolean(FILTER_WITH_LABELS_PREFERENCE, false);
showContainersWithLabels(filterByLabels);
service.getCommand(FILTER_CONTAINERS_COMMAND_ID).getState(TOGGLE_STATE).setValue(filterByLabels);
service.refreshElements(FILTER_CONTAINERS_COMMAND_ID, null);
DockerConnectionManager.getInstance().addConnectionManagerListener(this);
// On startup, this view might get set up after the Docker Explorer View
// and so we won't get the notification when it chooses the connection.
// Find out if it has a selection and set our connection appropriately.
ISelection selection = getSite().getWorkbenchWindow().getSelectionService().getSelection(DockerExplorerView.VIEW_ID);
if (selection != null) {
selectionChanged(null, selection);
// also notify DockerConnectionWatcher
DockerConnectionWatcher.getInstance().selectionChanged(null, selection);
}
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class ImportRPMsPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
// setting up the form page
super.createFormContent(managedForm);
GridLayout layout = new GridLayout();
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText(Messages.ImportRPMsPage_formHeaderText);
form.setImage(Activator.getImageDescriptor(HEADER_ICON).createImage());
ToolBarManager toolbarManager = (ToolBarManager) form.getToolBarManager();
toolkit.decorateFormHeading(form.getForm());
// add the menuContribution from MANIFEST.MF to the form
IMenuService menuService = getSite().getService(IMenuService.class);
menuService.populateContributionManager(toolbarManager, MENU_URI);
toolbarManager.update(true);
layout = new GridLayout(2, true);
layout.marginWidth = 6;
layout.marginHeight = 12;
form.getBody().setLayout(layout);
// Section and its client area to manage importing the RPMs
Section rpmSection = toolkit.createSection(form.getBody(), Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
layout = new GridLayout();
rpmSection.setText(Messages.ImportRPMsPage_sectionTitle);
rpmSection.setDescription(Messages.ImportRPMsPage_sectionInstruction);
rpmSection.setLayoutData(expandComposite());
// the client area containing the tree + buttons
Composite sectionClient = toolkit.createComposite(rpmSection);
layout = new GridLayout(2, false);
layout.marginWidth = 1;
layout.marginHeight = 7;
sectionClient.setLayout(layout);
TreeViewer viewer = new TreeViewer(sectionClient, SWT.BORDER | SWT.MULTI | SWT.HORIZONTAL | SWT.VERTICAL | SWT.LEFT_TO_RIGHT | SWT.SMOOTH);
viewer.addDropSupport(DND.DROP_COPY, new Transfer[] { FileTransfer.getInstance() }, new ImportRPMDropListener(viewer, project));
tree = viewer.getTree();
tree.setLayoutData(expandComposite());
Composite buttonList = toolkit.createComposite(sectionClient);
layout = new GridLayout();
GridData data = new GridData(SWT.BEGINNING, SWT.FILL, false, true);
layout.marginWidth = 0;
layout.marginHeight = 0;
buttonList.setLayout(layout);
buttonList.setLayoutData(data);
createPushButton(buttonList, Messages.ImportRPMsPage_buttonImportRPMs, toolkit).addSelectionListener(new ImportButtonListener());
createPushButton(buttonList, Messages.ImportRPMsPage_buttonRemoveRPMs, toolkit).addSelectionListener(new RemoveButtonListener());
new Label(buttonList, SWT.NONE).setLayoutData(new GridData(0, 0));
createPushButton(buttonList, Messages.ImportRPMsPage_buttonCreateRepo, toolkit).addSelectionListener(new CreaterepoButtonListener());
refreshTree();
rpmSection.setClient(sectionClient);
managedForm.refresh();
}
use of org.eclipse.ui.forms.widgets.FormToolkit 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);
}
Aggregations