|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.table.EditTraverseHandlerAbstract
EditTraverseHandlerOld
controls the cell traversal and editor
display/commit/cancel logic for JDK's prior to 1.4. It also fires
TraverseCell
and EditCell
events as required.
Field Summary | |
protected Component |
component
|
protected int |
edit_column
|
protected int |
edit_row
|
protected com.klg.jclass.cell.JCCellEditor |
editor
|
protected com.klg.jclass.table.JCTable |
table
|
Fields inherited from interface com.klg.jclass.table.EditTraverseHandler |
DOWN, HORIZONTAL, LEFT, RIGHT, UP, VERTICAL |
Constructor Summary | |
EditTraverseHandlerAbstract(com.klg.jclass.table.JCTable table)
Constructor that requires a table |
Method Summary | |
protected void |
addKeyAndFocusListeners(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 |
protected abstract void |
addListeners(Component c,
KeyListener keyListener,
FocusListener focusListener)
|
protected boolean |
cancel()
Cancels the current edit on the given table, if an edit is in progress |
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. |
protected boolean |
commit()
Commits the current edit on the given table, if an edit is in progress |
boolean |
commit(boolean hide)
Commits the current edit on the table. |
protected boolean |
commit(boolean hide,
boolean stop)
Commits the current edit on the table. |
protected void |
commitAndTraverse(int direction)
Commits the edit and attempts a traversal in the given direction. |
void |
editingCanceled(com.klg.jclass.cell.JCCellEditorEvent event)
The JCCellEditor calls cancelEdit() to cancel and undo an edit;
for example, when the user presses Esc. |
void |
editingStopped(com.klg.jclass.cell.JCCellEditorEvent event)
The JCCellEditor posts EditingStopped when it is done editing. |
abstract void |
focusGained(FocusEvent event)
Reset the old focus owner for this focus period |
abstract void |
focusLost(FocusEvent event)
Sets the table as a focused component when the editor loses permanent focus. |
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 |
initializeEditor(AWTEvent e,
com.klg.jclass.table.TableCellInfoModel cellInfo,
Object o)
Initialize the editor based on a cellInfo object and data. |
protected boolean |
isValidCell(int row,
int column)
Returns true the given row and column is a valid cell. |
void |
move(int direction,
int value)
Move the component. |
protected void |
removeEditor()
Removes the edit component from table. |
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. |
protected void |
setFocusOnEditor(Component editComponent)
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. |
protected boolean |
setValues(com.klg.jclass.table.CellArea area,
int row,
int column,
Rectangle size)
Sets the bounds of the editor for the given cell. |
protected boolean |
setValues(int row,
int column,
Rectangle size)
Set attributes, first determining cell's editability. |
void |
setWidth(int value)
Sets the width of the edit component. |
protected void |
signalError()
Executes a beep to signal an error. |
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. |
protected boolean |
traverseInitial(int row,
int column,
boolean select,
int traverse_type)
Returns false if the cell is not traversable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.klg.jclass.table.JCTable table
protected com.klg.jclass.cell.JCCellEditor editor
protected Component component
protected int edit_row
protected int edit_column
Constructor Detail |
public EditTraverseHandlerAbstract(com.klg.jclass.table.JCTable table)
table
- The table for which this EditTraverseHandler is used.Method Detail |
public com.klg.jclass.cell.JCCellEditor getCellEditor()
getCellEditor
in interface EditTraverseHandler
null
if none.protected void addKeyAndFocusListeners(Component c, KeyListener keyListener, FocusListener focusListener)
c
- The component to which to add the listenerskeyListener
- The key listener to addfocusListener
- The focusListener to addprotected abstract void addListeners(Component c, KeyListener keyListener, FocusListener focusListener)
public void setCellEditor(com.klg.jclass.cell.JCCellEditor ed)
setCellEditor
in interface EditTraverseHandler
ed
- The new cell editorpublic int getEditRow()
getEditRow
in interface EditTraverseHandler
public int getEditColumn()
getEditColumn
in interface EditTraverseHandler
public void initializeEditor(AWTEvent e, com.klg.jclass.table.TableCellInfoModel cellInfo, Object o)
e
- The event which caused the editor to be invokedcellInfo
- The table cell informationo
- The data objectpublic boolean traverse(int row, int column, boolean select, AWTEvent event, int traverse_type, boolean show_editor)
traverse
in interface EditTraverseHandler
row
- The row to which to traversecolumn
- The column to which to traverseselect
- Should the cell be selectedevent
- 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
public void traverseInitial()
traverseInitial
in interface EditTraverseHandler
protected boolean traverseInitial(int row, int column, boolean select, int traverse_type)
row
- The row to which to traversecolumn
- The column to which to traverseselect
- Should the cell be selectedtraverse_type
- The type of traversal (right, left, down, up, home, ...)
protected boolean isValidCell(int row, int column)
row
- The row of the cellcolumn
- The column of the cell
protected boolean setValues(int row, int column, Rectangle size)
row
- The row of the cellcolumn
- The column of the cellsize
- The size to which the component is set
protected boolean setValues(com.klg.jclass.table.CellArea area, int row, int column, Rectangle size)
area
- The CellArea of the cell to be resizedrow
- The row of the cellcolumn
- The column of the cellsize
- The size to which the component is set
public void checkAndReparentEditor()
checkAndReparentEditor
in interface EditTraverseHandler
public void setWidth(int value)
setWidth
in interface EditTraverseHandler
value
- The new widthpublic void setHeight(int value)
setHeight
in interface EditTraverseHandler
value
- The new heightpublic void repositionEditor()
repositionEditor
in interface EditTraverseHandler
public void move(int direction, int value)
move
in interface EditTraverseHandler
direction
- The direction of movement, horizontal or verticalvalue
- The amount in pixels of movementprotected void signalError()
protected boolean cancel()
public boolean cancel(boolean hide)
cancel
in interface EditTraverseHandler
hide
- determines whether the editor is hidden after the commit.
protected boolean commit()
public boolean commit(boolean hide)
commit
in interface EditTraverseHandler
hide
- Determines whether the editor is hidden after the commit.
protected boolean commit(boolean hide, boolean stop)
hide
- Determines whether the editor is hidden after the commit.stop
- Determines whether the editor should be told to stop editing.
Set to false if the editor is originator for the commit to avoid round-trip.
protected void commitAndTraverse(int direction)
direction
- The direction which to traverseprotected void removeEditor()
public void editingStopped(com.klg.jclass.cell.JCCellEditorEvent event)
JCCellEditor
posts EditingStopped when it is done editing.
The container then will decide whether to call commit() in the editor.
editingStopped
in interface JCCellEditorListener
event
- The event which caused us to want editing to stoppublic void editingCanceled(com.klg.jclass.cell.JCCellEditorEvent event)
JCCellEditor
calls cancelEdit()
to cancel and undo an edit;
for example, when the user presses Esc.
editingCanceled
in interface JCCellEditorListener
event
- The event which caused us to want editing to be canceledpublic Component getFocusableChild(Component c)
getFocusableChild
in interface EditTraverseHandler
c
- The component whose focus or children's focus is being investigated
public void setFocusOnEditor()
setFocusOnEditor
in interface EditTraverseHandler
protected void setFocusOnEditor(Component editComponent)
editComponent
- The component or child of component on which to set
the focus.public abstract void focusGained(FocusEvent event)
focusGained
in interface FocusListener
event
- The focus event which caused focus to be gainedpublic abstract void focusLost(FocusEvent event)
focusLost
in interface FocusListener
event
- The focus event which caused focus to be lost
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |