Class EObjectManager<T extends EObject>
- java.lang.Object
-
- java.util.Observable
-
- org.palladiosimulator.pcmtx.pcmtxviews.manager.EObjectManager<T>
-
- Type Parameters:
T- The type of theEObjectthisEObjectManagermanages.
- 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 protectedEObjectManager()Creates a newEObjectManager.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the state of theEObjectManager.abstract TgetEObject()Returns theEObjectthisEObjectManagermanages.ResourceManager<T>getResourceManager()Returns theResourceManagerthisEObjectManageruses to access the model resource.booleanisDirty()Returns thedirty stateof thisEObjectManager.abstract voidreloadEObject()Reloads theEObject.voidrunLastUpdate(boolean eObjectChanges)Runs the last recognized update that modified theEObject.abstract voidsaveEObject()Persists the current EObject to a model file.voidsetDirty(boolean dirty)Sets thedirty stateof thisEObjectManager.abstract voidsetEObject(IResource resource)voidsetLastUpdate(UpdateRunnable update)Sets the last recognized update that modified theEObjectto 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- theIResourcethat contains the newEObject- Throws:
CoreException- if the operation failed.
-
getEObject
public abstract T getEObject()
Returns theEObjectthisEObjectManagermanages.- Returns:
- the
EObjectthisEObjectManagermanages.
-
reloadEObject
public abstract void reloadEObject()
Reloads theEObject.
-
saveEObject
public abstract void saveEObject() throws CoreExceptionPersists the current EObject to a model file.- Throws:
CoreException- if persisting failed.
-
getResourceManager
public ResourceManager<T> getResourceManager()
Returns theResourceManagerthisEObjectManageruses to access the model resource.- Returns:
- the
ResourceManagerthisEObjectManageruses
-
clear
public void clear()
Clears the state of theEObjectManager.
-
isDirty
public boolean isDirty()
Returns thedirty stateof thisEObjectManager.- Returns:
- the
dirty stateof this object
-
setDirty
public void setDirty(boolean dirty)
Sets thedirty stateof thisEObjectManager. Thedirty stateshould betrueif theEObjectcontains unsaved modifications,falseotherwise.- Parameters:
dirty- the newdirty state
-
runLastUpdate
public void runLastUpdate(boolean eObjectChanges)
Runs the last recognized update that modified theEObject.- Parameters:
eObjectChanges-trueif theEObjectwill change afterwards,falseotherwise
-
setLastUpdate
public void setLastUpdate(UpdateRunnable update)
Sets the last recognized update that modified theEObjectto the given one.- Parameters:
update- the new last recognized update
-
-