Class PCMTXView
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.ViewPart
-
- org.palladiosimulator.pcmtx.pcmtxviews.views.PCMTXView
-
- All Implemented Interfaces:
Observer,IAdaptable,IExecutableExtension,IPersistable,ISaveablePart,ISaveablePart2,IViewPart,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,IWorkbenchPartOrientation
- Direct Known Subclasses:
DatabasesView,EntityTypesView,TablesView
public abstract class PCMTXView extends ViewPart implements ISaveablePart2, Observer
This abstract class represents a pcmtx view.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPCMTX_FILE_EXTENSIONstatic StringRESOURCETYPE_FILE_EXTENSION-
Fields inherited from interface org.eclipse.ui.ISaveablePart
PROP_DIRTY
-
Fields inherited from interface org.eclipse.ui.ISaveablePart2
CANCEL, DEFAULT, NO, YES
-
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPCMTXView(String viewID, EObjectManager<?> manager, UIProvider uiProvider, String fileExtension)Creates a newPCMTXViewwith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreatePartControl(Composite parent)voiddispose()voiddoSave(IProgressMonitor monitor)voiddoSaveAs()IResourcegetCurrentResource()Returns theIResourcecurrently modified by this view.protected EObjectManager<?>getEObjectManager()Returns theEObjectManagerthe view uses for model modification.StringgetViewID()Returns the ID of thisPCMTXView.booleanisDirty()booleanisSaveAsAllowed()booleanisSaveOnCloseNeeded()voidnotifyActive(boolean newResourceSelected)Notifies thisPCMTXViewthat it is active.protected voidsetDirty(boolean dirty)Sets thedirtyflag to the given value.voidsetFocus()voidsetResource(IResource resource)Sets theIResourcethat contains the model to work with.voidupdate(Observable o, Object arg)Used to notify thePCMTXViewabout changes in the dirty state of theEObjectManagerand selection or deletion of model resources.-
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Methods inherited from interface org.eclipse.ui.ISaveablePart2
promptToSaveOnClose
-
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
-
-
-
Field Detail
-
PCMTX_FILE_EXTENSION
public static final String PCMTX_FILE_EXTENSION
- See Also:
- Constant Field Values
-
RESOURCETYPE_FILE_EXTENSION
public static final String RESOURCETYPE_FILE_EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PCMTXView
protected PCMTXView(String viewID, EObjectManager<?> manager, UIProvider uiProvider, String fileExtension)
Creates a newPCMTXViewwith the given parameters.- Parameters:
viewID- the ID of this viewmanager- theEObjectManagerthis view uses to access modelsuiProvider- theUIProviderthis view uses to create the user inferfacefileExtension- the file extension of model files this view provides access to
-
-
Method Detail
-
getViewID
public String getViewID()
Returns the ID of thisPCMTXView.- Returns:
- the ID of this
PCMTXView
-
getCurrentResource
public IResource getCurrentResource()
Returns theIResourcecurrently modified by this view.- Returns:
- the
IResourcecurrently modified by this view
-
setResource
public void setResource(IResource resource)
Sets theIResourcethat contains the model to work with.- Parameters:
resource- theIResourcethat contains the model
-
getEObjectManager
protected EObjectManager<?> getEObjectManager()
Returns theEObjectManagerthe view uses for model modification.- Returns:
- the
EObjectManager
-
createPartControl
public void createPartControl(Composite parent)
- Specified by:
createPartControlin interfaceIWorkbenchPart- Specified by:
createPartControlin classWorkbenchPart
-
setFocus
public void setFocus()
- Specified by:
setFocusin interfaceIWorkbenchPart- Specified by:
setFocusin classWorkbenchPart
-
dispose
public void dispose()
- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classWorkbenchPart
-
setDirty
protected void setDirty(boolean dirty)
Sets thedirtyflag to the given value.- Parameters:
dirty- the new dirty state
-
doSave
public void doSave(IProgressMonitor monitor)
- Specified by:
doSavein interfaceISaveablePart
-
doSaveAs
public void doSaveAs()
- Specified by:
doSaveAsin interfaceISaveablePart
-
isDirty
public boolean isDirty()
- Specified by:
isDirtyin interfaceISaveablePart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowedin interfaceISaveablePart
-
isSaveOnCloseNeeded
public boolean isSaveOnCloseNeeded()
- Specified by:
isSaveOnCloseNeededin interfaceISaveablePart
-
notifyActive
public void notifyActive(boolean newResourceSelected)
Notifies thisPCMTXViewthat it is active.- Parameters:
newResourceSelected-trueif a newIResourceis selected,falseotherwise
-
update
public void update(Observable o, Object arg)
Used to notify thePCMTXViewabout changes in the dirty state of theEObjectManagerand selection or deletion of model resources.
-
-