本文整理汇总了Java中org.eclipse.emf.edit.provider.IItemLabelProvider.getImage方法的典型用法代码示例。如果您正苦于以下问题:Java IItemLabelProvider.getImage方法的具体用法?Java IItemLabelProvider.getImage怎么用?Java IItemLabelProvider.getImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.edit.provider.IItemLabelProvider
的用法示例。
在下文中一共展示了IItemLabelProvider.getImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getImage
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
/**
* This returns TreeNodeWrapper.gif. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @generatedNot
*/
@Override
public Object getImage(Object object)
{
TreeNodeWrapper treeNodeWrapper = (TreeNodeWrapper) object;
Object realItem = ((TreeNodeWrapper) object).getObject();
if (realItem == null) {
return overlayImage(object,
getResourceLocator().getImage("full/obj16/TreeNodeWrapper"));
}
IItemLabelProvider realItemItemprovider = getRealItemItemProvider(
treeNodeWrapper, realItem);
return realItemItemprovider.getImage(realItem);
}
示例2: getImage
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
@Override
public Image getImage(Object element) {
if (element instanceof DynamicActivityGroup) {
DynamicActivityGroup dag = (DynamicActivityGroup) element;
Object value = dag.getValue();
if (value instanceof EEnumLiteral) {
return null;
}
IItemLabelProvider lp = EMFUtils.adapt(value, IItemLabelProvider.class);
if (lp != null) {
Object image = lp.getImage(value);
return ExtendedImageRegistry.getInstance().getImage(image);
}
return null;
}
return delegate.getImage(element);
}
示例3: createSubSection
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
public static Composite createSubSection(FormToolkit toolkit, Composite parent, EObject eObject, boolean hasLabel) {
Composite subSection = null;
IItemLabelProvider labelProvider = EMFUtils.adapt(eObject, IItemLabelProvider.class);
if (labelProvider != null) {
String text = labelProvider.getText(eObject);
Image image = null;
Object imageURL = labelProvider.getImage(eObject);
if (imageURL != null) {
try {
image = ExtendedImageRegistry.getInstance().getImage(imageURL);
} catch (Exception e) {
Logger.getLogger(DetailFormToolkit.class).error("failed to get image", e);
}
}
Section section = createSection(toolkit, parent, text, image);
subSection = toolkit.createComposite(section);
GridLayout layout = new GridLayout((hasLabel) ? 2 : 1, false);
layout.verticalSpacing = 2;
layout.horizontalSpacing = 10;
subSection.setLayout(layout);
section.setClient(subSection);
}
return subSection;
}
示例4: buildPropertySection
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
private void buildPropertySection(Composite parent, EObject target, List<IItemPropertyDescriptor> pds, IItemLabelProvider labeler) {
if (!hasVisibleDescriptors(target, pds))
return;
String text = null;
Image image = null;
if (labeler != null) {
text = labeler.getText(target);
Object imageURL = labeler.getImage(text);
if (imageURL != null) {
try {
image = ExtendedImageRegistry.getInstance().getImage(imageURL);
} catch (Exception e) {
LogUtil.error("failed to get image", e);
}
}
}
buildPropertySection(parent, target, pds, text, image);
}
示例5: getImage
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
/**
* This returns ReferencedObjectRow.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public Object getImage(Object object) {
ReferencedObjectRow row = (ReferencedObjectRow) object;
EObject reference = row.getReference();
if (reference != null) {
IItemLabelProvider lp = EMFUtils.adapt(reference, IItemLabelProvider.class);
if (lp != null) {
return lp.getImage(reference);
}
}
return overlayImage(object, getResourceLocator().getImage("full/obj16/ReferencedObjectRow"));
}
示例6: getColumnImage
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
@Override
public Object getColumnImage(Object object, int columnIndex)
{
IItemLabelProvider itemLabelProvider = (IItemLabelProvider) HELPER_ADAPTER_FACTORY.adapt(object, IItemLabelProvider.class);
return itemLabelProvider.getImage(object);
}
示例7: getItemProviderImage
import org.eclipse.emf.edit.provider.IItemLabelProvider; //导入方法依赖的package包/类
/**
* This will try and get the IItemLabelProvider associated to the given EObject if its ItemProviderFactory
* is registered, then return the image it provides.
*
* @param eObj
* EObject we need an image for.
* @return The Image provided by the IItemLabelProvider associated with <tt>eObj</tt>, <code>null</code>
* if it cannot be found.
* @see IItemLabelProvider#getImage(Object)
* @since 0.8
*/
public static Object getItemProviderImage(EObject eObj) {
final IItemLabelProvider labelProvider = adapt(eObj, IItemLabelProvider.class);
if (labelProvider != null)
return labelProvider.getImage(eObj);
return null;
}