java.lang.Objectjavax.swing.AbstractCellEditor
javax.swing.DefaultCellEditor
public class DefaultCellEditor
The default editor for table and tree cells.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder.
| Nested Class Summary | |
|---|---|
protected class |
DefaultCellEditor.EditorDelegate
The protected EditorDelegate class. |
| Field Summary | |
|---|---|
protected int |
clickCountToStart
An integer specifying the number of clicks needed to start editing. |
protected DefaultCellEditor.EditorDelegate |
delegate
The delegate class which handles all methods sent from the CellEditor. |
protected JComponent |
editorComponent
The Swing component being edited. |
| Fields inherited from class javax.swing.AbstractCellEditor |
|---|
changeEvent, listenerList |
| Constructor Summary | |
|---|---|
DefaultCellEditor(JCheckBox checkBox)
Constructs a DefaultCellEditor object that uses a check box. |
|
DefaultCellEditor(JComboBox comboBox)
Constructs a DefaultCellEditor object that uses a
combo box. |
|
DefaultCellEditor(JTextField textField)
Constructs a DefaultCellEditor that uses a text field. |
|
| Method Summary | |
|---|---|
void |
cancelCellEditing()
Forwards the message from the CellEditor to
the delegate. |
Object |
getCellEditorValue()
Forwards the message from the CellEditor to
the delegate. |
int |
getClickCountToStart()
Returns the number of clicks needed to start editing. |
Component |
getComponent()
Returns a reference to the editor component. |
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Implements the TableCellEditor interface. |
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
Implements the TreeCellEditor interface. |
boolean |
isCellEditable(EventObject anEvent)
Forwards the message from the CellEditor to
the delegate. |
void |
setClickCountToStart(int count)
Specifies the number of clicks needed to start editing. |
boolean |
shouldSelectCell(EventObject anEvent)
Forwards the message from the CellEditor to
the delegate. |
boolean |
stopCellEditing()
Forwards the message from the CellEditor to
the delegate. |
| Methods inherited from class javax.swing.AbstractCellEditor |
|---|
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener |
| 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, removeCellEditorListener |
| Methods inherited from interface javax.swing.CellEditor |
|---|
addCellEditorListener, removeCellEditorListener |
| Field Detail |
|---|
protected JComponent editorComponent
protected DefaultCellEditor.EditorDelegate delegate
CellEditor.
protected int clickCountToStart
clickCountToStart is defined as zero, it
will not initiate until a click occurs.
| Constructor Detail |
|---|
public DefaultCellEditor(JTextField textField)
DefaultCellEditor that uses a text field.
textField - a JTextField objectpublic DefaultCellEditor(JCheckBox checkBox)
DefaultCellEditor object that uses a check box.
checkBox - a JCheckBox objectpublic DefaultCellEditor(JComboBox comboBox)
DefaultCellEditor object that uses a
combo box.
comboBox - a JComboBox object| Method Detail |
|---|
public Component getComponent()
Componentpublic void setClickCountToStart(int count)
count - an int specifying the number of clicks needed to start editinggetClickCountToStart()public int getClickCountToStart()
public Object getCellEditorValue()
CellEditor to
the delegate.
getCellEditorValue in interface CellEditorDefaultCellEditor.EditorDelegate.getCellEditorValue()public boolean isCellEditable(EventObject anEvent)
CellEditor to
the delegate.
isCellEditable in interface CellEditorisCellEditable in class AbstractCellEditoranEvent - an event object
DefaultCellEditor.EditorDelegate.isCellEditable(EventObject)public boolean shouldSelectCell(EventObject anEvent)
CellEditor to
the delegate.
shouldSelectCell in interface CellEditorshouldSelectCell in class AbstractCellEditoranEvent - an event object
DefaultCellEditor.EditorDelegate.shouldSelectCell(EventObject)public boolean stopCellEditing()
CellEditor to
the delegate.
stopCellEditing in interface CellEditorstopCellEditing in class AbstractCellEditorDefaultCellEditor.EditorDelegate.stopCellEditing()public void cancelCellEditing()
CellEditor to
the delegate.
cancelCellEditing in interface CellEditorcancelCellEditing in class AbstractCellEditorpublic Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
TreeCellEditor interface.
getTreeCellEditorComponent in interface TreeCellEditortree - the JTree that is asking the editor to edit;
this parameter can be nullvalue - the value of the cell to be editedisSelected - true is the cell is to be renderer with
selection highlightingexpanded - true if the node is expandedleaf - true if the node is a leaf noderow - the row index of the node being edited
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
TableCellEditor interface.
getTableCellEditorComponent in interface TableCellEditortable - the JTable that is asking the
editor to edit; can be nullvalue - the value of the cell to be edited; it is
up to the specific editor to interpret
and draw the value. For example, if value is
the string "true", it could be rendered as a
string or it could be rendered as a check
box that is checked. null
is a valid valueisSelected - true if the cell is to be rendered with
highlightingrow - the row of the cell being editedcolumn - the column of the cell being edited
Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)