com.tensegrity.gui.swing.control.attributetable
Class PreferenceTableCellEditor

java.lang.Object
  extended byjavax.swing.AbstractCellEditor
      extended bycom.tensegrity.gui.swing.control.attributetable.AttributeTableCellEditor
          extended bycom.tensegrity.gui.swing.control.attributetable.PreferenceTableCellEditor
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.CellEditor, java.util.EventListener, java.io.Serializable, javax.swing.table.TableCellEditor

Deprecated. After the introduction of the AttributeEditorTranslator which is used to translate cells in the AttributeTable and the AttributeTree, this class is no longer supported and should not be used anymore.

public class PreferenceTableCellEditor
extends com.tensegrity.gui.swing.control.attributetable.AttributeTableCellEditor

The PreferenceTableCellEditor looks up all provided strings of column 0 in the UIManager. By doing this, displayed strings get localized (if there is a matching entry in the UIManager instance.

Version:
$Id: PreferenceTableCellEditor.java,v 1.17 2005/10/19 13:37:49 BurkhardWick Exp $
Author:
Andreas Ebbert
See Also:
Serialized Form

Nested Class Summary
protected static class PreferenceTableCellEditor.TranslatingCombo
          Deprecated. A JComboBox which gets localized by means of a UIManager instance.
 
Field Summary
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
PreferenceTableCellEditor(SwingAttributeTable attributetable, UIManager uiManager)
          Deprecated. Constructor providing the UIManager to be used and the SwingAttributeTable within that this editor is used.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          We stop editing if an action occurs.
 void cancelCellEditing()
           
 void fireEditingCancelled()
           
 void fireEditingStopped()
           
protected  Attribute getAttribute(int row)
          Returns the Attribute at the given row index.
 java.lang.Object getCellEditorValue()
          Returns the value from the current editor.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Deprecated. Returns localized Labels and an unfoldable component for categories.
 java.awt.Component getTableCellEditorComponent(java.lang.Object value, int row, int column)
          Return the editor component for the given cell.
 boolean isCellEditable(java.util.EventObject event)
          All cells are editable by default.
 boolean stopCellEditing()
           
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, getCellEditorListeners, removeCellEditorListener, shouldSelectCell
 
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, shouldSelectCell
 

Constructor Detail

PreferenceTableCellEditor

public PreferenceTableCellEditor(SwingAttributeTable attributetable,
                                 UIManager uiManager)
Deprecated. 
Constructor providing the UIManager to be used and the SwingAttributeTable within that this editor is used.

Parameters:
attributetable - the SwingAttributeTable.
uiManager - the UIManager to use to localize values.
Method Detail

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Deprecated. 
Returns localized Labels and an unfoldable component for categories.

Parameters:
table - the JTable to use.
value - the value-object to be edited.
isSelected - determining whether the cell is selected.
row - the row of the cell.
column - the column of the cell.
Returns:
the Component that can be used as a cell-editor.

getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the value from the current editor.

Specified by:
getCellEditorValue in interface javax.swing.CellEditor

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
We stop editing if an action occurs. (Such as press of the return key)

Specified by:
actionPerformed in interface java.awt.event.ActionListener

isCellEditable

public boolean isCellEditable(java.util.EventObject event)
All cells are editable by default. This method always returns true.

Specified by:
isCellEditable in interface javax.swing.CellEditor
See Also:
CellEditor.isCellEditable(EventObject)

fireEditingStopped

public void fireEditingStopped()

fireEditingCancelled

public void fireEditingCancelled()

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(java.lang.Object value,
                                                      int row,
                                                      int column)
Return the editor component for the given cell. IMPORTANT: You have to notify the table model about data changes. For components that are editing and provide their results at a later point in time, add an action listener to this class. This will invoke stopCellEditing() in the event thread at the proper point in time. For model dialogs use fireEditingStopped.


stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface javax.swing.CellEditor

cancelCellEditing

public void cancelCellEditing()
Specified by:
cancelCellEditing in interface javax.swing.CellEditor

getAttribute

protected Attribute getAttribute(int row)
Returns the Attribute at the given row index.

Parameters:
row - row index.
Returns:
the Attribute at the given row index.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.