|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.common.notify.impl.AdapterImpl
com.ibm.xtools.uml.msl.internal.resources.LogicalUMLResourceProvider
public class LogicalUMLResourceProvider
Represents the provider of a logical UML resource. It manages groupings of UML resources into logical resources.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
|---|
Adapter.Internal |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl |
|---|
target |
| Method Summary | |
|---|---|
protected static void |
addChildrenUnits(LogicalUMLUnit unit)
Adds children units to the specified unit. |
protected ILogicalUMLResource |
buildLogicalResource(Resource resource)
Builds the logical resource for the specified root resource |
ILogicalUMLResource |
findLogicalResource(Resource resource)
Returns a logical UML resource for a resource even if no part of that logical resource is loaded. |
static ILogicalUMLResource |
findLogicalUMLResouce(Resource resource)
Returns a logical UML resource for a resource even if no part of that logical resource is loaded. |
static List<EObject> |
getAllContainedLoadedFragmentRoots(EObject eObj)
Returns the list of all fragments contained in the model branch rooted at the specified object. |
static List<EObject> |
getContainedFragments(EObject eObj,
boolean selfIncluded,
boolean resolve)
Returns the list of fragments contained in the model branch rooted at the specified object. |
static Resource |
getContainerResource(Resource resource)
Gets the resource referred to by a resources fragment container annotation. |
static List<ILogicalUnit> |
getFirstLevelChildren(Resource rootResource)
Returns the first level children of the specified resource. |
static EObject |
getFragmentDirectContainer(EModelElement fragmentRoot)
Returns the direct container of the fragment. |
static List<EObject> |
getFragments(EModelElement resourceRoot)
Returns fragments of the resource. |
static ILogicalUnit |
getHierarchicalStructure(Resource rootResource)
Builds and returns hierarchical structure of the logical resource. |
static LogicalUMLResourceProvider |
getInstance()
|
protected static ILogicalUMLUnit |
getInternalHierarchicalStructure(Resource rootResource)
Builds and returns the partial UML hierarchical structure of a logical resource starting at a particular resource. |
ILogicalUMLResource |
getLogicalResource(Resource resource)
Returns the logical UML resource of the specified resource. |
ILogicalUMLResource |
getLogicalResource(Resource resource,
boolean trackUnknowns)
Returns the logical UML resource of the specified resource. |
static ILogicalUMLResource |
getLogicalUMLResource(EObject eObj)
Returns the logical UML resource of the specified EObject. |
static ILogicalUMLResource |
getLogicalUMLResource(EObject eObj,
boolean trackUnknowns)
Returns the logical UML resource of the specified EObject. |
static ILogicalUMLResource |
getLogicalUMLResource(Resource resource)
Returns the logical UML resource of the specified resource. |
static Resource |
getResource(IResource resource)
Find the EMF resource of an IResource if there is one |
static EObject |
getRootContainerInResource(EObject eObject)
Finds the root container in the same resource. |
static boolean |
isFragmentable(EObject eObj)
Determines if the specified element can be moved into a fragment. |
static boolean |
isFragmentRoot(EObject eObj)
Tests if the specified object is a fragment root. |
static boolean |
isLogicalResourceRoot(EObject eObj)
Tests if the specified object is a logical resource root. |
void |
notifyChanged(Notification msg)
|
protected void |
processResourceUnloaded(Resource resource)
Processes the RESOURCE UNLOADED event. |
static void |
registerFragmentExtension(String fragmentExtension)
Registers the file extension with the provider to be considered as a logical resource fragment. |
static void |
registerRootExtension(String rootExtension)
Registers the file extension with the provider to be considered as a logical resource root. |
static void |
registerSaveProvider(ISaveProvider saveProvider)
Registers save provider. |
void |
reset(ILogicalUMLResource lResource)
Resets the list of loaded fragments of the logical resource. |
static void |
resolveNestedFragments(Resource fragment)
Resolves specified fragment's first level nested fragments. |
static void |
saveResource(ILogicalUMLResource lResource)
Saves logical resource. |
| Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl |
|---|
getTarget, isAdapterForType, setTarget, unsetTarget |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final LogicalUMLResourceProvider getInstance()
public static ILogicalUMLResource getLogicalUMLResource(Resource resource)
resource - The resource whose logical resource is returned
public ILogicalUMLResource findLogicalResource(Resource resource)
ILogicalUMLResourceAdapterUnloadedLogicalUMLResource is returned.
findLogicalResource in interface ILogicalUMLResourceAdapterresource - The resource whose logical resource is returned
public static ILogicalUMLResource findLogicalUMLResouce(Resource resource)
UnloadedLogicalUMLResource is returned.
resource - The resource whose logical resource is returned
public static Resource getContainerResource(Resource resource)
resource -
public static ILogicalUMLResource getLogicalUMLResource(EObject eObj)
eObj - The EObject whose logical resource is returned
public static ILogicalUMLResource getLogicalUMLResource(EObject eObj,
boolean trackUnknowns)
eObj - The EObject whose logical resource is returnedtrackUnknown - Indicates whether the provider should keep track of unknown resources,
if this is set to false any returned UnknownLogicalUMLResource may not be canonical.
public ILogicalUMLResource getLogicalResource(Resource resource,
boolean trackUnknowns)
getLogicalResource in interface ILogicalUMLResourceAdapterresource - The resource whose logical resource is returned. If the
resource is not loaded the fragment list is not built and the
returned logical resource can be used only as the wrapper.
Subsequent invocations for the same resource will return in
that case different instance of the logical resource.trackUnknown - Indicates whether the provider should keep track of unknown
resources, if this is set to false any returned
UnknownLogicalUMLResource may not be canonical.
public ILogicalUMLResource getLogicalResource(Resource resource)
getLogicalResource in interface ILogicalUMLResourceAdapterresource - The resource whose logical resource is returned. If the
resource is not loaded the fragment list is not built and the
returned logical resource can be used only as the wrapper.
Subsequent invocations for the same resource will return in
that case different instance of the logical resource.
public void notifyChanged(Notification msg)
notifyChanged in interface AdapternotifyChanged in class AdapterImplAdapterImpl.notifyChanged(org.eclipse.emf.common.notify.Notification)protected ILogicalUMLResource buildLogicalResource(Resource resource)
resource - The root resourceprotected void processResourceUnloaded(Resource resource)
resource - The unloaded resourcepublic void reset(ILogicalUMLResource lResource)
lResource - Logical resourcepublic static boolean isLogicalResourceRoot(EObject eObj)
eObj - Object to be tested
public static boolean isFragmentRoot(EObject eObj)
eObj - Object to be tested
public static EObject getFragmentDirectContainer(EModelElement fragmentRoot)
fragmentRoot - The fragment root
public static List<EObject> getFragments(EModelElement resourceRoot)
resourceRoot - The resource root
public static EObject getRootContainerInResource(EObject eObject)
eObject - Object whose root container is returned
public static Resource getResource(IResource resource)
resource -
public static List<EObject> getAllContainedLoadedFragmentRoots(EObject eObj)
eObj - The root of the model branch to be queried.
public static List<EObject> getContainedFragments(EObject eObj,
boolean selfIncluded,
boolean resolve)
eObj - The root of the model branch to be queried.selfIncluded - Indicates how the specified object should be considered. If
the flag is set to true and this object is a fragment root
then it is considered to be the only contained fragment root -
it is the only item in the returned list. If the flag is set
to false then there is no special behavior when the specified
element is fragment root.resolve - Indicates if the objects in the returned list should be
resolved or not. Even if it is set to 'true' the objects might
still be proxies - if they cannot be resolved.
public static void resolveNestedFragments(Resource fragment)
fragment - Fragment whose nested fragments are resolvedpublic static void registerRootExtension(String rootExtension)
rootExtension - The file extensionpublic static void registerFragmentExtension(String fragmentExtension)
fragmentExtension - The file extensionpublic static void registerSaveProvider(ISaveProvider saveProvider)
saveProvider - The save provider
public static void saveResource(ILogicalUMLResource lResource)
throws IOException
lResource - Logical resource to be saved
IOExceptionpublic static boolean isFragmentable(EObject eObj)
eObj - The element to be tested
public static ILogicalUnit getHierarchicalStructure(Resource rootResource)
protected static ILogicalUMLUnit getInternalHierarchicalStructure(Resource rootResource)
rootResource - resource to
public static List<ILogicalUnit> getFirstLevelChildren(Resource rootResource)
rootResource -
protected static void addChildrenUnits(LogicalUMLUnit unit)
unit - Logical unit whose children are calculated
|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||