se.entitymanager.presentation.swing
Class EntityTreeCellEditor

java.lang.Object
  extended by se.entitymanager.presentation.swing.EntityTreeCellEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, javax.swing.CellEditor, javax.swing.tree.TreeCellEditor

public class EntityTreeCellEditor
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.tree.TreeCellEditor

A TreeCellEditor for entity cells.

This editor differs from standard editor in calling logicFacade.rename() when user changes name of entity.


Field Summary
private  java.util.Vector cellEditorListener
          List of CellEditorListener who are informed in case of change.
private  EntityInterface entity
          The entity whose name is edited.
private  SwingPresentationFacade presentationFacade
          The presentation facade object, this object belongs to.
private  javax.swing.JTextField textField
          The text field used to edit name of entity.
 
Constructor Summary
protected EntityTreeCellEditor(SwingPresentationFacade presentationFacade)
          Constructs a EntryTreeCellEditor for a special presentationFacade.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent arg0)
           
 void addCellEditorListener(javax.swing.event.CellEditorListener l)
           
 void cancelCellEditing()
           
 java.lang.Object getCellEditorValue()
          Returns the current entity, that is edited.
 java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
           
 boolean isCellEditable(java.util.EventObject anEvent)
           
 void removeCellEditorListener(javax.swing.event.CellEditorListener l)
           
 boolean shouldSelectCell(java.util.EventObject anEvent)
           
 boolean stopCellEditing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textField

private javax.swing.JTextField textField
The text field used to edit name of entity.


entity

private EntityInterface entity
The entity whose name is edited.


cellEditorListener

private java.util.Vector cellEditorListener
List of CellEditorListener who are informed in case of change.

See Also:
addCellEditorListener(CellEditorListener), removeCellEditorListener(CellEditorListener)

presentationFacade

private SwingPresentationFacade presentationFacade
The presentation facade object, this object belongs to.

Constructor Detail

EntityTreeCellEditor

protected EntityTreeCellEditor(SwingPresentationFacade presentationFacade)
Constructs a EntryTreeCellEditor for a special presentationFacade.

Parameters:
presentationFacade - the presentation facade
Method Detail

getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the current entity, that is edited.

Specified by:
getCellEditorValue in interface javax.swing.CellEditor
Returns:
the entity that is edited

getTreeCellEditorComponent

public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree,
                                                     java.lang.Object value,
                                                     boolean isSelected,
                                                     boolean expanded,
                                                     boolean leaf,
                                                     int row)
Specified by:
getTreeCellEditorComponent in interface javax.swing.tree.TreeCellEditor

addCellEditorListener

public void addCellEditorListener(javax.swing.event.CellEditorListener l)
Specified by:
addCellEditorListener in interface javax.swing.CellEditor

removeCellEditorListener

public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Specified by:
removeCellEditorListener in interface javax.swing.CellEditor

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Specified by:
isCellEditable in interface javax.swing.CellEditor

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject anEvent)
Specified by:
shouldSelectCell in interface javax.swing.CellEditor

cancelCellEditing

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

stopCellEditing

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