JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Interface EditTraverseHandler

All Known Implementing Classes:
EditTraverseHandlerAbstract

public interface EditTraverseHandler

EditTraverseHandler controls the cell traversal and editor display/commit/cancel logic. It also fires TraverseCell and EditCell events as required.


Field Summary
static int DOWN
           
static int HORIZONTAL
           
static int LEFT
           
static int RIGHT
           
static int UP
           
static int VERTICAL
           
 
Method Summary
 boolean cancel(boolean hide)
          Cancels the current edit on the given table, if an edit is in progress
 void checkAndReparentEditor()
          Check to see if editor component needs reparenting.
 boolean commit(boolean hide)
          Commits the current edit on the table.
 com.klg.jclass.cell.JCCellEditor getCellEditor()
          Returns the current cell editor.
 int getEditColumn()
          Get the column of the current cell being edited.
 int getEditRow()
          Get the row of the current cell being edited.
 Component getFocusableChild(Component c)
          Return the component if it is focusable, otherwise the first kid which is focusable.
 void move(int direction, int value)
          Move the component.
 void repositionEditor()
          Repositions the editor.
 void setCellEditor(com.klg.jclass.cell.JCCellEditor ed)
          Sets the cell editor.
 void setFocusOnEditor()
          Set focus on the component if it is focusable or to the first focusable child.
 void setHeight(int value)
          Sets the height of the edit component.
 void setWidth(int value)
          Sets the width of the edit component.
 boolean traverse(int row, int column, boolean select, AWTEvent event, int traverse_type, boolean show_editor)
          Traverse to the specified cell.
 void traverseInitial()
          Traverses to the top-left cell.
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values
Method Detail

getCellEditor

public com.klg.jclass.cell.JCCellEditor getCellEditor()
Returns the current cell editor.

Returns:
The current cell editor. Returns null if none.

setCellEditor

public void setCellEditor(com.klg.jclass.cell.JCCellEditor ed)
Sets the cell editor.

Parameters:
ed - The new cell editor

getEditRow

public int getEditRow()
Get the row of the current cell being edited.

Returns:
The current edit row

getEditColumn

public int getEditColumn()
Get the column of the current cell being edited.

Returns:
The current edit column

traverse

public boolean traverse(int row,
                        int column,
                        boolean select,
                        AWTEvent event,
                        int traverse_type,
                        boolean show_editor)
Traverse to the specified cell.

Parameters:
row - The row to which to traverse
column - The column to which to traverse
select - Should the cell be selected
event - The event that caused this traverse (null if none)
traverse_type - The type of traversal (right, left, down, up, home, ...)
show_editor - Display the component, if called programatically
Returns:
false if the cell is not traversable

traverseInitial

public void traverseInitial()
Traverses to the top-left cell.


checkAndReparentEditor

public void checkAndReparentEditor()
Check to see if editor component needs reparenting. Reparenting is needed if the CellArea objects have changed boundaries around the cell the editor is in.


setWidth

public void setWidth(int value)
Sets the width of the edit component.

Parameters:
value - The new width

setHeight

public void setHeight(int value)
Sets the height of the edit component.

Parameters:
value - The new height

repositionEditor

public void repositionEditor()
Repositions the editor.


move

public void move(int direction,
                 int value)
Move the component.

Parameters:
direction - The direction of movement, horizontal or vertical
value - The amount in pixels of movement

cancel

public boolean cancel(boolean hide)
Cancels the current edit on the given table, if an edit is in progress

Parameters:
hide - determines whether the editor is hidden after the commit.
Returns:
Whether cancel succeeded

commit

public boolean commit(boolean hide)
Commits the current edit on the table.

Parameters:
hide - determines whether the editor is hidden after the commit.
Returns:
Whether commit succeeded

setFocusOnEditor

public void setFocusOnEditor()
Set focus on the component if it is focusable or to the first focusable child.


getFocusableChild

public Component getFocusableChild(Component c)
Return the component if it is focusable, otherwise the first kid which is focusable. If no focusable kids, return the component (we need to use something). Note that this method does not recurse into the children's children.

Parameters:
c - The component whose focus or children's focus is being investigated
Returns:
The component or child component which is focusable. Note that if no children are focusable, the original component is returned whether it is focusable or not

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