@Override public FormText createFormText(Composite parent, boolean trackFocus) { FormText text = super.createFormText(parent, trackFocus); if (PDERuntimePlugin.HAS_IDE_BUNDLES) { text.addHyperlinkListener(new SpyHyperlinkAdapter(dialog)); addCopyQNameMenuItem(text); } return text; }
/** * Adds an item to the specified section. * * @param toolkit * The form toolkit. * @param sectionTitle * The section title. * @param text * The text which will be shown. * @param image * The image which will be shown. * @param minColumnWidth * the minimum width of the column. */ protected void addItemToSection(FormToolkit toolkit, String sectionTitle, String text, Image image, int minColumnWidth) { if (sections.containsKey(sectionTitle)) { FormText formText = toolkit.createFormText(sections.get(sectionTitle), false); if (image != null) { formText.setText("<form><p><img href=\"img\"/> " + text + "</p></form>", true, false); formText.setImage("img", image); } else { formText.setText("<form><p>" + text + "</p></form>", true, false); } formText.setLayoutData(new GridData(minColumnWidth, SWT.DEFAULT)); } }
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); }
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); FormText text = toolkit.createFormText(group, false); text.setText(PDEUIMessages.ProductIntroWizardPage_formText, true, false); GridData gd = new GridData(GridData.FILL_HORIZONTAL);
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; }
/** * 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); }
/** * 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); }
private void reviewTask(EditableTask task) { TaskEditor taskEditor = getTaskEditor(task); Composite container = taskEditor.getControl().getParent(); Composite separator = toolkit.createCompositeSeparator(container); GridData data = new GridData(); data.heightHint = 1; data.horizontalAlignment = SWT.FILL; separator.setLayoutData(data); FormText text = toolkit.createFormText(container, false); text.setImage(DescriptionPanel.REVIEW_IMAGE, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.COMPOSITE_TASK_REVIEW)); text.addHyperlinkListener(getEndReviewListener()); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); StringBuilder buf = new StringBuilder(); buf.append("<form>"); //$NON-NLS-1$ addHyperlink(buf, END_REVIEW_TAG + task.getId(), DescriptionPanel.REVIEW_IMAGE, Messages.COMPOSITE_PAGE_END_REVIEW ); buf.append("</form>"); //$NON-NLS-1$ text.setText(buf.toString(), true, false); task.setUnderReview(true); container.layout(true); showEditor(task); }
/** * 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; }
img.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, true)); formText = toolkit.createFormText(main, false); formText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
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; }
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; }
FormText rowText = toolkit.createFormText(composite, false); if (null != image) { rowText.setText("<form><p><img href=\"img\"/> <span color=\"headingColor\">" + title + "</span></p></form>", true, false);
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; }
/** * 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(); } }
/** * 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(); } }
/** * 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(parent.getBackground()); formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); return formText; } finally { toolkit.dispose(); } }
String msg= Messages.format(PreferencesMessages.JavaCategoryPropertyPage_text, args); FormText formText = toolkit.createFormText(composite, true); try { formText.setText(msg, true, false);
toolkit.paintBordersFor(container); FormText ftext = toolkit.createFormText(formText, false); formText.setFormText(ftext); formText.setExpandHorizontal(true);
section.setText(PDEUIMessages.DependencyAnalysisSection_title); formText = toolkit.createFormText(section, true); formText.setText(getFormText(), true, false); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider();