com.tssap.util.ui.reuse.tree
Class LogicalCheckedTreeViewer

java.lang.Object
  |
  +--com.tssap.util.ui.reuse.tree.LogicalCheckedTreeViewer

public class LogicalCheckedTreeViewer
extends java.lang.Object

See Also:
LogicalCheckedTreeViewer(CheckboxTreeViewer)

Inner Class Summary
 class LogicalCheckedTreeViewer.LeaveFilter
           
 
Field Summary
static int LEAVE_FILTER
          Filter type filtering all elements that are not leaves in the tree
static int LOGIC_NONE
          Normal CheckboxTree
static int LOGIC_TYPE1
          Checking a node checks all subnodes.
static int LOGIC_TYPE2
          Checking a node checks and grays all subnodes.
static int LOGIC_TYPE3
          Grayed nodes can not be checked/unchecked.
static int LOGIC_TYPE4
          Grayed nodes can not be checked/unchecked.
static int LOGIC_TYPE5
          Grayed nodes can not be checked/unchecked.
 
Constructor Summary
LogicalCheckedTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer checkboxTreeViewer)
          An instance wraps a @see CheckboxTreeViewer.
 
Method Summary
 void clearSelection()
          Clears all selections in the tree.
 void expandToLevel(int level)
          Delegation method.
 org.eclipse.jface.viewers.CheckboxTreeViewer getCheckboxTreeViewer()
          returns the wrapped CheckboxTreeViewer
 java.lang.Object[] getFilteredSelection()
          Returns the currently selected elements which are accepted by the used result filter.
 com.tssap.util.core.IFilter getResultFilter()
           
 void preCheckElements(java.lang.Object[] elements)
          Checks the specified Elements in the tree.
 void preGrayedElements(java.lang.Object[] elements)
          Sets the specified elements grayed and unchecked.
 void refreshTreeViewer()
          Delegation method.
 void setContentProvider(org.eclipse.jface.viewers.ITreeContentProvider lProvider)
          Delegation method. set the @see ITreeContentProvider for the wrapped tree.
 void setLabelProvider(org.eclipse.jface.viewers.ILabelProvider lProvider)
          Delegation method. set the @see ILabelProvider for the wrapped tree.
 void setResultFilter(com.tssap.util.core.IFilter filter)
          The selection result that may accessed via @see #getFilteredSelection() uses this prefilter
 void setResultFilterType(int filterType)
          Allows the setting of special filters. (
 void setSelectionLogicType(int type)
          Set the selection logic to be used.
 void setTreeInput(java.lang.Object treeInput)
          Delegation method. set the tree input for the wrapped tree.
 void toggleElement(java.lang.Object element)
          Simulates the user toggling the specified element
 void toggleElements(java.lang.Object[] elements)
          Simulates the user toggling the specified elements (in the order of the array)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEAVE_FILTER

public static final int LEAVE_FILTER
Filter type filtering all elements that are not leaves in the tree

LOGIC_NONE

public static final int LOGIC_NONE
Normal CheckboxTree

LOGIC_TYPE1

public static final int LOGIC_TYPE1
Checking a node checks all subnodes. A checked and grayed nodes indicates that at least one subnode is checked.

LOGIC_TYPE2

public static final int LOGIC_TYPE2
Checking a node checks and grays all subnodes. Grayed nodes can not be unchecked.

LOGIC_TYPE3

public static final int LOGIC_TYPE3
Grayed nodes can not be checked/unchecked.

LOGIC_TYPE4

public static final int LOGIC_TYPE4
Grayed nodes can not be checked/unchecked. Max one sibling can be checked (radio button behaviour on siblings)

LOGIC_TYPE5

public static final int LOGIC_TYPE5
Grayed nodes can not be checked/unchecked. Max one tree element can be checked (radio button behaviour on tree nodes)
Constructor Detail

LogicalCheckedTreeViewer

public LogicalCheckedTreeViewer(org.eclipse.jface.viewers.CheckboxTreeViewer checkboxTreeViewer)
An instance wraps a @see CheckboxTreeViewer. USERS MUST NOT USE ANY METHODS ON THE GIVEN CheckboxTreeViewer THAT ARE WRAPPED BY THIS CLASS.
Parameters:
checkboxTreeViewer - the CheckboxTreeViewer to be wrapped
Method Detail

getResultFilter

public com.tssap.util.core.IFilter getResultFilter()
Returns:
 
See Also:
setResultFilter(IFilter)

setResultFilter

public void setResultFilter(com.tssap.util.core.IFilter filter)
The selection result that may accessed via @see #getFilteredSelection() uses this prefilter
Parameters:
filter -  

setResultFilterType

public void setResultFilterType(int filterType)
Allows the setting of special filters. (@see #setResultFilter(IFilter)) Currently there is just one predefined special filter: @see #LEAVE_FILTER
Parameters:
filterType -  

getCheckboxTreeViewer

public org.eclipse.jface.viewers.CheckboxTreeViewer getCheckboxTreeViewer()
returns the wrapped CheckboxTreeViewer
Returns:
 

getFilteredSelection

public java.lang.Object[] getFilteredSelection()
Returns the currently selected elements which are accepted by the used result filter.
See Also:
setResultFilter(IFilter), org.eclipse.ui.dialogs.SelectionDialog#getResult()

clearSelection

public void clearSelection()
Clears all selections in the tree. (Uncheck all)

preCheckElements

public void preCheckElements(java.lang.Object[] elements)
Checks the specified Elements in the tree. Works like the specified Elements are checked by the user. Remark: If elements are provided which are not contained in the tree model (recived from the TreeContentProvider) they marked as selected elements and retured by getStoredChecked() method. Obviously the user has no possibility to uncheck them.

preGrayedElements

public void preGrayedElements(java.lang.Object[] elements)
Sets the specified elements grayed and unchecked. This method does not care about the tree logic
Parameters:
elements -  

refreshTreeViewer

public void refreshTreeViewer()
Delegation method. @see org.eclipse.jface.viewers.StructuredViewer#refresh()

setContentProvider

public void setContentProvider(org.eclipse.jface.viewers.ITreeContentProvider lProvider)
Delegation method. set the @see ITreeContentProvider for the wrapped tree.
Parameters:
lProvider -  

setLabelProvider

public void setLabelProvider(org.eclipse.jface.viewers.ILabelProvider lProvider)
Delegation method. set the @see ILabelProvider for the wrapped tree.
Parameters:
lProvider -  

setTreeInput

public void setTreeInput(java.lang.Object treeInput)
Delegation method. set the tree input for the wrapped tree. @see org.eclipse.jface.viewers.StructuredViewer#setInput(java.lang.Object)
Parameters:
treeInput -  

setSelectionLogicType

public void setSelectionLogicType(int type)
Set the selection logic to be used. (See class comment)
This should be called only once and befor using methods like @see #toggleElement(Object), ...
Parameters:
type - @see #LOGIC_TYPE1, ...

toggleElement

public void toggleElement(java.lang.Object element)
Simulates the user toggling the specified element
Parameters:
element -  

toggleElements

public void toggleElements(java.lang.Object[] elements)
Simulates the user toggling the specified elements (in the order of the array)
Parameters:
elements -  

expandToLevel

public void expandToLevel(int level)
Delegation method. @see org.eclipse.jface.viewers.AbstractTreeViewer#expandToLevel(int) for the wrapped tree.
Parameters:
level -  


Copyright © 2005 SAP AG. All Rights Reserved.