本文整理匯總了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;
}