|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.grid.RolloverTableUtils
public class RolloverTableUtils
RolloverTableUtils
adds a mouse input listener to any JTable and will try to automatically force the
table cell into editing mode or the rollover mode when mouse is moved over a cell if condition meets. If you are
using install(javax.swing.JTable, com.jidesoft.grid.RolloverTableUtils.AutoCellAction)
, you can create
AutoCellEditingSupport.AutoCellEditing and tell RolloverTableUtils which cells should automatically start cell
editing. If you pass in null for the RolloverTableUtils.AutoCellAction parameter, we will check the CellEditor and
see if it is an instance of CellEditingSupport
interface and if true, check if its isEditable method returns
true. We will also check if the cell editor is an instance of CellRolloverSupport
and if isRollover returns
true. The difference is for isRollover is true, we will call JideTable.rolloverCellAt(int, int)
. If
isEditable is true, we will call JTable.editCellAt(int, int)
. Some cell editors such as ButtonTableCellEditorRenderer
and HyperlinkTableCellEditorRenderer
implement CellRolloverSupport
and
those cell editors will start cell rollover even if the AutoCellAction is not defined.
TableCellEditorRenderer
,
AbstractTableCellEditorRenderer
,
HyperlinkTableCellEditorRenderer
,
ButtonTableCellEditorRenderer
Nested Class Summary | |
---|---|
static interface |
RolloverTableUtils.AutoCellAction
|
Constructor Summary | |
---|---|
RolloverTableUtils()
|
Method Summary | |
---|---|
static void |
cancelRollover(JTable table,
MouseEvent e)
Cancel the rollover (or editing depending on the AutoCellAction used when install(javax.swing.JTable,
com.jidesoft.grid.RolloverTableUtils.AutoCellAction) is called. |
protected static boolean[] |
getCellAction(JTable table,
MouseEvent e,
int row,
int column,
RolloverTableUtils.AutoCellAction autoCellAction)
|
static void |
install(JTable table)
Installs mouse input listener to JTable to enable auto cell editing when rollover. |
static void |
install(JTable table,
RolloverTableUtils.AutoCellAction autoCellAction)
Installs mouse input listener to JTable to enable auto cell editing when rollover. |
static void |
prepareCellEditorComponent(Component component,
JTable table,
boolean isSelected,
int row,
int column)
|
static void |
uninstall(JTable table)
Uninstalls the listener installed by install(javax.swing.JTable) or install(javax.swing.JTable,
com.jidesoft.grid.RolloverTableUtils.AutoCellAction) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLIENT_PROPERTY_ROLLOVER_AUTO_CELL_ACTION
public static final String CLIENT_PROPERTY_ROLLOVER_MOUSE_LISTENER
public static final String CLIENT_PROPERTY_ROLLOVER_COLUMN_MODEL_LISTENER
public static final String CLIENT_PROPERTY_ROLLOVER_PROPERTY_CHANGE_LISTENER
Constructor Detail |
---|
public RolloverTableUtils()
Method Detail |
---|
public static void install(JTable table)
CellEditingSupport
, it will be used to decide whether to start auto cell editing. For all cells that are
not editable as defined in table model or the cell editor doesn't implement CellEditingSupport
, the cell
won't start editing when rollover.
table
- the tablepublic static void install(JTable table, RolloverTableUtils.AutoCellAction autoCellAction)
CellEditingSupport
, the use it to decide whether to start auto cell editing. For all cells that are not editable
as defined in table model or the cell editor doesn't implement CellEditingSupport
, the cell won't start
editing when rollover.
table
- the tableautoCellAction
- allows user to define if a cell is auto-editing or auto-rollover. it can be controlled by
the cell editor when it implements CellRolloverSupport
and/or CellEditingSupport
. However when sometimes the cell editors are not under your control,
you can use this interface to do it. If you use AutoCellAction, it has a higher priority
than the returned values defined by cell editors.public static void cancelRollover(JTable table, MouseEvent e)
install(javax.swing.JTable,
com.jidesoft.grid.RolloverTableUtils.AutoCellAction)
is called.
table
- the table where RolloverTableUtils is used.e
- the MouseEventprotected static boolean[] getCellAction(JTable table, MouseEvent e, int row, int column, RolloverTableUtils.AutoCellAction autoCellAction)
public static void uninstall(JTable table)
install(javax.swing.JTable)
or install(javax.swing.JTable,
com.jidesoft.grid.RolloverTableUtils.AutoCellAction)
.
table
- the table.public static void prepareCellEditorComponent(Component component, JTable table, boolean isSelected, int row, int column)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |