当前位置: 首页>>代码示例>>Java>>正文


Java IItemLabelProvider.getImage方法代码示例

本文整理汇总了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);

}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:TreeNodeWrapperItemProvider.java

示例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);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:PlanElementRowHeaderEditPart.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:DetailFormToolkit.java

示例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);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:EMFDetailFormPart.java

示例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"));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:ReferencedObjectRowItemProvider.java

示例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);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:7,代码来源:CustomAdapterFactory.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:AdapterUtils.java


注:本文中的org.eclipse.emf.edit.provider.IItemLabelProvider.getImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。