當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。