public class DiagramItemLabelAdapter
extends org.eclipse.emf.edit.provider.ItemProviderAdapter
implements org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.ItemProviderAdapter.ChildrenStore, org.eclipse.emf.edit.provider.ItemProviderAdapter.ModifiableSingletonEList<E>, org.eclipse.emf.edit.provider.ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand, org.eclipse.emf.edit.provider.ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommandActionDelegate
Modifier and Type | Field and Description |
---|---|
static java.util.Map |
ANNOTATIONS_NAME_MAP
Map internal annotation name string representation to their external
counterpart defined in message.properties.
|
protected org.eclipse.swt.graphics.Image |
note_attachment_image
Image used to show note attachment element
|
protected org.eclipse.swt.graphics.Image |
note_image
Image used to show note element
|
protected java.util.Set |
STYLES
A set of model object styles
|
protected org.eclipse.swt.graphics.Image |
text_image
Image used to show text element
|
protected static org.eclipse.swt.graphics.Image |
unknown_image
Image used to show unknown element
|
Constructor and Description |
---|
DiagramItemLabelAdapter(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
Constructs a new DiagramItemLabelAdapter
|
Modifier and Type | Method and Description |
---|---|
protected void |
addHandledStyle(java.lang.Class cls)
Adds a model element style to this item provider
|
protected static org.eclipse.swt.graphics.Image |
fetchIcon(java.lang.String pluginId,
java.lang.String iconPath)
Helper method for getting the icons from other plugins
|
protected java.lang.String |
getContainerName(org.eclipse.emf.ecore.EObject eobject)
Returns the name of the style as the name of the container.
|
protected static java.lang.String |
getDisplayName(org.eclipse.emf.ecore.ENamedElement element)
Retrieves the displayable name of an EMF named element
|
protected java.lang.String |
getEdgeName(org.eclipse.gmf.runtime.notation.Edge edge)
Handles the formatting of any edge name.
|
protected org.eclipse.swt.graphics.Image |
getExtendedImagePost(java.lang.Object object)
Override if you want to check the object AFTER super classes
|
protected org.eclipse.swt.graphics.Image |
getExtendedImagePre(java.lang.Object object)
Override if you want to check the object BEFORE super classes
|
protected java.lang.String |
getExtendedObjectNamePost(java.lang.Object object)
Override if you want to take a crack at naming the object AFTER the
superclasses have had at it
|
protected java.lang.String |
getExtendedObjectNamePre(java.lang.Object object)
Override if you want to take a crack at naming the object BEFORE the
superclasses have had at it
|
protected java.lang.String |
getExtendedTextPost(java.lang.Object object)
Override if you have types that you want to handle after diagram has had
a crack at the types
|
protected java.lang.String |
getExtendedTextPre(java.lang.Object object)
Override if you have types that you want to handle before diagram has had
a crack at the types
|
java.lang.String |
getFormattedEAnnotation(org.eclipse.emf.ecore.EAnnotation ann)
Get a formatted string representation of the given EAnnotation
|
protected java.lang.String |
getFormattedTypeText(java.lang.Object object)
Returns the element's formatted type name, calls the extendable
getLocalizedTypeTextByKey to allow for overridden access to the
meta-model's type names
|
java.lang.Object |
getImage(java.lang.Object object)
Retrieves the image associated with the given object
|
protected java.lang.Object |
getImageFromDifferentItemLabelProvider(java.lang.Object object)
Cannot override this, instead override getItemLabelProviderForObject
|
protected org.eclipse.emf.edit.provider.IItemLabelProvider |
getItemLabelProviderForObject(java.lang.Object object)
Looks for an alternative item label provider that is capable of rendering
this object.
|
protected java.lang.String |
getLocalizedTypeTextByKey(java.lang.Object object,
java.lang.String key) |
protected java.lang.String |
getNodeName(org.eclipse.gmf.runtime.notation.Node node)
Handles the formatting of any node name, including styles, geoshapes and
so on.
|
protected java.lang.String |
getObjectName(java.lang.Object object)
No reason to override this as there are other ways to tweak the name and
qualifiers.
|
protected java.lang.String |
getObjectNameQualifiers(java.lang.Object object)
Object qualifiers are anything you want added to the front of an object
name.
|
protected java.lang.String |
getObjectNameWithQualAndType(java.lang.Object object)
Override this only if you want to change the basic format of the name of
elements with qualifiers and type.
|
protected java.lang.String |
getObjectNameWithQualOnly(java.lang.Object object)
Override this only if you want to change the basic format of the name of
elements with qualifier only.
|
java.lang.String |
getText(java.lang.Object object)
Retrieves the text associated with the given object
|
protected java.lang.String |
getTextFromDifferentItemLabelProvider(java.lang.Object object)
Cannot override this, instead override getItemLabelProviderForObject
|
protected boolean |
isDescription(org.eclipse.gmf.runtime.notation.Node node)
Determines if the node is a description node
|
protected boolean |
isDiagramName(org.eclipse.gmf.runtime.notation.Node node)
Determines if the given node is a diagram name node
|
protected boolean |
isGeoShape(org.eclipse.gmf.runtime.notation.Node node)
Determines if the given node is a geo shape
|
protected boolean |
isNote(org.eclipse.gmf.runtime.notation.Node node)
Determines if the given node is a note
|
protected boolean |
isNoteAttachment(org.eclipse.gmf.runtime.notation.Edge edge)
Determines if the given edge is a note attachment
|
protected boolean |
isReference(org.eclipse.gmf.runtime.notation.Edge edge)
Determines if the given edge is a reference
|
protected boolean |
isStyle(java.lang.Object object)
Determine if the given object is a style
|
protected boolean |
isText(org.eclipse.gmf.runtime.notation.Node node)
Determines if the given note is a text.
|
protected boolean |
isTypedEdge(org.eclipse.gmf.runtime.notation.Edge edge,
java.lang.String type)
Determines whether the given edge has a type equals to the given string
|
protected boolean |
isTypedNode(org.eclipse.gmf.runtime.notation.Node node,
java.lang.String type)
Determines if the given node has a type equals to the given string
|
protected java.lang.String |
makeShortenedTextString(java.lang.String text_in) |
addListener, adjustWrapperIndex, adjustWrapperIndices, adjustWrapperIndices, collectNewChildDescriptors, createAddCommand, createAddCommand, createChildParameter, createChildrenStore, createCommand, createCopyCommand, createCreateChildCommand, createCreateChildCommand, createCreateCopyCommand, createDragAndDropCommand, createDragAndDropCommand, createInitializeCopyCommand, createItemPropertyDescriptor, createItemPropertyDescriptor, createMoveCommand, createMoveCommand, createRemoveCommand, createRemoveCommand, createReplaceCommand, createReplaceCommand, createReplaceCommand, createSetCommand, createSetCommand, createWrapper, crop, dispose, disposeWrapper, disposeWrappers, factorAddCommand, factorMoveCommand, factorRemoveCommand, fireNotifyChanged, getAdapterFactory, getBackground, getBackground, getBaseURL, getChildFeature, getChildReference, getChildren, getChildrenFeatures, getChildrenReferences, getChildrenStore, getColumnImage, getColumnText, getCreateChildDescription, getCreateChildImage, getCreateChildResult, getCreateChildText, getCreateChildToolTipText, getEditableValue, getElements, getFeatureText, getFeatureValue, getFont, getFont, getForeground, getForeground, getImage, getNewChildDescriptors, getParent, getPropertyDescriptor, getPropertyDescriptors, getPropertyValue, getReferenceValue, getResourceLocator, getResourceLocator, getRootAdapterFactory, getSetFeature, getSetFeatures, getString, getString, getString, getString, getString, getString, getString, getString, getStyledText, getTypeText, getTypeText, getUpdateableText, getValue, getWrappedValues, hasChildren, hasChildren, isAdapterForType, isEquivalentValue, isPropertySet, isResolveProxies, isValidValue, isWrappingNeeded, overlayImage, removeListener, resetPropertyValue, setPropertyValue, setTarget, shouldComposeCreationImage, shouldTranslate, unsetTarget, unwrap, unwrapCommandValues, updateChildren, wrap, wrapCommand
protected static org.eclipse.swt.graphics.Image unknown_image
protected org.eclipse.swt.graphics.Image note_image
protected org.eclipse.swt.graphics.Image note_attachment_image
protected org.eclipse.swt.graphics.Image text_image
protected java.util.Set STYLES
Style
public static java.util.Map ANNOTATIONS_NAME_MAP
public DiagramItemLabelAdapter(org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
adapterFactory
- adapterFActory used to create itemLobelAdatperpublic java.lang.String getText(java.lang.Object object)
getText
in interface org.eclipse.emf.edit.provider.IItemLabelProvider
getText
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
object
- given objectItemProviderAdapter.getText(java.lang.Object)
protected java.lang.String getExtendedTextPre(java.lang.Object object)
object
- --
object for which a label is requiredprotected java.lang.String getExtendedTextPost(java.lang.Object object)
object
- --
object for which a label is requiredpublic java.lang.Object getImage(java.lang.Object object)
getImage
in interface org.eclipse.emf.edit.provider.IItemLabelProvider
getImage
in class org.eclipse.emf.edit.provider.ItemProviderAdapter
object
- the given objectItemProviderAdapter.getImage(java.lang.Object)
protected org.eclipse.swt.graphics.Image getExtendedImagePre(java.lang.Object object)
object
- --
object for which icon is desiredprotected org.eclipse.swt.graphics.Image getExtendedImagePost(java.lang.Object object)
object
- --
object for which icon is desiredprotected void addHandledStyle(java.lang.Class cls)
cls
- --
a style class that can be handled by this item providerprotected static java.lang.String getDisplayName(org.eclipse.emf.ecore.ENamedElement element)
element
- --
an EMF named element or subclassprotected org.eclipse.emf.edit.provider.IItemLabelProvider getItemLabelProviderForObject(java.lang.Object object)
object
- --
the object for which an item label provider is requiredprotected final java.lang.String getTextFromDifferentItemLabelProvider(java.lang.Object object)
object
- --
object for which label is desiredprotected final java.lang.Object getImageFromDifferentItemLabelProvider(java.lang.Object object)
object
- --
object for which image is desiredprotected java.lang.String getObjectNameWithQualAndType(java.lang.Object object)
object
- --
the object for which the name is requiredprotected java.lang.String getObjectNameWithQualOnly(java.lang.Object object)
object
- --
the object for which the name is requiredprotected final java.lang.String getObjectName(java.lang.Object object)
object
- --
the element for which you desire an unformatted, localized
nameprotected java.lang.String getExtendedObjectNamePre(java.lang.Object object)
object
- --
object for which a nems is desiredprotected java.lang.String getExtendedObjectNamePost(java.lang.Object object)
object
- --
object for which a name is desiredprotected java.lang.String getObjectNameQualifiers(java.lang.Object object)
object
- --
the object for which qualifiers are desiredprotected java.lang.String getNodeName(org.eclipse.gmf.runtime.notation.Node node)
node
- --
the node to be namedprotected java.lang.String getContainerName(org.eclipse.emf.ecore.EObject eobject)
eobject
- --
a style object, usually contained by a node or edgeprotected java.lang.String getEdgeName(org.eclipse.gmf.runtime.notation.Edge edge)
edge
- --
the edge to be namedpublic java.lang.String getFormattedEAnnotation(org.eclipse.emf.ecore.EAnnotation ann)
ann
- the given EAnnotationprotected java.lang.String getFormattedTypeText(java.lang.Object object)
object
- given elementprotected java.lang.String makeShortenedTextString(java.lang.String text_in)
protected java.lang.String getLocalizedTypeTextByKey(java.lang.Object object, java.lang.String key)
key
- --
a string of the format "protected final boolean isTypedEdge(org.eclipse.gmf.runtime.notation.Edge edge, java.lang.String type)
edge
- --
any object that may or may not be an Edgetype
- --
string representing the edge typeprotected final boolean isTypedNode(org.eclipse.gmf.runtime.notation.Node node, java.lang.String type)
node
- --
any object that may or may not be a Nodetype
- --
string representing the node typeprotected final boolean isDescription(org.eclipse.gmf.runtime.notation.Node node)
node
- --
an object that may or may not be a Description nodeprotected final boolean isDiagramName(org.eclipse.gmf.runtime.notation.Node node)
node
- --
an object that may or may not be a diagram name nodeprotected final boolean isGeoShape(org.eclipse.gmf.runtime.notation.Node node)
node
- --
an object that may or may not be a geo shapeprotected final boolean isNote(org.eclipse.gmf.runtime.notation.Node node)
node
- --
an object that may or may not be a note nodeprotected final boolean isNoteAttachment(org.eclipse.gmf.runtime.notation.Edge edge)
edge
- --
an object that may or may not be a note attachmentprotected final boolean isReference(org.eclipse.gmf.runtime.notation.Edge edge)
edge
- --
an object that may or may not be a reference (edge)protected boolean isStyle(java.lang.Object object)
object
- --
object that may or may not be a style objectprotected final boolean isText(org.eclipse.gmf.runtime.notation.Node node)
node
- --
an object that might be a text objectprotected static org.eclipse.swt.graphics.Image fetchIcon(java.lang.String pluginId, java.lang.String iconPath)
pluginId
- -
The plugin contains the icon to be fetchediconPath
- -
The icon path relative to the plugin