Modelers

org.topcased.modeler.extensions
Class DiagramDescriptor

java.lang.Object
  extended by org.topcased.modeler.extensions.DiagramDescriptor

public class DiagramDescriptor
extends java.lang.Object

Class that describes a Diagram


Field Summary
static java.lang.String ATT_CLASS
          The class attribute
static java.lang.String ATT_CONFIGURATION
          The configuration attribute
static java.lang.String ATT_CREATION_COMMAND
          The creationCommand attribute
static java.lang.String ATT_EDITOR_ID
          The editorID attribute
static java.lang.String ATT_ICON
          The icon attribute
static java.lang.String ATT_ID
          The id attribute
static java.lang.String ATT_NAME
          The name attribute
static java.lang.String TAG_DIAGRAM
          The diagram tag
static java.lang.String TAG_ENABLE_FOR
          The enableFor tag
 
Method Summary
 boolean canCreateDiagramOn(EObject model)
          Deprecated. Use the method with editorID as additional input parameter instead.
 boolean canCreateDiagramOn(EObject model, java.lang.String theEditorID)
          This method is used to check if a Diagram may be created on this model object in the given editor
 IConfiguration getConfiguration()
          Get the configuration associated with this extension
 org.eclipse.gef.commands.Command getCreationCommand(EObject model)
          This method retrieve the creation command that may be associated with the current Diagram when the creation is requested on a model object that will not be the real container of the diagram
 org.eclipse.swt.graphics.Image getIcon()
          Get the icon associated with this diagram
 org.eclipse.jface.resource.ImageDescriptor getIconDescriptor()
          Get the icon associated with this diagram
 java.lang.String getId()
          Get the id of the diagram
 java.lang.String getName()
          Get the name of the diagram (This will be the text displayed in the contextual menu)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_DIAGRAM

public static final java.lang.String TAG_DIAGRAM
The diagram tag

See Also:
Constant Field Values

ATT_ID

public static final java.lang.String ATT_ID
The id attribute

See Also:
Constant Field Values

ATT_NAME

public static final java.lang.String ATT_NAME
The name attribute

See Also:
Constant Field Values

ATT_ICON

public static final java.lang.String ATT_ICON
The icon attribute

See Also:
Constant Field Values

ATT_EDITOR_ID

public static final java.lang.String ATT_EDITOR_ID
The editorID attribute

See Also:
Constant Field Values

ATT_CONFIGURATION

public static final java.lang.String ATT_CONFIGURATION
The configuration attribute

See Also:
Constant Field Values

TAG_ENABLE_FOR

public static final java.lang.String TAG_ENABLE_FOR
The enableFor tag

See Also:
Constant Field Values

ATT_CLASS

public static final java.lang.String ATT_CLASS
The class attribute

See Also:
Constant Field Values

ATT_CREATION_COMMAND

public static final java.lang.String ATT_CREATION_COMMAND
The creationCommand attribute

See Also:
Constant Field Values
Method Detail

getConfiguration

public IConfiguration getConfiguration()
                                throws org.eclipse.core.runtime.CoreException
Get the configuration associated with this extension

Returns:
the configuration or null if not found
Throws:
org.eclipse.core.runtime.CoreException

getIconDescriptor

public org.eclipse.jface.resource.ImageDescriptor getIconDescriptor()
Get the icon associated with this diagram

Returns:
the image descriptor or null if not found

getIcon

public org.eclipse.swt.graphics.Image getIcon()
Get the icon associated with this diagram

Returns:
the image or null if not found

canCreateDiagramOn

public boolean canCreateDiagramOn(EObject model)
Deprecated. Use the method with editorID as additional input parameter instead.

This method is used to check if a Diagram may be created on this model object

Parameters:
model - the model object that should be associated with the diagram
Returns:
true if the creation is enabled

canCreateDiagramOn

public boolean canCreateDiagramOn(EObject model,
                                  java.lang.String theEditorID)
This method is used to check if a Diagram may be created on this model object in the given editor

Parameters:
model - the model object that should be associated with the diagram
theEditorID - the editorID
Returns:
true if the creation is enabled

getCreationCommand

public org.eclipse.gef.commands.Command getCreationCommand(EObject model)
This method retrieve the creation command that may be associated with the current Diagram when the creation is requested on a model object that will not be the real container of the diagram

Parameters:
model - the model object on which the creation is requested
Returns:
Command the command to execute for the diagram creation or null when the default behavior should be performed

getId

public java.lang.String getId()
Get the id of the diagram

Returns:
String

getName

public java.lang.String getName()
Get the name of the diagram (This will be the text displayed in the contextual menu)

Returns:
String

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.