edu.usc.cse.desi.editor
Class AbstractPage

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.EditorPart
          extended byedu.usc.cse.desi.editor.AbstractPage
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.ui.IEditorPart, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2
Direct Known Subclasses:
DESIGraphicalPage, DESISelectionPage, DESITabularPage

public abstract class AbstractPage
extends org.eclipse.ui.part.EditorPart

Author:
Nels Started Apr 9, 2004

Field Summary
private  org.eclipse.gef.EditDomain myEditDomain
           
private  DESIEditor myEditor
           
 
Fields inherited from class org.eclipse.ui.part.EditorPart
 
Fields inherited from class org.eclipse.ui.part.WorkbenchPart
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
AbstractPage(DESIEditor top_level_editor, org.eclipse.gef.EditDomain top_level_edit_dom)
           
 
Method Summary
abstract  void createPartControl(org.eclipse.swt.widgets.Composite parent)
          This method is overridden, to make each page special.
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 org.eclipse.gef.commands.CommandStack getCommandStack()
          Returns the command stack of this page's edit domain.
 DESIViewModel getModel()
          All pages will need to use the model.
 org.eclipse.gef.EditDomain getMyEditDomain()
          Get my EditDomain, which comes from top-level editor.
 DESIEditor getMyEditor()
          Get my Editor, the editor that this page is a part of.
abstract  java.lang.String getPageName()
          What is the readable name of this page?
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
 boolean isDirty()
           
 boolean isSaveAsAllowed()
           
abstract  void modelChanged(DESIViewModel old_model, DESIViewModel new_model)
          This is an abstract method that will be called on all pages of the editor when the model has changed.
protected abstract  void registerEditPartViewer(org.eclipse.gef.EditPartViewer viewer)
          If this page has an viewer, it must be registered with the Editor and the edit domain.
abstract  void setFocus()
          Call set focus on our graphical viewer.
 void switchedTo()
          This method will be called when this page is switched to.
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, dispose, getSite, getTitle, getTitleImage, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

myEditor

private final DESIEditor myEditor

myEditDomain

private final org.eclipse.gef.EditDomain myEditDomain
Constructor Detail

AbstractPage

public AbstractPage(DESIEditor top_level_editor,
                    org.eclipse.gef.EditDomain top_level_edit_dom)
Method Detail

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)

doSaveAs

public void doSaveAs()

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
          throws org.eclipse.ui.PartInitException
Throws:
org.eclipse.ui.PartInitException

isDirty

public boolean isDirty()

isSaveAsAllowed

public boolean isSaveAsAllowed()

switchedTo

public void switchedTo()
This method will be called when this page is switched to.


createPartControl

public abstract void createPartControl(org.eclipse.swt.widgets.Composite parent)
This method is overridden, to make each page special.


getPageName

public abstract java.lang.String getPageName()
What is the readable name of this page?

Returns:
String

modelChanged

public abstract void modelChanged(DESIViewModel old_model,
                                  DESIViewModel new_model)
This is an abstract method that will be called on all pages of the editor when the model has changed.

Parameters:
new_model - DESIViewModel - The new model.
old_model - DESIViewModel - The old model.

registerEditPartViewer

protected abstract void registerEditPartViewer(org.eclipse.gef.EditPartViewer viewer)
If this page has an viewer, it must be registered with the Editor and the edit domain.

Parameters:
viewer - EditPartViewer

setFocus

public abstract void setFocus()
Call set focus on our graphical viewer. (This really only applies to the graphical viewer, as far as I can tell.


getMyEditDomain

public org.eclipse.gef.EditDomain getMyEditDomain()
Get my EditDomain, which comes from top-level editor.

Returns:

getCommandStack

public org.eclipse.gef.commands.CommandStack getCommandStack()
Returns the command stack of this page's edit domain.

Returns:

getMyEditor

public DESIEditor getMyEditor()
Get my Editor, the editor that this page is a part of.

Returns:

getModel

public DESIViewModel getModel()
All pages will need to use the model. So here it is.

Returns:
DESIViewModel