org.openswing.swing.client
Class BaseInputControl

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.openswing.swing.client.BaseInputControl
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, InputControl, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
CheckBoxListControl, CodLookupControl, ComboBoxControl, ComboBoxVOControl, CurrencyControl, DateControl, FormattedTextControl, ImageControl, ListControl, ListVOControl, NumericControl, ProgressBarControl, SpinnerListControl, SpinnerNumberControl, TextAreaControl, TextControl

public class BaseInputControl
extends javax.swing.JPanel
implements InputControl

Title: OpenSwing Framework

Description: Class that could be used as bease class for an input control.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BaseInputControl()
          Constructor.
 
Method Summary
 void addValueChangedListener(ValueChangeListener listener)
          Add a value changed listener to this input control.
 java.lang.String getAttributeName()
          Link the input control to the form which contains it and with the specified the attribute.
 javax.swing.JComponent getBindingComponent()
           
 java.awt.Font getFont()
           
 LabelControl getLinkLabel()
           
 int getTextAlignment()
           
 java.lang.String getToolTipText()
           
 java.lang.Object getValue()
           
 ValueChangeListener[] getValueChangeListeners()
           
 boolean isCanCopy()
           
 boolean isChanged()
           
 boolean isEnabled()
           
 boolean isEnabledOnEdit()
           
 boolean isEnabledOnInsert()
           
 boolean isRequired()
           
 void removeValueChangedListener(ValueChangeListener listener)
          Remove a value changed listener from this input control.
 void requestFocus()
           
 void setAttributeName(java.lang.String attributeName)
          Link the input control to the form which contains it and with the specified the attribute.
 void setCanCopy(boolean canCopy)
          Define if the input control value is duplicated when user has clicked on COPY button.
 void setChanged(boolean changed)
          Define if the input control value is changed.
 void setEnabled(boolean enabled)
          Set current input control abilitation.
 void setEnabledOnEdit(boolean enabled)
          Define if the input control is enabled on EDIT mode, false otherwise
 void setEnabledOnInsert(boolean enabled)
          Define if the input control is enabled on INSERT mode.
 void setFont(java.awt.Font font)
          Set the specified font.
 void setLinkLabel(LabelControl linkedLabel)
          Link the input control label to the specified label.
 void setRequired(boolean required)
          Define mandatory property of the input control.
 void setTextAlignment(int alignment)
          Set column text horizontal alignement.
 void setToolTipText(java.lang.String toolTipText)
          Set a tooltip text.
 void setValue(java.lang.Object value)
          Set value to the input control.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openswing.swing.client.InputControl
addFocusListener, removeFocusListener
 

Constructor Detail

BaseInputControl

public BaseInputControl()
Constructor.

Method Detail

getBindingComponent

public javax.swing.JComponent getBindingComponent()
Returns:
component inside this whose contains the value

addValueChangedListener

public final void addValueChangedListener(ValueChangeListener listener)
Add a value changed listener to this input control.

Specified by:
addValueChangedListener in interface InputControl
Parameters:
listener - value changed listener to add

removeValueChangedListener

public final void removeValueChangedListener(ValueChangeListener listener)
Remove a value changed listener from this input control.

Specified by:
removeValueChangedListener in interface InputControl
Parameters:
listener - value changed listener to remove

setLinkLabel

public final void setLinkLabel(LabelControl linkedLabel)
Link the input control label to the specified label.

Specified by:
setLinkLabel in interface InputControl
Parameters:
linkedLabel - label used when showing error messages related to the input control

getLinkLabel

public final LabelControl getLinkLabel()
Specified by:
getLinkLabel in interface InputControl
Returns:
label used when showing error messages related to the input control

isRequired

public final boolean isRequired()
Specified by:
isRequired in interface InputControl
Returns:
mandatory property of the input control

getFont

public final java.awt.Font getFont()
Specified by:
getFont in interface java.awt.MenuContainer
Returns:
current Font setting

setFont

public final void setFont(java.awt.Font font)
Set the specified font.

Parameters:
font - Font to set

setToolTipText

public final void setToolTipText(java.lang.String toolTipText)
Set a tooltip text. This text will be translated according to the internationalization settings.

Parameters:
toolTipText - tool tip text entry in the dictionary

getToolTipText

public final java.lang.String getToolTipText()
Returns:
tool tip text entry in the dictionary

setRequired

public final void setRequired(boolean required)
Define mandatory property of the input control.


isEnabledOnInsert

public final boolean isEnabledOnInsert()
Specified by:
isEnabledOnInsert in interface InputControl
Returns:
true if the input control is enabled on INSERT mode, false otherwise

setEnabledOnInsert

public final void setEnabledOnInsert(boolean enabled)
Define if the input control is enabled on INSERT mode.

Specified by:
setEnabledOnInsert in interface InputControl
Parameters:
enabled - true if the input control is enabled on INSERT mode, false otherwise

isEnabledOnEdit

public final boolean isEnabledOnEdit()
Specified by:
isEnabledOnEdit in interface InputControl
Returns:
true if the input control is enabled on EDIT mode, false otherwise

setEnabledOnEdit

public final void setEnabledOnEdit(boolean enabled)
Define if the input control is enabled on EDIT mode, false otherwise

Specified by:
setEnabledOnEdit in interface InputControl
Parameters:
enabled - mandatory property of the input control

isCanCopy

public final boolean isCanCopy()
Specified by:
isCanCopy in interface InputControl
Returns:
define if the input control value is duplicated when user has clicked on COPY button

setCanCopy

public final void setCanCopy(boolean canCopy)
Define if the input control value is duplicated when user has clicked on COPY button.

Specified by:
setCanCopy in interface InputControl
Parameters:
canCopy - define if the input control value is duplicated when user has clicked on COPY button

setAttributeName

public final void setAttributeName(java.lang.String attributeName)
Link the input control to the form which contains it and with the specified the attribute.

Specified by:
setAttributeName in interface InputControl
Parameters:
attributeName - attribute name to which link the input control

getAttributeName

public final java.lang.String getAttributeName()
Link the input control to the form which contains it and with the specified the attribute.

Specified by:
getAttributeName in interface InputControl

setEnabled

public void setEnabled(boolean enabled)
Set current input control abilitation.

Specified by:
setEnabled in interface InputControl

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface InputControl
Returns:
current input control abilitation

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface InputControl
Returns:
value related to the input control

setValue

public void setValue(java.lang.Object value)
Set value to the input control.

Specified by:
setValue in interface InputControl
Parameters:
value - value to set into the input control

isChanged

public final boolean isChanged()
Specified by:
isChanged in interface InputControl
Returns:
true if the input control value is changed, false otherwise

setChanged

public final void setChanged(boolean changed)
Define if the input control value is changed.

Specified by:
setChanged in interface InputControl
Parameters:
changed - true if the input control value is changed, false otherwise

getValueChangeListeners

public final ValueChangeListener[] getValueChangeListeners()
Specified by:
getValueChangeListeners in interface InputControl
Returns:
value changed listeners list

requestFocus

public void requestFocus()

getTextAlignment

public final int getTextAlignment()
Returns:
column text horizontal alignment

setTextAlignment

public final void setTextAlignment(int alignment)
Set column text horizontal alignement.

Parameters:
alignment - column text horizontal alignement; possible values: "SwingConstants.LEFT", "SwingConstants.RIGHT", "SwingConstants.CENTER".