Class EObjectManager<T extends EObject>
- java.lang.Object
-
- java.util.Observable
-
- org.palladiosimulator.pcmtx.pcmtxviews.manager.EObjectManager<T>
-
- Type Parameters:
T
- The type of theEObject
thisEObjectManager
manages.
- All Implemented Interfaces:
Observer
- Direct Known Subclasses:
DataRepositoryManager
,ResourceRepositoryManager
public abstract class EObjectManager<T extends EObject> extends Observable implements Observer
This abstract class represents a manager for anEObject
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EObjectManager()
Creates a newEObjectManager
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the state of theEObjectManager
.abstract T
getEObject()
Returns theEObject
thisEObjectManager
manages.ResourceManager<T>
getResourceManager()
Returns theResourceManager
thisEObjectManager
uses to access the model resource.boolean
isDirty()
Returns thedirty state
of thisEObjectManager
.abstract void
reloadEObject()
Reloads theEObject
.void
runLastUpdate(boolean eObjectChanges)
Runs the last recognized update that modified theEObject
.abstract void
saveEObject()
Persists the current EObject to a model file.void
setDirty(boolean dirty)
Sets thedirty state
of thisEObjectManager
.abstract void
setEObject(IResource resource)
void
setLastUpdate(UpdateRunnable update)
Sets the last recognized update that modified theEObject
to the given one.-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Method Detail
-
setEObject
public abstract void setEObject(IResource resource) throws CoreException
- Parameters:
resource
- theIResource
that contains the newEObject
- Throws:
CoreException
- if the operation failed.
-
getEObject
public abstract T getEObject()
Returns theEObject
thisEObjectManager
manages.- Returns:
- the
EObject
thisEObjectManager
manages.
-
reloadEObject
public abstract void reloadEObject()
Reloads theEObject
.
-
saveEObject
public abstract void saveEObject() throws CoreException
Persists the current EObject to a model file.- Throws:
CoreException
- if persisting failed.
-
getResourceManager
public ResourceManager<T> getResourceManager()
Returns theResourceManager
thisEObjectManager
uses to access the model resource.- Returns:
- the
ResourceManager
thisEObjectManager
uses
-
clear
public void clear()
Clears the state of theEObjectManager
.
-
isDirty
public boolean isDirty()
Returns thedirty state
of thisEObjectManager
.- Returns:
- the
dirty state
of this object
-
setDirty
public void setDirty(boolean dirty)
Sets thedirty state
of thisEObjectManager
. Thedirty state
should betrue
if theEObject
contains unsaved modifications,false
otherwise.- Parameters:
dirty
- the newdirty state
-
runLastUpdate
public void runLastUpdate(boolean eObjectChanges)
Runs the last recognized update that modified theEObject
.- Parameters:
eObjectChanges
-true
if theEObject
will change afterwards,false
otherwise
-
setLastUpdate
public void setLastUpdate(UpdateRunnable update)
Sets the last recognized update that modified theEObject
to the given one.- Parameters:
update
- the new last recognized update
-
-