Class AbstractKeyEditor
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- org.pentaho.reporting.tools.configeditor.editor.AbstractKeyEditor
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,KeyEditor
- Direct Known Subclasses:
EnumKeyEditor
,TextKeyEditor
public abstract class AbstractKeyEditor extends 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static String
VALID_INPUT_PROPERTY
A constant for the "validInput" property name.-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractKeyEditor(org.pentaho.reporting.libraries.base.config.HierarchicalConfiguration config, ConfigDescriptionEntry entry)
Creates a new key editor for the given report configuration and key entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteValue()
Removes the value from the configuration; the configuration will fall back to the default value from the global configuration.JComponent
getComponent()
Returns the editor component; this implementation returns the "this" reference.org.pentaho.reporting.libraries.base.config.Configuration
getConfig()
Returns the report configuration instance used for this editor.protected Icon
getEmptyIcon()
Returns the empty icon for this an all derived editors.ConfigDescriptionEntry
getEntry()
Returns the config description entry of this editor.protected 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 String
loadValue()
Loads the value from the configuration.protected void
setContentPane(JPanel contentPane)
Defines the content pane for this editor.protected void
setValidInput(boolean validInput)
Defines, whether the input is valid.protected void
storeValue(String o)
Stores the value to the configuration.-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.tools.configeditor.editor.KeyEditor
getLabelWidth, isEnabled, reset, setEnabled, setLabelWidth, store
-
-
-
-
Field Detail
-
VALID_INPUT_PROPERTY
public static final String VALID_INPUT_PROPERTY
A constant for the "validInput" property name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractKeyEditor
protected AbstractKeyEditor(org.pentaho.reporting.libraries.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 editorentry
- the entry description provides the meta data for the edited key.
-
-
Method Detail
-
getEmptyIcon
protected Icon getEmptyIcon()
Returns the empty icon for this an all derived editors.- Returns:
- the empty icon.
-
getErrorIcon
protected Icon getErrorIcon()
Returns the error icon for this an all derived editors.- Returns:
- the error icon.
-
setContentPane
protected void setContentPane(JPanel contentPane)
Defines the content pane for this editor.- Parameters:
contentPane
- the new content pane
-
getConfig
public org.pentaho.reporting.libraries.base.config.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 String loadValue()
Loads the value from the configuration.- Returns:
- the value of the edited key from the configuration.
-
storeValue
protected void storeValue(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 theisDefined
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.
-
getComponent
public JComponent getComponent()
Returns the editor component; this implementation returns the "this" reference.- Specified by:
getComponent
in interfaceKeyEditor
- Returns:
- a reference to this object.
-
-