public ConfigurationFormToolkit ( final Display display ) { this.toolkit = new FormToolkit ( display ); this.toolkitCreated = true; this.dbc = new DataBindingContext (); }
/** * Creates the composite as a part of the form. * * @param parent * the composite parent * @return the composite widget */ public Composite createComposite(Composite parent) { return createComposite(parent, SWT.NULL); }
public void widgetDisposed(DisposeEvent e) { if (toolkit != null) { toolkit.dispose(); toolkit = null; } } });
public static Text createText(Composite parent, String label, FormToolkit factory, int span) { factory.createLabel(parent, label); Text text = factory.createText(parent, ""); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
/** * Creates a managed form in the provided parent. Form toolkit and widget * will be created and owned by this object. * * @param parent * the parent widget */ public ManagedForm(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); ownsToolkit = true; form = toolkit.createScrolledForm(parent); }
protected void init(Display display) { toolkit = new FormToolkit(display); backgroundColor = toolkit.getColors().getBackground(); }
/** * {@inheritDoc} */ @Override public void createContent(IManagedForm managedForm, Composite parent) { FormToolkit toolkit = managedForm.getToolkit(); section = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED); section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); section.setText(title); descriptionLabel = toolkit.createLabel(section, ""); descriptionLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); section.setDescriptionControl(descriptionLabel); Composite main = toolkit.createComposite(section); main.setLayout(new GridLayout(1, false)); section.setClient(main); super.createContent(new DirtyStateDelegatingManagedForm(managedForm, section), main); }
@Override protected void createButtons(Composite parent, FormToolkit toolkit) { super.createButtons(parent, toolkit); enableButtons(); if (createCount()) { Composite comp = toolkit.createComposite(fButtonContainer); comp.setLayout(createButtonsLayout()); comp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_END | GridData.FILL_BOTH)); fCount = toolkit.createLabel(comp, ""); //$NON-NLS-1$ fCount.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fCount.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); getTablePart().getTableViewer().getTable().addPaintListener(e -> updateLabel()); } }
private void createUILabelType(Composite parent) { Color foreground = fToolkit.getColors().getColor(IFormColors.TITLE); Label label = fToolkit.createLabel(parent, PDEUIMessages.SplashTemplatesSection_typeName, SWT.WRAP); label.setForeground(foreground); }
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType ) { this.toolkit.createLabel ( parent, label + ":" ); final Text text = this.toolkit.createText ( parent, "" ); text.setMessage ( textMessage ); text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) ); text.setToolTipText ( textMessage ); final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value ); final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE ); link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) ); link.addHyperlinkListener ( new HyperlinkAdapter () { @Override public void linkActivated ( final HyperlinkEvent e ) { EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () ); } } ); }
/** * Creates a new section part inside the provided parent and using the * provided toolkit. The section part will create the section widget. * * @param parent * the parent * @param toolkit * the toolkit to use * @param style * the section widget style */ public SectionPart(Composite parent, FormToolkit toolkit, int style) { this(toolkit.createSection(parent, style)); }
public void createStandardCombo ( final Composite parent, final String attributeName, final String label, final String[] items, final IObservableMap data, final Object valueType ) { this.toolkit.createLabel ( parent, label + ":" ); final Combo combo = new Combo ( parent, SWT.DROP_DOWN ); combo.setItems ( items ); this.toolkit.adapt ( combo ); final GridData gd = new GridData ( GridData.FILL, GridData.BEGINNING, true, true ); gd.horizontalSpan = 2; combo.setLayoutData ( gd ); final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.text ().observe ( combo ), value ); }
@Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); createMinOccurComp(parent, toolkit); createMaxOccurComp(parent, toolkit); fRefLabel = toolkit.createLabel(parent, PDEUIMessages.SchemaElementReferenceDetails_reference); fRefLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fReferenceLink = toolkit.createHyperlink(parent, "", SWT.NONE); //$NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; fReferenceLink.setLayoutData(gd); setText(PDEUIMessages.SchemaElementReferenceDetails_title); }
@Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); new Label(composite, SWT.WRAP).setText(""); //$NON-NLS-1$ String sAddToFlowPrompt = Messages .getString("MultiResourceSelectionDialogWithFlowOption.addSelectedAEsToEndOfFlow"); //$NON-NLS-1$ FormToolkit factory = new FormToolkit(TAEConfiguratorPlugin.getDefault().getFormColors( parent.getDisplay())); autoAddToFlowButton = factory.createButton(composite, sAddToFlowPrompt, SWT.CHECK); m_bAutoAddToFlow = "false".equals(CDEpropertyPage.getAddToFlow(editor.getProject())) ? false : true; autoAddToFlowButton.setSelection(m_bAutoAddToFlow); autoAddToFlowButton.setBackground(null); return composite; }
private Button createButton(Composite parent, FormToolkit toolkit, String label) { Button button = toolkit.createButton(parent, label, SWT.CHECK); GridData gd = new GridData(); gd.horizontalSpan = F_NUM_COLUMNS; button.setLayoutData(gd); return button; }
@Override protected Control createContent(Composite parent, FormToolkit toolkit) { Composite composite = toolkit.createComposite(parent); composite.setLayout(new GridLayout(2, false)); hyperlink = toolkit.createHyperlink(composite, "Show Output in Console", SWT.NONE); hyperlink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent event) { buildOutputAction.run(); } }); hyperlink.setEnabled(buildOutputAction.isEnabled()); return composite; }
private void staticCreatePartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode( HyperlinkSettings.UNDERLINE_HOVER); // create a page that has only one link. The URL and tooltip will be set // by the standby listener. welcomeLink = createStaticPage(parent); }
private Group createGroup(Composite parent) { fRadioButton = fToolkit.createButton(parent, "", SWT.RADIO); //$NON-NLS-1$ fRadioButton.addSelectionListener(widgetSelectedAdapter(e -> enable(fRadioButton.getSelection()))); fGroup = new Group(parent, SWT.NONE); GridData gd = new GridData(GridData.FILL_HORIZONTAL); fGroup.setLayoutData(gd); fGroup.setLayout(new GridLayout()); fGroup.setText(getName()); createGroupContents(fGroup); fToolkit.adapt(fGroup, false, false); return fGroup; }
public void createControl(Composite parent, FormToolkit toolkit, int style) { if (toolkit.getBorderStyle() == SWT.BORDER) combo = new Combo(parent, style | SWT.BORDER); else combo = new CCombo(parent, style | SWT.FLAT); toolkit.adapt(combo, true, false); }