本文整理汇总了Java中org.eclipse.ui.forms.widgets.FormText.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java FormText.setImage方法的具体用法?Java FormText.setImage怎么用?Java FormText.setImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.forms.widgets.FormText
的用法示例。
在下文中一共展示了FormText.setImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLabel
import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
/**
* 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();
}
});
}
示例2: createPluginsSection
import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void createPluginsSection(Composite parent) {
Section sctnPlugins = createSection(parent, "Plug-ins");
sctnPlugins.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
sctnPlugins.setLayoutData(data);
FormText text = formToolkit.createFormText(sctnPlugins, true);
ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/cordovaplug_wiz.png");
text.setImage("plugin", idesc.createImage());
text.setText(PLUGINS_SECTION_CONTENT, true, false);
sctnPlugins.setClient(text);
text.addHyperlinkListener(this);
}
示例3: configureFormText
import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void configureFormText(final Form form, FormText text) {
text.addHyperlinkListener(new HyperlinkAdapter() {
@SuppressWarnings("unchecked")
public void linkActivated(HyperlinkEvent e) {
String is = (String) e.getHref();
try {
((FormText) e.widget).getShell().dispose();
int index = Integer.parseInt(is);
IMessage[] messages = form.getChildrenMessages();
IMessage message = messages[index];
Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) message.getData();
if (conflicts != null) {
viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
}
} catch (NumberFormatException ex) {
}
}
});
text.setImage("error", getImage(IMessageProvider.ERROR));
text.setImage("warning", getImage(IMessageProvider.WARNING));
text.setImage("info", getImage(IMessageProvider.INFORMATION));
}
示例4: createExportSection
import org.eclipse.ui.forms.widgets.FormText; //导入方法依赖的package包/类
private void createExportSection(Composite parent) {
Section sctnExport = createSection(parent, "Export");
sctnExport.setLayout(FormUtils.createClearTableWrapLayout(false, 1));
TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
sctnExport.setLayoutData(data);
FormText text = formToolkit.createFormText(sctnExport, true);
ImageDescriptor idesc = HybridUI.getImageDescriptor(HybridUI.PLUGIN_ID, "/icons/etool16/export_wiz.png");
text.setImage("export", idesc.createImage());
text.setText(EXPORT_SECTION_CONTENT, true, false);
sctnExport.setClient(text);
text.addHyperlinkListener(this);
}