Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view
Class SystemViewPart

java.lang.Object
  extended byViewPart
      extended bycom.ibm.etools.systems.core.ui.view.SystemViewPart
All Implemented Interfaces:
EventListener, IAdapterFactory, ISystemMessageLine, ISystemPreferenceChangeListener, ISystemShellProvider

public class SystemViewPart
extends ViewPart
implements ISystemShellProvider, ISystemMessageLine, IAdapterFactory, ISystemPreferenceChangeListener

This is the desktop view wrapper of the System View viewer. ViewPart is from com.ibm.itp.ui.support.parts

See Also:
Serialized Form

Nested Class Summary
protected  class SystemViewPart.RemoteObject
           
 class SystemViewPart.RestoreStateRunnable
           
 class SystemViewPart.ToggleLinkingAction
           
 
Field Summary
protected  SystemCopyToClipboardAction _copyAction
           
protected  SystemPasteFromClipboardAction _pasteAction
           
static String copyright
           
protected  boolean doTimings
           
protected  String errorMessage
           
protected  IMemento fMemento
           
protected  FrameList frameList
           
protected  SystemViewPartGotoActionGroup gotoActionGroup
           
static String ID
           
protected  ISystemViewInputProvider input
           
protected  boolean inputIsRoot
           
protected  boolean isLinkingEnabled
           
static String MEMENTO_DELIM
           
protected  String message
           
protected  IPartListener partListener
           
protected  IAdapterManager platformManager
           
protected  SystemPreferenceQualifyConnectionNamesAction qualifyConnectionNamesAction
           
protected  SystemPreferenceRestoreStateAction restoreStateAction
           
protected  SystemPreferenceShowFilterPoolsAction showFilterPoolsAction
           
protected  IStatusLineManager statusLine
           
protected  SystemMessage sysErrorMessage
           
protected  SystemView systemView
           
protected  SystemElapsedTimer timer
           
protected  SystemViewPart.ToggleLinkingAction toggleLinkingAction
           
protected static SystemWorkWithProfilesAction wwProfilesAction
           
 
Constructor Summary
SystemViewPart()
          SystemViewPart constructor.
 
Method Summary
 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.
 IAdaptable createElement(IMemento memento)
          Given the memento created by saveState, for the input to the perspective, recreate the input object at startup time.
protected  FrameList createFrameList()
          Creates the frame source and frame list, and connects them.
 void createPartControl(Composite parent)
          Creates the SWT controls for a part.
 void dispose()
           
protected  void editorActivated(IEditorPart editor)
          An editor has been activated.
protected  void fillLocalToolBar(boolean showConnectionActions)
          Fills the local tool bar with actions.
 IActionBars getActionBars()
          Return the action bars for this view part
 Object getAdapter(Object adaptableObject, Class adapterType)
           
 Class[] getAdapterList()
           
 String getErrorMessage()
          Get the currently displayed error text.
 String getFactoryId()
          Return the element factory ID as declared in the extension point for "org.eclipse.ui.elementFactories" in plugin.xml
 FrameList getFrameList()
          Return the FrameList object for this view part
protected  String getFrameName(Object element)
          Returns the name for the given element.
protected  String getFrameToolTipText(Object element)
          Returns the tool tip text for the given element.
 SystemViewPartGotoActionGroup getGotoActionGroup()
          Return the Goto action group
protected  String getInputMementoHandle(Object o, ISystemViewElementAdapter adapter)
           
protected  ISystemViewInputProvider getInputProvider()
          Returns the initial input provider for the viewer.
protected  String getMementoHandle(Object o, ISystemViewElementAdapter adapter)
          Defer to the adapter to get 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(boolean showFilterPools, boolean showFilterStrings, String memento)
          protected method to deconstruct an expanded/selected memento into an actual object
 Shell getShell()
          Return the shell for this view part
 SystemMessage getSystemErrorMessage()
          Get the currently displayed error text.
 SystemView getSystemView()
          Easy access to the TreeViewer object
 void init(IViewSite site, IMemento memento)
          Initializes this view with the given view site.
protected  void linkToEditor(IStructuredSelection selection)
           
static void populateSystemViewPulldownMenu(IMenuManager menuMgr, Shell shell, boolean showConnectionActions, IWorkbenchPart viewPart, ISelectionProvider sp)
          Pulldown the local toolbar menu with actions
 void registerWithManager(IAdapterManager manager, Object input)
          Called by our plugin's startup method to register our adaptable object types with the platform.
protected  void restoreState(IMemento memento)
          Our own method for restoring state
protected  void saveInputState(IMemento memento)
          The workbench is closing, and we are being asked to save the state of the input object in one of the secondary perspectives.
 void saveState(IMemento memento)
          Method declared on IViewPart.
 void selectionChanged(SelectionChangedEvent e)
           
 void selectReveal(ISelection selection)
          When an element is added/deleted/changed/etc and we have focus, this method is called.
 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()
           
 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 systemPreferenceChanged(ISystemPreferenceChangeEvent event)
          This is the method in your class that will be called when a system resource changes.
 void toggleLinkingEnabled()
           
static Vector tokenize(String inputString, String delimiter)
          Parse a string into tokens.
 void unregisterWithManager(IAdapterManager manager)
          Called by our plugin's startup method to register our adaptable object types with the platform.
protected  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

systemView

protected SystemView systemView

input

protected ISystemViewInputProvider input

message

protected String message

errorMessage

protected String errorMessage

sysErrorMessage

protected SystemMessage sysErrorMessage

statusLine

protected IStatusLineManager statusLine

inputIsRoot

protected boolean inputIsRoot

doTimings

protected boolean doTimings

isLinkingEnabled

protected boolean isLinkingEnabled

timer

protected SystemElapsedTimer timer

frameList

protected FrameList frameList

gotoActionGroup

protected SystemViewPartGotoActionGroup gotoActionGroup

toggleLinkingAction

protected SystemViewPart.ToggleLinkingAction toggleLinkingAction

fMemento

protected IMemento fMemento

platformManager

protected IAdapterManager platformManager

qualifyConnectionNamesAction

protected SystemPreferenceQualifyConnectionNamesAction qualifyConnectionNamesAction

showFilterPoolsAction

protected SystemPreferenceShowFilterPoolsAction showFilterPoolsAction

restoreStateAction

protected SystemPreferenceRestoreStateAction restoreStateAction

wwProfilesAction

protected static SystemWorkWithProfilesAction wwProfilesAction

_copyAction

protected SystemCopyToClipboardAction _copyAction

_pasteAction

protected SystemPasteFromClipboardAction _pasteAction

MEMENTO_DELIM

public static final String MEMENTO_DELIM
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

partListener

protected IPartListener partListener
Constructor Detail

SystemViewPart

public SystemViewPart()
SystemViewPart constructor.

Method Detail

getSystemView

public SystemView getSystemView()
Easy access to the TreeViewer object


selectReveal

public void selectReveal(ISelection selection)
When an element is added/deleted/changed/etc and we have focus, this method is called. See SystemStaticHelpers.selectReveal method.


getFrameName

protected String getFrameName(Object element)
Returns the name for the given element. Used as the name for the current frame.


getFrameToolTipText

protected String getFrameToolTipText(Object element)
Returns the tool tip text for the given element. Used as the tool tip text for the current frame, and for the view title tooltip.


toggleLinkingEnabled

public void toggleLinkingEnabled()

editorActivated

protected void editorActivated(IEditorPart editor)
An editor has been activated. Sets the selection in this navigator to be the editor's input, if linking is enabled.

Parameters:
editor - the active editor
Since:
2.0

updateTitle

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


createPartControl

public void createPartControl(Composite parent)
Creates the SWT controls for a part. Called by Eclipse framework.


createFrameList

protected FrameList createFrameList()
Creates the frame source and frame list, and connects them.

Since:
2.0

getFrameList

public FrameList getFrameList()
Return the FrameList object for this view part

Since:
2.0

getGotoActionGroup

public SystemViewPartGotoActionGroup getGotoActionGroup()
Return the Goto action group


getShell

public Shell getShell()
Return the shell for this view part

Specified by:
getShell in interface ISystemShellProvider

getActionBars

public IActionBars getActionBars()
Return the action bars for this view part

Specified by:
getActionBars in interface ISystemShellProvider

setFocus

public void setFocus()
See Also:
IWorkbenchPart#setFocus()

selectionChanged

public void selectionChanged(SelectionChangedEvent e)

linkToEditor

protected void linkToEditor(IStructuredSelection selection)

fillLocalToolBar

protected void fillLocalToolBar(boolean showConnectionActions)
Fills the local tool bar with actions.


populateSystemViewPulldownMenu

public static void populateSystemViewPulldownMenu(IMenuManager menuMgr,
                                                  Shell shell,
                                                  boolean showConnectionActions,
                                                  IWorkbenchPart viewPart,
                                                  ISelectionProvider sp)
Pulldown the local toolbar menu with actions


dispose

public void dispose()

getInputProvider

protected ISystemViewInputProvider getInputProvider()
Returns the initial input provider for the viewer. Tries to deduce the appropriate input provider based on current input.


systemPreferenceChanged

public void systemPreferenceChanged(ISystemPreferenceChangeEvent event)
Description copied from interface: ISystemPreferenceChangeListener
This is the method in your class that will be called when a system resource changes.

Specified by:
systemPreferenceChanged in interface ISystemPreferenceChangeListener
See Also:
ISystemPreferenceChangeEvent

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

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

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,
                                  ISystemViewElementAdapter adapter)
Defer to the adapter to get the memento handle key plus the memento handle for each part leading up to the current object.


restoreState

protected void restoreState(IMemento memento)
Our own method for restoring state


getObjectFromMemento

protected Object getObjectFromMemento(boolean showFilterPools,
                                      boolean showFilterStrings,
                                      String memento)
protected method to deconstruct an expanded/selected memento into an actual object


tokenize

public static Vector tokenize(String inputString,
                              String delimiter)
Parse a string into tokens. Unlike StringTokenizer, this supports delimiter strings versus only delimiter characters


createElement

public IAdaptable createElement(IMemento memento)
Given the memento created by saveState, for the input to the perspective, recreate the input object at startup time. See the extension point for "org.eclipse.ui.elementFactories" in plugin.xml


getFactoryId

public String getFactoryId()
Return the element factory ID as declared in the extension point for "org.eclipse.ui.elementFactories" in plugin.xml


saveInputState

protected void saveInputState(IMemento memento)
The workbench is closing, and we are being asked to save the state of the input object in one of the secondary perspectives. This method is called by our saveState when it detects this is a save for the input vs a page save.


getInputMementoHandle

protected String getInputMementoHandle(Object o,
                                       ISystemViewElementAdapter adapter)

getAdapterList

public Class[] getAdapterList()
Specified by:
getAdapterList in interface IAdapterFactory
See Also:
IAdapterFactory.getAdapterList()

registerWithManager

public void registerWithManager(IAdapterManager manager,
                                Object input)
Called by our plugin's startup method to register our adaptable object types with the platform. We prefer to do it here to isolate/encapsulate all factory logic in this one place.


unregisterWithManager

public void unregisterWithManager(IAdapterManager manager)
Called by our plugin's startup method to register our adaptable object types with the platform. We prefer to do it here to isolate/encapsulate all factory logic in this one place.


getAdapter

public Object getAdapter(Object adaptableObject,
                         Class adapterType)
Specified by:
getAdapter in interface IAdapterFactory
See Also:
IAdapterFactory.getAdapter(java.lang.Object, java.lang.Class)

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.