Oracle Data-aware Controls Reference

oracle.dacf.style.control
Class PropertyCellEditor

java.lang.Object
  extended byoracle.dacf.style.control.PropertyCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, javax.swing.table.TableCellEditor

public class PropertyCellEditor
extends java.lang.Object
implements javax.swing.table.TableCellEditor

the PropertyCellEditor implements the TableCellEditor for StyleElements. It knows about 3 types of Property Editor formats.

Version:
PUBLIC

Field Summary
protected  javax.swing.event.ChangeEvent _changeEvent
           
protected  int _clickCountToStart
           
protected  oracle.dacf.style.control.PropertyCellEditor.EditorDelegate _delegate
           
protected  javax.swing.JComponent _editorComponent
           
protected  javax.swing.event.EventListenerList _listenerList
          Event listeners
protected  java.beans.PropertyEditor _propertyEditor
           
 
Constructor Summary
PropertyCellEditor(javax.swing.JComboBox comboBox, java.beans.PropertyEditor propertyEditor)
          Constructor for the ComboBox version
PropertyCellEditor(javax.swing.JTextField textField, java.beans.PropertyEditor propertyEditor)
          Constructor for the TextField version
PropertyCellEditor(oracle.dacf.style.control.properties.PropertyPanel pPanel, java.beans.PropertyEditor propertyEditor)
          Constructor for the ComboBox version
 
Method Summary
 void addCellEditorListener(javax.swing.event.CellEditorListener l)
          Adds a CellEditorListener
 void cancelCellEditing()
          Tell the editor to cancel editing and not accept any partially edited value.
protected  void fireEditingCanceled()
           
protected  void fireEditingStopped()
           
 java.lang.Object getCellEditorValue()
          Returns the value contained in the editor
 int getClickCountToStart()
          returns the clickCountToStart value
 java.awt.Component getComponent()
          returns the property editor component
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Returns the component that should be added to the client's Component hierarchy.
 boolean isCellEditable(java.util.EventObject anEvent)
          Ask the editor if it can start editing using anEvent.
 void removeCellEditorListener(javax.swing.event.CellEditorListener l)
          Remove a CellEditorListener
 void setClickCountToStart(int count)
          clickCountToStart controls the number of clicks required to start editing if the event passed to isCellEditable() or startCellEditing() is a MouseEvent.
 boolean shouldSelectCell(java.util.EventObject anEvent)
          Tell the editor to start editing using anEvent.
 boolean stopCellEditing()
          Tell the editor to stop editing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_listenerList

protected javax.swing.event.EventListenerList _listenerList
Event listeners


_changeEvent

protected javax.swing.event.ChangeEvent _changeEvent

_editorComponent

protected javax.swing.JComponent _editorComponent

_delegate

protected oracle.dacf.style.control.PropertyCellEditor.EditorDelegate _delegate

_clickCountToStart

protected int _clickCountToStart

_propertyEditor

protected java.beans.PropertyEditor _propertyEditor
Constructor Detail

PropertyCellEditor

public PropertyCellEditor(javax.swing.JTextField textField,
                          java.beans.PropertyEditor propertyEditor)
Constructor for the TextField version

Parameters:
textField - the textfield you will use for editing
propertyEditor - the Property editor

PropertyCellEditor

public PropertyCellEditor(javax.swing.JComboBox comboBox,
                          java.beans.PropertyEditor propertyEditor)
Constructor for the ComboBox version

Parameters:
comboBox - the comboBox you will use for editing
propertyEditor - the Property editor

PropertyCellEditor

public PropertyCellEditor(oracle.dacf.style.control.properties.PropertyPanel pPanel,
                          java.beans.PropertyEditor propertyEditor)
Constructor for the ComboBox version

Parameters:
pPanel - the PropertyPanel that displays the values and popups the editor in a Dialog
propertyEditor - the Property editor
Method Detail

getComponent

public java.awt.Component getComponent()
returns the property editor component

Returns:
the Component that represents the Property Editor

setClickCountToStart

public void setClickCountToStart(int count)
clickCountToStart controls the number of clicks required to start editing if the event passed to isCellEditable() or startCellEditing() is a MouseEvent. For example, by default the clickCountToStart for a JTextField is set to 2, so in a JTable the user will need to double click to begin editing a cell. This method sets the clickCountToStart

Parameters:
count - the new clickCountToStart value

getClickCountToStart

public int getClickCountToStart()
returns the clickCountToStart value

Returns:
the clickCountToStart value

getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the value contained in the editor

Specified by:
getCellEditorValue in interface javax.swing.CellEditor
Returns:
the value contained in the editor

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Ask the editor if it can start editing using anEvent.

Specified by:
isCellEditable in interface javax.swing.CellEditor
Parameters:
anEvent - the event the editor should use to consider whether to begin editing or not.
Returns:
true if editing can be started.
See Also:
#shouldSelectCell()

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject anEvent)
Tell the editor to start editing using anEvent.

Specified by:
shouldSelectCell in interface javax.swing.CellEditor
Parameters:
anEvent - the event the editor should use to start editing.
Returns:
true if the editor would like the editing cell to be selected
See Also:
#isCellEditable()

stopCellEditing

public boolean stopCellEditing()
Tell the editor to stop editing

Specified by:
stopCellEditing in interface javax.swing.CellEditor
Returns:
true if editing was stopped

cancelCellEditing

public void cancelCellEditing()
Tell the editor to cancel editing and not accept any partially edited value.

Specified by:
cancelCellEditing in interface javax.swing.CellEditor

addCellEditorListener

public void addCellEditorListener(javax.swing.event.CellEditorListener l)
Adds a CellEditorListener

Specified by:
addCellEditorListener in interface javax.swing.CellEditor
Parameters:
l - CellEditorListener

removeCellEditorListener

public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Remove a CellEditorListener

Specified by:
removeCellEditorListener in interface javax.swing.CellEditor
Parameters:
l - CellEditorListener

fireEditingStopped

protected void fireEditingStopped()

fireEditingCanceled

protected void fireEditingCanceled()

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Parameters:
table - the JTable that is asking the editor to edit This parameter can be null.
value - the value of the cell to be edited. It is up to the specific editor to interpret and draw the value. eg. 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 value.
isSelected - true is the cell is to be renderer with selection highlighting
row - the row of the cell being edited
column - the column of the cell being edited
Returns:
the component for editing

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.