Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view
Interface ISystemTree

All Known Implementing Classes:
SystemView, SystemViewForm

public interface ISystemTree

To drive our GUI we find ourselves adding additional useful methods on top of the JFace tree viewer, in our subclasses. We capture those here in an interface so they can be implemented by other viewers that wish to fully drive our UI. Typically this is for interesting properties in the property sheet.

Ultimately, these are methods that AbstractTreeViewer itself should have!


Field Summary
static String Copyright
           
 
Method Summary
 boolean areAnySelectedItemsExpandable()
          Returns true if any of the selected items are expandable but not yet expanded
 boolean areAnySelectedItemsExpanded()
          Returns true if any of the selected items are currently expanded
 int getChildCount(Object element)
          Return the number of immediate children in the tree, for the given tree node
 Object[] getElementNodes(Object element)
          This returns an array containing each element in the tree, up to but not including the root.
 Object getNextElement()
          This returns the element immediately after the last selected element in this tree level Often needed for enablement decisions for move down actions.
 Object getPreviousElement()
          This returns the element immediately before the first selected element in this tree level.
 Object getRootParent()
          This is called to walk the tree back up to the roots and return the visible root node for the first selected object.
 Object getSelectedParent()
          This is called to accurately get the parent object for the current selection for this viewer.
 Item getViewerItem()
          Returns the tree item of the first selected object.
 boolean isSelectedOrChildSelected(Object parentElement)
          Helper method to determine if a given object is currently selected.
 boolean sameParent()
          This is called to ensure all elements in a multiple-selection have the same parent in the tree viewer.
 void select(Object element, boolean expand)
          Called to select an object within the tree, and optionally expand it
 void updatePropertySheet()
          Called when a property is updated and we need to inform the Property Sheet viewer.
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Method Detail

sameParent

public boolean sameParent()
This is called to ensure all elements in a multiple-selection have the same parent in the tree viewer. If they don't we automatically disable all actions.

Designed to be as fast as possible by going directly to the SWT widgets


select

public void select(Object element,
                   boolean expand)
Called to select an object within the tree, and optionally expand it


getChildCount

public int getChildCount(Object element)
Return the number of immediate children in the tree, for the given tree node


getSelectedParent

public Object getSelectedParent()
This is called to accurately get the parent object for the current selection for this viewer.

The getParent() method in the adapter is very unreliable... adapters can't be sure of the context which can change via filtering and view options.


getPreviousElement

public Object getPreviousElement()
This returns the element immediately before the first selected element in this tree level. Often needed for enablement decisions for move up actions.


getNextElement

public Object getNextElement()
This returns the element immediately after the last selected element in this tree level Often needed for enablement decisions for move down actions.


getRootParent

public Object getRootParent()
This is called to walk the tree back up to the roots and return the visible root node for the first selected object.


getElementNodes

public Object[] getElementNodes(Object element)
This returns an array containing each element in the tree, up to but not including the root. The array is in reverse order, starting at the leaf and going up.


isSelectedOrChildSelected

public boolean isSelectedOrChildSelected(Object parentElement)
Helper method to determine if a given object is currently selected. Does consider if a child node of the given object is currently selected.


updatePropertySheet

public void updatePropertySheet()
Called when a property is updated and we need to inform the Property Sheet viewer. There is no formal mechanism for this so we simulate a selection changed event as this is the only event the property sheet listens for.


getViewerItem

public Item getViewerItem()
Returns the tree item of the first selected object. Used for setViewerItem in a resource change event.


areAnySelectedItemsExpanded

public boolean areAnySelectedItemsExpanded()
Returns true if any of the selected items are currently expanded


areAnySelectedItemsExpandable

public boolean areAnySelectedItemsExpandable()
Returns true if any of the selected items are expandable but not yet expanded


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.