com.tssap.util.ui.dialog
Class StructuredObjectSelectionDialog

com.tssap.util.ui.dialog.StructuredObjectSelectionDialog
Direct Known Subclasses:
StructuredObjSelectionDialogWithAdditionalFeatures

public class StructuredObjectSelectionDialog


Field Summary
static int TREELOGIC_NONE
          Normal CheckboxTree
static int TREELOGIC_TYPE1
           
static int TREELOGIC_TYPE2
           
static int TREELOGIC_TYPE3
           
static int TREELOGIC_TYPE4
           
static int TREELOGIC_TYPE5
           
 
Constructor Summary
StructuredObjectSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String title, java.lang.String message)
          Creates a new instance of the Dialog.
 
Method Summary
 org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
          Returns the used TreeContentProvider providing the Objects the UI user can choose from
 java.lang.Object[] getResult()
           
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, boolean returnLeaves)
          Basic open method.
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, boolean returnLeaves, int treeLogicType)
          Like @see #openDialog(ITreeContentProvider, boolean) with a possibillity to use a special checking logic in the tree.
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, com.tssap.util.core.IFilter filter)
          Like @see #openDialog(ITreeContentProvider, boolean) with an other prefilter method.
The returned array contains all elements selected by the user AND accepted by the given filter
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, com.tssap.util.core.IFilter filter, int treeLogicType)
          Like @see #openDialog(ITreeContentProvider, IFilter) with a possibillity to use a special checking logic in the tree.
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, java.lang.Object[] selectableElements)
          Like @see #openDialog(ITreeContentProvider, boolean) with an other prefilter method The returned array contains all elements selected by the user AND are contained in the given selectableElements parameter.
 java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, java.lang.Object[] selectableElements, int treeLogicType)
          Like @see #openDialog(ITreeContentProvider, Object[]) with a possibillity to use a special checking logic in the tree.
 java.lang.Object[] openPreFilteredDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, java.lang.Object[] unselectableElements)
          Like @see #openDialog(ITreeContentProvider, Object[]) with the difference that the given unselectableElements are diplayed grayed in the tree and are not checkable for the UI user
 java.lang.Object[] openPreFilteredSingleSiblingDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp, java.lang.Object[] unselectableElements)
          Like @see #openPreFilteredDialog(ITreeContentProvider, Object[]) with the difference that a special tree logic only allows to select one sibling in the tree (radio buttopn behaviour of siblings)
 void refreshTreeViewer()
          Refreshes the TreeViewer diplaying the choosabel actions.
 void setExpandTreeLevel(int level)
          On opening of the dialog the tree will be expanded to the given level.
 void setLabelProvider(org.eclipse.jface.viewers.ILabelProvider lProvider)
          The @see ILabelProvider to be used in the presentation of the Objects to choose from.
 void setPreGrayedObjects(java.lang.Object[] grayedObjs)
          On opening of the Dialog the specified Elements are grayed in the tree.
 void setPreSelectedObjects(java.lang.Object[] selectedObjs)
          On opening of the Dialog the specified Elements are checked in the tree.
 void setTreeInput(java.lang.Object treeContentProviderInput)
          This is not a delegation method.
 

Field Detail

TREELOGIC_NONE

public static final int TREELOGIC_NONE
Normal CheckboxTree

TREELOGIC_TYPE1

public static final int TREELOGIC_TYPE1
See Also:
LogicalCheckedTreeViewer.LOGIC_TYPE1

TREELOGIC_TYPE2

public static final int TREELOGIC_TYPE2
See Also:
LogicalCheckedTreeViewer.LOGIC_TYPE2

TREELOGIC_TYPE3

public static final int TREELOGIC_TYPE3
See Also:
LogicalCheckedTreeViewer.LOGIC_TYPE3

TREELOGIC_TYPE4

public static final int TREELOGIC_TYPE4
See Also:
LogicalCheckedTreeViewer.LOGIC_TYPE4

TREELOGIC_TYPE5

public static final int TREELOGIC_TYPE5
See Also:
LogicalCheckedTreeViewer.LOGIC_TYPE5
Constructor Detail

StructuredObjectSelectionDialog

public StructuredObjectSelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
                                       java.lang.String title,
                                       java.lang.String message)
Creates a new instance of the Dialog. @see #openDialog(Object[])
Parameters:
parentShell - the parent shell of the dialog. Given null a new shell will be created
title - window title
message - message to be shown above the selection area. normaly exlaining the UI user what to do
Method Detail

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     java.lang.Object[] selectableElements)
Like @see #openDialog(ITreeContentProvider, boolean) with an other prefilter method The returned array contains all elements selected by the user AND are contained in the given selectableElements parameter.
Parameters:
tcp -  
selectableElements - a prefilter
Returns:
 

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     boolean returnLeaves)
Basic open method. The @see ITreeContentProvider provides the Objects the user may choose from. When the dialog is close via OK button the returned Object array contains the Objects selected by the UI user, null when the dialog was canceled. The return leaves parameter is the simplest form of prefiltering the users selection. When true only selected Objects will be returned that are leaves with in the tree. When false all user selected Obbject are returned
Parameters:
tcp - provider of selectable Objects
returnLeaves - if true all none leaves will be prefilted and nor returned
Returns:
the selected and prefiltered Objects

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     com.tssap.util.core.IFilter filter)
Like @see #openDialog(ITreeContentProvider, boolean) with an other prefilter method.
The returned array contains all elements selected by the user AND accepted by the given filter
Parameters:
tcp -  
filter -  
Returns:
 

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     java.lang.Object[] selectableElements,
                                     int treeLogicType)
Like @see #openDialog(ITreeContentProvider, Object[]) with a possibillity to use a special checking logic in the tree. @see LogicalCheckedTreeViewer and @see #TREELOGIC_TYPE1, ...
Parameters:
tcp -  
selectableElements -  
treeLogicType -  
Returns:
 

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     boolean returnLeaves,
                                     int treeLogicType)
Like @see #openDialog(ITreeContentProvider, boolean) with a possibillity to use a special checking logic in the tree. @see LogicalCheckedTreeViewer and @see #TREELOGIC_TYPE1, ...
Parameters:
tcp -  
returnLeaves -  
treeLogicType -  
Returns:
 

openDialog

public java.lang.Object[] openDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                     com.tssap.util.core.IFilter filter,
                                     int treeLogicType)
Like @see #openDialog(ITreeContentProvider, IFilter) with a possibillity to use a special checking logic in the tree. @see LogicalCheckedTreeViewer and @see #TREELOGIC_TYPE1, ...
Parameters:
tcp -  
filter -  
treeLogicType -  
Returns:
 

openPreFilteredDialog

public java.lang.Object[] openPreFilteredDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                                java.lang.Object[] unselectableElements)
Like @see #openDialog(ITreeContentProvider, Object[]) with the difference that the given unselectableElements are diplayed grayed in the tree and are not checkable for the UI user
Parameters:
tcp -  
unselectableElements -  
Returns:
 

openPreFilteredSingleSiblingDialog

public java.lang.Object[] openPreFilteredSingleSiblingDialog(org.eclipse.jface.viewers.ITreeContentProvider tcp,
                                                             java.lang.Object[] unselectableElements)
Like @see #openPreFilteredDialog(ITreeContentProvider, Object[]) with the difference that a special tree logic only allows to select one sibling in the tree (radio buttopn behaviour of siblings)
Parameters:
tcp -  
unselectableElements -  
Returns:
 

setLabelProvider

public void setLabelProvider(org.eclipse.jface.viewers.ILabelProvider lProvider)
The @see ILabelProvider to be used in the presentation of the Objects to choose from. If no such provider is given a default will be used
Parameters:
lProvider -  

getContentProvider

public org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
Returns the used TreeContentProvider providing the Objects the UI user can choose from
Returns:
 

setPreSelectedObjects

public void setPreSelectedObjects(java.lang.Object[] selectedObjs)
On opening of the Dialog the specified Elements are checked 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.

setPreGrayedObjects

public void setPreGrayedObjects(java.lang.Object[] grayedObjs)
On opening of the Dialog the specified Elements are grayed in the tree. This may be useful with TREELOGIC types restricting the possibility to select grayed nodes. Should not be used with TREELOGIC types modifying the grayed state corresponding to check state changes

setExpandTreeLevel

public void setExpandTreeLevel(int level)
On opening of the dialog the tree will be expanded to the given level.
Parameters:
level -  
See Also:
AbstractTreeViewer#expandToLevel(int)

setTreeInput

public void setTreeInput(java.lang.Object treeContentProviderInput)
This is not a delegation method. It has to be called before the dialog is opened via any open method. On openening the given tree input will be set to the used TreeViewer.
Parameters:
treeContentProviderInput -  
See Also:
org.eclipse.jface.viewers.StructuredViewer#setInput(java.lang.Object).

refreshTreeViewer

public void refreshTreeViewer()
Refreshes the TreeViewer diplaying the choosabel actions.

getResult

public java.lang.Object[] getResult()
See Also:
org.eclipse.ui.dialogs.SelectionDialog#getResult()


Copyright © 2005 SAP AG. All Rights Reserved.