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 String
PCMTX_FILE_EXTENSION
static String
RESOURCETYPE_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 protected
PCMTXView(String viewID, EObjectManager<?> manager, UIProvider uiProvider, String fileExtension)
Creates a newPCMTXView
with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createPartControl(Composite parent)
void
dispose()
void
doSave(IProgressMonitor monitor)
void
doSaveAs()
IResource
getCurrentResource()
Returns theIResource
currently modified by this view.protected EObjectManager<?>
getEObjectManager()
Returns theEObjectManager
the view uses for model modification.String
getViewID()
Returns the ID of thisPCMTXView
.boolean
isDirty()
boolean
isSaveAsAllowed()
boolean
isSaveOnCloseNeeded()
void
notifyActive(boolean newResourceSelected)
Notifies thisPCMTXView
that it is active.protected void
setDirty(boolean dirty)
Sets thedirty
flag to the given value.void
setFocus()
void
setResource(IResource resource)
Sets theIResource
that contains the model to work with.void
update(Observable o, Object arg)
Used to notify thePCMTXView
about changes in the dirty state of theEObjectManager
and 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 newPCMTXView
with the given parameters.- Parameters:
viewID
- the ID of this viewmanager
- theEObjectManager
this view uses to access modelsuiProvider
- theUIProvider
this 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 theIResource
currently modified by this view.- Returns:
- the
IResource
currently modified by this view
-
setResource
public void setResource(IResource resource)
Sets theIResource
that contains the model to work with.- Parameters:
resource
- theIResource
that contains the model
-
getEObjectManager
protected EObjectManager<?> getEObjectManager()
Returns theEObjectManager
the view uses for model modification.- Returns:
- the
EObjectManager
-
createPartControl
public void createPartControl(Composite parent)
- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Specified by:
createPartControl
in classWorkbenchPart
-
setFocus
public void setFocus()
- Specified by:
setFocus
in interfaceIWorkbenchPart
- Specified by:
setFocus
in classWorkbenchPart
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classWorkbenchPart
-
setDirty
protected void setDirty(boolean dirty)
Sets thedirty
flag to the given value.- Parameters:
dirty
- the new dirty state
-
doSave
public void doSave(IProgressMonitor monitor)
- Specified by:
doSave
in interfaceISaveablePart
-
doSaveAs
public void doSaveAs()
- Specified by:
doSaveAs
in interfaceISaveablePart
-
isDirty
public boolean isDirty()
- Specified by:
isDirty
in interfaceISaveablePart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()
- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
-
isSaveOnCloseNeeded
public boolean isSaveOnCloseNeeded()
- Specified by:
isSaveOnCloseNeeded
in interfaceISaveablePart
-
notifyActive
public void notifyActive(boolean newResourceSelected)
Notifies thisPCMTXView
that it is active.- Parameters:
newResourceSelected
-true
if a newIResource
is selected,false
otherwise
-
update
public void update(Observable o, Object arg)
Used to notify thePCMTXView
about changes in the dirty state of theEObjectManager
and selection or deletion of model resources.
-
-