Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.ui.builders
Class TreeBuilder<T>

java.lang.Object
  extended by oracle.javatools.ui.builders.BasicBuilder<T>
      extended by oracle.javatools.ui.builders.TreeBuilder<T>

public final class TreeBuilder<T>
extends BasicBuilder<T>

A class to simply and concisely build a tree component with many more abilities than a standard JTree.

Tell the builder the features you'd like the tree to have (or not have), call build(), and the builder will take care of putting one together for you.

The builder takes care of ensuring that it conforms to UI standards, and does the common work of things like adding the scrollpane, making the tree key press navigable.

T is the type of item in one node of the tree.


Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.javatools.ui.builders.BasicBuilder
BasicBuilder.Instructions
 
Field Summary
static java.lang.String ACTION_CMD_CONTEXT
          The action command given to the context listener on action performed
static java.lang.String ACTION_CMD_DOUBLE_CLICK
          The action command given to the double click listener on action performed
 
Fields inherited from class oracle.javatools.ui.builders.BasicBuilder
instructions
 
Constructor Summary
TreeBuilder()
           
 
Method Summary
 BuiltTree<T> build()
          Create and return the class containing the built UI for the specified table.
protected  BasicBuilder.Instructions createInstructions()
           
 TreeBuilder selectionMode(int selectionMode)
          Set the selection mode of the tree, by default the mode is single selection
 void setContextListener(java.awt.event.ActionListener actionListener)
          set the listener to be called when the user performs the action to display the context menu.
 void setExpandTip(boolean expandTip)
          Set whether the tree cells will expand to show clipped content when the mouse cursor moves over them.
 void setModel(javax.swing.tree.TreeModel model)
           
 void setRenderer(javax.swing.tree.TreeCellRenderer renderer)
           
 void setVisibleRows(int visibleRows)
          Set the preferred number of visible rows
 
Methods inherited from class oracle.javatools.ui.builders.BasicBuilder
buildToolbar, setActions, setActionsSecondary, setActionsSecondary, setCheckable, setDoubleClickListener, setEmptyText, setEmptyTextLarge, setLabel, setResizable, setRollover, setSelection, setSelectionEnabledAction, setSelectionEnabledComponent, setTitlebar, setToolbarComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_CMD_CONTEXT

public static final java.lang.String ACTION_CMD_CONTEXT
The action command given to the context listener on action performed

See Also:
Constant Field Values

ACTION_CMD_DOUBLE_CLICK

public static final java.lang.String ACTION_CMD_DOUBLE_CLICK
The action command given to the double click listener on action performed

See Also:
Constant Field Values
Constructor Detail

TreeBuilder

public TreeBuilder()
Method Detail

createInstructions

protected BasicBuilder.Instructions createInstructions()
Specified by:
createInstructions in class BasicBuilder<T>

build

public BuiltTree<T> build()
Create and return the class containing the built UI for the specified table.

Returns:
a BuiltTable configured to the specification of previous calls to this builder.

setModel

public void setModel(javax.swing.tree.TreeModel model)

setExpandTip

public void setExpandTip(boolean expandTip)
Set whether the tree cells will expand to show clipped content when the mouse cursor moves over them. Defaults to true.

Parameters:
expandTip - set false to turn off the expand tip ability

setContextListener

public void setContextListener(java.awt.event.ActionListener actionListener)
set the listener to be called when the user performs the action to display the context menu. The 'source' of the action event generated will be the MouseEvent or KeyEvent used to invoke the context menu.


selectionMode

public TreeBuilder selectionMode(int selectionMode)
Set the selection mode of the tree, by default the mode is single selection

Parameters:
selectionMode - a TreeSelectionModel constant

setVisibleRows

public void setVisibleRows(int visibleRows)
Set the preferred number of visible rows

Parameters:
visibleRows - the number of visible rows

setRenderer

public void setRenderer(javax.swing.tree.TreeCellRenderer renderer)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.