|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.ui.editor.DiagramEditorInput
public class DiagramEditorInput
The editor input object for DiagramEditor
s. Wraps the URI
of
a Diagram
and an ID of a diagram type provider for displaying it with
a Graphiti diagram editor.
IEditorInput}
,
IPersistableElement}
,
DiagramEditorInputFactory}
,
DiagramEditor}
Field Summary | |
---|---|
static java.lang.String |
KEY_PROVIDER_ID
The memento key for the ID of the diagram type provider. |
static java.lang.String |
KEY_URI
The memento key for the stored URI string |
private java.lang.String |
name
The cached input name (e.g. |
private java.lang.String |
providerId
The ID of the diagram type provider. |
private java.lang.String |
tooltip
The cached input tooltip |
private URI |
uri
The stored URI string |
Constructor Summary | |
---|---|
DiagramEditorInput(URI diagramUri,
java.lang.String providerId)
Creates a new DiagramEditorInput out of a URI string and
a Graphiti diagram type provider ID. |
Method Summary | |
---|---|
static DiagramEditorInput |
createEditorInput(Diagram diagram,
java.lang.String providerId)
Creates a new DiagramEditorInput for the given Diagram
and the given diagram type provider ID. |
boolean |
equals(java.lang.Object obj)
Checks if this instance of the input represent the same object as the given instance. |
boolean |
exists()
Checks if the diagram this input represents exist. |
java.lang.Object |
getAdapter(java.lang.Class adapter)
Adapter method as defined in IAdaptable , supports adaptation to
IFile . |
java.lang.String |
getFactoryId()
Returns the factory ID for creating DiagramEditorInput s from
mementos. |
ImageDescriptor |
getImageDescriptor()
|
java.lang.String |
getName()
|
IPersistableElement |
getPersistable()
|
java.lang.String |
getProviderId()
Returns the diagram type provider id. |
java.lang.String |
getToolTipText()
|
URI |
getUri()
|
java.lang.String |
getUriString()
|
int |
hashCode()
|
protected boolean |
hasName()
Checks if a name is set for this instance |
private URI |
normalizeUriString(URI diagramUri)
|
void |
saveState(IMemento memento)
Saves URI string, object name and provider ID to the given
IMemento . |
protected void |
setName(java.lang.String name)
Sets the name for this instance. |
void |
setProviderId(java.lang.String providerId)
Sets the diagram type provider id. |
java.lang.String |
toString()
Used for logging only! |
void |
updateUri(URI diagramFileUri)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_URI
URI
string
public static java.lang.String KEY_PROVIDER_ID
private URI uri
URI
string
private java.lang.String providerId
private java.lang.String name
EObject
)
#getLiveName()
private java.lang.String tooltip
#getLiveToolTipText()
Constructor Detail |
---|
public DiagramEditorInput(URI diagramUri, java.lang.String providerId)
DiagramEditorInput
out of a URI
string and
a Graphiti diagram type provider ID. For resolving the URI
to an
EObject
the ResourceSet
that will be created when a
diagram editor starts is taken. This input object will not resolve the
diagram.
diagramUri
- A URI
that denotes the input's EObject
. This
can either be a URI of a Graphiti diagram or the URI of an EMF
resource storing a Graphiti diagram. In the latter case the
given URI will b e trimmed to point to the first element in
the resource; make sure that this lemenet is a Graphiti
diagram, otherwise an exception will be thrown when the
diagram editor opens. No check on this is done inside the
input object itself!providerId
- A String
which holds the diagram type id. When it is
null, it is set later in
DiagramEditor.setInput(IEditorInput)
java.lang.IllegalArgumentException
- if uriString
parameter is null URI
Method Detail |
---|
private URI normalizeUriString(URI diagramUri)
public static DiagramEditorInput createEditorInput(Diagram diagram, java.lang.String providerId)
DiagramEditorInput
for the given Diagram
and the given diagram type provider ID.
diagram
- A Diagram
providerId
- A String
which holds the diagram type provider id.
DiagramEditorInput
editor inputpublic java.lang.String getProviderId()
getProviderId
in interface IDiagramEditorInput
public void setProviderId(java.lang.String providerId)
setProviderId
in interface IDiagramEditorInput
providerId
- The providerId to set.public java.lang.String getFactoryId()
DiagramEditorInput
s from
mementos.
public ImageDescriptor getImageDescriptor()
null
.public java.lang.String getName()
URI
string#getLiveName()
protected boolean hasName()
true
in case a name is set, false
in
name is null
.protected void setName(java.lang.String name)
name
- The name to set.public java.lang.String getToolTipText()
URI
string#getLiveToolTipText()
public java.lang.Object getAdapter(java.lang.Class adapter)
IAdaptable
, supports adaptation to
IFile
.
adapter
- The adapter class to look up
null
if
this object does not have an adapter for the given classpublic void saveState(IMemento memento)
URI
string, object name and provider ID to the given
IMemento
.
memento
- The memento to store the information inpublic final java.lang.String getUriString()
getUriString
in interface IDiagramEditorInput
URI
string this input and its editors operate onpublic boolean exists()
Note: The editor gets only restored, when true
is returned.
true
if the input's state denotes a living EMF
object public IPersistableElement getPersistable()
public URI getUri()
getUri
in interface IDiagramEditorInput
URI
or null
in case of failurespublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to compare this instance with.
true
if the represented objects are the samepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void updateUri(URI diagramFileUri)
updateUri
in interface IDiagramEditorInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |