JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Interface FocusModel

All Known Implementing Classes:
FocusManager

public interface FocusModel

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


Method Summary
 com.klg.jclass.table.ComponentModel createDefaultComponentModel()
          Creates the default Component handler.
 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
 void handleControlTab(boolean isShift, boolean doCommit)
          The user has hit CTRL-TAB or CTRL-SHIFT-TAB.
 boolean isFocusTraversable(Component c)
          Can this component receive the focus
 boolean requestFocus()
          Gets table to request focus.
 boolean requestFocus(Component c)
          Gets the passed in component to request focus.
 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
 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.
 

Method Detail

getTable

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

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

Parameters:
table - The new table that uses this focus manager

requestFocus

public boolean requestFocus(Component c)
Gets the passed in component to request focus.

Parameters:
c - The component who will request the focus.
Returns:
Whether the request will fail or most likely succeed (it only fails under an extraordinary event such as a disposal of the Component's peer).

requestFocus

public boolean requestFocus()
Gets table to request focus.

Returns:
Whether the request will fail or most likely succeed (it only fails under an extraordinary event such as a disposal of the Component's peer).

getEditTraverseHandler

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

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

Parameters:
editTraverseHandler - The new edit handler

getComponentModel

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

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

Parameters:
componentHandler - The new compnnent handler for the table

createDefaultComponentModel

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

Returns:
The newly created component handler for a given model

isFocusTraversable

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

Parameters:
c - The component whose focusability is in question
Returns:
Whether the component can receive focus

findFocusOwner

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

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 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.

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 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.


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