Java Code Examples for org.eclipse.ui.forms.widgets.FormToolkit#createSection()
The following examples show how to use
org.eclipse.ui.forms.widgets.FormToolkit#createSection() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationOverviewEditorPart.java From codewind-eclipse with Eclipse Public License 2.0 | 7 votes |
public ProjectInfoSection(Composite parent, FormToolkit toolkit, int hSpan, int vSpan) { Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); section.setText(Messages.AppOverviewEditorProjectInfoSection); section.setLayoutData(new GridData(SWT.FILL,SWT.FILL, true, false, hSpan, vSpan)); section.setExpanded(true); Composite composite = toolkit.createComposite(section); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginHeight = 5; layout.marginWidth = 10; layout.verticalSpacing = 5; layout.horizontalSpacing = 10; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); toolkit.paintBordersFor(composite); section.setClient(composite); typeEntry = new StringEntry(composite, Messages.AppOverviewEditorTypeEntry); languageEntry = new StringEntry(composite, Messages.AppOverviewEditorLanguageEntry); projectIdEntry = new StringEntry(composite, Messages.AppOverviewEditorProjectIdEntry); locationEntry = new StringEntry(composite, Messages.AppOverviewEditorLocationEntry); }
Example 2
Source File: FormHelper.java From tlaplus with MIT License | 6 votes |
/** * Constructs a section and returns a section client composite * * the section layout is TableWrapLayout * * * @param parent parent container for the section * @param title title of the section * @param description description of the section * @param toolkit toolkit to create the composite * @param sectionFlags parameters of the section * @param expansionListener * @return a section client (the content container of the section) */ public static Section createSectionComposite(Composite parent, String title, String description, FormToolkit toolkit, int sectionFlags, IExpansionListener expansionListener) { final Section section = toolkit.createSection(parent, sectionFlags); section.setData(SECTION_IS_NOT_SPACE_GRABBING, new Object()); section.setText(title); section.setDescription(description); if (expansionListener != null) { section.addExpansionListener(expansionListener); } // create section client Composite sectionClient = toolkit.createComposite(section); TableWrapLayout layout = new TableWrapLayout(); layout.numColumns = 1; sectionClient.setLayout(layout); section.setClient(sectionClient); // draw flat borders toolkit.paintBordersFor(sectionClient); return section; }
Example 3
Source File: OverviewPage.java From typescript.java with MIT License | 6 votes |
private void createGeneralInformationSection(Composite parent) { FormToolkit toolkit = super.getToolkit(); Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR); section.setDescription(TsconfigEditorMessages.OverviewPage_GeneralInformationSection_desc); section.setText(TsconfigEditorMessages.OverviewPage_GeneralInformationSection_title); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); Composite body = createBody(section); // Target/Module createCombo(body, TsconfigEditorMessages.OverviewPage_target_label, new JSONPath("compilerOptions.target"), TsconfigJson.getAvailableTargets(), TsconfigJson.getDefaultTarget()); createCombo(body, TsconfigEditorMessages.OverviewPage_module_label, new JSONPath("compilerOptions.module"), TsconfigJson.getAvailableModules()); createCombo(body, TsconfigEditorMessages.OverviewPage_moduleResolution_label, new JSONPath("compilerOptions.moduleResolution"), TsconfigJson.getAvailableModuleResolutions(), TsconfigJson.getDefaultModuleResolution()); // Others.... createCheckbox(body, TsconfigEditorMessages.OverviewPage_experimentalDecorators_label, new JSONPath("compilerOptions.experimentalDecorators")); }
Example 4
Source File: OutputPage.java From typescript.java with MIT License | 6 votes |
private void createReportingSection(Composite parent) { FormToolkit toolkit = super.getToolkit(); Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR); section.setDescription(TsconfigEditorMessages.OutputPage_ReportingSection_desc); section.setText(TsconfigEditorMessages.OutputPage_ReportingSection_title); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); Composite body = createBody(section); createCheckbox(body, TsconfigEditorMessages.OutputPage_diagnostics_label, new JSONPath("compilerOptions.diagnostics")); createCheckbox(body, TsconfigEditorMessages.OutputPage_pretty_label, new JSONPath("compilerOptions.pretty")); createCheckbox(body, TsconfigEditorMessages.OutputPage_traceResolution_label, new JSONPath("compilerOptions.traceResolution")); createCheckbox(body, TsconfigEditorMessages.OutputPage_listEmittedFiles_label, new JSONPath("compilerOptions.listEmittedFiles")); }
Example 5
Source File: XSPEditorUtil.java From XPagesExtensionLibrary with Apache License 2.0 | 6 votes |
static public Section createSection(FormToolkit toolkit, Composite parent, String title, int hSpan, int vSpan) { Section section = toolkit.createSection(parent, Section.SHORT_TITLE_BAR); GridData osectionGridData = new GridData(SWT.FILL, SWT.BEGINNING, false, false); osectionGridData.horizontalSpan = hSpan; osectionGridData.verticalSpan = vSpan; osectionGridData.horizontalIndent = 5; section.setLayoutData(osectionGridData); section.setText(title); GridLayout osectionGL = new GridLayout(1, true); osectionGL.marginHeight = 0; osectionGL.marginWidth = 0; section.setLayout(osectionGL); return section; }
Example 6
Source File: OutputPage.java From typescript.java with MIT License | 5 votes |
private void createJSXSection(Composite parent) { FormToolkit toolkit = super.getToolkit(); Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR); section.setDescription(TsconfigEditorMessages.OutputPage_JSXSection_desc); section.setText(TsconfigEditorMessages.OutputPage_JSXSection_title); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); Composite body = createBody(section); CCombo jsxCombo = createCombo(body, TsconfigEditorMessages.OutputPage_jsx_label, new JSONPath("compilerOptions.jsx"), new String[] { "", "preserve", "react" }); Text reactNamespaceText = createText(body, TsconfigEditorMessages.OutputPage_reactNamespace_label, new JSONPath("compilerOptions.reactNamespace"), null, "jsxFactory"); }
Example 7
Source File: ICEMasterDetailsPage.java From ice with Eclipse Public License 1.0 | 5 votes |
/** * <p> * This operation overrides the default/abstract implementation of * FormPage.createFormContents to create the contents of the * ICEMasterDetailsPage. * </p> * * @param managedForm * <p> * The Form widget on which the ICEMasterDetailsPage exists. * </p> */ @Override protected void createFormContent(IManagedForm managedForm) { // Set the Form final ScrolledForm scrolledForm = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); Section section = toolkit.createSection(scrolledForm.getBody(), Section.DESCRIPTION | ExpandableComposite.TITLE_BAR); GridData gd = new GridData(GridData.FILL_HORIZONTAL); section.setLayoutData(gd); // Set the MasterDetailsComponent's "header component" that contains // global data if it exists. ICEDataComponentSectionPart headerSectionPart = new ICEDataComponentSectionPart( section, ICEFormEditor, managedForm); DataComponent header = masterDetailsComponent.getGlobalsComponent(); if (header != null) { headerSectionPart.setDataComponent(header); headerSectionPart.renderSection(); } // Get the Provider ICEDetailsPageProvider pageProvider = new ICEDetailsPageProvider( masterDetailsComponent, ICEFormEditor); // Create a scrolledPropertiesBlock with given providers. block = new ICEScrolledPropertiesBlock(masterDetailsComponent, ICEFormEditor, pageProvider); block.createContent(managedForm); }
Example 8
Source File: SplitterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.SplitterPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 9
Source File: ChannelPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.ChannelPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 10
Source File: CompositeProcessorPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.CompositeProcessorPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 11
Source File: ResequencerPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.ResequencerPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 12
Source File: CamelDependenciesEditor.java From tesb-studio-se with Apache License 2.0 | 5 votes |
private ManageRouteResourcePanel createResourceTableViewer(Composite parent, FormToolkit toolkit, String title) { Section section = toolkit.createSection(parent, Section.TITLE_BAR); section.setText(title); final ManageRouteResourcePanel c = new ManageRouteResourcePanel(section, isReadOnly(), this, this); section.setClient(c); toolkit.adapt(c); return c; }
Example 13
Source File: RouterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.RouterPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 14
Source File: TransformerPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.TransformerPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 15
Source File: InvocableEndpointPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.InvocableEndpointPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 16
Source File: CamelDependenciesEditor.java From tesb-studio-se with Apache License 2.0 | 5 votes |
private CamelDependenciesPanel createTableViewer(Composite parent, FormToolkit toolkit, String title, String type) { Section section = toolkit.createSection(parent, Section.TITLE_BAR); section.setText(title); final CamelDependenciesPanel c = (type == ManifestItem.BUNDLE_CLASSPATH) ? new CheckedCamelDependenciesPanel(section, type, isReadOnly(), this, this) : new CamelDependenciesPanel(section, type, isReadOnly(), this, this); section.setClient(c); toolkit.adapt(c); return c; }
Example 17
Source File: EIPModelPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.EIPModelPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 18
Source File: FilterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) { Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); propertiesSection.setText(EipMessages.FilterPropertiesEditionPart_PropertiesGroupLabel); GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL); propertiesSectionData.horizontalSpan = 3; propertiesSection.setLayoutData(propertiesSectionData); Composite propertiesGroup = widgetFactory.createComposite(propertiesSection); GridLayout propertiesGroupLayout = new GridLayout(); propertiesGroupLayout.numColumns = 3; propertiesGroup.setLayout(propertiesGroupLayout); propertiesSection.setClient(propertiesGroup); return propertiesGroup; }
Example 19
Source File: OpenMiniatureViewAction.java From olca-app with Mozilla Public License 2.0 | 4 votes |
@Override protected Control createContents(final Composite parent) { FormToolkit toolkit = new FormToolkit(Display.getCurrent()); ScrolledForm scrolledForm = toolkit.createScrolledForm(parent); Composite body = scrolledForm.getBody(); body.setLayout(new FillLayout()); toolkit.paintBordersFor(body); SashForm sashForm = new SashForm(body, SWT.VERTICAL); toolkit.adapt(sashForm, true, true); Section categorySection = toolkit .createSection(sashForm, ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED); categorySection.setText(""); Composite composite = toolkit.createComposite(categorySection, SWT.NONE); composite.setLayout(new GridLayout()); categorySection.setClient(composite); toolkit.paintBordersFor(composite); final Scale scale = new Scale(composite, SWT.NONE); scale.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); final double[] values = GraphConfig.ZOOM_LEVELS; final int increment = 100 / (values.length - 1); scale.setIncrement(increment); scale.setMinimum(0); scale.setMaximum(100); Controls.onSelect(scale, (e) -> { zoomManager.setZoom(values[scale.getSelection() / increment]); }); scale.setSelection(increment * (values.length - 1) / 2); Canvas canvas = new Canvas(composite, SWT.BORDER); canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); lws = new LightweightSystem(canvas); thumbnail = new ScrollableThumbnail(port); thumbnail.setSource(figure); lws.setContents(thumbnail); disposeListener = new DisposeListener() { @Override public void widgetDisposed(final DisposeEvent e) { if (thumbnail != null) { thumbnail.deactivate(); thumbnail = null; } if (control != null && !control.isDisposed()) control.removeDisposeListener(disposeListener); close(); } }; control.addDisposeListener(disposeListener); return super.createContents(parent); }
Example 20
Source File: ApplicationOverviewEditorPart.java From codewind-eclipse with Eclipse Public License 2.0 | 4 votes |
public ProjectStatusSection(Composite parent, FormToolkit toolkit, int hSpan, int vSpan) { Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); section.setText(Messages.AppOverviewEditorProjectStatusSection); section.setLayoutData(new GridData(SWT.FILL,SWT.FILL, true, false, hSpan, vSpan)); section.setExpanded(true); Composite composite = toolkit.createComposite(section); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginHeight = 5; layout.marginWidth = 10; layout.verticalSpacing = 5; layout.horizontalSpacing = 10; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL)); toolkit.paintBordersFor(composite); section.setClient(composite); autoBuildEntry = new StringEntry(composite, Messages.AppOverviewEditorAutoBuildEntry); injectMetricsEntry = new StringEntry(composite, Messages.AppOverviewEditorInjectMetricsEntry); appStatusEntry = new StringEntry(composite, Messages.AppOverviewEditorAppStatusEntry); buildStatusEntry = new StringEntry(composite, Messages.AppOverviewEditorBuildStatusEntry); lastImageBuildEntry = new StringEntry(composite, Messages.AppOverviewEditorLastImageBuildEntry); lastBuildEntry = new StringEntry(composite, Messages.AppOverviewEditorLastBuildEntry); Label label = new Label(composite, SWT.NONE); label.setFont(boldFont); label.setText(Messages.AppOverviewEditorProjectLogs); label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false)); projectLogs = new Link(composite, SWT.NONE); projectLogs.setText(""); projectLogs.setVisible(false); GridData data = new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false); data.horizontalIndent = 2; data.exclude = true; projectLogs.setLayoutData(data); IDEUtil.paintBackgroundToMatch(projectLogs, composite); projectLogs.addListener(SWT.Selection, event -> { CodewindEclipseApplication app = (CodewindEclipseApplication) getApp(getConn()); if (app == null) { Logger.logError("A log link was selected but could not find the application for the " + connectionId //$NON-NLS-1$ + " connection with name: " + projectId); //$NON-NLS-1$ return; } Optional<ProjectLogInfo> logInfo = app.getLogInfos().stream().filter(info -> info.logName.equals(event.text)).findFirst(); if (logInfo.isPresent()) { try { SocketConsole console = app.getConsole(logInfo.get()); if (console == null) { console = CodewindConsoleFactory.createLogFileConsole(app, logInfo.get()); app.addConsole(console); } ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console); } catch (Exception e) { Logger.logError("An error occurred trying to open the " + logInfo.get().logName //$NON-NLS-1$ + "log file for application: " + projectId, e); //$NON-NLS-1$ MessageDialog.openError(parent.getShell(), Messages.AppOverviewEditorOpenLogErrorTitle, NLS.bind(Messages.AppOverviewEditorOpenLogErrorMsg, new String[] {logInfo.get().logName, app.name, e.getMessage()})); } } else { Logger.logError("The " + event.text + " was selected but the associated log info could not be found for the " + projectId + " project."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }); noProjectLogs = new Text(composite, SWT.READ_ONLY); noProjectLogs.setText(Messages.AppOverviewEditorNoProjectLogs); noProjectLogs.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE); noProjectLogs.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, true, false)); IDEUtil.paintBackgroundToMatch(noProjectLogs, composite); }