protected void init(Display display) { toolkit = new FormToolkit(display); backgroundColor = toolkit.getColors().getBackground(); }
private void createSmallNavigator(Composite parent, IntroLink[] links) { for (int i = 0; i < links.length; i++) { Control c = createImageHyperlink(parent, links[i]); c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); } for (int i = 0; i < links.length; i++) { Label text = toolkit.createLabel(parent, links[i].getLabel()); text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); text.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); } }
protected Label createLabel(FormToolkit toolkit, Composite parent, String text) { Label label = toolkit.createLabel(parent, text); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); return label; }
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); }
protected Label createLabel(Composite parent, FormToolkit toolkit, String value) { Label label = toolkit.createLabel(parent, value); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); return label; }
protected Composite createMinOccurComp(Composite parent, FormToolkit toolkit) { fMinLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_minOccurLabel); fMinLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); Composite comp = toolkit.createComposite(parent); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; GridLayout layout = new GridLayout(); layout.marginHeight = layout.marginWidth = 0; comp.setLayout(layout); comp.setLayoutData(gd); fMinOccurSpinner = new Spinner(comp, SWT.BORDER); fMinOccurSpinner.setMinimum(0); fMinOccurSpinner.setMaximum(999); return comp; }
private boolean isReverseVideo() { Color bg = toolkit.getColors().getBackground(); return ((bg.getBlue() + bg.getRed() + bg.getGreen()) < 380); }
protected Control createSeparator(Composite parent, IntroSeparator sep) { String key = sep.getParentPage().getId()+".separator.fg"; //$NON-NLS-1$ Color fg = styleManager.getColor(toolkit, key); //Composite l = toolkit.createCompositeSeparator(parent); Composite l = new Composite(parent, SWT.NULL); if (fg!=null) l.setBackground(fg); else l.setBackground(toolkit.getColors().getColor(IFormColors.SEPARATOR)); TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.FILL); td.grabHorizontal = true; td.maxHeight = 1; l.setLayoutData(td); return l; }
@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()); } }
/** * Creates Heading for a section with the given heading text. * * @param heading * the heading text */ private void createSectionHeading(String heading) { FormText headingText = toolkit.createFormText(mainComposite, false); GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, NUM_COLUMNS, 1); gridData.verticalIndent = 20; headingText.setLayoutData(gridData); headingText.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); headingText.setFont("header", JFaceResources.getBannerFont()); headingText.setText("<form><p><span color=\"header\" font=\"header\">" + heading + "</span></p></form>", true, false); }
protected void createLabel(Composite parent, FormToolkit toolkit) { Label label = toolkit.createLabel(parent, getPropertyLabel(), SWT.NULL); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); PDETextHover.addHoverListenerToControl(fIC, label, this); }
/** * Create title part based on the sensor configuration being assigned. * * @param parent * Composite to create on. * @param toolkit * {@link FormToolkit} to use. * @return {@link FormText} */ protected FormText createTitle(Composite parent, FormToolkit toolkit) { title = toolkit.createFormText(parent, false); title.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); title.setFont("header", JFaceResources.getBannerFont()); return title; }
/** * {@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 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); }
private void computeReverseVideoColors(Display display) { Color background = toolkit.getColors().getBackground(); RGB white = new RGB(255, 255, 255); // Create new colors, they will get disposed RGB rgb = background.getRGB(); activeColor = new Color(display, rgb ); rgb = FormColors.blend(rgb, white, 85); inactiveColor1 = new Color(display, rgb); rgb = FormColors.blend(rgb, white, 85); inactiveColor2 = new Color(display, rgb ); introColor = new Color(display, rgb ); }
@Override protected Text doCreateFilterText(Composite parent) { int borderStyle = toolkit.getBorderStyle(); toolkit.setBorderStyle(SWT.NONE); // we don't want Forms border around tree filter Text temp = super.doCreateFilterText(parent); int style = temp.getStyle(); temp.dispose(); fEntryFilter = new FormEntry(parent, toolkit, null, style); toolkit.setBorderStyle(borderStyle); // restore Forms border settings setBackground(toolkit.getColors().getBackground()); return fEntryFilter.getText(); }
/** * Creates a label to display the link description when you hover over a * hyperlink. * * @param body */ private Label createHoverLabel(Composite body) { Label label = toolkit.createLabel(body, "", SWT.WRAP); //$NON-NLS-1$ String key = StringUtil.concat(rootPage.getId(), ".", "hover-text.fg"); //$NON-NLS-1$ //$NON-NLS-2$ Color fg = rootPageStyleManager.getColor(toolkit, key); if (fg == null) fg = toolkit.getColors().getColor(IFormColors.TITLE); label.setForeground(fg); label.setAlignment(SWT.CENTER); label.setFont(PageStyleManager.getBannerFont()); return label; }
private void createProductEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { Label label = toolkit.createLabel(client, PDEUIMessages.ProductInfoSection_product); label.setToolTipText(PDEUIMessages.ProductInfoSection_productTooltip); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fProductCombo = new ExtensionIdComboPart(); fProductCombo.createControl(client, toolkit, SWT.READ_ONLY); fProductCombo.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fProductCombo.setItems(TargetPlatform.getProducts()); fProductCombo.add(""); //$NON-NLS-1$ fProductCombo.addSelectionListener(widgetSelectedAdapter(e -> getProduct().setProductId(fProductCombo.getSelection()))); Button button = toolkit.createButton(client, PDEUIMessages.ProductInfoSection_new, SWT.PUSH); button.setEnabled(isEditable()); button.addSelectionListener(widgetSelectedAdapter(e -> handleNewDefinition())); fProductCombo.getControl().setEnabled(isEditable()); }
private void createApplicationEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { Label label = toolkit.createLabel(client, PDEUIMessages.ProductInfoSection_app, SWT.WRAP); label.setToolTipText(PDEUIMessages.ProductInfoSection_appTooltip); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fAppCombo = new ExtensionIdComboPart(); fAppCombo.createControl(client, toolkit, SWT.READ_ONLY); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = NUM_COLUMNS - 1; fAppCombo.getControl().setLayoutData(gd); fAppCombo.setItems(TargetPlatform.getApplications()); fAppCombo.add(""); //$NON-NLS-1$ fAppCombo.addSelectionListener(widgetSelectedAdapter(e -> getProduct().setApplication(fAppCombo.getSelection()))); fAppCombo.getControl().setEnabled(isEditable()); }
private void createTagsArea(Composite parent, FormToolkit toolkit, int span) { Composite tagArea = toolkit.createComposite(parent); GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false) .applyTo(tagArea); GridDataFactory.fillDefaults().span(span, 1).grab(true, false) .applyTo(tagArea); toolkit.createLabel(tagArea, UIText.CommitEditorPage_LabelTags) .setForeground( toolkit.getColors().getColor(IFormColors.TB_TOGGLE)); tagLabelArea = toolkit.createComposite(tagArea); GridDataFactory.fillDefaults().grab(true, true).applyTo(tagLabelArea); GridLayoutFactory.fillDefaults().spacing(1, 1).applyTo(tagLabelArea); }