org.jfree.report.modules.gui.config.editor
Class AbstractKeyEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.jfree.report.modules.gui.config.editor.AbstractKeyEditor
Direct Known Subclasses:
EnumKeyEditor, TextKeyEditor

public abstract class AbstractKeyEditor
extends javax.swing.JComponent
implements KeyEditor

This key editor class is the base class for all key editor components. It provides common services usable for most key editor implementation.

Author:
Thomas Morgner
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String VALID_INPUT_PROPERTY
          A constant for the "validInput" property name.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AbstractKeyEditor(org.jfree.base.config.HierarchicalConfiguration config, ConfigDescriptionEntry entry)
          Creates a new key editor for the given report configuration and key entry.
 
Method Summary
protected  void deleteValue()
          Removes the value from the configuration; the configuration will fall back to the default value from the global configuration.
 javax.swing.JComponent getComponent()
          Returns the editor component; this implementation returns the "this" reference.
 org.jfree.util.Configuration getConfig()
          Returns the report configuration instance used for this editor.
protected  javax.swing.Icon getEmptyIcon()
          Returns the empty icon for this an all derived editors.
 ConfigDescriptionEntry getEntry()
          Returns the config description entry of this editor.
protected  javax.swing.Icon getErrorIcon()
          Returns the error icon for this an all derived editors.
 boolean isDefined()
          Checks, whether the local key has a defined value in the local report configuration.
 boolean isValidInput()
          Returns true, if the component validated the entered values, false otherwise.
protected  java.lang.String loadValue()
          Loads the value from the configuration.
protected  void setContentPane(javax.swing.JPanel contentPane)
          Defines the content pane for this editor.
protected  void setValidInput(boolean validInput)
          Defines, whether the input is valid.
protected  void storeValue(java.lang.String o)
          Stores the value to the configuration.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALID_INPUT_PROPERTY

public static final java.lang.String VALID_INPUT_PROPERTY
A constant for the "validInput" property name.
Constructor Detail

AbstractKeyEditor

public AbstractKeyEditor(org.jfree.base.config.HierarchicalConfiguration config,
                         ConfigDescriptionEntry entry)
Creates a new key editor for the given report configuration and key entry.
Parameters:
config - the report configuration that supplies the value for the editor
entry - the entry description provides the meta data for the edited key.
Method Detail

getEmptyIcon

protected javax.swing.Icon getEmptyIcon()
Returns the empty icon for this an all derived editors.
Returns:
the empty icon.

getErrorIcon

protected javax.swing.Icon getErrorIcon()
Returns the error icon for this an all derived editors.
Returns:
the error icon.

setContentPane

protected void setContentPane(javax.swing.JPanel contentPane)
Defines the content pane for this editor.
Parameters:
contentPane - the new content pane

getConfig

public org.jfree.util.Configuration getConfig()
Returns the report configuration instance used for this editor.
Returns:
the report configuration instance of this editor.

getEntry

public ConfigDescriptionEntry getEntry()
Returns the config description entry of this editor.
Returns:
the config description entry.

loadValue

protected java.lang.String loadValue()
Loads the value from the configuration.
Returns:
the value of the edited key from the configuration.

storeValue

protected void storeValue(java.lang.String o)
Stores the value to the configuration.
Parameters:
o - the new value for the key of the editor.

deleteValue

protected void deleteValue()
Removes the value from the configuration; the configuration will fall back to the default value from the global configuration.

Deleting the value triggers the isDefined property.


isValidInput

public boolean isValidInput()
Returns true, if the component validated the entered values, false otherwise.
Returns:
true, if the input is valid, false otherwise.

setValidInput

protected void setValidInput(boolean validInput)
Defines, whether the input is valid. This should be called after the value of the component changed.
Parameters:
validInput - true, if the input should be considered valid, false otherwise.

isDefined

public boolean isDefined()
Checks, whether the local key has a defined value in the local report configuration.
Specified by:
isDefined in interface KeyEditor
Returns:
true, if the key is defined, false otherwise.
See Also:
KeyEditor.isDefined()

getComponent

public javax.swing.JComponent getComponent()
Returns the editor component; this implementation returns the "this" reference.
Specified by:
getComponent in interface KeyEditor
Returns:
a reference to this object.
See Also:
KeyEditor.getComponent()