Project: com.ibm.rational.teamapi.scout

com.ibm.rational.teamapi.scout
Class FolderView

java.lang.Object
  extended by org.eclipse.ui.part.WorkbenchPart
      extended by org.eclipse.ui.part.ViewPart
          extended by com.ibm.rational.teamapi.scout.FolderView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class FolderView
extends org.eclipse.ui.part.ViewPart

A CM API Folder hierarchy viewer based on the Eclipse TreeViewer control. The hierarchy is determined by the CHILD_BINDING_LIST property of each folder in the view. Each element of the tree view is a ProxyElement, which wraps a CM API proxy and represents the resource referenced by that proxy. Each element implements IPropertySource, so the properties of the CM API resource can be viewed in the Eclipse property viewer simply by selecting the element in the tree view.


Field Summary
protected  org.eclipse.jface.action.Action m_addRootAction
          The Actions for implementing list management operations
private  boolean m_askForServerUrl
           
protected  org.eclipse.jface.viewers.ViewerFilter m_atLeastThreeFilter
          The ViewFilter for implementing display options
protected  org.eclipse.jface.action.Action m_foldersFirstAction
          The Actions for implementing sort options
protected  org.eclipse.jface.viewers.ViewerSorter m_foldersFirstSorter
          The ViewSorter for implementing sort options
protected  org.eclipse.jface.action.Action m_nonEmptyFolders
          The Actions for implementing display options
protected  org.eclipse.jface.action.Action m_noTypeAction
          The Actions for implementing sort options
protected  org.eclipse.jface.viewers.ViewerSorter m_noTypeSorter
          The ViewSorter for implementing sort options
protected  org.eclipse.jface.action.Action m_onlyFoldersAction
          The Actions for implementing display options
protected  org.eclipse.jface.viewers.ViewerFilter m_onlyFoldersFilter
          The ViewFilter for implementing display options
protected  org.eclipse.jface.action.Action m_refreshAction
          The Actions for implementing list management operations
protected  org.eclipse.jface.action.Action m_removeAction
          The Actions for implementing list management operations
protected  ProxyElement m_root
          The root of the tree view.
protected  org.eclipse.swt.widgets.Text m_text
          The Text for this view
protected  org.eclipse.jface.viewers.TreeViewer m_treeViewer
          The TreeViewer control on which this view is based
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
FolderView()
          The constructor.
 
Method Summary
protected  void addNewRoot()
          Raises a dialog requesting the selector for a folder resource to be added to the tree view.
protected  boolean addRoot(java.lang.String selectorString)
          Constructs a proxy for the resource named by a given selector and adds it to the tree view as a new top-level folder.
protected  boolean addRoots(java.util.List roots)
          Adds the objects in a given list to the display.
protected  void createActions()
          Creates the actions used by this view
protected  void createFiltersAndSorters()
          Creates the filtering and sort objects used to filter and sort the display
protected  void createMenus()
          Creates the menu structures needed for this view.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
protected  void createToolbar()
          Adds buttons to the tool bar for the actions defined for this view.
protected  void fillMenu(org.eclipse.jface.action.IMenuManager rootMenuManager)
          Builds the drop-down menu used for this tree view.
 java.lang.Object getInitalInput(org.eclipse.swt.widgets.Shell shell)
          Makes initial entries into the tree viewer for the sample databases and projects usually installed with ClearQuest.
protected  void hookListeners()
          Creates selection-changed listener, which keeps the label field up-to-date with the selected elements of the tree view.
protected  void refresh()
          Refreshes the child set of each selected resource.
protected  void removeRoot()
          Removes the selected object(s) from the tree view.
 void setFocus()
           
protected  void updateFilter(org.eclipse.jface.action.Action action)
          Updates the TreeViewer filters to reflect the filtering options selected by the user.
protected  void updateSorter(org.eclipse.jface.action.Action action)
          Updates the TreeViewer's sorter to match the options selected by the user in the sort sub-menu.
 
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, dispose, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, 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, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

m_treeViewer

protected org.eclipse.jface.viewers.TreeViewer m_treeViewer
The TreeViewer control on which this view is based


m_text

protected org.eclipse.swt.widgets.Text m_text
The Text for this view


m_onlyFoldersAction

protected org.eclipse.jface.action.Action m_onlyFoldersAction
The Actions for implementing display options


m_nonEmptyFolders

protected org.eclipse.jface.action.Action m_nonEmptyFolders
The Actions for implementing display options


m_foldersFirstAction

protected org.eclipse.jface.action.Action m_foldersFirstAction
The Actions for implementing sort options


m_noTypeAction

protected org.eclipse.jface.action.Action m_noTypeAction
The Actions for implementing sort options


m_addRootAction

protected org.eclipse.jface.action.Action m_addRootAction
The Actions for implementing list management operations


m_removeAction

protected org.eclipse.jface.action.Action m_removeAction
The Actions for implementing list management operations


m_refreshAction

protected org.eclipse.jface.action.Action m_refreshAction
The Actions for implementing list management operations


m_onlyFoldersFilter

protected org.eclipse.jface.viewers.ViewerFilter m_onlyFoldersFilter
The ViewFilter for implementing display options


m_atLeastThreeFilter

protected org.eclipse.jface.viewers.ViewerFilter m_atLeastThreeFilter
The ViewFilter for implementing display options


m_foldersFirstSorter

protected org.eclipse.jface.viewers.ViewerSorter m_foldersFirstSorter
The ViewSorter for implementing sort options


m_noTypeSorter

protected org.eclipse.jface.viewers.ViewerSorter m_noTypeSorter
The ViewSorter for implementing sort options


m_root

protected ProxyElement m_root
The root of the tree view.


m_askForServerUrl

private boolean m_askForServerUrl
Constructor Detail

FolderView

public FolderView()
The constructor.

Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
Parameters:
parent - The Composite that is the parent of this View.
See Also:
IWorkbenchPart.createPartControl(Composite)

createFiltersAndSorters

protected void createFiltersAndSorters()
Creates the filtering and sort objects used to filter and sort the display


hookListeners

protected void hookListeners()
Creates selection-changed listener, which keeps the label field up-to-date with the selected elements of the tree view.


createActions

protected void createActions()
Creates the actions used by this view


addNewRoot

protected void addNewRoot()
Raises a dialog requesting the selector for a folder resource to be added to the tree view. Unless canceled, by the user, the new folder is added as a root of the display.


removeRoot

protected void removeRoot()
Removes the selected object(s) from the tree view. Only root folders at the top level may be removed since all other tree view entries are derived objects.


refresh

protected void refresh()
Refreshes the child set of each selected resource. The bound member list of each selected child is reread from the repository.


createMenus

protected void createMenus()
Creates the menu structures needed for this view.


fillMenu

protected void fillMenu(org.eclipse.jface.action.IMenuManager rootMenuManager)
Builds the drop-down menu used for this tree view.

Parameters:
rootMenuManager - The menu manager that will contain the menu items.

updateSorter

protected void updateSorter(org.eclipse.jface.action.Action action)
Updates the TreeViewer's sorter to match the options selected by the user in the sort sub-menu.

Parameters:
action - The Action selected by the user.

updateFilter

protected void updateFilter(org.eclipse.jface.action.Action action)
Updates the TreeViewer filters to reflect the filtering options selected by the user.

Parameters:
action - An Action identifying the filter option that has changed.

createToolbar

protected void createToolbar()
Adds buttons to the tool bar for the actions defined for this view.


addRoot

protected boolean addRoot(java.lang.String selectorString)
Constructs a proxy for the resource named by a given selector and adds it to the tree view as a new top-level folder. The resource referenced by the selector is not accessed until the new entry is highlighted or expanded.

Parameters:
selectorString - A String containing a CM API object selector naming a resource.
Returns:
true if the resource was successfully added to the tree view.

addRoots

protected boolean addRoots(java.util.List roots)
Adds the objects in a given list to the display.

Parameters:
roots - An array of object whose toString() value is a valid object selector
Returns:
true if at least one root was added to the display.

getInitalInput

public java.lang.Object getInitalInput(org.eclipse.swt.widgets.Shell shell)
Makes initial entries into the tree viewer for the sample databases and projects usually installed with ClearQuest. Using a known server (which will have to be changed for your location), a ClearCase server is contacted and client workspaces known to the server are added as roots.

Parameters:
shell - The Shell used for display context when requesting credentials from the user.
Returns:
A ProxyElement object representing the (invisible) root of the tree to be viewed.

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.setFocus()

Generated Tue 3-Mar-2009 02:02 AM

Copyright © IBM 2009. All rights reserved.