org.progeeks.meta.swing.editor
Class AbstractSpinnerEditor

java.lang.Object
  extended by org.progeeks.meta.swing.AbstractPropertyUI
      extended by org.progeeks.meta.swing.AbstractPropertyEditor
          extended by org.progeeks.meta.swing.editor.AbstractSpinnerEditor
All Implemented Interfaces:
MetaPropertyEditor, MetaPropertyUI
Direct Known Subclasses:
DoubleEditor, FloatEditor, IntegerEditor, SpinnerEnumeratedTypeEditor

public abstract class AbstractSpinnerEditor
extends AbstractPropertyEditor

Basic spinner control editor implementation.

Version:
$Revision: 1.10 $
Author:
Paul Speed

Constructor Summary
protected AbstractSpinnerEditor()
           
protected AbstractSpinnerEditor(MetaPropertyContext viewContext)
           
 
Method Summary
protected  void componentChanged()
           
protected  javax.swing.JSpinner createSpinner()
          Deprecated.  
protected abstract  java.lang.Object getEmptyValue()
           
protected  javax.swing.JFormattedTextField getFormattedTextField()
          Returns the JFormattedTextField that is used to display the spinner values.
 java.awt.Component getUIComponent()
          Returns the component that allows modification of the associated property mutator.
protected  void releaseComponent()
          Implemented by subclasses to release any component-related resources.
protected  void resetComponentValue()
          Called to set the component value to a default state.
protected  void setComponentValue(java.lang.Object value)
          Called to set the current value displayed in the component.
 void setPropertyMutator(PropertyMutator mutator)
          Overridden to configure an appropriate text field formatter as necessary.
 
Methods inherited from class org.progeeks.meta.swing.AbstractPropertyEditor
flushEdits
 
Methods inherited from class org.progeeks.meta.swing.AbstractPropertyUI
getPropertyMutator, getViewContext, initializeView, isLabeled, isSingleColumn, propertyChanged, release, setPropertyValue, setupToolTipText, terminateView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.progeeks.meta.swing.MetaPropertyUI
getViewContext, initializeView, isLabeled, isSingleColumn, release
 

Constructor Detail

AbstractSpinnerEditor

protected AbstractSpinnerEditor()

AbstractSpinnerEditor

protected AbstractSpinnerEditor(MetaPropertyContext viewContext)
Method Detail

setPropertyMutator

public void setPropertyMutator(PropertyMutator mutator)
Overridden to configure an appropriate text field formatter as necessary. Default implementation calls getFormattedTextField() and installs the appropriate format factory for any non-null text field. Subclasses can therefore avoid this behavior by overridding the getFormattedTextField() method to return null. Alternately, if no MetaPropertyContext was given to this class then no attempt will be made to override formatting from default toString() behavior.

Specified by:
setPropertyMutator in interface MetaPropertyUI
Overrides:
setPropertyMutator in class AbstractPropertyUI

getUIComponent

public java.awt.Component getUIComponent()
Returns the component that allows modification of the associated property mutator.

Specified by:
getUIComponent in interface MetaPropertyUI
Specified by:
getUIComponent in class AbstractPropertyUI

releaseComponent

protected void releaseComponent()
Implemented by subclasses to release any component-related resources.

Specified by:
releaseComponent in class AbstractPropertyEditor

createSpinner

protected final javax.swing.JSpinner createSpinner()
Deprecated. 

Kill this when all uses have been verified removed.


getEmptyValue

protected abstract java.lang.Object getEmptyValue()

resetComponentValue

protected void resetComponentValue()
Called to set the component value to a default state. The default implementation calls setComponentValue(null).

Overrides:
resetComponentValue in class AbstractPropertyUI

setComponentValue

protected void setComponentValue(java.lang.Object value)
Called to set the current value displayed in the component.

Specified by:
setComponentValue in class AbstractPropertyUI

componentChanged

protected void componentChanged()

getFormattedTextField

protected javax.swing.JFormattedTextField getFormattedTextField()
Returns the JFormattedTextField that is used to display the spinner values. This method is provided for two reasons: 1) for convenience and 2) so that subclasses can return null if they'd rather not have their values auto-formatted.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.