Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.controls
Class JFastTreeTable.TreeTableCellEditor

java.lang.Object
  extended by oracle.ide.controls.AbstractCellEditor
      extended by oracle.ide.controls.JFastTreeTable.TreeTableCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, javax.swing.table.TableCellEditor
Enclosing class:
JFastTreeTable

public class JFastTreeTable.TreeTableCellEditor
extends AbstractCellEditor
implements javax.swing.table.TableCellEditor

TreeTableCellEditor implementation. Component returned is the JTree.


Field Summary
 
Fields inherited from class oracle.ide.controls.AbstractCellEditor
listenerList
 
Constructor Summary
JFastTreeTable.TreeTableCellEditor()
           
 
Method Summary
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int r, int c)
           
 boolean isCellEditable(java.util.EventObject e)
          Overridden to return false, and if the event is a mouse event it is forwarded to the tree.
 
Methods inherited from class oracle.ide.controls.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorValue, removeCellEditorListener, shouldSelectCell, stopCellEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, cancelCellEditing, getCellEditorValue, removeCellEditorListener, shouldSelectCell, stopCellEditing
 

Constructor Detail

JFastTreeTable.TreeTableCellEditor

public JFastTreeTable.TreeTableCellEditor()
Method Detail

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int r,
                                                      int c)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject e)
Overridden to return false, and if the event is a mouse event it is forwarded to the tree.

The behavior for this is debatable, and should really be offered as a property. By returning false, all keyboard actions are implemented in terms of the table. By returning true, the tree would get a chance to do something with the keyboard events. For the most part this is ok. But for certain keys, such as left/right, the tree will expand/collapse where as the table focus should really move to a different column. Page up/down should also be implemented in terms of the table. By returning false this also has the added benefit that clicking outside of the bounds of the tree node, but still in the tree column will select the row, whereas if this returned true that wouldn't be the case.

By returning false we are also enforcing the policy that the tree will never be editable (at least by a key sequence).

Specified by:
isCellEditable in interface javax.swing.CellEditor
Overrides:
isCellEditable in class AbstractCellEditor

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.