LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJTextField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JTextField
                      extended by leon.view.win.swing.component.LyJTextField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, javax.swing.SwingConstants
Direct Known Subclasses:
LyJFormattedField, LyJFormattedInput._LyFormattedField

public class LyJTextField
extends javax.swing.JTextField

This class manage a text field with a popup menu.

See Also:
Serialized Form

Nested Class Summary
 class LyJTextField._LyPopupInvoker
          Defines the mouse event listeners for this popup menu.
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding
 
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
           
static java.lang.String CANCEL
          The cancel string.
static java.lang.String COPY
          The copy string.
static java.lang.String CUT
          The cut string.
static java.lang.String DELETE
          The delete string.
static java.lang.String PASTE
          The paste string.
static java.lang.String SELECT_ALL
          The select all string.
 
Fields inherited from class javax.swing.JTextField
notifyAction
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LyJTextField(javax.swing.text.Document doc, java.lang.String text, int columns, LyEnvironment env)
          Creates a text field with the specified attributes.
LyJTextField(int columns, LyEnvironment env)
          Creates a text field with the specified attributes.
LyJTextField(LyEnvironment env)
          Creates a default text field with an empty text field.
LyJTextField(java.lang.String text, int columns, LyEnvironment env)
          Creates a text field with the specified attributes.
LyJTextField(java.lang.String text, LyEnvironment env)
          Creates a text field with the specified attributes.
 
Method Summary
 javax.swing.JPopupMenu createPopupMenu()
          Creates the editing popup menu and initializes its actions.
 void delete()
          Executes the delete action on the selected text.
 int getColumnWidth()
           
 javax.swing.JPopupMenu getMenu()
          Gets the popup menu of this text field.
 java.awt.Dimension getMinimumSize()
          Keeps the preferred size of text fields in views.
 void init(LyEnvironment env)
          Initializes this component and its attributes in the specified environment.
 void paste()
          Executes the paste action if this text field is editable.
 void showMenu(java.awt.Component comp, int x, int y)
          Shows the popup menu at the specified (x,y) position in the specified component.
 void superPaste()
          Call the paste method of the super class.
 void undo()
          Nothing is done for the undo action.
 
Methods inherited from class javax.swing.JTextField
addActionListener, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, print, print, print, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, addKeyListener, 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, 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, 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

CANCEL

public static java.lang.String CANCEL
The cancel string.


CUT

public static java.lang.String CUT
The cut string.


COPY

public static java.lang.String COPY
The copy string.


PASTE

public static java.lang.String PASTE
The paste string.


DELETE

public static java.lang.String DELETE
The delete string.


SELECT_ALL

public static java.lang.String SELECT_ALL
The select all string.

Constructor Detail

LyJTextField

public LyJTextField(LyEnvironment env)
Creates a default text field with an empty text field.

Parameters:
env - the current environment to access the resources

LyJTextField

public LyJTextField(javax.swing.text.Document doc,
                    java.lang.String text,
                    int columns,
                    LyEnvironment env)
Creates a text field with the specified attributes.

Parameters:
doc - the document model that rules input
text - the initial text of the text field
columns - the number of columns of this text field
env - the current environment to access the resources

LyJTextField

public LyJTextField(int columns,
                    LyEnvironment env)
Creates a text field with the specified attributes. By default, the text field is empty and the default document model is used.

Parameters:
columns - the number of columns of this text field
env - the current environment to access the resources

LyJTextField

public LyJTextField(java.lang.String text,
                    LyEnvironment env)
Creates a text field with the specified attributes. By default, the default document model is used and the number of columns is 0.

Parameters:
text - the initial text of the text field
env - the current environment to access the resources

LyJTextField

public LyJTextField(java.lang.String text,
                    int columns,
                    LyEnvironment env)
Creates a text field with the specified attributes. The default document model is used.

Parameters:
text - the initial text of the text field
columns - the number of columns of this text field
env - the current environment to access the resources
Method Detail

init

public void init(LyEnvironment env)
Initializes this component and its attributes in the specified environment.

Parameters:
env - the current environment

paste

public void paste()
Executes the paste action if this text field is editable.

Overrides:
paste in class javax.swing.text.JTextComponent
See Also:
JTextComponent.paste()

superPaste

public void superPaste()
Call the paste method of the super class.


getColumnWidth

public int getColumnWidth()
Overrides:
getColumnWidth in class javax.swing.JTextField

delete

public void delete()
Executes the delete action on the selected text.


undo

public void undo()
Nothing is done for the undo action.


createPopupMenu

public javax.swing.JPopupMenu createPopupMenu()
Creates the editing popup menu and initializes its actions.

Returns:
the popup menu of this text field

getMenu

public javax.swing.JPopupMenu getMenu()
Gets the popup menu of this text field.

Returns:
the popup menu

showMenu

public void showMenu(java.awt.Component comp,
                     int x,
                     int y)
Shows the popup menu at the specified (x,y) position in the specified component.

Parameters:
comp - the invoking component
x - the x-coordinate to show the popup menu
y - the y-coordinate to show the popup menu

getMinimumSize

public java.awt.Dimension getMinimumSize()
Keeps the preferred size of text fields in views.

Overrides:
getMinimumSize in class javax.swing.JComponent
Returns:
the preferred size
See Also:
Component.getMinimumSize()

(c) January 2013 - W4 S.A.

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