org.eclipse.ui.forms.widgets.FormToolkit Java Examples
The following examples show how to use
org.eclipse.ui.forms.widgets.FormToolkit.
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: HintTextGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Creates a form text. * * @param parent the parent to put the form text on * @param text the form text to be displayed * @return the created form text * * @see FormToolkit#createFormText(org.eclipse.swt.widgets.Composite, boolean) */ private FormText createFormText(Composite parent, String text) { FormToolkit toolkit= new FormToolkit(getShell().getDisplay()); try { FormText formText= toolkit.createFormText(parent, true); formText.setFont(parent.getFont()); try { formText.setText(text, true, false); } catch (IllegalArgumentException e) { formText.setText(e.getMessage(), false, false); JavaPlugin.log(e); } formText.marginHeight= 2; formText.marginWidth= 0; formText.setBackground(null); formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); return formText; } finally { toolkit.dispose(); } }
Example #2
Source File: ResultTypeCombo.java From olca-app with Mozilla Public License 2.0 | 6 votes |
private void initCostCombo(FormToolkit tk, Composite comp) { boolean enabled = getType(initialSelection) == ModelType.CURRENCY; Button check = tk.createButton(comp, M.CostCategory, SWT.RADIO); check.setSelection(enabled); Controls.onSelect(check, _e -> { if (check.getSelection()) { costCombo.setEnabled(true); selectedType = ModelType.CURRENCY; fireSelection(); } else { costCombo.setEnabled(false); } }); costCombo = new CostResultViewer(comp); costCombo.setEnabled(enabled); costCombo.setInput(costs); costCombo.selectFirst(); costCombo.addSelectionChangedListener((val) -> fireSelection()); if (enabled) { costCombo.select((CostResultDescriptor) initialSelection); } }
Example #3
Source File: ImpactFactorPage.java From olca-app with Mozilla Public License 2.0 | 6 votes |
@Override protected void createFormContent(IManagedForm mform) { ScrolledForm form = UI.formHeader(this); FormToolkit tk = mform.getToolkit(); Composite body = UI.formBody(form, tk); Section section = UI.section(body, tk, M.ImpactFactors); UI.gridData(section, true, true); Composite client = tk.createComposite(section); section.setClient(client); UI.gridLayout(client, 1); render(client, section); List<ImpactFactor> factors = impact().impactFactors; sortFactors(factors); viewer.setInput(factors); form.reflow(true); }
Example #4
Source File: FilesPage.java From typescript.java with MIT License | 6 votes |
private void createScopeSection(Composite parent) { FormToolkit toolkit = super.getToolkit(); Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR); section.setDescription(TsconfigEditorMessages.FilesPage_ScopeSection_desc); section.setText(TsconfigEditorMessages.FilesPage_ScopeSection_title); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); Composite client = toolkit.createComposite(section); section.setClient(client); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginWidth = 2; layout.marginHeight = 2; client.setLayout(layout); Table table = toolkit.createTable(client, SWT.NONE); GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = 200; gd.widthHint = 100; table.setLayoutData(gd); }
Example #5
Source File: ReplaceFlowsDialog.java From olca-app with Mozilla Public License 2.0 | 6 votes |
private void createBottom(Composite parent, FormToolkit toolkit) { Composite bottom = UI.formComposite(parent, toolkit); UI.gridLayout(bottom, 1, 0, 0); Composite typeContainer = UI.formComposite(bottom, toolkit); UI.gridLayout(typeContainer, 4, 20, 5); UI.formLabel(typeContainer, toolkit, M.ReplaceIn); replaceFlowsButton = toolkit.createButton(typeContainer, M.InputsOutputs, SWT.RADIO); replaceFlowsButton.setSelection(true); Controls.onSelect(replaceFlowsButton, this::updateSelection); replaceImpactsButton = toolkit.createButton(typeContainer, M.ImpactFactors, SWT.RADIO); Controls.onSelect(replaceImpactsButton, this::updateSelection); replaceBothButton = toolkit.createButton(typeContainer, M.Both, SWT.RADIO); Controls.onSelect(replaceBothButton, this::updateSelection); Composite excludeContainer = UI.formComposite(bottom, toolkit); UI.gridLayout(excludeContainer, 2, 20, 5); excludeWithProviders = UI.formCheckbox(excludeContainer, toolkit); UI.formLabel(excludeContainer, toolkit, M.ExcludeExchangesWithDefaultProviders); toolkit.paintBordersFor(bottom); toolkit.adapt(bottom); createNote(parent, toolkit); }
Example #6
Source File: ContractConstraintsTableViewerTest.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { parent = realm.createComposite(); FileActionDialog.setDisablePopup(true); viewer = new ContractConstraintsTableViewer(parent, new FormToolkit(parent.getDisplay())); final ContractConstraintController inputController = new ContractConstraintController(new WritableValue(aContract() .build(), Contract.class)); viewer.initialize(inputController, messageManager, new EMFDataBindingContext()); final Contract contract = ProcessFactory.eINSTANCE.createContract(); final ContractInput input = ProcessFactory.eINSTANCE.createContractInput(); input.setName("name"); input.setType(ContractInputType.TEXT); contract.getInputs().add(input); constraint = ProcessFactory.eINSTANCE.createContractConstraint(); constraint.setName("c1"); constraint2 = ProcessFactory.eINSTANCE.createContractConstraint(); constraint2.setName("c2"); contract.getConstraints().add(constraint); contract.getConstraints().add(constraint2); viewer.setInput(EMFObservables.observeList(Realm.getDefault(), contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS)); }
Example #7
Source File: CommitAttributeEditor.java From git-appraise-eclipse with Eclipse Public License 1.0 | 6 votes |
@Override public void createControl(final Composite parent, FormToolkit toolkit) { link = new Link(parent, SWT.BORDER); link.setText("<a>" + getValue() + "</a>"); link.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { try { RepositoryCommit commit = getCommit(); if (commit != null) { CommitEditor.openQuiet(commit); } else { MessageDialog alert = new MessageDialog(parent.getShell(), "Oops", null, "Commit " + getValue() + " not found", MessageDialog.ERROR, new String[] {"OK"}, 0); alert.open(); } } catch (IOException e) { AppraiseUiPlugin.logError("Error reading commit " + getValue(), e); } } }); setControl(link); }
Example #8
Source File: LocationPage.java From olca-app with Mozilla Public License 2.0 | 6 votes |
@Override protected void createFormContent(IManagedForm mform) { ScrolledForm form = UI.formHeader(mform, Labels.name(setup.productSystem), Images.get(result)); FormToolkit tk = mform.getToolkit(); Composite body = UI.formBody(form, tk); createCombos(body, tk); SashForm sash = new SashForm(body, SWT.VERTICAL); UI.gridData(sash, true, true); tk.adapt(sash); createTree(sash, tk); map = ResultMap.on(sash, tk); form.reflow(true); refreshSelection(); }
Example #9
Source File: DatabasePropertiesDialog.java From olca-app with Mozilla Public License 2.0 | 6 votes |
private void renderFolderLink(DerbyConfiguration conf, Composite parent, FormToolkit toolkit) { File folder = DatabaseDir.getRootFolder(conf.getName()); String path = folder.toURI().toString(); Hyperlink link = new Hyperlink(parent, SWT.NONE); toolkit.adapt(link); link.setText(Strings.cut(path, 75)); link.setToolTipText(path); Controls.onClick(link, e -> { try { Desktop.browse(path); } catch (Exception ex) { Logger log = LoggerFactory.getLogger(getClass()); log.error("failed to open folder", ex); } }); }
Example #10
Source File: SplitterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createToChannelsReferencesTable(FormToolkit widgetFactory, Composite parent) { this.toChannels = new ReferencesTable(getDescription(EipViewsRepository.Splitter.Properties.toChannels, EipMessages.SplitterPropertiesEditionPart_ToChannelsLabel), new ReferencesTableListener () { public void handleAdd() { addToChannels(); } public void handleEdit(EObject element) { editToChannels(element); } public void handleMove(EObject element, int oldIndex, int newIndex) { moveToChannels(element, oldIndex, newIndex); } public void handleRemove(EObject element) { removeFromToChannels(element); } public void navigateTo(EObject element) { } }); this.toChannels.setHelpText(propertiesEditionComponent.getHelpContent(EipViewsRepository.Splitter.Properties.toChannels, EipViewsRepository.FORM_KIND)); this.toChannels.createControls(parent, widgetFactory); this.toChannels.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (e.item != null && e.item.getData() instanceof EObject) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(SplitterPropertiesEditionPartForm.this, EipViewsRepository.Splitter.Properties.toChannels, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); } } }); GridData toChannelsData = new GridData(GridData.FILL_HORIZONTAL); toChannelsData.horizontalSpan = 3; this.toChannels.setLayoutData(toChannelsData); this.toChannels.disableMove(); toChannels.setID(EipViewsRepository.Splitter.Properties.toChannels); toChannels.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ // Start of user code for createToChannelsReferencesTable // End of user code return parent; }
Example #11
Source File: ResultTypeCombo.java From olca-app with Mozilla Public License 2.0 | 5 votes |
private void render(Composite comp, FormToolkit tk) { ModelType initType = getType(initialSelection); if (initType != ModelType.UNKNOWN) selectedType = initType; if (flows != null && !flows.isEmpty()) initFlowCombo(tk, comp); if (impacts != null && !impacts.isEmpty()) initImpactCombo(tk, comp); if (costs != null && !costs.isEmpty()) initCostCombo(tk, comp); }
Example #12
Source File: AbstractManifestEditorPage.java From XPagesExtensionLibrary with Apache License 2.0 | 5 votes |
public AbstractManifestEditorPage(Composite parent, FormToolkit toolkit, ManifestMultiPageEditor mpe) { super(parent, SWT.NONE); _mpe = mpe; _toolkit = toolkit; _errorImage = getDisplay().getSystemImage(SWT.ICON_ERROR); _errorFont = JFaceResources.getDefaultFont(); _titleFont = JFaceResources.getHeaderFont(); initialize(); }
Example #13
Source File: CommitEntryDialog.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override protected void createFormContent(IManagedForm mform) { ScrolledForm form = UI.formHeader(mform, M.ChangesToBeFetched); FormToolkit toolkit = mform.getToolkit(); Composite body = form.getBody(); body.setLayout(new GridLayout()); toolkit.paintBordersFor(body); UI.gridData(body, true, true); CommitEntryViewer viewer = new CommitEntryViewer(body, client); form.reflow(true); viewer.setInput(commits); }
Example #14
Source File: TogglePropertyHelpContributionItem.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public TogglePropertyHelpContributionItem(final FormToolkit toolkit, final Form form, final String helpContent, int wellSeverity, final PropertySectionHistory propertySectionHistory) { this.helpContent = helpContent; this.wellSeverity = wellSeverity; this.form = form; this.toolkit = toolkit; this.propertySectionHistory = propertySectionHistory; }
Example #15
Source File: RecipientListRouterPropertiesEditionPartForm.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.RecipientListRouterPropertiesEditionPart_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: Widgets.java From olca-app with Mozilla Public License 2.0 | 5 votes |
public static Button checkBox(Composite parent, String label, String property, ModelEditor<?> editor, FormToolkit toolkit) { Button button = UI.formCheckBox(parent, toolkit, label); editor.getBinding().onBoolean(() -> editor.getModel(), property, button); new CommentControl(parent, toolkit, property, editor.getComments()); return button; }
Example #17
Source File: MemoryError.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override protected void createFormContent(IManagedForm mform) { String message = M.CouldNotAllocateMemoryError; FormToolkit toolkit = mform.getToolkit(); mform.getForm().setText(M.OutOfMemory); Composite comp = UI.formBody(mform.getForm(), mform.getToolkit()); UI.gridLayout(comp, 1); Label label = toolkit.createLabel(comp, message, SWT.WRAP); UI.gridData(label, true, false); Hyperlink link = UI.formLink(comp, toolkit, "Open preference dialog"); Controls.onClick(link, e -> openPreferences()); }
Example #18
Source File: ResultPage.java From tlaplus with MIT License | 5 votes |
private int getHeightGuidanceForLabelTextFieldLine(final Composite parent, final FormToolkit toolkit) { final Label l = toolkit.createLabel(parent, "Just Some Concerned Text you get"); final Text t = toolkit.createText(parent, "More time text 12345:67890", SWT.FLAT); final int height = Math.max(t.computeSize(SWT.DEFAULT, SWT.DEFAULT).y, l.computeSize(SWT.DEFAULT, SWT.DEFAULT).y); l.dispose(); t.dispose(); return height; }
Example #19
Source File: ServiceRefPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} * * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) * */ public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); Form form = scrolledForm.getForm(); view = form.getBody(); GridLayout layout = new GridLayout(); layout.numColumns = 3; view.setLayout(layout); createControls(widgetFactory, view); return scrolledForm; }
Example #20
Source File: SocialAspectsPage.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override protected void createFormContent(IManagedForm managedForm) { for (SocialAspect a : getModel().socialAspects) treeModel.addAspect(a); form = UI.formHeader(this); FormToolkit tk = managedForm.getToolkit(); Composite body = UI.formBody(form, tk); createEntrySection(tk, body); form.reflow(true); }
Example #21
Source File: SqlEditor.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = UI.formHeader(managedForm, "SQL Query Browser", Icon.SQL.get()); FormToolkit toolkit = managedForm.getToolkit(); Composite body = UI.formBody(form, toolkit); createStatementSection(body, toolkit); createResultSection(body, toolkit); }
Example #22
Source File: ContentFilterPropertiesEditionPartForm.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.ContentFilterPropertiesEditionPart_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 #23
Source File: EnricherPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
protected Composite createPartEMFComboViewer(FormToolkit widgetFactory, Composite parent) { createDescription(parent, EipViewsRepository.Enricher.Properties.part, EipMessages.EnricherPropertiesEditionPart_PartLabel); part = new EMFComboViewer(parent); part.setContentProvider(new ArrayContentProvider()); part.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory())); GridData partData = new GridData(GridData.FILL_HORIZONTAL); part.getCombo().setLayoutData(partData); part.addSelectionChangedListener(new ISelectionChangedListener() { /** * {@inheritDoc} * * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) * */ public void selectionChanged(SelectionChangedEvent event) { if (propertiesEditionComponent != null) propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(EnricherPropertiesEditionPartForm.this, EipViewsRepository.Enricher.Properties.part, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getPart())); } }); part.setID(EipViewsRepository.Enricher.Properties.part); FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EipViewsRepository.Enricher.Properties.part, EipViewsRepository.FORM_KIND), null); //$NON-NLS-1$ // Start of user code for createPartEMFComboViewer // End of user code return parent; }
Example #24
Source File: ResequencerPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createFromChannelsReferencesTable(FormToolkit widgetFactory, Composite parent) { this.fromChannels = new ReferencesTable(getDescription(EipViewsRepository.Resequencer.Properties.fromChannels, EipMessages.ResequencerPropertiesEditionPart_FromChannelsLabel), new ReferencesTableListener () { public void handleAdd() { addFromChannels(); } public void handleEdit(EObject element) { editFromChannels(element); } public void handleMove(EObject element, int oldIndex, int newIndex) { moveFromChannels(element, oldIndex, newIndex); } public void handleRemove(EObject element) { removeFromFromChannels(element); } public void navigateTo(EObject element) { } }); this.fromChannels.setHelpText(propertiesEditionComponent.getHelpContent(EipViewsRepository.Resequencer.Properties.fromChannels, EipViewsRepository.FORM_KIND)); this.fromChannels.createControls(parent, widgetFactory); this.fromChannels.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (e.item != null && e.item.getData() instanceof EObject) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ResequencerPropertiesEditionPartForm.this, EipViewsRepository.Resequencer.Properties.fromChannels, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); } } }); GridData fromChannelsData = new GridData(GridData.FILL_HORIZONTAL); fromChannelsData.horizontalSpan = 3; this.fromChannels.setLayoutData(fromChannelsData); this.fromChannels.disableMove(); fromChannels.setID(EipViewsRepository.Resequencer.Properties.fromChannels); fromChannels.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ // Start of user code for createFromChannelsReferencesTable // End of user code return parent; }
Example #25
Source File: CommentControl.java From olca-app with Mozilla Public License 2.0 | 5 votes |
private void initControl(Composite parent, FormToolkit toolkit) { if (!App.isCommentingEnabled() || comments == null || !comments.hasPath(path)) { UI.filler(parent, toolkit); return; } ImageHyperlink control = new ImageHyperlink(parent, SWT.NONE); UI.gridData(control, false, false).verticalAlignment = SWT.TOP; Controls.onClick(control, (e) -> { new CommentDialog(path, comments).open(); }); control.setImage(Icon.SHOW_COMMENTS.get()); control.setToolTipText(M.Comment); }
Example #26
Source File: ContentFilterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createToChannelsReferencesTable(FormToolkit widgetFactory, Composite parent) { this.toChannels = new ReferencesTable(getDescription(EipViewsRepository.ContentFilter.Properties.toChannels, EipMessages.ContentFilterPropertiesEditionPart_ToChannelsLabel), new ReferencesTableListener () { public void handleAdd() { addToChannels(); } public void handleEdit(EObject element) { editToChannels(element); } public void handleMove(EObject element, int oldIndex, int newIndex) { moveToChannels(element, oldIndex, newIndex); } public void handleRemove(EObject element) { removeFromToChannels(element); } public void navigateTo(EObject element) { } }); this.toChannels.setHelpText(propertiesEditionComponent.getHelpContent(EipViewsRepository.ContentFilter.Properties.toChannels, EipViewsRepository.FORM_KIND)); this.toChannels.createControls(parent, widgetFactory); this.toChannels.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (e.item != null && e.item.getData() instanceof EObject) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ContentFilterPropertiesEditionPartForm.this, EipViewsRepository.ContentFilter.Properties.toChannels, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); } } }); GridData toChannelsData = new GridData(GridData.FILL_HORIZONTAL); toChannelsData.horizontalSpan = 3; this.toChannels.setLayoutData(toChannelsData); this.toChannels.disableMove(); toChannels.setID(EipViewsRepository.ContentFilter.Properties.toChannels); toChannels.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ // Start of user code for createToChannelsReferencesTable // End of user code return parent; }
Example #27
Source File: WellTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_have_a_warning_background_for_warning_status() throws Exception { final Well well = new Well(realm.createComposite(), "", new FormToolkit(realm.getShell().getDisplay()), IStatus.WARNING); final GC gc = paint(well); assertThat(gc.getBackground()).isEqualTo(Well.warningBackground); }
Example #28
Source File: RouterPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} * * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit) * */ public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) { ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent); Form form = scrolledForm.getForm(); view = form.getBody(); GridLayout layout = new GridLayout(); layout.numColumns = 3; view.setLayout(layout); createControls(widgetFactory, view); return scrolledForm; }
Example #29
Source File: InvoiceCorrectionView.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
public void createComponents(FallDTO fallDTO){ this.setBackground(UiDesk.getColor(UiDesk.COL_WHITE)); FormToolkit tk = UiDesk.getToolkit(); ScrolledForm form = tk.createScrolledForm(this); form.setBackground(UiDesk.getColor(UiDesk.COL_WHITE)); form.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false)); Composite body = form.getBody(); GridLayout gd1 = new GridLayout(); gd1.marginWidth = 0; gd1.marginHeight = 0; body.setLayout(gd1); ExpandableComposite expandable = WidgetFactory.createExpandableComposite(tk, form, ""); //$NON-NLS-1$ expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); expandable.setExpanded(false); expandable.setText("Fallangaben"); expandable.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e){ invoiceComposite.updateScrollBars(); } }); Composite group = tk.createComposite(expandable, SWT.NONE); GridLayout gd = new GridLayout(2, false); gd.marginWidth = 0; gd.marginHeight = 0; group.setLayout(gd); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); expandable.setClient(group); fallDetailBlatt2 = new FallDetailBlatt2(group, fallDTO, true); GridData gd2 = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1); gd2.heightHint = 340; fallDetailBlatt2.setLayoutData(gd2); }
Example #30
Source File: TextWidget.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
protected TextWidget(Composite container, String id, boolean topLabel, int horizontalLabelAlignment, int verticalLabelAlignment, int labelWidth, boolean readOnly, String label, String message, boolean useCompositeMessageDecorator, Optional<String> labelButton, boolean transactionalEdit, BiConsumer<String, String> onEdit, Optional<FormToolkit> toolkit, Optional<IContentProposalProvider> proposalProvider, Optional<ComputedValue<Boolean>> enableStrategy, Optional<DataBindingContext> ctx) { super(container, id, topLabel, horizontalLabelAlignment, verticalLabelAlignment, labelWidth, readOnly, label, message, useCompositeMessageDecorator, labelButton, toolkit); this.transactionalEdit = transactionalEdit; this.onEdit = Optional.ofNullable(onEdit); this.proposalProvider = proposalProvider; this.editingColor = resourceManager.createColor(ColorConstants.EDITING_RGB); this.enableStrategy = enableStrategy; this.ctx = ctx; }