Modelers

org.topcased.modeler.utils
Class LabelHelper

java.lang.Object
  extended by org.topcased.modeler.utils.LabelHelper

public class LabelHelper
extends java.lang.Object

This helper class is used to get the name of an EObject for a given EditDomain. The class provides also utilities to find an available name to give to the newly created EObject. Created 2 juin 2005


Field Summary
static LabelHelper INSTANCE
          The singleton
 
Constructor Summary
LabelHelper()
           
 
Method Summary
 java.lang.String getDiagramPath(org.eclipse.gef.EditDomain editDomain, Diagram diagram)
          Computes the path identifying the position of a Diagram
 java.lang.String getName(org.eclipse.gef.EditDomain editDomain, EObject model)
          This class uses a custom Provider to get the name.
 void initName(org.eclipse.gef.EditDomain editDomain, EObject parentEObject, EObject childEObject)
          Initialize the name of a child EObject contained in a parent EObject within a given EditDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final LabelHelper INSTANCE
The singleton

Constructor Detail

LabelHelper

public LabelHelper()
Method Detail

initName

public void initName(org.eclipse.gef.EditDomain editDomain,
                     EObject parentEObject,
                     EObject childEObject)
Initialize the name of a child EObject contained in a parent EObject within a given EditDomain

Parameters:
editDomain - the EditDomain that contain the AdapterFactory
parentEObject - the parent EObject that will contain the child EObject
childEObject - the child EObject whose name should be initialized

getName

public java.lang.String getName(org.eclipse.gef.EditDomain editDomain,
                                EObject model)
This class uses a custom Provider to get the name. It must be implemented by the extension point that will be present in the EMF release for Eclipse 3.1

Parameters:
editDomain - the editing domain
model - the EObject
Returns:
string the LabelFeature of the EObject

getDiagramPath

public java.lang.String getDiagramPath(org.eclipse.gef.EditDomain editDomain,
                                       Diagram diagram)
Computes the path identifying the position of a Diagram

Parameters:
editDomain - the editDomain
diagram - the Diagram
Returns:
the path

Modelers

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