Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view.team
Class SystemTeamViewPart

java.lang.Object
  extended byViewPart
      extended bycom.ibm.etools.systems.core.ui.view.team.SystemTeamViewPart
All Implemented Interfaces:
ISystemDeleteTarget, ISystemMessageLine, ISystemModelChangeListener, ISystemRenameTarget

public class SystemTeamViewPart
extends ViewPart
implements ISystemModelChangeListener, ISystemMessageLine, ISystemDeleteTarget, ISystemRenameTarget

The viewer and view part for the Team view

See Also:
Serialized Form

Nested Class Summary
 class SystemTeamViewPart.RestoreStateRunnable
          Inner class for running restore-state in a thread
 
Field Summary
protected  SystemCollapseAllAction collapseAllAction
           
static String Copyright
           
protected  SystemCommonDeleteAction deleteAction
           
static String ID
           
protected  SystemTeamViewRefreshAllAction menuRefreshAllAction
           
protected  SystemNewProfileAction newProfileAction
           
protected  ISystemViewElementAdapter profileAdapter
           
protected  PropertyDialogAction propertyDialogAction
           
protected  SystemTeamReloadAction reloadRSEAction
           
protected  SystemTeamViewRefreshAllAction toolBarRefreshAllAction
           
 
Fields inherited from interface com.ibm.etools.systems.model.ISystemModelChangeListener
copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.messages.ISystemMessageLine
copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.ISystemDeleteTarget
copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.ISystemRenameTarget
copyright
 
Constructor Summary
SystemTeamViewPart()
           
 
Method Summary
protected  void addActions(SystemMenuManager ourMenu, IStructuredSelection selection)
          Let each object add their own actions...
 void addSelectionChangedListener(ISelectionChangedListener listener)
          Add a selection change listener
protected  void addTreeViewerListeners()
          Adds the listeners to the tree viewer.
 boolean canDelete()
          Return true if delete should be enabled based on your current selection.
 boolean canRename()
          Return true if rename should be enabled based on your current selection.
 void clearErrorMessage()
          Clears the currently displayed error message and redisplayes the message which was active before the error message was set.
 void clearMessage()
          Clears the currently displayed message.
 void createPartControl(Composite parent)
          Create the viewer to go in this view part.
 void createStandardGroups(IMenuManager menu)
          Creates the Systems plugin standard groups in a context menu.
 void dispose()
           
 boolean doDelete()
          Actually do the delete of currently selected items.
 boolean doRename(String[] newNames)
          Actually do the rename of currently selected items.
 void fillActionBars(IActionBars actionBars)
          Adds the actions in this group and its subgroups to the action bars.
protected  SystemCollapseAllAction getCollapseAllAction()
          Return the collapseAll action
protected  IAction getDeleteAction(IStructuredSelection selection)
          Rather than pre-defined this common action we wait until it is first needed, for performance reasons.
 String getErrorMessage()
          Get the currently displayed error text.
protected  IAdaptable getInput()
          Determines the input for the viewer.
protected  String getMementoHandle(Object o)
          Return the memento handle key plus the memento handle for each part leading up to the current object.
 String getMessage()
          Get the currently displayed message.
protected  ImageDescriptor getNavigatorImageDescriptor(String relativePath)
          Returns the image descriptor with the given relative path.
protected  Object getObjectFromMemento(String memento)
          Private method to deconstruct an expanded/selected memento into an actual object
 ISelection getSelection()
          Returns selection for the tree view
 Shell getShell()
          Returns the shell to use for opening dialogs.
 IStructuredSelection getStructuredSelection()
          Returns the tree viewer selection as a structured selection
 SystemMessage getSystemErrorMessage()
          Get the currently displayed error text.
 TreeViewer getTreeViewer()
           
 TreeViewer getViewer()
          Return our viewer.
protected  void handleOpen(OpenEvent event)
          Handles an open event from the viewer.
 void init(IViewSite site, IMemento memento)
          Initializes this view with the given view site.
protected  String internalGetMementoHandle(Object o)
          Encapsulate code to look at object class type and determine what to return for a memento handle
protected  String internalGetMementoHandleKey(Object o)
          Encapsulate code to look at object class type and determine what to return for a memento handle key
 void menuAboutToShow(IMenuManager menu)
          Called when the context menu is about to open.
 void removeSelectionChangedListener(ISelectionChangedListener listener)
          Remove a selection change listener
 void saveState(IMemento memento)
          Method declared on IViewPart.
 void selectionChanged(SelectionChangedEvent event)
          Handles selection changed in viewer.
 void selectReveal(ISelection selection)
          Reveal and selects the passed selection in viewer.
 void setErrorMessage(String message)
          Display the given error message.
 void setErrorMessage(SystemMessage message)
          Display the given error message.
 void setErrorMessage(Throwable exc)
          Display the given error message.
 void setFocus()
          We are getting focus
 void setMessage(String message)
          Set the message text.
 void setMessage(SystemMessage message)
          If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage
 void setSelection(ISelection selection)
           
 boolean showDelete()
          Return true if delete should even be shown in the popup menu
 boolean showRename()
          Return true if rename should even be shown in the popup menu
 void systemModelResourceChanged(ISystemModelChangeEvent event)
          This is the method in your class that will be called when a resource in the RSE model changes.
 void updateActionBars(IStructuredSelection selection)
          Updates the actions which were added to the action bars.
 void updateTitle()
          Updates the title text and title tool tip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

reloadRSEAction

protected SystemTeamReloadAction reloadRSEAction

newProfileAction

protected SystemNewProfileAction newProfileAction

deleteAction

protected SystemCommonDeleteAction deleteAction

propertyDialogAction

protected PropertyDialogAction propertyDialogAction

toolBarRefreshAllAction

protected SystemTeamViewRefreshAllAction toolBarRefreshAllAction

menuRefreshAllAction

protected SystemTeamViewRefreshAllAction menuRefreshAllAction

collapseAllAction

protected SystemCollapseAllAction collapseAllAction

profileAdapter

protected ISystemViewElementAdapter profileAdapter
Constructor Detail

SystemTeamViewPart

public SystemTeamViewPart()
Method Detail

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Remove a selection change listener


addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
Add a selection change listener


getSelection

public ISelection getSelection()
Returns selection for the tree view


setSelection

public void setSelection(ISelection selection)

getStructuredSelection

public IStructuredSelection getStructuredSelection()
Returns the tree viewer selection as a structured selection


getTreeViewer

public TreeViewer getTreeViewer()

setFocus

public void setFocus()
We are getting focus


createPartControl

public void createPartControl(Composite parent)
Create the viewer to go in this view part.


menuAboutToShow

public void menuAboutToShow(IMenuManager menu)
Called when the context menu is about to open. From IMenuListener interface Calls #fillContextMenu(IMenuManager)


init

public void init(IViewSite site,
                 IMemento memento)
          throws PartInitException
Initializes this view with the given view site. A memento is passed to the view which contains a snapshot of the views state from a previous session. Where possible, the view should try to recreate that state within the part controls.

The parent's default implementation will ignore the memento and initialize the view in a fresh state. Subclasses may override the implementation to perform any state restoration as needed.

Throws:
PartInitException

addTreeViewerListeners

protected void addTreeViewerListeners()
Adds the listeners to the tree viewer.


getShell

public Shell getShell()
Returns the shell to use for opening dialogs. Used in this class, and in the actions.


handleOpen

protected void handleOpen(OpenEvent event)
Handles an open event from the viewer. Opens an editor on the selected file.


selectReveal

public void selectReveal(ISelection selection)
Reveal and selects the passed selection in viewer.


addActions

protected void addActions(SystemMenuManager ourMenu,
                          IStructuredSelection selection)
Let each object add their own actions...


createStandardGroups

public void createStandardGroups(IMenuManager menu)
Creates the Systems plugin standard groups in a context menu.


getDeleteAction

protected IAction getDeleteAction(IStructuredSelection selection)
Rather than pre-defined this common action we wait until it is first needed, for performance reasons.


dispose

public void dispose()

getViewer

public TreeViewer getViewer()
Return our viewer.


updateTitle

public void updateTitle()
Updates the title text and title tool tip. Called whenever the input of the viewer changes.


getInput

protected IAdaptable getInput()
Determines the input for the viewer. This is needed for the "Open in New Window" action that sets the input to the workbench page, and expects the viewers to use it.


fillActionBars

public void fillActionBars(IActionBars actionBars)
Adds the actions in this group and its subgroups to the action bars.


getCollapseAllAction

protected SystemCollapseAllAction getCollapseAllAction()
Return the collapseAll action


updateActionBars

public void updateActionBars(IStructuredSelection selection)
Updates the actions which were added to the action bars.


systemModelResourceChanged

public void systemModelResourceChanged(ISystemModelChangeEvent event)
This is the method in your class that will be called when a resource in the RSE model changes. You will be called after the resource is changed.

Specified by:
systemModelResourceChanged in interface ISystemModelChangeListener
See Also:
ISystemModelChangeEvent

showDelete

public boolean showDelete()
Description copied from interface: ISystemDeleteTarget
Return true if delete should even be shown in the popup menu

Specified by:
showDelete in interface ISystemDeleteTarget

canDelete

public boolean canDelete()
Description copied from interface: ISystemDeleteTarget
Return true if delete should be enabled based on your current selection.

Specified by:
canDelete in interface ISystemDeleteTarget

doDelete

public boolean doDelete()
Description copied from interface: ISystemDeleteTarget
Actually do the delete of currently selected items. Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)

Specified by:
doDelete in interface ISystemDeleteTarget

showRename

public boolean showRename()
Description copied from interface: ISystemRenameTarget
Return true if rename should even be shown in the popup menu

Specified by:
showRename in interface ISystemRenameTarget

canRename

public boolean canRename()
Description copied from interface: ISystemRenameTarget
Return true if rename should be enabled based on your current selection.

Specified by:
canRename in interface ISystemRenameTarget

doRename

public boolean doRename(String[] newNames)
Description copied from interface: ISystemRenameTarget
Actually do the rename of currently selected items. The array of new names matches the currently selected items. Return true if it worked. Return false if it didn't (you display msg), or throw an exception (framework displays msg)

Specified by:
doRename in interface ISystemRenameTarget

getNavigatorImageDescriptor

protected ImageDescriptor getNavigatorImageDescriptor(String relativePath)
Returns the image descriptor with the given relative path.


saveState

public void saveState(IMemento memento)
Method declared on IViewPart.


getMementoHandle

protected String getMementoHandle(Object o)
Return the memento handle key plus the memento handle for each part leading up to the current object.


internalGetMementoHandleKey

protected String internalGetMementoHandleKey(Object o)
Encapsulate code to look at object class type and determine what to return for a memento handle key


internalGetMementoHandle

protected String internalGetMementoHandle(Object o)
Encapsulate code to look at object class type and determine what to return for a memento handle


getObjectFromMemento

protected Object getObjectFromMemento(String memento)
Private method to deconstruct an expanded/selected memento into an actual object


selectionChanged

public void selectionChanged(SelectionChangedEvent event)
Handles selection changed in viewer. Updates global actions. Links to editor (if option enabled)


clearErrorMessage

public void clearErrorMessage()
Clears the currently displayed error message and redisplayes the message which was active before the error message was set.

Specified by:
clearErrorMessage in interface ISystemMessageLine

clearMessage

public void clearMessage()
Clears the currently displayed message.

Specified by:
clearMessage in interface ISystemMessageLine

getErrorMessage

public String getErrorMessage()
Get the currently displayed error text.

Specified by:
getErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

getMessage

public String getMessage()
Get the currently displayed message.

Specified by:
getMessage in interface ISystemMessageLine
Returns:
The message. If no message is displayed null is returned.

setErrorMessage

public void setErrorMessage(String message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

getSystemErrorMessage

public SystemMessage getSystemErrorMessage()
Get the currently displayed error text.

Specified by:
getSystemErrorMessage in interface ISystemMessageLine
Returns:
The error message. If no error message is displayed null is returned.

setErrorMessage

public void setErrorMessage(SystemMessage message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setErrorMessage

public void setErrorMessage(Throwable exc)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.

Specified by:
setErrorMessage in interface ISystemMessageLine

setMessage

public void setMessage(String message)
Set the message text. If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage

Specified by:
setMessage in interface ISystemMessageLine

setMessage

public void setMessage(SystemMessage message)
If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage

Specified by:
setMessage in interface ISystemMessageLine

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.