public String createIdentifierSection(FormText text, String title, String[] ids) { StringBuilder buffer = new StringBuilder(); if (ids.length > 0) { buffer.append("<p>"); //$NON-NLS-1$ buffer.append(title); buffer.append("</p>"); //$NON-NLS-1$ for (String id : ids) { buffer.append("<li bindent=\"20\" style=\"image\" value=\"id\">"); //$NON-NLS-1$ buffer.append(id); buffer.append("</li>"); //$NON-NLS-1$ } Image image = PDERuntimePluginImages.get(PDERuntimePluginImages.IMG_ID_OBJ); text.setImage("id", image); //$NON-NLS-1$ } return buffer.toString(); }
/** * Same as registerHitIcon() but to register a grayed icon. You * can provide the same URL for both the regular and grayed icons, * but two different IDs will be returned. * * @param iconURL the URL to the icon * @return the ID to use for referencing the icon */ private String registerGrayedHitIcon(URL iconURL) { Image image = HelpUIResources.getImage(iconURL); if (image != null) { searchResults.setImage(iconURL.toString(), image); return KEY_PREFIX_GRAYED + iconURL.toString(); } return null; }
/** * Registers the given icon URL for use with this section. Icons * must be registered before use and referenced by the returned * ID. * * @param iconURL the URL to the icon * @return the ID to use for referencing the icon */ private String registerHitIcon(URL iconURL) { Image image = HelpUIResources.getImage(iconURL); if (image != null) { searchResults.setImage(iconURL.toString(), image); return iconURL.toString(); } return null; }
public String createInterfaceSection(FormText text, String title, Class<?>... clazzes) { StringBuilder buffer = new StringBuilder(); if (clazzes.length > 0) { buffer.append("<p>"); //$NON-NLS-1$ buffer.append(title); buffer.append("</p>"); //$NON-NLS-1$ for (Class<?> clazz : clazzes) { buffer.append("<li bindent=\"20\" style=\"image\" value=\"interface\">"); //$NON-NLS-1$ createClassReference(buffer, clazz); buffer.append("</li>"); //$NON-NLS-1$ } Image image = PDERuntimePluginImages.get(PDERuntimePluginImages.IMG_INTERFACE_OBJ); text.setImage("interface", image); //$NON-NLS-1$ } return buffer.toString(); }
public String createClassSection(FormText text, String title, Class<?>... clazzes) { StringBuilder buffer = new StringBuilder(); if (clazzes.length > 0) { buffer.append("<p>"); //$NON-NLS-1$ buffer.append(title); buffer.append("</p>"); //$NON-NLS-1$ for (Class<?> clazz : clazzes) { buffer.append("<li bindent=\"20\" style=\"image\" value=\"class\">"); //$NON-NLS-1$ createClassReference(buffer, clazz); buffer.append("</li>"); //$NON-NLS-1$ } Image image = PDERuntimePluginImages.get(PDERuntimePluginImages.IMG_CLASS_OBJ); text.setImage("class", image); //$NON-NLS-1$ } return buffer.toString(); }
text.setImage("plugin", pluginImage); //$NON-NLS-1$
/** * 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); }
/** * 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 createTestingSection(Composite parent, FormToolkit toolkit) { Section section = createStaticSection(toolkit, parent, PDEUIMessages.Product_OverviewPage_testing); FormText text = createClient(section, getLauncherText(getLauncherHelper().isOSGi(), PDEUIMessages.Product_overview_testing), toolkit); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); text.setImage("run", lp.get(PDEPluginImages.DESC_RUN_EXC)); //$NON-NLS-1$ text.setImage("debug", lp.get(PDEPluginImages.DESC_DEBUG_EXC)); //$NON-NLS-1$ text.setImage("profile", lp.get(PDEPluginImages.DESC_PROFILE_EXC)); //$NON-NLS-1$ section.setClient(text); }
/** * Create a label with a hyperlink and a picture. * * @param parent the parent widget of the label * @param text the text of the label * @param action the action to be executed if the hyperlink is activated */ private void createLabel(Composite parent, String text, final BuildpathModifierAction action) { FormText formText= createFormText(parent, text); Image image= fImageMap.get(action.getId()); if (image == null) { image= action.getImageDescriptor().createImage(); fImageMap.put(action.getId(), image); } formText.setImage("defaultImage", image); //$NON-NLS-1$ formText.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { action.run(); } }); }
/** * Create a label with a hyperlink and a picture. * * @param parent the parent widget of the label * @param text the text of the label * @param action the action to be executed if the hyperlink is activated */ private void createLabel(Composite parent, String text, final BuildpathModifierAction action) { FormText formText= createFormText(parent, text); Image image= (Image)fImageMap.get(action.getId()); if (image == null) { image= action.getImageDescriptor().createImage(); fImageMap.put(action.getId(), image); } formText.setImage("defaultImage", image); //$NON-NLS-1$ formText.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { action.run(); } }); }
/** * Create a label with a hyperlink and a picture. * * @param parent the parent widget of the label * @param text the text of the label * @param action the action to be executed if the hyperlink is activated */ private void createLabel(Composite parent, String text, final BuildpathModifierAction action) { FormText formText= createFormText(parent, text); Image image= fImageMap.get(action.getId()); if (image == null) { image= action.getImageDescriptor().createImage(); fImageMap.put(action.getId(), image); } formText.setImage("defaultImage", image); //$NON-NLS-1$ formText.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { action.run(); } }); }
formText.setText(getFormText(), true, false); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); formText.setImage("loops", lp.get(PDEPluginImages.DESC_LOOP_OBJ)); //$NON-NLS-1$ formText.setImage("search", lp.get(PDEPluginImages.DESC_PSEARCH_OBJ)); //$NON-NLS-1$ formText.setImage("hierarchy", lp.get(PDEPluginImages.DESC_CALLEES)); //$NON-NLS-1$ formText.setImage("dependencies", lp.get(PDEPluginImages.DESC_CALLERS)); //$NON-NLS-1$ formText.addHyperlinkListener(new HyperlinkAdapter() { @Override
private void createTestingSection(IManagedForm managedForm, Composite parent, FormToolkit toolkit) { Section section = createStaticSection(toolkit, parent, PDEUIMessages.ManifestEditor_TestingSection_title); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); Composite container = createStaticSectionClient(toolkit, section); String prefixText = (!((ManifestEditor) getEditor()).showExtensionTabs()) ? PDEUIMessages.OverviewPage_OSGiTesting : isFragment() ? PDEUIMessages.OverviewPage_fTesting : PDEUIMessages.OverviewPage_testing; FormText text = createClient(container, getLauncherText(getLauncherHelper().isOSGi(), prefixText), toolkit); text.setImage("run", lp.get(PDEPluginImages.DESC_RUN_EXC)); //$NON-NLS-1$ text.setImage("debug", lp.get(PDEPluginImages.DESC_DEBUG_EXC)); //$NON-NLS-1$ text.setImage("profile", lp.get(PDEPluginImages.DESC_PROFILE_EXC)); //$NON-NLS-1$ section.setClient(container); }
private Section createContentSection(IManagedForm managedForm, Composite parent, FormToolkit toolkit) { Section section = createStaticSection(parent, toolkit); FormText text; section.setText(PDEUIMessages.FeatureEditor_InfoPage_ContentSection_title); text = createClient(section, PDEUIMessages.FeatureEditor_InfoPage_ContentSection_text, toolkit); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); text.setImage("page", lp.get(PDEPluginImages.DESC_PAGE_OBJ, //$NON-NLS-1$ SharedLabelProvider.F_EDIT)); return section; }
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); }
text.setImage("contextid", image); //$NON-NLS-1$
if (null != image) { rowText.setText("<form><p><img href=\"img\"/> <span color=\"headingColor\">" + title + "</span></p></form>", true, false); rowText.setImage("img", image); } else { rowText.setText("<form><p><span color=\"headingColor\">" + title + "</span></p></form>", true, false);
private void createContentSection(IManagedForm managedForm, Composite parent, FormToolkit toolkit) { String sectionTitle; if (isFragment()) { sectionTitle = PDEUIMessages.ManifestEditor_ContentSection_ftitle; } else { sectionTitle = PDEUIMessages.ManifestEditor_ContentSection_title; } Section section = createStaticSection(toolkit, parent, sectionTitle); Composite container = createStaticSectionClient(toolkit, section); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); if (!isBundle() && isEditable()) { String content; // Inform the user to convert manually to OSGi if (isFragment()) { content = PDEUIMessages.OverviewPage_NoPluginConverterFragment; } else { content = PDEUIMessages.OverviewPage_NoPluginConverterPlugin; } FormText warningText = createClient(container, content, toolkit); warningText.setImage("warning", lp.get(PDEPluginImages.DESC_WARNING_ST_OBJ, 0)); //$NON-NLS-1$ warningText.setImage("error", lp.get(PDEPluginImages.DESC_ERROR_ST_OBJ, 0)); //$NON-NLS-1$ } FormText text = createClient(container, isFragment() ? PDEUIMessages.OverviewPage_fContent : PDEUIMessages.OverviewPage_content, toolkit); text.setImage("page", lp.get(PDEPluginImages.DESC_PAGE_OBJ, SharedLabelProvider.F_EDIT)); //$NON-NLS-1$ section.setClient(container); }
private void createExtensionSection(IManagedForm managedForm, Composite parent, FormToolkit toolkit) { String sectionTitle = PDEUIMessages.ManifestEditor_ExtensionSection_title; Section section = createStaticSection(toolkit, parent, sectionTitle); Composite container = createStaticSectionClient(toolkit, section); FormText text = createClient(container, isFragment() ? PDEUIMessages.OverviewPage_fExtensionContent : PDEUIMessages.OverviewPage_extensionContent, toolkit); PDELabelProvider lp = PDEPlugin.getDefault().getLabelProvider(); text.setImage("page", lp.get(PDEPluginImages.DESC_PAGE_OBJ, SharedLabelProvider.F_EDIT)); //$NON-NLS-1$ section.setClient(container); }