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

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

public class ResourceExplorerView
extends org.eclipse.ui.part.ViewPart
implements IResourceTreeView

the Eclipse ViewPart for the Resource Explorer.

The Resource Explorer uses a JFace TreeViewer for most of its work. A set of objects beginning with ResourceExplorerRoot represent the model for the TreeViewer.

Note that although this code is note a GEF application, it uses GEF's command stack to manage actions, and make them undoable.

Author:
John Bradley

Field Summary
static String NAME_ID
           
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ResourceExplorerView()
           
 
Method Summary
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
           
protected  void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)
           
 org.eclipse.gef.commands.CommandStack getCommandStack()
          returns the view's CommandStack.
 org.eclipse.jface.viewers.TreeViewer getMyViewer()
          return the main tree viewer that displays items in this View.
 Vector getSelectedBaseObjects()
           
 Vector getSelectedObjectsToOpen()
          returns a Vector containing Pliny Model elements that are selected and ready to open in their own editors.
 Vector getSelectedResourceExplorerItems()
          returns a Vector containing instances of IResourceExplorerItems that are currently selected by the user.
protected  void handleKeyReleased(org.eclipse.swt.events.KeyEvent event)
           
 void setFocus()
           
 
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
addPropertyListener, firePropertyChange, getAdapter, 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.IViewPart
getViewSite, init, init, saveState
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

NAME_ID

public static final String NAME_ID
See Also:
Constant Field Values
Constructor Detail

ResourceExplorerView

public ResourceExplorerView()
Method Detail

getCommandStack

public org.eclipse.gef.commands.CommandStack getCommandStack()
Description copied from interface: IResourceTreeView
returns the view's CommandStack.

Specified by:
getCommandStack in interface IResourceTreeView
Returns:
CommandStack for the view.

dispose

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

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart

handleKeyReleased

protected void handleKeyReleased(org.eclipse.swt.events.KeyEvent event)

fillContextMenu

protected void fillContextMenu(org.eclipse.jface.action.IMenuManager manager)

getMyViewer

public org.eclipse.jface.viewers.TreeViewer getMyViewer()
Description copied from interface: IResourceTreeView
return the main tree viewer that displays items in this View.

Specified by:
getMyViewer in interface IResourceTreeView
Returns:
the main TreeViewer.

setFocus

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

getSelectedBaseObjects

public Vector getSelectedBaseObjects()

getSelectedResourceExplorerItems

public Vector getSelectedResourceExplorerItems()
Description copied from interface: IResourceTreeView
returns a Vector containing instances of IResourceExplorerItems that are currently selected by the user.

Specified by:
getSelectedResourceExplorerItems in interface IResourceTreeView
Returns:
a Vector of IResourceExplorerItems.

getSelectedObjectsToOpen

public Vector getSelectedObjectsToOpen()
Description copied from interface: IResourceTreeView
returns a Vector containing Pliny Model elements that are selected and ready to open in their own editors. This code needs to contain special handling code to take care of the special needs of items under the 'DisplayedIn' category.

Specified by:
getSelectedObjectsToOpen in interface IResourceTreeView
Returns:
Vector of Pliny Model elements