mainFormText.setColor("info", toolkit.getColors().getColor(IFormColors.TITLE)); mainFormText.setColor("header", getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); mainFormText.setFont("header", JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); mainFormText.addHyperlinkListener(new HyperlinkAdapter() {
/** * 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); }
if (CollectionUtils.isNotEmpty(sqlList)) { Color durationInInvocationColor = ColorFormatter.getPerformanceColor(GREEN_RGB, YELLOW_RGB, RED_RGB, percentage, 20d, 80d, resourceManager); percentageOfDuration.setColor("durationInInvocationColor", durationInInvocationColor); percentageOfDuration.setText("<form><p><b>" + SQLS_DURATION_IN_INVOCATION + "</b> <span color=\"durationInInvocationColor\">" + formatedPercentage + "%</span></p></form>", true, false); } else { slowestCount.setColor(SLOWEST8020_COLOR, color8020); slowestHyperlinkSettings.setForeground(color8020);
/** * 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; }
rowText.setText("<form><p><span color=\"headingColor\">" + title + "</span></p></form>", true, false); rowText.setColor("headingColor", toolkit.getColors().getColor(IFormColors.TITLE));
mainMessageFormText.setText(mainMessage.toString(), true, false); mainMessageFormText.setLayoutData(new TableWrapData(TableWrapData.FILL)); mainMessageFormText.setColor("headingColor", toolkit.getColors().getColor(IFormColors.TITLE)); titleFormText.setColor("headingColor", getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); titleFormText.setFont(JFaceResources.getFont(JFaceResources.HEADER_FONT)); gd = new GridData(SWT.CENTER, SWT.FILL, true, false); descriptionFormText.setColor("headingColor", getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); descriptionFormText.setFont("headingFont", JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); descriptionFormText.setText(descriptionMessage.toString(), true, false);
public Control createControl(Composite parent, final FormToolkit toolkit) { section = toolkit.createSection(parent, Section.SHORT_TITLE_BAR | Section.COMPACT | Section.TWISTIE | Section.EXPANDED | Section.LEFT_TEXT_CLIENT_ALIGNMENT); // section.marginHeight = 10; container = toolkit.createComposite(section); TableWrapLayout layout = new TableWrapLayout(); layout.topMargin = 0; layout.bottomMargin = 0; layout.leftMargin = 0; layout.rightMargin = 0; layout.verticalSpacing = 0; container.setLayout(layout); createFormText(container, toolkit); searchResults.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); searchResults.setColor("summary", parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); //$NON-NLS-1$ section.setClient(container); updateSectionTitle(0); section.addExpansionListener(new IExpansionListener() { public void expansionStateChanging(ExpansionEvent e) { if (needsUpdating) asyncUpdateResults(true, false); } public void expansionStateChanged(ExpansionEvent e) { } }); return section; }
headingText.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); headingText.setFont("header", JFaceResources.getBannerFont()); headingText.setText("<form><p><span color=\"header\" font=\"header\">" + getName() + "</span></p></form>", true, false);
upperText.marginHeight = 5; upperText.setFont("header", JFaceResources.getHeaderFont()); //$NON-NLS-1$ upperText.setColor("title", toolkit.getColors().getColor(IFormColors.TITLE)); //$NON-NLS-1$ lowerText.marginWidth = 5; lowerText.marginHeight = 5;
Image titleImage = ImageFormatter.getSensorConfigImage(JmxSensorConfig.class); FormText title = toolkit.createFormText(parent, false); title.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); title.setFont("header", JFaceResources.getBannerFont()); title.setText("<form><p> <img href=\"titleImage\"/> <span color=\"header\" font=\"header\">" + titleText + "</span></p></form>", true, false);
text.setWhitespaceNormalized(false); text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); text.setColor(IFormColors.TITLE, toolkit.getColors().getColor( IFormColors.TITLE)); codeFont = createCodeFont(parent.getDisplay(), parent.getFont(), JFaceResources.getTextFont());
private void createFormText(Composite parent, FormToolkit toolkit) { searchResults = toolkit.createFormText(parent, false); searchResults.setColor(IFormColors.TITLE, toolkit.getColors().getColor(IFormColors.TITLE)); searchResults.marginHeight = 5; String topicKey = IHelpUIConstants.IMAGE_FILE_F1TOPIC; searchResults.setImage(topicKey, HelpUIResources.getImage(topicKey)); searchResults.setImage(searchKey, HelpUIResources.getImage(searchKey)); searchResults.setColor("summary", parent.getDisplay().getSystemColor( //$NON-NLS-1$ SWT.COLOR_WIDGET_DARK_SHADOW)); searchResults.setImage(ISharedImages.IMG_TOOL_FORWARD, PlatformUI.getWorkbench().getSharedImages()
searchResults = toolkit.createFormText(section, false); section.setClient(searchResults); searchResults.setColor(IFormColors.TITLE, toolkit.getColors().getColor( IFormColors.TITLE)); String topicKey = IHelpUIConstants.IMAGE_FILE_F1TOPIC;