use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class RpmSectionPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
super.createFormContent(managedForm);
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText(rpmSection);
GridLayout layout = new GridLayout();
form.getBody().setLayout(layout);
layout.numColumns = 2;
toolkit.createLabel(form.getBody(), rpmSection);
final Text text = toolkit.createText(form.getBody(), section.getContents(), SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
text.setLayoutData(gd);
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class DockerExplorerView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
this.pageBook = new PageBook(parent, SWT.NONE);
this.connectionsPane = createConnectionsPane(pageBook, toolkit);
this.explanationsPane = createExplanationPane(pageBook, toolkit);
showConnectionsOrExplanations();
this.containersAndImagesSearchFilter = getContainersAndImagesSearchFilter();
getCommonViewer().addFilter(containersAndImagesSearchFilter);
DockerConnectionManager.getInstance().addConnectionManagerListener(this);
if (DockerConnectionManager.getInstance().getConnections().length > 0) {
IDockerConnection conn = DockerConnectionManager.getInstance().getConnections()[0];
getCommonViewer().setSelection(new StructuredSelection(conn));
}
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class DockerImageHierarchyView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
this.pageBook = new PageBook(parent, SWT.NONE);
this.hierarchyPane = createHierarchyPane(pageBook, toolkit);
this.explanationsPane = createExplanationPane(pageBook, toolkit);
showHierarchyOrExplanations();
}
use of org.eclipse.ui.forms.widgets.FormToolkit in project linuxtools by eclipse.
the class DockerImagesView 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);
// track selection changes in the Docker Explorer view (only)
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(DockerExplorerView.VIEW_ID, this);
hookContextMenu();
// Look at stored preference to determine if all images should be
// shown or just top-level images. By default, only show
// top-level images.
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
boolean showAll = preferences.getBoolean(SHOW_ALL_IMAGES_PREFERENCE, false);
showAllImages(showAll);
final ICommandService service = getViewSite().getWorkbenchWindow().getService(ICommandService.class);
service.getCommand(SHOW_ALL_IMAGES_COMMAND_ID).getState(TOGGLE_STATE).setValue(showAll);
service.refreshElements(SHOW_ALL_IMAGES_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 knime-core by knime.
the class WorkflowSetMetaInfoEditor method createPartControl.
/**
* {@inheritDoc}
*/
@Override
public void createPartControl(final Composite parent) {
m_toolkit = new FormToolkit(parent.getDisplay());
m_form = m_toolkit.createScrolledForm(parent);
m_form.setText(getPartName());
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.makeColumnsEqualWidth = true;
m_form.getBody().setLayout(layout);
// content composite
Composite content = m_toolkit.createComposite(m_form.getBody());
layout = new GridLayout();
layout.numColumns = 2;
layout.horizontalSpacing = 20;
layout.makeColumnsEqualWidth = false;
content.setLayout(layout);
// placeholder composite
m_toolkit.createComposite(m_form.getBody());
GridData layoutData = new GridData();
layoutData.minimumWidth = 100;
layoutData.widthHint = 100;
layoutData.verticalAlignment = SWT.TOP;
for (MetaGUIElement element : m_elements) {
LOGGER.debug("element " + element.getLabel());
Label label = m_toolkit.createLabel(content, element.getLabel() + ": ");
label.setLayoutData(layoutData);
element.createGUIElement(m_toolkit, content);
element.addListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
setDirty(true);
}
});
}
m_form.reflow(true);
}
Aggregations