本文整理匯總了Java中org.eclipse.emf.edit.provider.ItemProviderAdapter類的典型用法代碼示例。如果您正苦於以下問題:Java ItemProviderAdapter類的具體用法?Java ItemProviderAdapter怎麽用?Java ItemProviderAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ItemProviderAdapter類屬於org.eclipse.emf.edit.provider包,在下文中一共展示了ItemProviderAdapter類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hasChildren
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
@Override
public boolean hasChildren(Object object)
{
if (object != null && object instanceof TreeNodeWrapper)
{
TreeNodeWrapper treeNodeWrapper = (TreeNodeWrapper) object;
if (treeNodeWrapper.getObject() != null && treeNodeWrapper.getObject() instanceof BTSConfig)
{
Object realItem = ((TreeNodeWrapper) object).getObject();
IItemLabelProvider realItemItemprovider = getRealItemItemProvider(treeNodeWrapper, realItem);
return ((ItemProviderAdapter) realItemItemprovider).hasChildren(realItem);
}
}
return super.hasChildren(object);
}
示例2: getTypeName
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Returns the type name for the given object.
* The type name is retrieved from the edit plug-in,
* which provides type names for all types (classes).
*
* @param eObject the object the type name to get for
* @return the type name for the given object, null if an error occurred
*/
public static String getTypeName(EObject eObject) {
// Get the key name of this object for the translated string
// by using the objects interface name.
String className = eObject.eClass().getName();
String key = "_UI_" + className + "_type";
String result = null;
try {
ItemProviderAdapter itemProvider = getItemProvider(eObject);
result = itemProvider.getString(key);
}
catch (MissingResourceException e) {
System.err.println("Error: Missing Resource for " + className
+ "! Did you forget to register the adapter factory?");
}
return result;
}
示例3: appendType
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
private StringBuffer appendType(final StringBuffer text, final Type type) {
if (type == null) {
return text;
}
return ((ILabelAppender) adapterFactory.adapt(type, ItemProviderAdapter.class)).appendLabel(
text.append(" (of type "), type).append(')');
}
示例4: getNewChildDescriptor
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Returns the new child descriptor for creating a new child of the given feature for the given object.
*
* @param eObject the object a child should created for
* @param childFeature the feature of the children
* @return the {@link CommandParameter} (new child descriptor)
*/
public static CommandParameter getNewChildDescriptor(EObject eObject, EStructuralFeature childFeature) {
EditingDomain editingDomain = getEditingDomain(eObject);
ItemProviderAdapter itemProvider = getItemProvider(eObject);
for (Object object : itemProvider.getNewChildDescriptors(eObject, editingDomain, null)) {
CommandParameter childDescriptor = (CommandParameter) object;
if (childDescriptor.getFeature() == childFeature) {
return childDescriptor;
}
}
return null;
}
示例5: getPropertyDescriptor
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Returns the property descriptor for the feature of the given object.
*
* @param object the object containing the feature
* @param feature the feature/property
* @return the {@link IItemPropertyDescriptor} for the feature of the given object
*/
public static IItemPropertyDescriptor getPropertyDescriptor(EObject object, EStructuralFeature feature) {
ItemProviderAdapter itemProvider = getItemProvider(object);
return itemProvider.getPropertyDescriptor(object, feature);
}
示例6: getItemProvider
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Returns the item provider for the given object.
*
* @param object the object the item provider is requested for
* @return the {@link ItemProviderAdapter} for the given object
*/
public static ItemProviderAdapter getItemProvider(EObject object) {
return (ItemProviderAdapter) getAdapterFactory(object).adapt(object, IItemPropertySource.class);
}
示例7: addListenerFor
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Adds the given listener to the item provider of the given object.
* Make sure to remove the listener when not needed anymore.
*
* @param object the object
* @param listener the listener
*/
public static void addListenerFor(EObject object, INotifyChangedListener listener) {
ItemProviderAdapter itemProvider = getItemProvider(object);
itemProvider.addListener(listener);
}
示例8: removeListenerFor
import org.eclipse.emf.edit.provider.ItemProviderAdapter; //導入依賴的package包/類
/**
* Removes the given listener from the item provider of the given object.
*
* @param object the object
* @param listener the listener
*/
public static void removeListenerFor(EObject object, INotifyChangedListener listener) {
ItemProviderAdapter itemProvider = getItemProvider(object);
itemProvider.removeListener(listener);
}