com.tssap.util.ui.glpc.section
Class TreeSection

com.tssap.util.ui.glpc.section.TreeSection
All Implemented Interfaces:
IEditable, IGridLayoutPaneContainer, ISection, ISectionWithButtons, ITitledGridLayoutPaneContainer, ITreeSection

public class TreeSection
implements ITreeSection

This is the base class for all tree sections with button support.


Constructor Summary
TreeSection(javax.swing.tree.TreeModel treeModel, IWidgetFactory widgetFactory, java.lang.String title, java.lang.String description, java.lang.String[] buttons)
          Creates a new TreeSection with non-equal column widths.
TreeSection(javax.swing.tree.TreeModel treeModel, IWidgetFactory widgetFactory, java.lang.String title, java.lang.String description, java.lang.String[] buttons, boolean[] buttonsEnabled)
          Creates a new TreeSection with non-equal column widths.
 
Method Summary
 void addMenuProvider(IMenuProvider provider)
          Adds a new IMenuProvider to the section tree.
 void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Adds a new SelectionListener to the section tree.
 javax.swing.tree.TreeModel getTreeModel()
          Getter method for the tree model used for this tree section.
 ISapTreeViewer getTreeViewer()
          Getter method for the tree viewer used for this tree section.
 void initButtonedSection(IGridLayoutPane glp)
          Initializes the section by adding a tree viewer on the left.
 void removeMenuProvider(IMenuProvider provider)
          Removes a IMenuProvider to the section tree.
 void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
          Removes a SelectionListener to the section tree.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
          Called when the default widget has been selected.
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
          Called when a selection event occured.
 
Methods inherited from interface com.tssap.util.ui.glpc.section.ISectionWithButtons
addButtonClickedListener, removeButtonClickedListener
 
Methods inherited from interface com.tssap.util.ui.glpc.section.ISection
initSection
 
Methods inherited from interface com.tssap.util.ui.glpc.ITitledGridLayoutPaneContainer
getDescription, getTitle, setDescription, setTitle
 
Methods inherited from interface com.tssap.util.ui.glpc.IGridLayoutPaneContainer
getUserGridNumOfColumns, initContainer, isUserGridEqualColSize
 
Methods inherited from interface com.tssap.util.ui.IEditable
isEditable, setEditable
 

Constructor Detail

TreeSection

public TreeSection(javax.swing.tree.TreeModel treeModel,
                   IWidgetFactory widgetFactory,
                   java.lang.String title,
                   java.lang.String description,
                   java.lang.String[] buttons)
Creates a new TreeSection with non-equal column widths.
Parameters:
treeModel - The Swing TreeModel to use for the tree section.
widgetFactory - The WidgetFactory to use.
columns - The number of columns the client area should have.
title - The title of the section.
description - The description of the section.
buttons - Array of Strings with the texts of the buttons to be displayed.

TreeSection

public TreeSection(javax.swing.tree.TreeModel treeModel,
                   IWidgetFactory widgetFactory,
                   java.lang.String title,
                   java.lang.String description,
                   java.lang.String[] buttons,
                   boolean[] buttonsEnabled)
Creates a new TreeSection with non-equal column widths.
Parameters:
treeModel - The Swing TreeModel to use for the tree section.
widgetFactory - The WidgetFactory to use.
title - The title of the section.
description - The description of the section.
buttons - Array of Strings with the texts of the buttons to be displayed.
Method Detail

getTreeModel

public javax.swing.tree.TreeModel getTreeModel()
Getter method for the tree model used for this tree section.
Returns:
The tree model set for this tree section.

getTreeViewer

public ISapTreeViewer getTreeViewer()
Getter method for the tree viewer used for this tree section.
Returns:
The tree viewer set for this tree section.

initButtonedSection

public void initButtonedSection(IGridLayoutPane glp)
Initializes the section by adding a tree viewer on the left. The tree viewer is based upon the given tree model, which means that the setTreeModel(TreeModel> method must have been called before this method is called by the framework.
Specified by:
initButtonedSection in interface ISectionWithButtons
Parameters:
glp - The client area of the super class to be filled within the section.

addSelectionListener

public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds a new SelectionListener to the section tree.
Parameters:
listener - The listener to add.

removeSelectionListener

public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes a SelectionListener to the section tree.
Parameters:
listener - The listener to remove.

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Called when the default widget has been selected. The implementation within this class simply calls widgetSelected(SelectionEvent).
Parameters:
e - The selection event.

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Called when a selection event occured. The implementation in this class checks if a tree selection has changed and sets the selection to the first selected tree item. Otherwise the selection event is propagated to the super class.
Parameters:
e - The selection event.

addMenuProvider

public void addMenuProvider(IMenuProvider provider)
Adds a new IMenuProvider to the section tree.
Parameters:
provider - The provider to add.

removeMenuProvider

public void removeMenuProvider(IMenuProvider provider)
Removes a IMenuProvider to the section tree.
Parameters:
provider - The provider to remove.


Copyright © 2005 SAP AG. All Rights Reserved.