org.eclipse.gmt.umlx.editor.regimes
Class StringRegime

java.lang.Object
  extended by org.eclipse.gmt.umlx.editor.messages.VeryAbstractProblemMessage<java.lang.String>
      extended by org.eclipse.gmt.umlx.editor.regimes.StringRegime
All Implemented Interfaces:
IErrorMessage, IProblemMessage<java.lang.String>, IRegime, IRegimeCo0<java.lang.String,java.lang.Object>, IClassExtension

public class StringRegime
extends VeryAbstractProblemMessage<java.lang.String>
implements IRegimeCo0<java.lang.String,java.lang.Object>


Field Summary
static StringRegime INSTANCE
           
 
Fields inherited from interface org.eclipse.gmt.umlx.editor.messages.IErrorMessage
ERROR_SEVERITY, GUIDANCE_SEVERITY
 
Method Summary
 boolean canCopy(IRegimeContext regimeContext, java.lang.String selectedObject)
           
 boolean canDelete(IRegimeContext regimeContext, java.lang.String selectedObject)
           
 IProblemMessage<java.lang.String> computeProblemMessage(java.lang.String model)
          Return a non-null message describing a problem with model.
 IAbstractCommand createCreateChildLinkCommand(IActiveEditDomain editDomain, java.lang.Object coChild, java.lang.Object child, java.lang.Object parent)
          Create a command to create a graphical link between a newly created graphical child and its graphical parent.
 CreateCommand createCreateCommand(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object parent)
          Create a command to create an instance of the model element managed by this regime, with the created element a child of parent, and instantiating coModel.
 DeleteCommand createDeleteCommand(DeleteDomain deleteDomain, java.lang.String model)
           
 INodeFigure createFigure()
           
 ILinkEnd createLinkEnd(java.lang.Object object)
          Create an object to describe the end of a link terminating at object.
 java.lang.String createModelObject()
          Create a new and uninitialised EMF object of the type managed by this regime.
 AbstractOutline createOutline(OutlineViewer viewer, java.lang.String model)
           
 AbstractPropertySource createPropertySource(java.lang.String model)
           
 org.eclipse.gef.EditPart createView(SheetViewer viewer, java.lang.String model)
           
 GModelElement getBackElement(java.lang.Object editModel)
          Return the non-opaque model element behind the graphical editModel.
 GModelElement getBackOf(org.eclipse.gef.EditPart editPart)
           
 java.lang.Class<java.lang.Object> getBasicClass()
           
 java.lang.Object getCoModel(java.lang.Object model)
          Return the co-model of model if it has one.
 java.lang.Class<?> getCoModelClass()
          Return the co-model class if it has one.
 java.lang.Class<?> getCoModelParentClass()
          Return the co-model parent class if it has one.
 IRegimeCo0<?,?> getCoRegime()
          Return the co-regime if it has one.
 IFacet<? super java.lang.Object>[] getFacets()
           
 java.lang.Enum getIcon()
          Return the icon to be shown in the construction context (the Palette for GCore objects, the Outline for ECore objects).
 java.lang.String getLabel()
          Return a descriptive label for the managed object type
 java.lang.String getModel()
          Return the model object identified as the source of this error message.
 java.lang.Class<java.lang.String> getModelClass()
          Return the model class.
 java.lang.String getNewNamePrefix()
          Return a prefix for autogenerated names.
 java.lang.Class<java.lang.Object> getParentModelClass()
          Return the class of the parent
 IProblem getProblem(ActiveEditDomain domain, java.lang.String model)
           
 IRegimeCo0<java.lang.String,?> getRegime()
          Return the regime that created this error message.
 java.lang.Class<? extends GSheet> getSheetClass()
          Return the class of the sheet that this regime supports
 java.lang.Object getSource(java.lang.Object model)
          Return the source node of model if it is a link.
 java.lang.Class<?> getSourceModelClass()
          Return the class of source nodes if appropriate
 java.lang.Object getTarget(java.lang.Object model)
          Return the target node of model if it is a link.
 java.lang.Class<?> getTargetModelClass()
          Return the class of target nodes if appropriate
 ILinkRegimeCo0<?,java.lang.String,?,java.lang.Object> isLink()
           
 INodeRegimeCo0<java.lang.String,java.lang.Object> isNode()
           
 IRegimeCo0<java.lang.String,java.lang.Object> isRegimeCo0()
          Return this non-null regime if it is suitable for use with zero or more levels of co-model.
 IRegimeCo1<java.lang.String,java.lang.Object,?,?> isRegimeCo1()
          Return this non-null regime if it is suitable for use with one or more levels of co-model.
 IRegimeCo2<java.lang.String,java.lang.Object,?,?> isRegimeCo2()
          Return this non-null regime if it is suitable for use with two or more levels of co-model.
 IProblemMessage<?> refreshProblemMessage(ActiveEditDomain domain, java.lang.String model)
          Recompute and return the error message for model within domain.
 void setCoModel(java.lang.String model, java.lang.Object coModel)
           
 java.lang.String toDebugString(java.lang.Object object)
          Return a message fragment to assist a developer in understanding the usage of object
 java.lang.String toTestString()
          JUnit-friendly presentration of error message.
 java.lang.String toUserString(java.lang.Object object)
          Return a message fragment to assist a user in understanding the usage of object
 
Methods inherited from class org.eclipse.gmt.umlx.editor.messages.VeryAbstractProblemMessage
equals, getSeverity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.messages.IErrorMessage
toString
 

Field Detail

INSTANCE

public static final StringRegime INSTANCE
Method Detail

canCopy

public boolean canCopy(IRegimeContext regimeContext,
                       java.lang.String selectedObject)
Specified by:
canCopy in interface IRegimeCo0<java.lang.String,java.lang.Object>

canDelete

public boolean canDelete(IRegimeContext regimeContext,
                         java.lang.String selectedObject)
Specified by:
canDelete in interface IRegimeCo0<java.lang.String,java.lang.Object>

computeProblemMessage

public IProblemMessage<java.lang.String> computeProblemMessage(java.lang.String model)
Description copied from interface: IRegimeCo0
Return a non-null message describing a problem with model.

Specified by:
computeProblemMessage in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
a error message or null.

createCreateChildLinkCommand

public IAbstractCommand createCreateChildLinkCommand(IActiveEditDomain editDomain,
                                                     java.lang.Object coChild,
                                                     java.lang.Object child,
                                                     java.lang.Object parent)
Description copied from interface: IRegime
Create a command to create a graphical link between a newly created graphical child and its graphical parent. This is used to create an attribution link when a sheet attribute is created.

Specified by:
createCreateChildLinkCommand in interface IRegime

createCreateCommand

public CreateCommand createCreateCommand(IActiveEditDomain editDomain,
                                         java.lang.Object coModel,
                                         java.lang.Object parent)
Description copied from interface: IRegime
Create a command to create an instance of the model element managed by this regime, with the created element a child of parent, and instantiating coModel.

Specified by:
createCreateCommand in interface IRegime

createDeleteCommand

public DeleteCommand createDeleteCommand(DeleteDomain deleteDomain,
                                         java.lang.String model)
Specified by:
createDeleteCommand in interface IRegimeCo0<java.lang.String,java.lang.Object>

createFigure

public INodeFigure createFigure()

createLinkEnd

public ILinkEnd createLinkEnd(java.lang.Object object)
Description copied from interface: IRegime
Create an object to describe the end of a link terminating at object.

Specified by:
createLinkEnd in interface IRegime

createModelObject

public java.lang.String createModelObject()
Description copied from interface: IRegime
Create a new and uninitialised EMF object of the type managed by this regime.

Specified by:
createModelObject in interface IRegime
Specified by:
createModelObject in interface IRegimeCo0<java.lang.String,java.lang.Object>

createOutline

public AbstractOutline createOutline(OutlineViewer viewer,
                                     java.lang.String model)
Specified by:
createOutline in interface IRegimeCo0<java.lang.String,java.lang.Object>

createPropertySource

public AbstractPropertySource createPropertySource(java.lang.String model)
Specified by:
createPropertySource in interface IRegimeCo0<java.lang.String,java.lang.Object>

createView

public org.eclipse.gef.EditPart createView(SheetViewer viewer,
                                           java.lang.String model)
Specified by:
createView in interface IRegimeCo0<java.lang.String,java.lang.Object>

getBackElement

public GModelElement getBackElement(java.lang.Object editModel)
Description copied from interface: IRegime
Return the non-opaque model element behind the graphical editModel.

Specified by:
getBackElement in interface IRegime
Returns:
the non-opaque model element behind the graphical editModel

getBackOf

public GModelElement getBackOf(org.eclipse.gef.EditPart editPart)

getBasicClass

public java.lang.Class<java.lang.Object> getBasicClass()
Specified by:
getBasicClass in interface IClassExtension

getCoModel

public java.lang.Object getCoModel(java.lang.Object model)
Description copied from interface: IRegime
Return the co-model of model if it has one.

Specified by:
getCoModel in interface IRegime
Parameters:
model - model
Returns:
co-model or null

getCoModelClass

public java.lang.Class<?> getCoModelClass()
Description copied from interface: IRegime
Return the co-model class if it has one.

Specified by:
getCoModelClass in interface IRegime
Returns:
co-model class or null

getCoModelParentClass

public java.lang.Class<?> getCoModelParentClass()
Description copied from interface: IRegime
Return the co-model parent class if it has one.

Specified by:
getCoModelParentClass in interface IRegime
Returns:
co-model parent class or null

getCoRegime

public IRegimeCo0<?,?> getCoRegime()
Description copied from interface: IRegime
Return the co-regime if it has one.

Specified by:
getCoRegime in interface IRegime
Specified by:
getCoRegime in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
co-regime class or null

getFacets

public IFacet<? super java.lang.Object>[] getFacets()
Specified by:
getFacets in interface IRegimeCo0<java.lang.String,java.lang.Object>

getIcon

public java.lang.Enum getIcon()
Description copied from interface: IRegime
Return the icon to be shown in the construction context (the Palette for GCore objects, the Outline for ECore objects).

Specified by:
getIcon in interface IRegime
Returns:
the icon

getLabel

public java.lang.String getLabel()
Description copied from interface: IRegime
Return a descriptive label for the managed object type

Specified by:
getLabel in interface IRegime
Returns:
label

getModel

public java.lang.String getModel()
Description copied from interface: IProblemMessage
Return the model object identified as the source of this error message.

Specified by:
getModel in interface IProblemMessage<java.lang.String>
Returns:
the source of the error message

getModelClass

public java.lang.Class<java.lang.String> getModelClass()
Description copied from interface: IRegime
Return the model class.

Specified by:
getModelClass in interface IRegime
Specified by:
getModelClass in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
model class

getNewNamePrefix

public java.lang.String getNewNamePrefix()
Description copied from interface: IRegime
Return a prefix for autogenerated names.

Specified by:
getNewNamePrefix in interface IRegime
Returns:
prefix

getParentModelClass

public java.lang.Class<java.lang.Object> getParentModelClass()
Description copied from interface: IRegime
Return the class of the parent

Specified by:
getParentModelClass in interface IRegime
Specified by:
getParentModelClass in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
parent class

getProblem

public IProblem getProblem(ActiveEditDomain domain,
                           java.lang.String model)

getRegime

public IRegimeCo0<java.lang.String,?> getRegime()
Description copied from interface: IProblemMessage
Return the regime that created this error message.

Specified by:
getRegime in interface IProblemMessage<java.lang.String>
Returns:
the creator of the error message

getSheetClass

public java.lang.Class<? extends GSheet> getSheetClass()
Description copied from interface: IRegime
Return the class of the sheet that this regime supports

Specified by:
getSheetClass in interface IRegime
Returns:
sheet class or null.

getSource

public java.lang.Object getSource(java.lang.Object model)
Description copied from interface: IRegime
Return the source node of model if it is a link.

Specified by:
getSource in interface IRegime
Parameters:
model - model
Returns:
this or null

getSourceModelClass

public java.lang.Class<?> getSourceModelClass()
Description copied from interface: IRegime
Return the class of source nodes if appropriate

Specified by:
getSourceModelClass in interface IRegime
Returns:
source node class or null

getTarget

public java.lang.Object getTarget(java.lang.Object model)
Description copied from interface: IRegime
Return the target node of model if it is a link.

Specified by:
getTarget in interface IRegime
Parameters:
model - model
Returns:
this or null

getTargetModelClass

public java.lang.Class<?> getTargetModelClass()
Description copied from interface: IRegime
Return the class of target nodes if appropriate

Specified by:
getTargetModelClass in interface IRegime
Returns:
target node class or null

isLink

public ILinkRegimeCo0<?,java.lang.String,?,java.lang.Object> isLink()
Specified by:
isLink in interface IRegimeCo0<java.lang.String,java.lang.Object>

isNode

public INodeRegimeCo0<java.lang.String,java.lang.Object> isNode()
Specified by:
isNode in interface IRegimeCo0<java.lang.String,java.lang.Object>

isRegimeCo0

public IRegimeCo0<java.lang.String,java.lang.Object> isRegimeCo0()
Description copied from interface: IRegime
Return this non-null regime if it is suitable for use with zero or more levels of co-model.

Specified by:
isRegimeCo0 in interface IRegime
Specified by:
isRegimeCo0 in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
this or null

isRegimeCo1

public IRegimeCo1<java.lang.String,java.lang.Object,?,?> isRegimeCo1()
Description copied from interface: IRegime
Return this non-null regime if it is suitable for use with one or more levels of co-model.

Specified by:
isRegimeCo1 in interface IRegime
Specified by:
isRegimeCo1 in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
this or null

isRegimeCo2

public IRegimeCo2<java.lang.String,java.lang.Object,?,?> isRegimeCo2()
Description copied from interface: IRegime
Return this non-null regime if it is suitable for use with two or more levels of co-model.

Specified by:
isRegimeCo2 in interface IRegime
Specified by:
isRegimeCo2 in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
this or null

refreshProblemMessage

public IProblemMessage<?> refreshProblemMessage(ActiveEditDomain domain,
                                                java.lang.String model)
Description copied from interface: IRegimeCo0
Recompute and return the error message for model within domain.

Specified by:
refreshProblemMessage in interface IRegimeCo0<java.lang.String,java.lang.Object>
Returns:
the error message or null.

setCoModel

public void setCoModel(java.lang.String model,
                       java.lang.Object coModel)
Specified by:
setCoModel in interface IRegimeCo0<java.lang.String,java.lang.Object>

toDebugString

public java.lang.String toDebugString(java.lang.Object object)
Description copied from interface: IClassExtension
Return a message fragment to assist a developer in understanding the usage of object

Specified by:
toDebugString in interface IClassExtension
Parameters:
object - to diagnose
Returns:
message fragment

toTestString

public java.lang.String toTestString()
Description copied from interface: IErrorMessage
JUnit-friendly presentration of error message. Typically ignores potential future objects.

Specified by:
toTestString in interface IErrorMessage
Returns:
JUnit-friendly message

toUserString

public java.lang.String toUserString(java.lang.Object object)
Description copied from interface: IClassExtension
Return a message fragment to assist a user in understanding the usage of object

Specified by:
toUserString in interface IClassExtension
Parameters:
object - to diagnose
Returns:
message fragment