|
|||||||||
| Home >> All >> org >> eclipse >> ui >> [ part overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.ui.part
Class DrillDownAdapter

java.lang.Objectorg.eclipse.ui.part.DrillDownAdapter
- All Implemented Interfaces:
- org.eclipse.jface.viewers.ISelectionChangedListener
- public class DrillDownAdapter
- extends java.lang.Object
- implements org.eclipse.jface.viewers.ISelectionChangedListener
- extends java.lang.Object
Implements a simple web style navigation metaphor for a TreeViewer.
Home, back, and "drill into" functions are supported for the viewer,
To use the DrillDownAdapter ..
- Create an instance of
TreeViewer. - Create a
DrillDownAdapterfor the viewer. - Create a container for your viewer with a toolbar or a popup menu. Add actions for "goBack", "goHome", and "goInto" to either one by calling addNavigationActions with the popup menu or toolbar.
If the input for the underlying viewer is changed by something other than the
adapter the reset method should be called. This will clear
the drill stack and update the navigation buttons to reflect the new
state of the underlying viewer.
| Field Summary | |
private org.eclipse.jface.action.Action |
backAction
|
private org.eclipse.jface.viewers.TreeViewer |
fChildTree
|
private DrillStack |
fDrillStack
|
private org.eclipse.jface.action.Action |
forwardAction
|
private org.eclipse.jface.action.Action |
homeAction
|
| Constructor Summary | |
DrillDownAdapter(org.eclipse.jface.viewers.TreeViewer tree)
Allocates a new DrillDownTreePart. |
|
| Method Summary | |
void |
addNavigationActions(org.eclipse.jface.action.IMenuManager manager)
Adds actions for "go back", "go home", and "go into" to a menu manager. |
void |
addNavigationActions(org.eclipse.jface.action.IToolBarManager toolBar)
Adds actions for "go back", "go home", and "go into" to a tool bar manager. |
boolean |
canExpand(java.lang.Object element)
Returns whether expansion is possible for the current selection. |
boolean |
canGoBack()
Returns whether "go back" is possible for child tree. |
boolean |
canGoHome()
Returns whether "go home" is possible for child tree. |
boolean |
canGoInto()
Returns whether "go into" is possible for child tree. |
private void |
createActions()
Create the actions for navigation. |
private void |
expand(java.util.List items)
Expands the given items in the tree. |
private java.util.List |
getExpanded()
Returns a list of elements corresponding to expanded nodes in child tree. |
void |
goBack()
Reverts the input for the tree back to the state when goInto
was last called. |
void |
goHome()
Reverts the input for the tree back to the state when the adapter was created. |
void |
goInto()
Sets the input for the tree to the current selection. |
void |
goInto(java.lang.Object newInput)
Sets the input for the tree to a particular item in the tree. |
void |
reset()
Resets the drill down adapter. |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Updates the navigation buttons when a selection change occurs in the tree. |
protected void |
updateNavigationButtons()
Updates the enabled state for each navigation button. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
fChildTree
private org.eclipse.jface.viewers.TreeViewer fChildTree
fDrillStack
private DrillStack fDrillStack
homeAction
private org.eclipse.jface.action.Action homeAction
backAction
private org.eclipse.jface.action.Action backAction
forwardAction
private org.eclipse.jface.action.Action forwardAction
| Constructor Detail |
DrillDownAdapter
public DrillDownAdapter(org.eclipse.jface.viewers.TreeViewer tree)
- Allocates a new DrillDownTreePart.
| Method Detail |
addNavigationActions
public void addNavigationActions(org.eclipse.jface.action.IMenuManager manager)
- Adds actions for "go back", "go home", and "go into" to a menu manager.
addNavigationActions
public void addNavigationActions(org.eclipse.jface.action.IToolBarManager toolBar)
- Adds actions for "go back", "go home", and "go into" to a tool bar manager.
canExpand
public boolean canExpand(java.lang.Object element)
- Returns whether expansion is possible for the current selection. This
will only be true if it has children.
canGoBack
public boolean canGoBack()
- Returns whether "go back" is possible for child tree. This is only possible
if the client has performed one or more drilling operations.
canGoHome
public boolean canGoHome()
- Returns whether "go home" is possible for child tree. This is only possible
if the client has performed one or more drilling operations.
canGoInto
public boolean canGoInto()
- Returns whether "go into" is possible for child tree. This is only possible
if the current selection in the client has one item and it has children.
createActions
private void createActions()
- Create the actions for navigation.
expand
private void expand(java.util.List items)
- Expands the given items in the tree. The list of items passed should be
derived by calling
getExpanded.
getExpanded
private java.util.List getExpanded()
- Returns a list of elements corresponding to expanded nodes in
child tree.
goBack
public void goBack()
- Reverts the input for the tree back to the state when
goIntowas last called.A frame is removed from the drill stack. Then that frame is used to reset the input and expansion state for the child tree.
goHome
public void goHome()
- Reverts the input for the tree back to the state when the adapter was
created.
All of the frames are removed from the drill stack. Then the oldest frame is used to reset the input and expansion state for the child tree.
goInto
public void goInto()
- Sets the input for the tree to the current selection.
The current input and expansion state are saved in a frame and added to the drill stack. Then the input for the tree is changed to be the current selection. The expansion state for the tree is maintained during the operation.
On return the client may revert back to the previous state by invoking
goBackorgoHome.
goInto
public void goInto(java.lang.Object newInput)
- Sets the input for the tree to a particular item in the tree.
The current input and expansion state are saved in a frame and added to the drill stack. Then the input for the tree is changed to be
newInput. The expansion state for the tree is maintained during the operation.On return the client may revert back to the previous state by invoking
goBackorgoHome.
reset
public void reset()
- Resets the drill down adapter.
This method is typically called when the input for the underlying view is reset by something other than the adapter. On return the drill stack has been cleared and the navigation buttons reflect the new state of the underlying viewer.
selectionChanged
public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
- Updates the navigation buttons when a selection change occurs
in the tree.
- Specified by:
selectionChangedin interfaceorg.eclipse.jface.viewers.ISelectionChangedListener
updateNavigationButtons
protected void updateNavigationButtons()
- Updates the enabled state for each navigation button.
|
|||||||||
| Home >> All >> org >> eclipse >> ui >> [ part overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.eclipse.ui.part.DrillDownAdapter