JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class ComponentHandlerNew

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--com.klg.jclass.table.JCSeries
                          |
                          +--com.klg.jclass.table.ComponentHandler
                                |
                                +--com.klg.jclass.table.ComponentHandlerNew
All Implemented Interfaces:
Cloneable, Collection, ComponentModel, EventListener, FocusListener, JCScrollListener, KeyListener, List, Moveable, RandomAccess, Serializable, SeriesModel

public class ComponentHandlerNew
extends ComponentHandler

ComponentHandler controls the placement of components within table and ensures that traverse from a component to table or table to component flows across and down the cells or to the left and up for reverse traversal.

Since:
JClass 6.0 for JDK 1.4 and later
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.klg.jclass.table.ComponentHandler
adjustBoundsRequired, controlDown, needsSetParent, shiftDown, table
 
Fields inherited from class com.klg.jclass.table.JCSeries
last_index
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ComponentHandlerNew()
          Creates a new ComponentHandler instance.
ComponentHandlerNew(com.klg.jclass.table.JCTable table)
          Creates new ComponentHandler instance linked to table.
 
Method Summary
protected  void addListeners(Component c, KeyListener keyListener, FocusListener focusListener)
          Add key and focus listeners to component if it is focusable, otherwise add them the first child which is focusable
 void focusGained(FocusEvent event)
          Adds a KeyListener to the component when table is managing component focus.
 void focusLost(FocusEvent event)
          Removes TraverseHandler as a key listener on the component when it loses focus.
 void keyPressed(KeyEvent event)
          Tracks TAB/SHIFT-TAB and keypad arrow keys to control navigation when a component has focus.
 
Methods inherited from class com.klg.jclass.table.ComponentHandler
addComponentsToParent, addKeyAndFocusListeners, afterScroll, findPosition, getDirectionFromKeyEvent, getTable, getTablePosition, isParentSetRequired, keyReleased, keyTyped, reconfigureComponents, removeCellComponents, scroll, setDefault, setParentSetRequired, setTable, setValue, traverseNext, updateTable
 
Methods inherited from class com.klg.jclass.table.JCSeries
getCellRanges, getDefault, getSeriesValues, getUniqueValues, getValue, moveColumns, moveRows, remapColumns, remapRows, remove, setValue, setValue, shiftColumn, shiftRow, swapColumns, swapRows
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.klg.jclass.table.SeriesModel
getCellRanges, getDefault, getSeriesValues, getUniqueValues, getValue, setValue, setValue
 
Methods inherited from interface com.klg.jclass.table.Moveable
moveColumns, moveRows, remapColumns, remapRows, shiftColumn, shiftRow, swapColumns, swapRows
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

ComponentHandlerNew

public ComponentHandlerNew()
Creates a new ComponentHandler instance. setTable must be called to connect the handler to table.


ComponentHandlerNew

public ComponentHandlerNew(com.klg.jclass.table.JCTable table)
Creates new ComponentHandler instance linked to table.

Parameters:
table - The table for this component handler
Method Detail

addListeners

protected void addListeners(Component c,
                            KeyListener keyListener,
                            FocusListener focusListener)
Add key and focus listeners to component if it is focusable, otherwise add them the first child which is focusable

Specified by:
addListeners in class ComponentHandler
Parameters:
c - The component to which to add the listeners
keyListener - The key listener to add
focusListener - The focusListener to add

focusGained

public void focusGained(FocusEvent event)
Adds a KeyListener to the component when table is managing component focus. Cancels any edit and cause a traversal to the underlying cell.

Specified by:
focusGained in interface FocusListener
Specified by:
focusGained in class ComponentHandler
Parameters:
event - The focus event which caused foucs to be gained.

focusLost

public void focusLost(FocusEvent event)
Removes TraverseHandler as a key listener on the component when it loses focus.

Specified by:
focusLost in interface FocusListener
Specified by:
focusLost in class ComponentHandler
Parameters:
event - The focus event which caused foucs to be lost.

keyPressed

public void keyPressed(KeyEvent event)
Tracks TAB/SHIFT-TAB and keypad arrow keys to control navigation when a component has focus.

Specified by:
keyPressed in interface KeyListener
Specified by:
keyPressed in class ComponentHandler
Parameters:
event - The event from the key press

Copyright © 2004 Quest Software Inc..
All rights reserved.