|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.core.model.util.ModelingUtil
public final class ModelingUtil
Utility class with static methods to handle EMF models and GEF EditParts.
Method Summary | ||
---|---|---|
static String |
fragmentUriToKielerUri(String fragmentUri,
Resource resource)
Method to get a (more readable) KIELER URI from a EMF Fragment URI and its resource. |
|
static Collection<EObject> |
getAllAncestorsByType(EClassifier eObjectClass,
EObject rootObject)
Get all objects that are direct or indirect parents of the given root EObject if they are of the given type. |
|
static Collection<EObject> |
getAllByType(EClassifier eObjectClass,
EditPart rootEditPart)
Get all objects that are direct or indirect children of the given root EObject corresponding to the given EditPart if they are of the specified type. |
|
static Collection<EObject> |
getAllByType(EClassifier eObjectClass,
EObject rootObject)
Get all objects that are direct or indirect children of the given root EObject if they are of the specified type. |
|
static EditPart |
getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep,
EObject theElement)
Find an EditPart corresponding to the given EObject in the DiagramEditPart. |
|
static EditPart |
getEditPart(EObject eObject)
Find an GEF EditPart that corresponds to an semantic model EObject. |
|
static EditPart |
getEditPart(EObject eObject,
EditPart rootEditPart)
Find an GEF EditPart that corresponds to an semantic model EObject. |
|
static EditPart |
getEditPart(IEditorPart editorPart,
EObject element)
Find an EditPart corresponding to the given EObject in an arbitrary editor. |
|
static List<EditPart> |
getEditParts(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep,
EObject theElement)
Finds ALL edit parts connected to the given semantic element. |
|
static String |
getFragmentUri(EObject eo)
Method to get the EMF Fragment URI for a given EObject. |
|
static List<EObject> |
getModelElementsFromSelection()
Returns a list of the EObjects currently selected in the diagram. |
|
static EObject |
getModelFromXtextEditor(org.eclipse.xtext.ui.editor.XtextEditor xtextEd)
Get the model from a given xtext editor. |
|
static
|
iterator2Collection(Iterator<T> iter)
Convert an Iterator to a Collection. |
|
static String |
kielerUriToFragmentUri(String kielerUri,
Resource resource)
Method to translate a KIELER URI in an EMF Fragment URI. |
|
static boolean |
packageExists(String packageClass)
Check whether a package class is registered in EMF or not |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EObject getModelFromXtextEditor(org.eclipse.xtext.ui.editor.XtextEditor xtextEd)
xtextEd
- the editor
public static EditPart getEditPart(EObject eObject, EditPart rootEditPart)
eObject
- the semantic objectrootEditPart
- the root EditPart so start the search. May be null, then the current active editor
is used
public static List<EditPart> getEditParts(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep, EObject theElement)
dep
- the root edit parttheElement
- the element to look for
public static EditPart getEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart dep, EObject theElement)
dep
- the DiagramEditPart to search intheElement
- the EObject to find
null
if none was foundpublic static EditPart getEditPart(IEditorPart editorPart, EObject element)
editorPart
- an editor partelement
- the EObject to find
null
if none was foundpublic static Collection<EObject> getAllByType(EClassifier eObjectClass, EObject rootObject)
eObjectClass
- The type of objectrootObject
- The root object
public static Collection<EObject> getAllAncestorsByType(EClassifier eObjectClass, EObject rootObject)
eObjectClass
- The type of objectrootObject
- The root object to start the search
public static Collection<EObject> getAllByType(EClassifier eObjectClass, EditPart rootEditPart)
eObjectClass
- The type of objectrootEditPart
- The root object
public static <T> Collection<T> iterator2Collection(Iterator<T> iter)
T
- the base typeiter
- The input Iterator
public static List<EObject> getModelElementsFromSelection()
public static EditPart getEditPart(EObject eObject)
eObject
- the semantic object
public static String kielerUriToFragmentUri(String kielerUri, Resource resource)
kielerUri
- The KIELER URI referring an EObject.resource
- The Resource holding the EObject.
public static String fragmentUriToKielerUri(String fragmentUri, Resource resource)
fragmentUri
- The Fragment URI from which the KIELER URI is generated (must not be null).resource
- The resource in which the referred EObject is held.
NamedObject
public static String getFragmentUri(EObject eo)
eo
- The EObject for which the URI is requested (must not be null).
public static boolean packageExists(String packageClass)
packageClass
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |