Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.view.swing
Class SComboBoxEditor  view SComboBoxEditor download SComboBoxEditor.java

java.lang.Object
  extended byorg.scopemvc.view.swing.SComboBoxEditor
All Implemented Interfaces:
javax.swing.ComboBoxEditor

public class SComboBoxEditor
extends java.lang.Object
implements javax.swing.ComboBoxEditor

Default combobox editor for SComboBox. It can be used for any value class for which a StringConvertor exists. The editor is created in SComboBox constructor, so it can be safely obtained with call getEditor.

The StringConvertor is obtained from StringConvertors to match the type of object being edited.

Version:
$Revision: 1.7 $ $Date: 2002/01/26 09:46:20 $

Field Summary
private  javax.swing.JTextField component
           
private  org.scopemvc.util.convertor.StringConvertor convertor
           
private static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
SComboBoxEditor()
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Add an ActionListener.
private  void createStringConvertor(java.lang.Object value)
          Returns current string convertor.
 java.awt.Component getEditorComponent()
          Return the component that should be added to the tree hierarchy for this editor
 java.lang.Object getItem()
          Return the edited item.
 void removeActionListener(java.awt.event.ActionListener l)
          Remove an ActionListener
 void selectAll()
          Ask the editor to start editing and to select everything
 void setItem(java.lang.Object anObject)
          Set the item that should be edited.
 void setStringConvertor(org.scopemvc.util.convertor.StringConvertor conv)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.commons.logging.Log LOG

convertor

private org.scopemvc.util.convertor.StringConvertor convertor

component

private javax.swing.JTextField component
Constructor Detail

SComboBoxEditor

public SComboBoxEditor()
Method Detail

setStringConvertor

public final void setStringConvertor(org.scopemvc.util.convertor.StringConvertor conv)

getItem

public java.lang.Object getItem()
                         throws java.lang.IllegalStateException
Return the edited item.

Specified by:
getItem in interface javax.swing.ComboBoxEditor

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Add an ActionListener. An action event is generated when the edited item changes

Specified by:
addActionListener in interface javax.swing.ComboBoxEditor

createStringConvertor

private void createStringConvertor(java.lang.Object value)
Returns current string convertor. If convertor was not set tries to obtain new one.


setItem

public void setItem(java.lang.Object anObject)
Set the item that should be edited. Cancel any editing if necessary

Specified by:
setItem in interface javax.swing.ComboBoxEditor

selectAll

public void selectAll()
Ask the editor to start editing and to select everything

Specified by:
selectAll in interface javax.swing.ComboBoxEditor

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Remove an ActionListener

Specified by:
removeActionListener in interface javax.swing.ComboBoxEditor

getEditorComponent

public java.awt.Component getEditorComponent()
Return the component that should be added to the tree hierarchy for this editor

Specified by:
getEditorComponent in interface javax.swing.ComboBoxEditor