uk.ac.kcl.cch.jb.pliny.views
Class AnnotationView

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.ui.part.WorkbenchPart
          extended byorg.eclipse.ui.part.ViewPart
              extended byorg.eclipse.ui.part.PageBookView
                  extended byuk.ac.kcl.cch.jb.pliny.views.AnnotationView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPartListener, org.eclipse.ui.IPersistable, IResourceDrivenPart, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class AnnotationView
extends org.eclipse.ui.part.PageBookView
implements IResourceDrivenPart

This is an PageBookView that manages Pliny's Annnotation View. With PageBookViews, Eclipse provides a linking mechanism between the main editor pane and this view so that is notified each time the user changes to a new Editor on a new Object, and can change its display to synchronize with the editor pane's focus. Specifially w.r.t. this AnnotationView, for those objects that are Pliny Resources it can generate its display. As all PageBookViews are supposed to do, it creates one instance of AnnotationViewPage for each Resource it is given during its operation, and (by means of inherited code) will switch between them as the user switches betwee different Pliny Resources.

Much of the code to generate the display and lay out the data is recycled from the example project com.realpersist.gef.schemaeditor. We thank the authors of this project for their example. The code here does not, however, actually inherit any code from this project, and it need not be included in the build path for this item to work.

Author:
John Bradley
See Also:
AnnotationViewPage, PageBookView

Nested Class Summary
 
Nested classes inherited from class org.eclipse.ui.part.PageBookView
org.eclipse.ui.part.PageBookView.PageRec, org.eclipse.ui.part.PageBookView.SelectionProvider
 
Field Summary
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
AnnotationView()
           
 
Method Summary
protected  org.eclipse.ui.part.IPage createDefaultPage(org.eclipse.ui.part.PageBook book)
           
 void dispose()
           
protected  org.eclipse.ui.part.PageBookView.PageRec doCreatePage(org.eclipse.ui.IWorkbenchPart part)
           
protected  void doDestroyPage(org.eclipse.ui.IWorkbenchPart part, org.eclipse.ui.part.PageBookView.PageRec pageRecord)
           
 Object getAdapter(Class adapter)
           
protected  org.eclipse.ui.IWorkbenchPart getBootstrapPart()
           
 Resource getMyResource()
          returns the Resource that this part is currently using as its input.
protected  boolean isImportant(org.eclipse.ui.IWorkbenchPart part)
           
 void partActivated(org.eclipse.ui.IWorkbenchPart part)
           
 void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
           
 void refreshPart(org.eclipse.ui.IWorkbenchPart part)
           
 
Methods inherited from class org.eclipse.ui.part.PageBookView
createPartControl, doesPageExist, getCurrentContributingPart, getCurrentPage, getDefaultPage, getPageBook, getPageRec, getPageRec, getPageSite, getSelectionProvider, getViewAdapter, init, initPage, partBroughtToTop, partClosed, partOpened, setFocus, showPageRec
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, 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.ui.IWorkbenchPart
addPropertyListener, createPartControl, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
 

Constructor Detail

AnnotationView

public AnnotationView()
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart

createDefaultPage

protected org.eclipse.ui.part.IPage createDefaultPage(org.eclipse.ui.part.PageBook book)

doCreatePage

protected org.eclipse.ui.part.PageBookView.PageRec doCreatePage(org.eclipse.ui.IWorkbenchPart part)

partActivated

public void partActivated(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partActivated in interface org.eclipse.ui.IPartListener

partDeactivated

public void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partDeactivated in interface org.eclipse.ui.IPartListener

doDestroyPage

protected void doDestroyPage(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.ui.part.PageBookView.PageRec pageRecord)

getBootstrapPart

protected org.eclipse.ui.IWorkbenchPart getBootstrapPart()

isImportant

protected boolean isImportant(org.eclipse.ui.IWorkbenchPart part)

getAdapter

public Object getAdapter(Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

getMyResource

public Resource getMyResource()
Description copied from interface: IResourceDrivenPart
returns the Resource that this part is currently using as its input.

Specified by:
getMyResource in interface IResourceDrivenPart
Returns:
Resource

refreshPart

public void refreshPart(org.eclipse.ui.IWorkbenchPart part)