LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJSelector

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by leon.view.win.swing.component.LyJSelector
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, LyActionListener, LyEventTransmitter, LyGetValueInterface, LyIsIdleInterface, LySetEditableInterface, LySetIdleInterface, LySetValueInterface
Direct Known Subclasses:
LyJDictionarySelector, LyJFileSelector, LyJFormattedInput, LyJNumberSelector, LySwingDate._LyJSpecialSelector

public class LyJSelector
extends javax.swing.JPanel
implements java.awt.event.FocusListener, java.awt.event.KeyListener, LyGetValueInterface, LySetValueInterface, LyActionListener, LyEventTransmitter, LySetEditableInterface, LySetIdleInterface, LyIsIdleInterface

This class defines a component containing a text field and a set of buttons.

See Also:
TextField, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String __VERSION
           
 
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
LyJSelector(java.lang.String value, LyEnvironment env, boolean useArrows)
          Creates a new selector component with the specified text value.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 LyJButton addButton(java.awt.Image image, java.lang.String label)
          Creates a button with the specified attributes and registers the action listeners then adds it to this component's buttons panel.
 void addKeyListener(java.awt.event.KeyListener listener)
          Adds a key listener on the text field.
 void focusGained(java.awt.event.FocusEvent e)
          (non-Javadoc).
 void focusLost(java.awt.event.FocusEvent e)
          (non-Javadoc).
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 javax.swing.JPanel getButtons()
          Gets the buttons panel of this component.
 java.awt.Dimension getPreferredSize()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          This selector doesn't handle selection events, so it has no selection transmitter.
 LyJTextField getTextField()
          Gets the text field of this component.
 java.lang.String getValue()
          (non-Javadoc).
 boolean isEditable()
          Checks if this component is editable or not.
 boolean isIdle()
          (non-Javadoc).
 void keyPressed(java.awt.event.KeyEvent evt)
          (non-Javadoc).
 void keyReleased(java.awt.event.KeyEvent evt)
          Nothing is done.
 void keyTyped(java.awt.event.KeyEvent evt)
          Nothing is done.
 void requestFocus()
          (non-Javadoc).
 void setAutorizeEnabledButtons(boolean enable)
          Autorize the button to be enabled
 void setBackColor(java.awt.Color color)
          Sets the background color.
 void setBackground(java.awt.Color color)
          (non-Javadoc).
 void setComponent(java.awt.Component comp)
          Adds the specified component as the "East" position of this component.
 void setDisabledColor(java.awt.Color color)
          Sets the disabled color.
 void setEditable(boolean editable)
          Sets the editable status of the field item.
 void setEnabled(boolean enable)
          (non-Javadoc).
 void setEnabledColor(java.awt.Color color)
          Sets the enabled color.
 void setFont(java.awt.Font font)
          (non-Javadoc).
 void setIdle(boolean status)
          (non-Javadoc).
 void setMaxChars(int maxChars)
          Sets the maximum number of characters of this component's text area.
 void setNCols(int nCols)
          Sets the number of text columns.
 void setValue(java.lang.String str)
          (non-Javadoc).
 void setValue(java.lang.String str, boolean notify)
          Changes the value of the text component.
 void setWidth(int width)
          Sets the width of this component.
 LyJTextField textFieldFactory()
          Creates and initializes a new TextField instance.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyJSelector

public LyJSelector(java.lang.String value,
                   LyEnvironment env,
                   boolean useArrows)
Creates a new selector component with the specified text value.

Parameters:
value - the text value of this component
env - the current environment
Method Detail

addButton

public LyJButton addButton(java.awt.Image image,
                           java.lang.String label)
Creates a button with the specified attributes and registers the action listeners then adds it to this component's buttons panel.

Parameters:
image - the image to associate to the button
label - the label of this button
Returns:
the newly created button

setEnabledColor

public void setEnabledColor(java.awt.Color color)
Sets the enabled color.

Parameters:
color - the new enabled color

setDisabledColor

public void setDisabledColor(java.awt.Color color)
Sets the disabled color.

Parameters:
color - the new disabled color

setComponent

public void setComponent(java.awt.Component comp)
Adds the specified component as the "East" position of this component.

Parameters:
comp - the component to add

setBackColor

public void setBackColor(java.awt.Color color)
Sets the background color.

Parameters:
color - the new background color

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
(non-Javadoc).

Specified by:
actionPerformed in interface LyActionListener
See Also:
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Nothing is done.

Specified by:
keyTyped in interface java.awt.event.KeyListener
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
(non-Javadoc).

Specified by:
keyPressed in interface java.awt.event.KeyListener
See Also:
KeyListener.keyPressed(java.awt.event.KeyEvent)

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Nothing is done.

Specified by:
keyReleased in interface java.awt.event.KeyListener
See Also:
KeyListener.keyReleased(java.awt.event.KeyEvent)

setMaxChars

public void setMaxChars(int maxChars)
Sets the maximum number of characters of this component's text area.

Parameters:
maxChars - the maximum width of the text

setNCols

public void setNCols(int nCols)
Sets the number of text columns.

Parameters:
nCols - the number of text columns

setWidth

public void setWidth(int width)
Sets the width of this component.

Parameters:
width - the width of this component. Use -1 for automatic calculation.

getPreferredSize

public java.awt.Dimension getPreferredSize()
(non-Javadoc).

Overrides:
getPreferredSize in class javax.swing.JComponent
See Also:
Component.getPreferredSize()

getTextField

public LyJTextField getTextField()
Gets the text field of this component.

Returns:
the text field

getButtons

public javax.swing.JPanel getButtons()
Gets the buttons panel of this component.

Returns:
the buttons panel

getValue

public java.lang.String getValue()
(non-Javadoc).

Specified by:
getValue in interface LyGetValueInterface
See Also:
LyGetValueInterface.getValue()

setValue

public final void setValue(java.lang.String str)
(non-Javadoc).

Specified by:
setValue in interface LySetValueInterface
Parameters:
str - the new value of the Value attribute
See Also:
LySetValueInterface.setValue(java.lang.String)

setValue

public void setValue(java.lang.String str,
                     boolean notify)
Changes the value of the text component.

Parameters:
str - the new value
notify - Indicates that the action transmitter must be notified of this change.
See Also:
getValue()

setAutorizeEnabledButtons

public void setAutorizeEnabledButtons(boolean enable)
Autorize the button to be enabled

Parameters:
enable - if false the button will never be enable

setEnabled

public void setEnabled(boolean enable)
(non-Javadoc).

Overrides:
setEnabled in class javax.swing.JComponent
See Also:
Component.setEnabled(boolean)

textFieldFactory

public LyJTextField textFieldFactory()
Creates and initializes a new TextField instance.

Returns:
the new text field

requestFocus

public void requestFocus()
(non-Javadoc).

Overrides:
requestFocus in class javax.swing.JComponent
See Also:
JComponent.requestFocus()

focusGained

public void focusGained(java.awt.event.FocusEvent e)
(non-Javadoc).

Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)

focusLost

public void focusLost(java.awt.event.FocusEvent e)
(non-Javadoc).

Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

setIdle

public void setIdle(boolean status)
(non-Javadoc).

Specified by:
setIdle in interface LySetIdleInterface
Parameters:
status - new idle status (LySetIdleInterface interface)
See Also:
LySetIdleInterface.setIdle(boolean)

isIdle

public boolean isIdle()
(non-Javadoc).

Specified by:
isIdle in interface LyIsIdleInterface
Returns:
true if the component is idle (it is not refreshed when modifications are applied).
See Also:
LyIsIdleInterface.isIdle()

isEditable

public boolean isEditable()
Checks if this component is editable or not.

Returns:
true if this component is editable, false otherwise
See Also:
setEditable(boolean)

setEditable

public void setEditable(boolean editable)
Sets the editable status of the field item.

Specified by:
setEditable in interface LySetEditableInterface
See Also:
LySetEditableInterface.setEditable(boolean), isEditable()

setBackground

public void setBackground(java.awt.Color color)
(non-Javadoc).

Overrides:
setBackground in class javax.swing.JComponent
See Also:
Component.setBackground(java.awt.Color)

setFont

public void setFont(java.awt.Font font)
(non-Javadoc).

Overrides:
setFont in class javax.swing.JComponent
See Also:
Component.setFont(java.awt.Font)

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
This selector doesn't handle selection events, so it has no selection transmitter.

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
null
See Also:
LyEventTransmitter.getSelectionTransmitter()

addKeyListener

public void addKeyListener(java.awt.event.KeyListener listener)
Adds a key listener on the text field.

Overrides:
addKeyListener in class java.awt.Component
See Also:
Component.addKeyListener(java.awt.event.KeyListener)

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com