JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class FocusManager

java.lang.Object
  |
  +--com.klg.jclass.table.FocusManager
All Implemented Interfaces:
FocusModel, Serializable
Direct Known Subclasses:
FocusManagerNew, FocusManagerOld

public abstract class FocusManager
extends Object
implements FocusModel, Serializable

Since in JDK1.4, a different focus mechanism is used, an object implementing the FocusModel interface is required to use the correct mechanism for the current environment.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.table.ComponentModel componentHandler
           
protected  com.klg.jclass.table.EditTraverseHandler editTraverseHandler
           
protected  com.klg.jclass.table.JCTable table
           
 
Method Summary
abstract  com.klg.jclass.table.ComponentModel createDefaultComponentModel()
          Creates the default component handler.
protected  com.klg.jclass.table.ComponentModel createDefaultComponentModel(String className)
          Creates the default component handler.
abstract  com.klg.jclass.table.EditTraverseHandler createDefaultEditTraverseHandler()
          Creates the default edit handler.
abstract  Component findFocusOwner(Component c)
          Return the child Component of the specified Component that is the focus owner, if any.
 com.klg.jclass.table.ComponentModel getComponentModel()
          Returns the current component handler.
 com.klg.jclass.table.EditTraverseHandler getEditTraverseHandler()
          Returns the edit handler for the table.
 com.klg.jclass.table.JCTable getTable()
          Return the table for this focus manager
abstract  void handleControlTab(boolean isShift, boolean doCommit)
          The user has hit CTRL-TAB or CTRL-SHIFT-TAB.
abstract  boolean isFocusTraversable(Component c)
          Can this component receive the focus
 boolean requestFocus()
          This method does nothing and is meant to be overridden
 boolean requestFocus(Component c)
          This method does nothing and is meant to be overridden
 void setComponentModel(com.klg.jclass.table.ComponentModel componentHandler)
          Sets a new component handler for the table
 void setEditTraverseHandler(com.klg.jclass.table.EditTraverseHandler editTraverseHandler)
          Sets a new edit handler for the table
 void setTable(com.klg.jclass.table.JCTable table)
          Set the table that uses this focus manager
abstract  void transferFocusCycle()
          In JDK 1.4 or later, we need to make sure that when table has the focus that we are within table's current focus cycle rather than any focus cycle of a container that table happens to be in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected com.klg.jclass.table.JCTable table

editTraverseHandler

protected com.klg.jclass.table.EditTraverseHandler editTraverseHandler

componentHandler

protected com.klg.jclass.table.ComponentModel componentHandler
Method Detail

getTable

public com.klg.jclass.table.JCTable getTable()
Return the table for this focus manager

Specified by:
getTable in interface FocusModel
Returns:
The table that uses this focus manager

setTable

public void setTable(com.klg.jclass.table.JCTable table)
Set the table that uses this focus manager

Specified by:
setTable in interface FocusModel
Parameters:
table - The new table that uses this focus manager

requestFocus

public boolean requestFocus(Component c)
This method does nothing and is meant to be overridden

Specified by:
requestFocus in interface FocusModel
Parameters:
c - The component on which to request focus
Returns:
Always returns true

requestFocus

public boolean requestFocus()
This method does nothing and is meant to be overridden

Specified by:
requestFocus in interface FocusModel
Returns:
Always returns true

getEditTraverseHandler

public com.klg.jclass.table.EditTraverseHandler getEditTraverseHandler()
Returns the edit handler for the table.

Specified by:
getEditTraverseHandler in interface FocusModel
Returns:
The current edit handler for the table

setEditTraverseHandler

public void setEditTraverseHandler(com.klg.jclass.table.EditTraverseHandler editTraverseHandler)
Sets a new edit handler for the table

Specified by:
setEditTraverseHandler in interface FocusModel
Parameters:
editTraverseHandler - The new edit handler

createDefaultEditTraverseHandler

public abstract com.klg.jclass.table.EditTraverseHandler createDefaultEditTraverseHandler()
Creates the default edit handler.

Returns:
The newly created edit handler for a given model

getComponentModel

public com.klg.jclass.table.ComponentModel getComponentModel()
Returns the current component handler.

Specified by:
getComponentModel in interface FocusModel
Returns:
The component handler for the table

setComponentModel

public void setComponentModel(com.klg.jclass.table.ComponentModel componentHandler)
Sets a new component handler for the table

Specified by:
setComponentModel in interface FocusModel
Parameters:
componentHandler - The new compnnent handler for the table

createDefaultComponentModel

public abstract com.klg.jclass.table.ComponentModel createDefaultComponentModel()
Creates the default component handler.

Specified by:
createDefaultComponentModel in interface FocusModel
Returns:
The newly created component handler for a given model

createDefaultComponentModel

protected com.klg.jclass.table.ComponentModel createDefaultComponentModel(String className)
Creates the default component handler.

Parameters:
className - The name of the class to be instantiated as the component handler.

isFocusTraversable

public abstract boolean isFocusTraversable(Component c)
Can this component receive the focus

Specified by:
isFocusTraversable in interface FocusModel
Parameters:
c - The component whose focusability is in question
Returns:
Whether the component can receive focus

findFocusOwner

public abstract Component findFocusOwner(Component c)
Return the child Component of the specified Component that is the focus owner, if any.

Specified by:
findFocusOwner in interface FocusModel
Parameters:
c - the root of the Component hierarchy to search for the focus owner
Returns:
the focus owner, or null if there is no focus owner, or if the focus owner is not c, or a descendant of c

handleControlTab

public abstract void handleControlTab(boolean isShift,
                                      boolean doCommit)
The user has hit CTRL-TAB or CTRL-SHIFT-TAB. We need to go up one cycle and tab out of table to the next or previous component. Nothing is done in JDK's prior to 1.4.

Specified by:
handleControlTab in interface FocusModel
Parameters:
isShift - True if the shift key has been hit.
doCommit - Do a commit edit before traversing. This is needed the user is editing a cell when he/she hits CTRL-TAB or CTRL-SHIFT-TAB.

transferFocusCycle

public abstract void transferFocusCycle()
In JDK 1.4 or later, we need to make sure that when table has the focus that we are within table's current focus cycle rather than any focus cycle of a container that table happens to be in.

Specified by:
transferFocusCycle in interface FocusModel

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