/** * Sets default text that has no informations displayed. */ private void setDefaultText() { resetDisplayed = false; totalSql.setText("<form><p><b>" + TOTAL_SQLS + "</b></p></form>", true, false); totalDuration.setText("<form><p><b>" + TOTAL_DURATION + "</b></p></form>", true, false); percentageOfDuration.setText("<form><p><b>" + SQLS_DURATION_IN_INVOCATION + "</b></p></form>", true, false); slowestCount.setText("<form><p><b>" + SLOWEST_80_20 + "</b></p></form>", true, false); }
/** * @param defaultText * The defaultText to set. */ public void setDefaultText(String defaultText) { this.defaultText = defaultText; if (text != null) text.setText(defaultText, false, false); }
/** * Define if reset button should be displayed in the 80/20 test. * * @param show * If <code>true</code> reset link will be show, otherwise hidden. */ private void showResetFor8020(boolean show) { if (show && !resetDisplayed) { resetDisplayed = true; slowestCount.setText("<form><p>" + slowestContent + " " + RESET_LINK + "</p></form>", true, false); } else if (!show && resetDisplayed) { resetDisplayed = false; slowestCount.setText("<form><p>" + slowestContent + "</p></form>", true, false); } }
private void loadText(String text) { if (content != null) { String markup = text; if (!markup.startsWith("<form>")) //$NON-NLS-1$ markup = "<form>" + text + "</form>"; //$NON-NLS-1$//$NON-NLS-2$ content.setText(markup, true, false); } } private void loadContents(InputStream is) {
private void loadText(String text) { if (content != null) { String markup = text; if (!markup.startsWith("<form>")) //$NON-NLS-1$ markup = "<form>" + text + "</form>"; //$NON-NLS-1$//$NON-NLS-2$ content.setText(markup, true, false); } } private void loadContents(InputStream is) {
/** * Sets the text that will be shown in the control while the real content is * loading. This is significant when content to render is loaded from the * input stream that was created from a remote URL, and the time to load the * entire content is nontrivial. * * @param loadingText * loading text message * @deprecated use setText(loadingText, false, false); */ @Deprecated public void setLoadingText(String loadingText) { setText(loadingText, false, false); }
/** * Sets the text that will be shown in the control while the real content is * loading. This is significant when content to render is loaded from the * input stream that was created from a remote URL, and the time to load the * entire content is nontrivial. * * @param loadingText * loading text message * @deprecated use setText(loadingText, false, false); */ @Deprecated public void setLoadingText(String loadingText) { setText(loadingText, false, false); }
/** * Updates the composite to display the not available info. */ public final void showDataUnavailable() { name.setText(NOT_AVAILABLE); description.setText(NOT_AVAILABLE, false, false); size.setText(NOT_AVAILABLE); cmrVersion.setText(NOT_AVAILABLE); if (showDataDownloaded) { downloaded.setText(NOT_AVAILABLE); } }
public synchronized void canceling() { if (hits.size() == 0 && !searchResults.isDisposed()) { StringBuffer buff = new StringBuffer(); buff.append("<form>"); //$NON-NLS-1$ buff.append("<p><span color=\"summary\">");//$NON-NLS-1$ buff.append(Messages.EngineResultSection_canceling); buff.append("</span></p>"); //$NON-NLS-1$ buff.append("</form>"); //$NON-NLS-1$ searchResults.setText(buff.toString(), true, false); } }
protected final FormText createClient(Composite section, String content, FormToolkit toolkit) { FormText text = toolkit.createFormText(section, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } text.addHyperlinkListener(this); return text; }
/** * Updates title based on the sensor configuration class. * * @param sensorConfigClass * Sensor configuration class. */ private void updateTitle(Class<? extends ISensorConfig> sensorConfigClass) { String titleText = TextFormatter.getSensorConfigName(sensorConfigClass); Image titleImage = ImageFormatter.getSensorConfigImage(sensorConfigClass); title.setText("<form><p> <img href=\"titleImage\"/> <span color=\"header\" font=\"header\">" + titleText + "</span></p></form>", true, false); title.setImage("titleImage", titleImage); }
private void updateRichText() { boolean hasSchema = fSchemaEntry.getValue().length() > 0; if (hasSchema && fRichTextData == SCHEMA_RTEXT_DATA) return; if (!hasSchema && fRichTextData == NO_SCHEMA_RTEXT_DATA) return; fRichTextData = hasSchema ? SCHEMA_RTEXT_DATA : NO_SCHEMA_RTEXT_DATA; fRichText.setText(fRichTextData, true, false); getManagedForm().getForm().reflow(true); }
private FormText createClient(Section section, String content, FormToolkit toolkit) { FormText text = toolkit.createFormText(section, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } section.setClient(text); section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); text.addHyperlinkListener(this); return text; }
void clearResults() { if (runningJob != null) { runningJob.cancel(); runningJob = null; } searchResults.setText("", false, false); //$NON-NLS-1$ getManagedForm().reflow(true); }
private void createFormText(FormToolkit toolkit, Composite parent, String content, int span) { FormText text = toolkit.createFormText(parent, false); text.setText(content, true, false); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = span; gd.widthHint = 400; text.setLayoutData(gd); text.setBackground(parent.getBackground()); text.addHyperlinkListener(this); }
private FormText createText(Section section, String content, FormToolkit toolkit) { Composite container = toolkit.createComposite(section, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1)); section.setClient(container); FormText text = toolkit.createFormText(container, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); data.maxWidth = 250; text.setLayoutData(data); text.addHyperlinkListener(this); return text; }
private void updateText(String helpText) { text.setText(helpText != null ? helpText : defaultText, helpText != null, false); getSection().layout(); getManagedForm().reflow(true); }
/** * Creates the empty profile hint for the user. */ private void createEmptyInputHint() { FormToolkit toolkit = managedForm.getToolkit(); emptyHintComposite = toolkit.createComposite(tabFolder, SWT.NONE); emptyHintComposite.setLayout(new GridLayout(2, false)); Label infoLabel = toolkit.createLabel(emptyHintComposite, null); infoLabel.setImage(Display.getDefault().getSystemImage(SWT.ICON_INFORMATION)); infoLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); FormText formText = toolkit.createFormText(emptyHintComposite, false); formText.setText("<form><p>Seems that there are no sensor assignments in this profile. Use <b>Add</b> action to start defining instrumentation points.</p></form>", true, false); formText.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); tabItem.setControl(emptyHintComposite); tabItem.setText("Getting Started"); tabFolder.setSelection(0); }
/** * 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); }
private Control createFormText(Composite parent, String text, Color fg) { FormText formText = toolkit.createFormText(parent, false); formText.addHyperlinkListener(hyperlinkAdapter); try { formText.setText(text, true, true); } catch (SWTError e) { Log.error(e.getMessage(), e); return createText(parent, text, fg); } if (fg != null) formText.setForeground(fg); return formText; }