org.eclipse.gmt.weaver.plugin.util
Class WeaverInterfaceUtil

java.lang.Object
  extended by org.eclipse.gmt.weaver.plugin.util.WeaverInterfaceUtil

public class WeaverInterfaceUtil
extends java.lang.Object

Util class for extension panels

Since:
1.0

Constructor Summary
WeaverInterfaceUtil()
           
 
Method Summary
static IIdentifierAdapter createGetIdentifierAdapter(org.eclipse.emf.ecore.EObject eObj)
          return the identifier adapter for generating IDs for a given object.
static org.eclipse.emf.ecore.EObject createGetWElementRef(org.eclipse.emf.ecore.EObject sourceObj, WeaverModelManager manager, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          gets (or create) a new WelementRef and generates and ID for it
static java.lang.String getNameProperty(org.eclipse.emf.ecore.EObject sourceObj)
          tries to get a name property value from an object . if it doees not exist returns its URI
static org.eclipse.emf.ecore.EObject getWModelRef(java.lang.String uri, org.eclipse.emf.ecore.resource.Resource res)
          returns the WModelRef that points to the resource passed in the URI
static org.eclipse.emf.ecore.EObject getWModelRef(java.lang.String uri, WeaverModelManager manager)
          returns the WModelRef that points to the resource passed in the URI
static void setAssociatedWLink(org.eclipse.emf.ecore.EObject wLink, org.eclipse.emf.ecore.EObject wAssociationEnd, WeaverModelManager mngr, org.eclipse.emf.edit.domain.EditingDomain domain)
          sets a new associated WLink for the specified WAssociationEnd
static void setLinkEndValueProperty(org.eclipse.emf.ecore.EObject aSource, org.eclipse.emf.ecore.EObject target, WeaverModelManager manager, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          sets the element property of the WLinkEnd object associated with the current action
static void setNewAssociationEnd(org.eclipse.emf.ecore.EObject wLink, org.eclipse.emf.ecore.EObject wAssociation, java.lang.String associationEndTypeDescr, java.lang.String referenceName, WeaverModelManager modelManager, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          creates a new WAssociationEnd for the given association and associates the WLink passed as parameter
static java.lang.Object setNewWLink(org.eclipse.emf.ecore.EObject parent, WeaverModelManager manager, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          creates a new WLink for the selected parent element
static java.lang.Object setNewWLinkEnd(org.eclipse.emf.ecore.EObject aSource, org.eclipse.emf.ecore.EObject target, java.lang.String linkEndTypeDescr, java.lang.String referenceName, WeaverModelManager manager, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          creates a new WLinkEnd for the selected WLink element
static void setWLinkEndProperties(org.eclipse.emf.ecore.EObject wLinkEnd, org.eclipse.emf.ecore.EObject elementRef, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
          sets the value of name and element feature of a WLinkEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeaverInterfaceUtil

public WeaverInterfaceUtil()
Method Detail

setAssociatedWLink

public static void setAssociatedWLink(org.eclipse.emf.ecore.EObject wLink,
                                      org.eclipse.emf.ecore.EObject wAssociationEnd,
                                      WeaverModelManager mngr,
                                      org.eclipse.emf.edit.domain.EditingDomain domain)
sets a new associated WLink for the specified WAssociationEnd

Parameters:
wLink - the wlink derived instance
wAssociationEnd - the WAssociationEnd derived instance
mngr - the model manager
domain - the editing domain

setNewWLinkEnd

public static java.lang.Object setNewWLinkEnd(org.eclipse.emf.ecore.EObject aSource,
                                              org.eclipse.emf.ecore.EObject target,
                                              java.lang.String linkEndTypeDescr,
                                              java.lang.String referenceName,
                                              WeaverModelManager manager,
                                              org.eclipse.emf.edit.domain.EditingDomain editingDomain)
creates a new WLinkEnd for the selected WLink element

Parameters:
aSource - the object to be woven
target - the WLink where the WLinkEnd will be created
linkEndTypeDescr - the type of WLinkEnd
manager -
editingDomain -
Returns:
the created WLinkEnd

setNewWLink

public static java.lang.Object setNewWLink(org.eclipse.emf.ecore.EObject parent,
                                           WeaverModelManager manager,
                                           org.eclipse.emf.edit.domain.EditingDomain editingDomain)
creates a new WLink for the selected parent element

Parameters:
parent - it might be a WModel or WLink where the WLink will be created
manager -
editingDomain -
Returns:
the created WLink

setNewAssociationEnd

public static void setNewAssociationEnd(org.eclipse.emf.ecore.EObject wLink,
                                        org.eclipse.emf.ecore.EObject wAssociation,
                                        java.lang.String associationEndTypeDescr,
                                        java.lang.String referenceName,
                                        WeaverModelManager modelManager,
                                        org.eclipse.emf.edit.domain.EditingDomain editingDomain)
creates a new WAssociationEnd for the given association and associates the WLink passed as parameter

Parameters:
wLink - the associated element
wAssociation - the association
associationEndTypeDescr - WAssociationEnd type
modelManager -
editingDomain -

setWLinkEndProperties

public static void setWLinkEndProperties(org.eclipse.emf.ecore.EObject wLinkEnd,
                                         org.eclipse.emf.ecore.EObject elementRef,
                                         org.eclipse.emf.edit.domain.EditingDomain editingDomain)
sets the value of name and element feature of a WLinkEnd

Parameters:
wLinkEnd -
elementRef - the WElementRef to be referenced in ref
editingDomain -

createGetWElementRef

public static org.eclipse.emf.ecore.EObject createGetWElementRef(org.eclipse.emf.ecore.EObject sourceObj,
                                                                 WeaverModelManager manager,
                                                                 org.eclipse.emf.edit.domain.EditingDomain editingDomain)
gets (or create) a new WelementRef and generates and ID for it

Parameters:
sourceObj - the source object
manager -
editingDomain -
Returns:
the created element
Throws:
WeaverException

getNameProperty

public static java.lang.String getNameProperty(org.eclipse.emf.ecore.EObject sourceObj)
tries to get a name property value from an object . if it doees not exist returns its URI

Parameters:
sourceObj -
Returns:

getWModelRef

public static org.eclipse.emf.ecore.EObject getWModelRef(java.lang.String uri,
                                                         WeaverModelManager manager)
returns the WModelRef that points to the resource passed in the URI

Parameters:
uri -
manager -
Returns:

getWModelRef

public static org.eclipse.emf.ecore.EObject getWModelRef(java.lang.String uri,
                                                         org.eclipse.emf.ecore.resource.Resource res)
returns the WModelRef that points to the resource passed in the URI

Parameters:
uri -
res -
Returns:

setLinkEndValueProperty

public static void setLinkEndValueProperty(org.eclipse.emf.ecore.EObject aSource,
                                           org.eclipse.emf.ecore.EObject target,
                                           WeaverModelManager manager,
                                           org.eclipse.emf.edit.domain.EditingDomain editingDomain)
sets the element property of the WLinkEnd object associated with the current action

Parameters:
aSource - the object source with a given URI
target - the WLinkEnd
manager -
editingDomain -

createGetIdentifierAdapter

public static IIdentifierAdapter createGetIdentifierAdapter(org.eclipse.emf.ecore.EObject eObj)
return the identifier adapter for generating IDs for a given object. If it does not exists creates a new XMIIdentifierAdapter.

Parameters:
eObj -
Returns: