bsys.propertyview
Class Editor

java.lang.Object
  extended by bsys.propertyview.Editor
All Implemented Interfaces:
java.util.EventListener, javax.swing.CellEditor, javax.swing.event.CellEditorListener, javax.swing.table.TableCellEditor

public class Editor
extends java.lang.Object
implements javax.swing.table.TableCellEditor, javax.swing.event.CellEditorListener

Versatile super editor

Author:
Bernard Bou

Field Summary
private static long serialVersionUID
           
private  PropertyView.Attribute theAttribute
          Attribute being edited
private  ColorEditor theColorEditor
          Color editor
private  javax.swing.DefaultCellEditor theDefaultEditor
          Default editor
private  FileEditor theFileEditor
          File editor
private  PropertyView.Handler theHandler
          Handler used to retrieve id map
private  ListEditor theListEditor
          List editor
private  LongTextEditor theLongTextEditor
          Long text editor
private  PropertyView thePropertyView
          View
private  javax.swing.table.TableCellEditor theSubEditor
          The delegate subeditor
private  javax.swing.table.TableCellEditor[] theSubEditors
          The subeditors
 
Constructor Summary
Editor(PropertyView thisPropertyView)
          Constructor
 
Method Summary
 void addCellEditorListener(javax.swing.event.CellEditorListener thisListener)
           
private  void addPopulateWithSharpIds(javax.swing.JComboBox thisCombo)
          Populate combobox with ids referencing nodes
 void cancelCellEditing()
           
 void editingCanceled(javax.swing.event.ChangeEvent e)
           
 void editingStopped(javax.swing.event.ChangeEvent e)
           
 java.lang.Object getCellEditorValue()
           
private  java.io.File getImageRepository()
          Get image repository
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object thisValue, boolean isSelected, int row, int column)
           
 boolean isCellEditable(java.util.EventObject thisAnEvent)
           
private  void populateWithFonts(javax.swing.JComboBox thisCombo)
          Populate combobox with fonts
private  void populateWithIds(javax.swing.JComboBox thisCombo)
          Populate combobox with ids
private  void populateWithStrings(javax.swing.JComboBox thisCombo, java.lang.String[] theseStrings)
          Populate combobox with strings list
private  void populateWithStrokes(javax.swing.JComboBox thisCombo)
          Populate combobox with stroke types
private  void populateWithTerminators(javax.swing.JComboBox thisCombo)
          Populate combobox with terminators
private  void populateWithTrueFalse(javax.swing.JComboBox thisCombo)
          Populate combobox with true/false
private  void populateWithUrls(javax.swing.JComboBox thisCombo)
          Populate combobox with urls
 void removeCellEditorListener(javax.swing.event.CellEditorListener thisListener)
           
 void setHandler(PropertyView.Handler thisHandler)
          Set get/set handlers
 boolean shouldSelectCell(java.util.EventObject thisEvent)
           
 boolean stopCellEditing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

thePropertyView

private final PropertyView thePropertyView
View


theHandler

private PropertyView.Handler theHandler
Handler used to retrieve id map


theAttribute

private PropertyView.Attribute theAttribute
Attribute being edited


theColorEditor

private ColorEditor theColorEditor
Color editor


theFileEditor

private FileEditor theFileEditor
File editor


theListEditor

private ListEditor theListEditor
List editor


theLongTextEditor

private LongTextEditor theLongTextEditor
Long text editor


theDefaultEditor

private javax.swing.DefaultCellEditor theDefaultEditor
Default editor


theSubEditor

private javax.swing.table.TableCellEditor theSubEditor
The delegate subeditor


theSubEditors

private javax.swing.table.TableCellEditor[] theSubEditors
The subeditors

Constructor Detail

Editor

public Editor(PropertyView thisPropertyView)
Constructor

Parameters:
thisPropertyView - view
Method Detail

setHandler

public void setHandler(PropertyView.Handler thisHandler)
Set get/set handlers

Parameters:
thisHandler - handler

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object thisValue,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

getCellEditorValue

public java.lang.Object getCellEditorValue()
Specified by:
getCellEditorValue in interface javax.swing.CellEditor

shouldSelectCell

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

stopCellEditing

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

cancelCellEditing

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

isCellEditable

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

getImageRepository

private java.io.File getImageRepository()
Get image repository

Returns:
image repository as file

populateWithIds

private void populateWithIds(javax.swing.JComboBox thisCombo)
Populate combobox with ids

Parameters:
thisCombo - combobox

populateWithStrokes

private void populateWithStrokes(javax.swing.JComboBox thisCombo)
Populate combobox with stroke types

Parameters:
thisCombo - combobox

populateWithTrueFalse

private void populateWithTrueFalse(javax.swing.JComboBox thisCombo)
Populate combobox with true/false

Parameters:
thisCombo - combobox

populateWithUrls

private void populateWithUrls(javax.swing.JComboBox thisCombo)
Populate combobox with urls

Parameters:
thisCombo - combobox

addPopulateWithSharpIds

private void addPopulateWithSharpIds(javax.swing.JComboBox thisCombo)
Populate combobox with ids referencing nodes

Parameters:
thisCombo - combobox

populateWithFonts

private void populateWithFonts(javax.swing.JComboBox thisCombo)
Populate combobox with fonts

Parameters:
thisCombo - combobox

populateWithTerminators

private void populateWithTerminators(javax.swing.JComboBox thisCombo)
Populate combobox with terminators

Parameters:
thisCombo - combobox

populateWithStrings

private void populateWithStrings(javax.swing.JComboBox thisCombo,
                                 java.lang.String[] theseStrings)
Populate combobox with strings list

Parameters:
thisCombo - combobox
theseStrings - list of strings

editingCanceled

public void editingCanceled(javax.swing.event.ChangeEvent e)
Specified by:
editingCanceled in interface javax.swing.event.CellEditorListener

editingStopped

public void editingStopped(javax.swing.event.ChangeEvent e)
Specified by:
editingStopped in interface javax.swing.event.CellEditorListener

addCellEditorListener

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

removeCellEditorListener

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