Java Doc for AbstractTreeViewer.java in  » IDE-Eclipse » jface » org » eclipse » jface » viewers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jface » org.eclipse.jface.viewers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.jface.viewers.Viewer
      org.eclipse.jface.viewers.ContentViewer
         org.eclipse.jface.viewers.StructuredViewer
            org.eclipse.jface.viewers.ColumnViewer
               org.eclipse.jface.viewers.AbstractTreeViewer

All known Subclasses:   org.eclipse.jface.viewers.TableTreeViewer,  org.eclipse.jface.viewers.TreeViewer,
AbstractTreeViewer
abstract public class AbstractTreeViewer extends ColumnViewer (Code)
Abstract base implementation for tree-structure-oriented viewers (trees and table trees).

Nodes in the tree can be in either an expanded or a collapsed state, depending on whether the children on a node are visible. This class introduces public methods for controlling the expanding and collapsing of nodes.

As of 3.2, AbstractTreeViewer supports multiple equal elements (each with a different parent chain) in the tree. This support requires that clients enable the element map by calling setUseHashLookup(true).

Content providers for abstract tree viewers must implement one of the interfaces ITreeContentProvider or (as of 3.2, to support multiple equal elements) ITreePathContentProvider.


See Also:   TreeViewer

Inner Class :class UpdateItemSafeRunnable extends SafeRunnable

Field Summary
final public static  intALL_LEVELS
     Constant indicating that all levels of the tree should be expanded or collapsed.

Constructor Summary
protected  AbstractTreeViewer()
     Creates an abstract tree viewer.

Method Summary
public  voidadd(Object parentElementOrTreePath, Object[] childElements)
     Adds the given child elements to this viewer as children of the given parent element.
public  voidadd(Object parentElementOrTreePath, Object childElement)
     Adds the given child element to this viewer as a child of the given parent element.
protected  voidaddSelectionListener(Control control, SelectionListener listener)
     Adds the given SWT selection listener to the given SWT control.
public  voidaddTreeListener(ITreeViewerListener listener)
     Adds a listener for expand and collapse events in this viewer.
abstract protected  voidaddTreeListener(Control control, TreeListener listener)
     Adds the given SWT tree listener to the given SWT control.
protected  voidassertContentProviderType(IContentProvider provider)
    
protected  voidassociate(Object element, Item item)
    
protected  voidbuildLabel(ViewerLabel updateLabel, Object elementOrPath)
     This implementation of buildLabel handles tree paths as well as elements.
public  voidcollapseAll()
     Collapses all nodes of the viewer's tree, starting with the root.
public  voidcollapseToLevel(Object elementOrTreePath, int level)
     Collapses the subtree rooted at the given element or tree path to the given level.
protected  voidcreateChildren(Widget widget)
     Creates all children for the given widget.

The default implementation of this framework method assumes that widget.getData() returns the element corresponding to the node.

protected  voidcreateTreeItem(Widget parent, Object element, int index)
     Creates a single item for the given parent and synchronizes it with the given element.
protected  ColumnViewerEditorcreateViewerEditor()
     This implementation of AbstractTreeViewer.createViewerEditor() returns null to ensure API backwards compatibility.
protected  voiddisassociate(Item item)
     The AbstractTreeViewer implementation of this method also recurses over children of the corresponding element.
protected  WidgetdoFindInputItem(Object element)
    
protected  WidgetdoFindItem(Object element)
    
protected  intdoGetColumnCount()
     Returns the number of columns of this viewer.
protected  voiddoUpdateItem(Item item, Object element)
     Copies the attributes of the given element into the given SWT item.
protected  voiddoUpdateItem(Widget widget, Object element, boolean fullMap)
    
public  voidexpandAll()
     Expands all nodes of the viewer's tree, starting with the root.
public  voidexpandToLevel(int level)
     Expands the root of the viewer's tree to the given level.
public  voidexpandToLevel(Object elementOrTreePath, int level)
     Expands all ancestors of the given element or tree path so that the given element becomes visible in this viewer's tree control, and then expands the subtree rooted at the given element to the given level.
protected  voidfireTreeCollapsed(TreeExpansionEvent event)
     Fires a tree collapsed event.
protected  voidfireTreeExpanded(TreeExpansionEvent event)
     Fires a tree expanded event.
public  intgetAutoExpandLevel()
     Returns the auto-expand level.
protected  ItemgetChild(Widget widget, int index)
     Get the child for the widget at index.
abstract protected  Item[]getChildren(Widget widget)
     Returns the SWT child items for the given SWT widget.
protected  WidgetgetColumnViewerOwner(int columnIndex)
    
abstract protected  booleangetExpanded(Item item)
     Returns whether the given SWT item is expanded or collapsed.
public  Object[]getExpandedElements()
     Returns a list of elements corresponding to expanded nodes in this viewer's tree, including currently hidden ones that are marked as expanded but are under a collapsed ancestor.
public  booleangetExpandedState(Object elementOrTreePath)
     Returns whether the node corresponding to the given element or tree path is expanded or collapsed.
public  TreePath[]getExpandedTreePaths()
     Returns a list of tree paths corresponding to expanded nodes in this viewer's tree, including currently hidden ones that are marked as expanded but are under a collapsed ancestor.
protected  Object[]getFilteredChildren(Object parentElementOrTreePath)
    
protected  ItemgetItemAt(Point point)
     This implementation of AbstractTreeViewer.getItemAt(Point) returns null to ensure API backwards compatibility.
abstract protected  intgetItemCount(Control control)
     Returns the number of child items of the given SWT control.
abstract protected  intgetItemCount(Item item)
     Returns the number of child items of the given SWT item.
abstract protected  Item[]getItems(Item item)
     Returns the child items of the given SWT item.
protected  ItemgetNextItem(Item item, boolean includeChildren)
     Returns the item after the given item in the tree, or null if there is no next item.
protected  ObjectgetParentElement(Object elementOrTreePath)
     This method takes a tree path or an element.
abstract protected  ItemgetParentItem(Item item)
     Returns the parent item of the given item in the tree, or null if there is no parent item.
protected  ItemgetPreviousItem(Item item)
     Returns the item before the given item in the tree, or null if there is no previous item.
protected  Object[]getRawChildren(Object parentElementOrTreePath)
    
abstract protected  Item[]getSelection(Control control)
     Returns all selected items for the given SWT control.
public  ISelectiongetSelection()
     This implementation of getSelection() returns an instance of ITreeSelection.
protected  ListgetSelectionFromWidget()
    
protected  Object[]getSortedChildren(Object parentElementOrTreePath)
    
protected  TreePathgetTreePathFromItem(Item item)
     Returns the tree path for the given item.
protected  ViewerRowgetViewerRowFromItem(Widget item)
    
public  Object[]getVisibleExpandedElements()
     Gets the expanded elements that are visible to the user.
protected  voidhandleDoubleSelect(SelectionEvent event)
    
protected  voidhandleTreeCollapse(TreeEvent event)
     Handles a tree collapse event from the SWT widget.
protected  voidhandleTreeExpand(TreeEvent event)
     Handles a tree expand event from the SWT widget.
protected  voidhookControl(Control control)
    
protected  intindexForElement(Widget parent, Object element)
     Returns the index where the item should be inserted.
Parameters:
  parent - The parent widget the element will be inserted into.
Parameters:
  element - The element to insert.
protected  voidinputChanged(Object input, Object oldInput)
    
public  voidinsert(Object parentElementOrTreePath, Object element, int position)
     Inserts the given element as a new child element of the given parent element at the given position.
protected  voidinternalAdd(Widget widget, Object parentElementOrTreePath, Object[] childElements)
     Adds the given child elements to this viewer as children of the given parent element.

EXPERIMENTAL.

protected  voidinternalCollapseToLevel(Widget widget, int level)
     Recursively collapses the subtree rooted at the given widget to the given level.
protected  WidgetinternalExpand(Object elementOrPath, boolean expand)
     Tries to create a path of tree items for the given element or tree path.
protected  voidinternalExpandToLevel(Widget widget, int level)
     Recursively expands the subtree rooted at the given widget to the given level.
final protected  Widget[]internalFindItems(Object parentElementOrTreePath)
    
protected  WidgetinternalGetWidgetToSelect(Object elementOrTreePath)
     Returns the widget to be selected for the given element or tree path.
protected  voidinternalInitializeTree(Control tree)
     Initializes the tree with root items, expanding to the appropriate level if necessary.
final protected  booleaninternalIsInputOrEmptyPath(Object elementOrTreePath)
     Returns true if the given object is either the input or an empty tree path.
protected  voidinternalRefresh(Object element)
    
protected  voidinternalRefresh(Object element, boolean updateLabels)
    
protected  voidinternalRefresh(Widget widget, Object element, boolean doStruct, boolean updateLabels)
     Refreshes the tree starting at the given widget.

EXPERIMENTAL.

 voidinternalRefreshStruct(Widget widget, Object element, boolean updateLabels)
     Update the structure and recurse.
protected  voidinternalRemove(Object[] elementsOrPaths)
     Removes the given elements from this viewer.

EXPERIMENTAL.

protected  voidinternalRemove(Object parent, Object[] elements)
     Removes the given elements from this viewer, whenever those elements appear as children of the given parent.
public  booleanisExpandable(Object elementOrTreePath)
     Return whether the tree node representing the given element or path can be expanded.
protected  booleanisSameSelection(List items, Item[] current)
     Returns true if the given list and array of items refer to the same model elements.
protected  voidlabelProviderChanged()
    
abstract protected  ItemnewItem(Widget parent, int style, int index)
     Creates a new item.
public  voidremove(Object[] elementsOrTreePaths)
     Removes the given elements from this viewer.
public  voidremove(Object parent, Object[] elements)
     Removes the given elements from this viewer whenever they appear as children of the given parent element.
public  voidremove(Object elementsOrTreePaths)
     Removes the given element from the viewer.
abstract protected  voidremoveAll(Control control)
     Removes all items from the given control.
public  voidremoveTreeListener(ITreeViewerListener listener)
     Removes a listener for expand and collapse events in this viewer.
public  voidreveal(Object elementOrTreePath)
     This implementation of reveal() reveals the given element or tree path.
public  ItemscrollDown(int x, int y)
    
public  ItemscrollUp(int x, int y)
    
public  voidsetAutoExpandLevel(int level)
     Sets the auto-expand level.
public  voidsetContentProvider(IContentProvider provider)
     The AbstractTreeViewer implementation of this method checks to ensure that the content provider is an ITreeContentProvider.
abstract protected  voidsetExpanded(Item item, boolean expand)
     Sets the expand state of the given item.
public  voidsetExpandedElements(Object[] elements)
     Sets which nodes are expanded in this viewer's tree.
public  voidsetExpandedState(Object elementOrTreePath, boolean expanded)
     Sets whether the node corresponding to the given element or tree path is expanded or collapsed.
public  voidsetExpandedTreePaths(TreePath[] treePaths)
     Sets which nodes are expanded in this viewer's tree.
abstract protected  voidsetSelection(List items)
     Sets the selection to the given list of items.
protected  voidsetSelectionToWidget(List v, boolean reveal)
     This implementation of setSelectionToWidget accepts a list of elements or a list of tree paths.
protected  voidsetSelectionToWidget(ISelection selection, boolean reveal)
    
abstract protected  voidshowItem(Item item)
     Shows the given item.
protected  voidupdateChildren(Widget widget, Object parent, Object[] elementChildren)
     Updates the tree items to correspond to the child elements of the given parent element.
protected  voidupdatePlus(Item item, Object element)
     Updates the "+"/"-" icon of the tree node from the given element.

Field Detail
ALL_LEVELS
final public static int ALL_LEVELS(Code)
Constant indicating that all levels of the tree should be expanded or collapsed.
See Also:   AbstractTreeViewer.expandToLevel(int)
See Also:   AbstractTreeViewer.collapseToLevel(Object,int)




Constructor Detail
AbstractTreeViewer
protected AbstractTreeViewer()(Code)
Creates an abstract tree viewer. The viewer has no input, no content provider, a default label provider, no sorter, no filters, and has auto-expand turned off.




Method Detail
add
public void add(Object parentElementOrTreePath, Object[] childElements)(Code)
Adds the given child elements to this viewer as children of the given parent element. If this viewer does not have a sorter, the elements are added at the end of the parent's list of children in the order given; otherwise, the elements are inserted at the appropriate positions.

This method should be called (by the content provider) when elements have been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.


Parameters:
  parentElementOrTreePath - the parent element
Parameters:
  childElements - the child elements to add



add
public void add(Object parentElementOrTreePath, Object childElement)(Code)
Adds the given child element to this viewer as a child of the given parent element. If this viewer does not have a sorter, the element is added at the end of the parent's list of children; otherwise, the element is inserted at the appropriate position.

This method should be called (by the content provider) when a single element has been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model. Note that there is another method for efficiently processing the simultaneous addition of multiple elements.


Parameters:
  parentElementOrTreePath - the parent element or path
Parameters:
  childElement - the child element



addSelectionListener
protected void addSelectionListener(Control control, SelectionListener listener)(Code)
Adds the given SWT selection listener to the given SWT control.
Parameters:
  control - the SWT control
Parameters:
  listener - the SWT selection listener



addTreeListener
public void addTreeListener(ITreeViewerListener listener)(Code)
Adds a listener for expand and collapse events in this viewer. Has no effect if an identical listener is already registered.
Parameters:
  listener - a tree viewer listener



addTreeListener
abstract protected void addTreeListener(Control control, TreeListener listener)(Code)
Adds the given SWT tree listener to the given SWT control.
Parameters:
  control - the SWT control
Parameters:
  listener - the SWT tree listener



assertContentProviderType
protected void assertContentProviderType(IContentProvider provider)(Code)



associate
protected void associate(Object element, Item item)(Code)



buildLabel
protected void buildLabel(ViewerLabel updateLabel, Object elementOrPath)(Code)
This implementation of buildLabel handles tree paths as well as elements.
Parameters:
  updateLabel - the ViewerLabel to collect the result in
Parameters:
  elementOrPath - the element or tree path for which a label should be built
See Also:   org.eclipse.jface.viewers.StructuredViewer.buildLabel(org.eclipse.jface.viewers.ViewerLabeljava.lang.Object)



collapseAll
public void collapseAll()(Code)
Collapses all nodes of the viewer's tree, starting with the root. This method is equivalent to collapseToLevel(ALL_LEVELS).



collapseToLevel
public void collapseToLevel(Object elementOrTreePath, int level)(Code)
Collapses the subtree rooted at the given element or tree path to the given level.
Parameters:
  elementOrTreePath - the element or tree path
Parameters:
  level - non-negative level, or ALL_LEVELS to collapseall levels of the tree



createChildren
protected void createChildren(Widget widget)(Code)
Creates all children for the given widget.

The default implementation of this framework method assumes that widget.getData() returns the element corresponding to the node. Note: the node is not visually expanded! You may have to call parent.setExpanded(true).


Parameters:
  widget - the widget



createTreeItem
protected void createTreeItem(Widget parent, Object element, int index)(Code)
Creates a single item for the given parent and synchronizes it with the given element.
Parameters:
  parent - the parent widget
Parameters:
  element - the element
Parameters:
  index - if non-negative, indicates the position to insert the iteminto its parent



createViewerEditor
protected ColumnViewerEditor createViewerEditor()(Code)
This implementation of AbstractTreeViewer.createViewerEditor() returns null to ensure API backwards compatibility. Subclasses should override.
since:
   3.3



disassociate
protected void disassociate(Item item)(Code)
The AbstractTreeViewer implementation of this method also recurses over children of the corresponding element.



doFindInputItem
protected Widget doFindInputItem(Object element)(Code)



doFindItem
protected Widget doFindItem(Object element)(Code)



doGetColumnCount
protected int doGetColumnCount()(Code)
Returns the number of columns of this viewer.

Subclasses should overwrite this method, which has a default implementation (returning 0) for API backwards compatility reasons

the number of columns
since:
   3.3



doUpdateItem
protected void doUpdateItem(Item item, Object element)(Code)
Copies the attributes of the given element into the given SWT item.
Parameters:
  item - the SWT item
Parameters:
  element - the element



doUpdateItem
protected void doUpdateItem(Widget widget, Object element, boolean fullMap)(Code)



expandAll
public void expandAll()(Code)
Expands all nodes of the viewer's tree, starting with the root. This method is equivalent to expandToLevel(ALL_LEVELS).



expandToLevel
public void expandToLevel(int level)(Code)
Expands the root of the viewer's tree to the given level.
Parameters:
  level - non-negative level, or ALL_LEVELS to expand alllevels of the tree



expandToLevel
public void expandToLevel(Object elementOrTreePath, int level)(Code)
Expands all ancestors of the given element or tree path so that the given element becomes visible in this viewer's tree control, and then expands the subtree rooted at the given element to the given level.
Parameters:
  elementOrTreePath - the element
Parameters:
  level - non-negative level, or ALL_LEVELS to expand alllevels of the tree



fireTreeCollapsed
protected void fireTreeCollapsed(TreeExpansionEvent event)(Code)
Fires a tree collapsed event. Only listeners registered at the time this method is called are notified.
Parameters:
  event - the tree expansion event
See Also:   ITreeViewerListener.treeCollapsed



fireTreeExpanded
protected void fireTreeExpanded(TreeExpansionEvent event)(Code)
Fires a tree expanded event. Only listeners registered at the time this method is called are notified.
Parameters:
  event - the tree expansion event
See Also:   ITreeViewerListener.treeExpanded



getAutoExpandLevel
public int getAutoExpandLevel()(Code)
Returns the auto-expand level. non-negative level, or ALL_LEVELS if all levels ofthe tree are expanded automatically
See Also:   AbstractTreeViewer.setAutoExpandLevel



getChild
protected Item getChild(Widget widget, int index)(Code)
Get the child for the widget at index. Note that the default implementation is not very efficient and should be overridden if this class is implemented.
Parameters:
  widget - the widget to check
Parameters:
  index - the index of the widget Item or null if widget is not a type that cancontain items.
throws:
  ArrayIndexOutOfBoundsException - if the index is not valid.
since:
   3.1



getChildren
abstract protected Item[] getChildren(Widget widget)(Code)
Returns the SWT child items for the given SWT widget.
Parameters:
  widget - the widget the child items



getColumnViewerOwner
protected Widget getColumnViewerOwner(int columnIndex)(Code)



getExpanded
abstract protected boolean getExpanded(Item item)(Code)
Returns whether the given SWT item is expanded or collapsed.
Parameters:
  item - the item true if the item is considered expanded andfalse if collapsed



getExpandedElements
public Object[] getExpandedElements()(Code)
Returns a list of elements corresponding to expanded nodes in this viewer's tree, including currently hidden ones that are marked as expanded but are under a collapsed ancestor.

This method is typically used when preserving the interesting state of a viewer; setExpandedElements is used during the restore.

the array of expanded elements
See Also:   AbstractTreeViewer.setExpandedElements



getExpandedState
public boolean getExpandedState(Object elementOrTreePath)(Code)
Returns whether the node corresponding to the given element or tree path is expanded or collapsed.
Parameters:
  elementOrTreePath - the element true if the node is expanded, andfalse if collapsed



getExpandedTreePaths
public TreePath[] getExpandedTreePaths()(Code)
Returns a list of tree paths corresponding to expanded nodes in this viewer's tree, including currently hidden ones that are marked as expanded but are under a collapsed ancestor.

This method is typically used when preserving the interesting state of a viewer; setExpandedElements is used during the restore.

the array of expanded tree paths
See Also:   AbstractTreeViewer.setExpandedElements
since:
   3.2



getFilteredChildren
protected Object[] getFilteredChildren(Object parentElementOrTreePath)(Code)



getItemAt
protected Item getItemAt(Point point)(Code)
This implementation of AbstractTreeViewer.getItemAt(Point) returns null to ensure API backwards compatibility. Subclasses should override.
since:
   3.3



getItemCount
abstract protected int getItemCount(Control control)(Code)
Returns the number of child items of the given SWT control.
Parameters:
  control - the control the number of children



getItemCount
abstract protected int getItemCount(Item item)(Code)
Returns the number of child items of the given SWT item.
Parameters:
  item - the item the number of children



getItems
abstract protected Item[] getItems(Item item)(Code)
Returns the child items of the given SWT item.
Parameters:
  item - the item the child items



getNextItem
protected Item getNextItem(Item item, boolean includeChildren)(Code)
Returns the item after the given item in the tree, or null if there is no next item.
Parameters:
  item - the item
Parameters:
  includeChildren - true if the children are considered indetermining which item is next, and false ifsubtrees are ignored the next item, or null if none



getParentElement
protected Object getParentElement(Object elementOrTreePath)(Code)
This method takes a tree path or an element. If the argument is not a tree path, returns the parent of the given element or null if the parent is not known. If the argument is a tree path with more than one segment, returns its parent tree path, otherwise returns null.
Parameters:
  elementOrTreePath - the parent element, or parent path, or null
since:
   3.2



getParentItem
abstract protected Item getParentItem(Item item)(Code)
Returns the parent item of the given item in the tree, or null if there is no parent item.
Parameters:
  item - the item the parent item, or null if none



getPreviousItem
protected Item getPreviousItem(Item item)(Code)
Returns the item before the given item in the tree, or null if there is no previous item.
Parameters:
  item - the item the previous item, or null if none



getRawChildren
protected Object[] getRawChildren(Object parentElementOrTreePath)(Code)



getSelection
abstract protected Item[] getSelection(Control control)(Code)
Returns all selected items for the given SWT control.
Parameters:
  control - the control the list of selected items



getSelection
public ISelection getSelection()(Code)
This implementation of getSelection() returns an instance of ITreeSelection.
since:
   3.2



getSelectionFromWidget
protected List getSelectionFromWidget()(Code)



getSortedChildren
protected Object[] getSortedChildren(Object parentElementOrTreePath)(Code)



getTreePathFromItem
protected TreePath getTreePathFromItem(Item item)(Code)
Returns the tree path for the given item.
Parameters:
  item - TreePath
since:
   3.2



getViewerRowFromItem
protected ViewerRow getViewerRowFromItem(Widget item)(Code)



getVisibleExpandedElements
public Object[] getVisibleExpandedElements()(Code)
Gets the expanded elements that are visible to the user. An expanded element is only visible if the parent is expanded. the visible expanded elements
since:
   2.0



handleDoubleSelect
protected void handleDoubleSelect(SelectionEvent event)(Code)



handleTreeCollapse
protected void handleTreeCollapse(TreeEvent event)(Code)
Handles a tree collapse event from the SWT widget.
Parameters:
  event - the SWT tree event



handleTreeExpand
protected void handleTreeExpand(TreeEvent event)(Code)
Handles a tree expand event from the SWT widget.
Parameters:
  event - the SWT tree event



hookControl
protected void hookControl(Control control)(Code)



indexForElement
protected int indexForElement(Widget parent, Object element)(Code)
Returns the index where the item should be inserted.
Parameters:
  parent - The parent widget the element will be inserted into.
Parameters:
  element - The element to insert. the index of the element



inputChanged
protected void inputChanged(Object input, Object oldInput)(Code)



insert
public void insert(Object parentElementOrTreePath, Object element, int position)(Code)
Inserts the given element as a new child element of the given parent element at the given position. If this viewer has a sorter, the position is ignored and the element is inserted at the correct position in the sort order.

This method should be called (by the content provider) when elements have been added to the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.


Parameters:
  parentElementOrTreePath - the parent element, or the tree path to the parent
Parameters:
  element - the element
Parameters:
  position - a 0-based position relative to the model, or -1 to indicatethe last position
since:
   3.2



internalAdd
protected void internalAdd(Widget widget, Object parentElementOrTreePath, Object[] childElements)(Code)
Adds the given child elements to this viewer as children of the given parent element.

EXPERIMENTAL. Not to be used except by JDT. This method was added to support JDT's explorations into grouping by working sets, which requires viewers to support multiple equal elements. See bug 76482 for more details. This support will likely be removed in Eclipse 3.2 in favor of proper support for multiple equal elements.


Parameters:
  widget - the widget for the parent element
Parameters:
  parentElementOrTreePath - the parent element
Parameters:
  childElements - the child elements to add
since:
   3.1



internalCollapseToLevel
protected void internalCollapseToLevel(Widget widget, int level)(Code)
Recursively collapses the subtree rooted at the given widget to the given level.

Note that the default implementation of this method does not call setRedraw.
Parameters:
  widget - the widget
Parameters:
  level - non-negative level, or ALL_LEVELS to collapseall levels of the tree



internalExpand
protected Widget internalExpand(Object elementOrPath, boolean expand)(Code)
Tries to create a path of tree items for the given element or tree path. This method recursively walks up towards the root of the tree and in the case of an element (rather than a tree path) assumes that getParent returns the correct parent of an element.
Parameters:
  elementOrPath - the element
Parameters:
  expand - true if all nodes on the path should beexpanded, and false otherwise Widget



internalExpandToLevel
protected void internalExpandToLevel(Widget widget, int level)(Code)
Recursively expands the subtree rooted at the given widget to the given level.

Note that the default implementation of this method does not call setRedraw.
Parameters:
  widget - the widget
Parameters:
  level - non-negative level, or ALL_LEVELS to collapseall levels of the tree



internalFindItems
final protected Widget[] internalFindItems(Object parentElementOrTreePath)(Code)
Find the items for the given element of tree path
Parameters:
  parentElementOrTreePath - the element or tree path the items for that element
since:
   3.3



internalGetWidgetToSelect
protected Widget internalGetWidgetToSelect(Object elementOrTreePath)(Code)
Returns the widget to be selected for the given element or tree path.
Parameters:
  elementOrTreePath - the element or tree path to select the widget to be selected, or null if not found
since:
   3.1



internalInitializeTree
protected void internalInitializeTree(Control tree)(Code)
Initializes the tree with root items, expanding to the appropriate level if necessary.
Parameters:
  tree - the tree control
since:
   3.3



internalIsInputOrEmptyPath
final protected boolean internalIsInputOrEmptyPath(Object elementOrTreePath)(Code)
Returns true if the given object is either the input or an empty tree path.
Parameters:
  elementOrTreePath - an element which could either be the viewer's input, or a tree path true if the given object is either the input or an empty tree path,false otherwise.
since:
   3.3



internalRefresh
protected void internalRefresh(Object element)(Code)



internalRefresh
protected void internalRefresh(Object element, boolean updateLabels)(Code)



internalRefresh
protected void internalRefresh(Widget widget, Object element, boolean doStruct, boolean updateLabels)(Code)
Refreshes the tree starting at the given widget.

EXPERIMENTAL. Not to be used except by JDT. This method was added to support JDT's explorations into grouping by working sets, which requires viewers to support multiple equal elements. See bug 76482 for more details. This support will likely be removed in Eclipse 3.2 in favor of proper support for multiple equal elements.


Parameters:
  widget - the widget
Parameters:
  element - the element
Parameters:
  doStruct - true if structural changes are to be picked up,and false if only label provider changes are ofinterest
Parameters:
  updateLabels - true to update labels for existing elements,false to only update labels as needed, assumingthat labels for existing elements are unchanged.
since:
   3.1



internalRefreshStruct
void internalRefreshStruct(Widget widget, Object element, boolean updateLabels)(Code)
Update the structure and recurse. Items are updated in updateChildren, as needed.
Parameters:
  widget -
Parameters:
  element -
Parameters:
  updateLabels -



internalRemove
protected void internalRemove(Object[] elementsOrPaths)(Code)
Removes the given elements from this viewer.

EXPERIMENTAL. Not to be used except by JDT. This method was added to support JDT's explorations into grouping by working sets, which requires viewers to support multiple equal elements. See bug 76482 for more details. This support will likely be removed in Eclipse 3.2 in favor of proper support for multiple equal elements.


Parameters:
  elementsOrPaths - the elements or element paths to remove
since:
   3.1



internalRemove
protected void internalRemove(Object parent, Object[] elements)(Code)
Removes the given elements from this viewer, whenever those elements appear as children of the given parent.
Parameters:
  parent - the parent element
Parameters:
  elements - the elements to remove
since:
   3.1



isExpandable
public boolean isExpandable(Object elementOrTreePath)(Code)
Return whether the tree node representing the given element or path can be expanded. Clients should query expandability by path if the viewer's content provider is an ITreePathContentProvider .

The default implementation of this framework method calls hasChildren on this viewer's content provider. It may be overridden if necessary.


Parameters:
  elementOrTreePath - the element or path true if the tree node representing the givenelement can be expanded, or false if not



isSameSelection
protected boolean isSameSelection(List items, Item[] current)(Code)
Returns true if the given list and array of items refer to the same model elements. Order is unimportant.

This method is not intended to be overridden by subclasses.


Parameters:
  items - the list of items
Parameters:
  current - the array of items true if the refer to the same elements,false otherwise
since:
   3.1 in TreeViewer, moved to AbstractTreeViewer in 3.3



labelProviderChanged
protected void labelProviderChanged()(Code)



newItem
abstract protected Item newItem(Widget parent, int style, int index)(Code)
Creates a new item.
Parameters:
  parent - the parent widget
Parameters:
  style - SWT style bits
Parameters:
  index - if non-negative, indicates the position to insert the iteminto its parent the newly-created item



remove
public void remove(Object[] elementsOrTreePaths)(Code)
Removes the given elements from this viewer. The selection is updated if required.

This method should be called (by the content provider) when elements have been removed from the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.


Parameters:
  elementsOrTreePaths - the elements to remove



remove
public void remove(Object parent, Object[] elements)(Code)
Removes the given elements from this viewer whenever they appear as children of the given parent element. If the given elements also appear as children of some other parent, the other parent will remain unchanged. The selection is updated if required.

This method should be called (by the content provider) when elements have been removed from the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model.


Parameters:
  parent - the parent of the elements to remove
Parameters:
  elements - the elements to remove
since:
   3.2



remove
public void remove(Object elementsOrTreePaths)(Code)
Removes the given element from the viewer. The selection is updated if necessary.

This method should be called (by the content provider) when a single element has been removed from the model, in order to cause the viewer to accurately reflect the model. This method only affects the viewer, not the model. Note that there is another method for efficiently processing the simultaneous removal of multiple elements.


Parameters:
  elementsOrTreePaths - the element



removeAll
abstract protected void removeAll(Control control)(Code)
Removes all items from the given control.
Parameters:
  control - the control



removeTreeListener
public void removeTreeListener(ITreeViewerListener listener)(Code)
Removes a listener for expand and collapse events in this viewer. Has no affect if an identical listener is not registered.
Parameters:
  listener - a tree viewer listener



reveal
public void reveal(Object elementOrTreePath)(Code)
This implementation of reveal() reveals the given element or tree path.



scrollDown
public Item scrollDown(int x, int y)(Code)



scrollUp
public Item scrollUp(int x, int y)(Code)



setAutoExpandLevel
public void setAutoExpandLevel(int level)(Code)
Sets the auto-expand level. The value 0 means that there is no auto-expand; 1 means that top-level elements are expanded, but not their children; 2 means that top-level elements are expanded, and their children, but not grandchildren; and so on.

The value ALL_LEVELS means that all subtrees should be expanded.


Parameters:
  level - non-negative level, or ALL_LEVELS to expand alllevels of the tree



setContentProvider
public void setContentProvider(IContentProvider provider)(Code)
The AbstractTreeViewer implementation of this method checks to ensure that the content provider is an ITreeContentProvider.



setExpanded
abstract protected void setExpanded(Item item, boolean expand)(Code)
Sets the expand state of the given item.
Parameters:
  item - the item
Parameters:
  expand - the expand state of the item



setExpandedElements
public void setExpandedElements(Object[] elements)(Code)
Sets which nodes are expanded in this viewer's tree. The given list contains the elements that are to be expanded; all other nodes are to be collapsed.

This method is typically used when restoring the interesting state of a viewer captured by an earlier call to getExpandedElements.


Parameters:
  elements - the array of expanded elements
See Also:   AbstractTreeViewer.getExpandedElements



setExpandedState
public void setExpandedState(Object elementOrTreePath, boolean expanded)(Code)
Sets whether the node corresponding to the given element or tree path is expanded or collapsed.
Parameters:
  elementOrTreePath - the element
Parameters:
  expanded - true if the node is expanded, andfalse if collapsed



setExpandedTreePaths
public void setExpandedTreePaths(TreePath[] treePaths)(Code)
Sets which nodes are expanded in this viewer's tree. The given list contains the tree paths that are to be expanded; all other nodes are to be collapsed.

This method is typically used when restoring the interesting state of a viewer captured by an earlier call to getExpandedTreePaths.


Parameters:
  treePaths - the array of expanded tree paths
See Also:   AbstractTreeViewer.getExpandedTreePaths()
since:
   3.2



setSelection
abstract protected void setSelection(List items)(Code)
Sets the selection to the given list of items.
Parameters:
  items - list of items (element type:org.eclipse.swt.widgets.Item)



setSelectionToWidget
protected void setSelectionToWidget(List v, boolean reveal)(Code)
This implementation of setSelectionToWidget accepts a list of elements or a list of tree paths.



setSelectionToWidget
protected void setSelectionToWidget(ISelection selection, boolean reveal)(Code)



showItem
abstract protected void showItem(Item item)(Code)
Shows the given item.
Parameters:
  item - the item



updateChildren
protected void updateChildren(Widget widget, Object parent, Object[] elementChildren)(Code)
Updates the tree items to correspond to the child elements of the given parent element. If null is passed for the children, this method obtains them (only if needed).
Parameters:
  widget - the widget
Parameters:
  parent - the parent element
Parameters:
  elementChildren - the child elements, or null



updatePlus
protected void updatePlus(Item item, Object element)(Code)
Updates the "+"/"-" icon of the tree node from the given element. It calls isExpandable to determine whether an element is expandable.
Parameters:
  item - the item
Parameters:
  element - the element



Fields inherited from org.eclipse.jface.viewers.ColumnViewer
boolean busy(Code)(Java Doc)
boolean logWhenBusy(Code)(Java Doc)

Methods inherited from org.eclipse.jface.viewers.ColumnViewer
protected void applyEditorValue()(Code)(Java Doc)
public void cancelEditing()(Code)(Java Doc)
void clearLegacyEditingSetup()(Code)(Java Doc)
abstract protected ColumnViewerEditor createViewerEditor()(Code)(Java Doc)
abstract protected int doGetColumnCount()(Code)(Java Doc)
public void editElement(Object element, int column)(Code)(Java Doc)
ViewerCell getCell(Point point)(Code)(Java Doc)
public CellEditor[] getCellEditors()(Code)(Java Doc)
public ICellModifier getCellModifier()(Code)(Java Doc)
public Object[] getColumnProperties()(Code)(Java Doc)
public ColumnViewerEditor getColumnViewerEditor()(Code)(Java Doc)
abstract protected Widget getColumnViewerOwner(int columnIndex)(Code)(Java Doc)
protected Item getItem(int x, int y)(Code)(Java Doc)
abstract protected Item getItemAt(Point point)(Code)(Java Doc)
public CellLabelProvider getLabelProvider(int columnIndex)(Code)(Java Doc)
protected Object[] getRawChildren(Object parent)(Code)(Java Doc)
ViewerColumn getViewerColumn(int columnIndex)(Code)(Java Doc)
protected ViewerRow getViewerRow(Point point)(Code)(Java Doc)
abstract protected ViewerRow getViewerRowFromItem(Widget item)(Code)(Java Doc)
protected void hookControl(Control control)(Code)(Java Doc)
protected void hookEditingSupport(Control control)(Code)(Java Doc)
boolean isBusy()(Code)(Java Doc)
public boolean isCellEditorActive()(Code)(Java Doc)
public void refresh(Object element)(Code)(Java Doc)
public void refresh(Object element, boolean updateLabels)(Code)(Java Doc)
public void setCellEditors(CellEditor[] editors)(Code)(Java Doc)
public void setCellModifier(ICellModifier modifier)(Code)(Java Doc)
public void setColumnProperties(String[] columnProperties)(Code)(Java Doc)
public void setColumnViewerEditor(ColumnViewerEditor columnViewerEditor)(Code)(Java Doc)
public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)(Java Doc)
protected void triggerEditorActivationEvent(ColumnViewerEditorActivationEvent event)(Code)(Java Doc)
public void update(Object element, String[] properties)(Code)(Java Doc)
ViewerCell updateCell(ViewerRow rowItem, int column, Object element)(Code)(Java Doc)

Methods inherited from org.eclipse.jface.viewers.StructuredViewer
public void addDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc)
public void addDragSupport(int operations, Transfer[] transferTypes, DragSourceListener listener)(Code)(Java Doc)
public void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener)(Code)(Java Doc)
public void addFilter(ViewerFilter filter)(Code)(Java Doc)
public void addOpenListener(IOpenListener listener)(Code)(Java Doc)
public void addPostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
protected void assertContentProviderType(IContentProvider provider)(Code)(Java Doc)
protected void assertElementsNotNull(Object[] elements)(Code)(Java Doc)
protected void associate(Object element, Item item)(Code)(Java Doc)
protected void buildLabel(ViewerLabel updateLabel, Object element)(Code)(Java Doc)
void buildLabel(ViewerLabel updateLabel, Object element, IViewerLabelProvider labelProvider)(Code)(Java Doc)
void buildLabel(ViewerLabel updateLabel, TreePath elementPath, ITreePathLabelProvider labelProvider)(Code)(Java Doc)
void buildLabel(ViewerLabel updateLabel, Object element, ILabelProvider labelProvider)(Code)(Java Doc)
protected void disassociate(Item item)(Code)(Java Doc)
abstract protected Widget doFindInputItem(Object element)(Code)(Java Doc)
abstract protected Widget doFindItem(Object element)(Code)(Java Doc)
abstract protected void doUpdateItem(Widget item, Object element, boolean fullMap)(Code)(Java Doc)
protected boolean equals(Object elementA, Object elementB)(Code)(Java Doc)
protected Object[] filter(Object[] elements)(Code)(Java Doc)
final protected Widget findItem(Object element)(Code)(Java Doc)
final protected Widget[] findItems(Object element)(Code)(Java Doc)
protected void fireDoubleClick(DoubleClickEvent event)(Code)(Java Doc)
protected void fireOpen(OpenEvent event)(Code)(Java Doc)
protected void firePostSelectionChanged(SelectionChangedEvent event)(Code)(Java Doc)
protected ColorAndFontCollector getColorAndFontCollector()(Code)(Java Doc)
public ViewerComparator getComparator()(Code)(Java Doc)
public IElementComparer getComparer()(Code)(Java Doc)
protected Object[] getFilteredChildren(Object parent)(Code)(Java Doc)
public ViewerFilter[] getFilters()(Code)(Java Doc)
protected Item getItem(int x, int y)(Code)(Java Doc)
protected Object[] getRawChildren(Object parent)(Code)(Java Doc)
protected Object getRoot()(Code)(Java Doc)
public ISelection getSelection()(Code)(Java Doc)
abstract protected List getSelectionFromWidget()(Code)(Java Doc)
protected Object[] getSortedChildren(Object parent)(Code)(Java Doc)
public ViewerSorter getSorter()(Code)(Java Doc)
protected void handleDispose(DisposeEvent event)(Code)(Java Doc)
protected void handleDoubleSelect(SelectionEvent event)(Code)(Java Doc)
protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection)(Code)(Java Doc)
protected void handleLabelProviderChanged(LabelProviderChangedEvent event)(Code)(Java Doc)
protected void handleOpen(SelectionEvent event)(Code)(Java Doc)
protected void handlePostSelect(SelectionEvent e)(Code)(Java Doc)
protected void handleSelect(SelectionEvent event)(Code)(Java Doc)
protected boolean hasFilters()(Code)(Java Doc)
protected void hookControl(Control control)(Code)(Java Doc)
abstract protected void internalRefresh(Object element)(Code)(Java Doc)
protected void internalRefresh(Object element, boolean updateLabels)(Code)(Java Doc)
protected void internalUpdate(Widget widget, Object element, String[] properties)(Code)(Java Doc)
protected void mapElement(Object element, Widget item)(Code)(Java Doc)
protected boolean needsRefilter(Object element, String property)(Code)(Java Doc)
CustomHashtable newHashtable(int capacity)(Code)(Java Doc)
protected void preservingSelection(Runnable updateCode)(Code)(Java Doc)
void preservingSelection(Runnable updateCode, boolean reveal)(Code)(Java Doc)
public void refresh()(Code)(Java Doc)
public void refresh(boolean updateLabels)(Code)(Java Doc)
public void refresh(Object element)(Code)(Java Doc)
public void refresh(Object element, boolean updateLabels)(Code)(Java Doc)
final protected void refreshItem(Widget widget, Object element)(Code)(Java Doc)
public void removeDoubleClickListener(IDoubleClickListener listener)(Code)(Java Doc)
public void removeFilter(ViewerFilter filter)(Code)(Java Doc)
public void removeOpenListener(IOpenListener listener)(Code)(Java Doc)
public void removePostSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
public void resetFilters()(Code)(Java Doc)
abstract public void reveal(Object element)(Code)(Java Doc)
public void setComparator(ViewerComparator comparator)(Code)(Java Doc)
public void setComparer(IElementComparer comparer)(Code)(Java Doc)
public void setContentProvider(IContentProvider provider)(Code)(Java Doc)
public void setFilters(ViewerFilter[] filters)(Code)(Java Doc)
final public void setInput(Object input)(Code)(Java Doc)
public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)(Java Doc)
public void setSelection(ISelection selection, boolean reveal)(Code)(Java Doc)
abstract protected void setSelectionToWidget(List l, boolean reveal)(Code)(Java Doc)
protected void setSelectionToWidget(ISelection selection, boolean reveal)(Code)(Java Doc)
public void setSorter(ViewerSorter sorter)(Code)(Java Doc)
public void setUseHashlookup(boolean enable)(Code)(Java Doc)
public Widget testFindItem(Object element)(Code)(Java Doc)
public Widget[] testFindItems(Object element)(Code)(Java Doc)
protected void unmapAllElements()(Code)(Java Doc)
protected void unmapElement(Object element)(Code)(Java Doc)
protected void unmapElement(Object element, Widget item)(Code)(Java Doc)
public void update(Object[] elements, String[] properties)(Code)(Java Doc)
public void update(Object element, String[] properties)(Code)(Java Doc)
final protected void updateItem(Widget widget, Object element)(Code)(Java Doc)
protected void updateSelection(ISelection selection)(Code)(Java Doc)
protected boolean usingElementMap()(Code)(Java Doc)

Methods inherited from org.eclipse.jface.viewers.ContentViewer
public IContentProvider getContentProvider()(Code)(Java Doc)
public Object getInput()(Code)(Java Doc)
public IBaseLabelProvider getLabelProvider()(Code)(Java Doc)
protected void handleDispose(DisposeEvent event)(Code)(Java Doc)
protected void handleLabelProviderChanged(LabelProviderChangedEvent event)(Code)(Java Doc)
protected void hookControl(Control control)(Code)(Java Doc)
protected void labelProviderChanged()(Code)(Java Doc)
public void setContentProvider(IContentProvider contentProvider)(Code)(Java Doc)
public void setInput(Object input)(Code)(Java Doc)
public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)(Java Doc)

Fields inherited from org.eclipse.jface.viewers.Viewer
final protected static String WIDGET_DATA_KEY(Code)(Java Doc)

Methods inherited from org.eclipse.jface.viewers.Viewer
public void addHelpListener(HelpListener listener)(Code)(Java Doc)
public void addSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
protected void fireHelpRequested(HelpEvent event)(Code)(Java Doc)
protected void fireSelectionChanged(SelectionChangedEvent event)(Code)(Java Doc)
abstract public Control getControl()(Code)(Java Doc)
public Object getData(String key)(Code)(Java Doc)
abstract public Object getInput()(Code)(Java Doc)
abstract public ISelection getSelection()(Code)(Java Doc)
protected void handleHelpRequest(HelpEvent event)(Code)(Java Doc)
protected void inputChanged(Object input, Object oldInput)(Code)(Java Doc)
abstract public void refresh()(Code)(Java Doc)
public void removeHelpListener(HelpListener listener)(Code)(Java Doc)
public void removeSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
public Item scrollDown(int x, int y)(Code)(Java Doc)
public Item scrollUp(int x, int y)(Code)(Java Doc)
public void setData(String key, Object value)(Code)(Java Doc)
abstract public void setInput(Object input)(Code)(Java Doc)
public void setSelection(ISelection selection)(Code)(Java Doc)
abstract public void setSelection(ISelection selection, boolean reveal)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.