javax.swing
Class DefaultCellEditor.EditorDelegate
- DefaultCellEditor
- ActionListener, EventListener, ItemListener, Serializable
This changeable module access the editor component in the component
specific way. For instance, to set the value for JTextField, we need to
call setText(String), and for JCheckBox we need to call
setSelected(boolean). Each default editor has the component specific
derivative of this class. These derivatives are private inner classes of
the DefaultCellEditor.
The editor delegate is also set for the editor component as the action
listener. It listens for the events that indicate that editing has stopped.
protected Object | value - The object value (updated when getting and setting the value).
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
value
protected Object value
The object value (updated when getting and setting the value).
cancelCellEditing
public void cancelCellEditing()
Cancel the cell editing session. This method notifies the registered
cell editor listeners (including the table) that the editing has been
canceled.
getCellEditorValue
public Object getCellEditorValue()
Get the value for the editor component. This method is normally
overridden to obtain the value in the way, specific for the text
component, check box or combo box.
- value the value of the component (String, Boolean or Number).
isCellEditable
public boolean isCellEditable(EventObject event)
The default method returns true for the
MouseEvent
and false
for any other events.
event
- the event to check
- true if the passed event is the mouse event and false otherwise.
setValue
public void setValue(Object aValue)
Set the value for the editor component. This method is normally
overridden to set the value in the way, specific for the text
component, check box or combo box.
aValue
- the value to set (String, Boolean or Number).
shouldSelectCell
public boolean shouldSelectCell(EventObject event)
Returns true to indicate that the editing cell can be selected.
The default method returns true without action but may be overridden
in derived classes for more specific behavior.
event
- unused in default method
startCellEditing
public boolean startCellEditing(EventObject event)
Start editing session and returns true to indicate the editing has begun.
The default method returns true without action but may be overridden
in derived classes for more specific behavior.
stopCellEditing
public boolean stopCellEditing()
Finish the cell editing session. This method notifies the registered
cell editor listeners (including the table) that the editing has been
stopped.
DefaultCellEditor.java --
Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.