LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingText

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingFieldItem
              extended by leon.view.win.swing.LySwingText
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.util.EventListener, javax.swing.event.DocumentListener, LyActionListener, LyEventTransmitter, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalText, LyViewComponent, LyFreeInterface, LySetEditableInterface, LySetEnabledInterface, LySetLabelInterface, LySwingComponent

public class LySwingText
extends LySwingFieldItem
implements LySwingComponent, java.awt.event.FocusListener, java.awt.event.KeyListener, javax.swing.event.DocumentListener, LyActionListener, LySetLabelInterface, LySetEnabledInterface, LySetEditableInterface, LyGraphicalText

This class implements the Text object (as described in the dtd) for swing viewer.

An input field of Text type allows to display a graphical input or text consultation component. It does not comprise any element. It is possible to specify if the text should be hidden, if it should respect a given format, if it can be divided into several lines and the maximum number of characters that it can contain.

See Also:
LyText

Nested Class Summary
 class LySwingText._LyJScrollPane
          Handles text areas scoll panels.
 
Field Summary
static java.lang.String __VERSION
           
static java.lang.String CHANGE_KEY_MAPPING
          Change the default key binding.
 
Constructor Summary
LySwingText(LyText text)
          Class constructor of a Text object for the Swing target.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void changedUpdate(javax.swing.event.DocumentEvent e)
          Nothing is done when document events are triggered at a changed property.
 void focusGained(java.awt.event.FocusEvent e)
          (non-Javadoc).
 void focusLost(java.awt.event.FocusEvent e)
          (non-Javadoc).
 LyJAutoCompletionViewer getAutoCompletionViewer()
           
 java.awt.Component getComponent()
          (non-Javadoc).
 void initialize()
          Builds the text component and places it in the scroll panel if needed.
 void insertUpdate(javax.swing.event.DocumentEvent e)
          Restores the text component at every insertion update.
 boolean isEditable()
          Indicates if the field item is editable or not.
 void keyPressed(java.awt.event.KeyEvent e)
          Keeps the focus when the user pressed the Enter key and it is necessary to keep it.
 void keyReleased(java.awt.event.KeyEvent e)
          Nothing is done when a key is released.
 void keyTyped(java.awt.event.KeyEvent e)
          Nothing is done when a key is typed.
 void removeUpdate(javax.swing.event.DocumentEvent e)
          Restores the text component at every removing update.
 void setContent()
          Registers keyboard events for this text component.
 void setEditable(boolean editable)
          Sets the editable status of the field item.
 void setEnabled(boolean status)
          Sets the text component editable status.
 void setLabel(java.lang.String labelNew)
          (non-Javadoc).
 
Methods inherited from class leon.view.win.swing.LySwingFieldItem
getActionTransmitter, getSelectionTransmitter
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, free, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

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

CHANGE_KEY_MAPPING

public static java.lang.String CHANGE_KEY_MAPPING
Change the default key binding. When set to true: TAB allows to change the focus field, ENTER validate the form, SHIFT+TAB allows to insert a tab and SHIFT+ENTER to insert a line break. When set to ALTERNATE: TAB allows to change the focus field and CTRL+TAB add a tab character.

Constructor Detail

LySwingText

public LySwingText(LyText text)
Class constructor of a Text object for the Swing target.

Parameters:
text - a TEXT component defined for every type of view targets. This text is initialized specificaly for the Swing view.
Method Detail

initialize

public void initialize()
Builds the text component and places it in the scroll panel if needed.


setContent

public void setContent()
Registers keyboard events for this text component.


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 e)
Nothing is done when a key is typed.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - discarded key event
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Keeps the focus when the user pressed the Enter key and it is necessary to keep it.

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 e)
Nothing is done when a key is released.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - discarded key event
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Nothing is done when document events are triggered at a changed property.

Specified by:
changedUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - discarded document event
See Also:
DocumentListener.changedUpdate(javax.swing.event.DocumentEvent)

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Restores the text component at every insertion update.

Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
See Also:
DocumentListener.insertUpdate(javax.swing.event.DocumentEvent)

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Restores the text component at every removing update.

Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
See Also:
DocumentListener.removeUpdate(javax.swing.event.DocumentEvent)

getAutoCompletionViewer

public LyJAutoCompletionViewer getAutoCompletionViewer()

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)

setLabel

public void setLabel(java.lang.String labelNew)
(non-Javadoc).

Specified by:
setLabel in interface LyGraphicalText
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
labelNew - new label
See Also:
LySetLabelInterface.setLabel(java.lang.String)

setEditable

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

Specified by:
setEditable in interface LySetEditableInterface
Parameters:
editable - new status
See Also:
LySetEditableInterface.setEditable(boolean)

isEditable

public boolean isEditable()
Indicates if the field item is editable or not.

Returns:
true if the field is editable, false otherwise

setEnabled

public void setEnabled(boolean status)
Sets the text component editable status. The status changes the background color of the text component whether it is enabled and editable at the same time, or not.

Specified by:
setEnabled in interface LySetEnabledInterface

getComponent

public java.awt.Component getComponent()
(non-Javadoc).

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
this Swing view component
See Also:
LySwingComponent.getComponent()

(c) January 2013 - W4 S.A.

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