uk.ac.kcl.cch.jb.pliny.containmentView
Class ContainmentView

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.containmentView.ContainmentView
All Implemented Interfaces:
EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPartListener, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation, PropertyChangeListener

public class ContainmentView
extends org.eclipse.ui.part.PageBookView
implements PropertyChangeListener

This is an PageBookView that manages Pliny's Containment 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 ContainmentView, for those objects that are Pliny Resources it can generate its display. A all PageBookViews are supposed to do, it creates one instance of ContainmentViewPage 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.

Linked editors that can change their resources during their operation (identifed as being instances of IResourceChangeablePart) provide particualar challenges as the display must completely change each time the main editor changes its resource. To handle this this ViewPart will link to an editor of this type and use the service it provides to be told when a resource changes.

Author:
John Bradley
See Also:
ContainmentViewMenuProvider, ContainmentViewPage

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
ContainmentView()
           
 
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()
           
 IncludedTypeManager getTypeManager()
          gets the IncludedTypeManager in effect at present, or creates one if there is none at present, and returns it.
protected  boolean isImportant(org.eclipse.ui.IWorkbenchPart part)
           
 void partActivated(org.eclipse.ui.IWorkbenchPart part)
           
 void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
           
 void propertyChange(PropertyChangeEvent arg0)
           
 
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, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 

Constructor Detail

ContainmentView

public ContainmentView()
Method Detail

dispose

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

getTypeManager

public IncludedTypeManager getTypeManager()
gets the IncludedTypeManager in effect at present, or creates one if there is none at present, and returns it. The IncludedTypeManager controls which kind of LinkableObjects are to be displayed -- according to their LOType.

Returns:
IncludedTypeManager the current manager.

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)

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)

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

getAdapter

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

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
Specified by:
propertyChange in interface PropertyChangeListener