|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.text.JTextComponent javax.swing.JTextField com.jbbres.lib.actions.tools.swing.JVTextField
public class JVTextField
A text field that can also receive Variable
s as content.
Variable
s should be inputed between %. For example, if you want
to use the content of a variable nammed MyVar
, you need to input
the text as follow: %MyVar%
.
When calling the getText
method, the variable are replaced by
their value (equivalent to calling
myVariable.getValue().toString()
). If the value is
null
, the variable is replaced by an empty String. If no
variable with the given name exists, the text is not changed.
If you want to access to the text without replacement, call
getLogicalText()
.
Nested Class Summary |
---|
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 |
PROPERTY_CONTENT
The property associated to the content of the text field. |
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 | |
---|---|
JVTextField()
Constructs a new TextField. |
|
JVTextField(javax.swing.text.Document doc,
java.lang.String text,
int columns)
Constructs a new JTextField that uses the given text storage model and the given number of columns. |
|
JVTextField(int columns)
Constructs a new empty TextField with the specified number of columns. |
|
JVTextField(java.lang.String text)
Constructs a new TextField initialized with the specified text. |
|
JVTextField(java.lang.String text,
int columns)
Constructs a new TextField initialized with the specified text and columns. |
|
JVTextField(Workflow workflow)
Constructs a new TextField. |
|
JVTextField(Workflow workflow,
javax.swing.text.Document doc,
java.lang.String text,
int columns)
Constructs a new JTextField that uses the given text storage model and the given number of columns. |
|
JVTextField(Workflow workflow,
int columns)
Constructs a new empty TextField with the specified number of columns. |
|
JVTextField(Workflow workflow,
java.lang.String text)
Constructs a new TextField initialized with the specified text. |
|
JVTextField(Workflow workflow,
java.lang.String text,
int columns)
Constructs a new TextField initialized with the specified text and columns. |
Method Summary | |
---|---|
java.lang.String |
getLogicalSelectedText()
Returns the text contained in this TextComponent, coded with variable values. |
java.lang.String |
getLogicalText()
Returns the text contained in this TextComponent, coded with variable values. |
java.util.Properties |
getProperties()
Returns the properties describing the current status of the JTextField. |
java.lang.String |
getSelectedText()
|
java.lang.String |
getText()
|
java.lang.String |
getText(int offs,
int len)
|
Workflow |
getWorkflow()
Returns the workflow. |
void |
setProperties(java.util.Properties properties)
Sets the JTextField with the given properties. |
void |
setWorkflow(Workflow workflow)
Set the workflow associated to the JVariableTextField . |
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, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, 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, getMinimumSize, 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 |
---|
public static final java.lang.String PROPERTY_CONTENT
Constructor Detail |
---|
public JVTextField(Workflow workflow)
workflow
- - the workflow associated to the objectpublic JVTextField(Workflow workflow, javax.swing.text.Document doc, java.lang.String text, int columns)
workflow
- - the workflow associated to the objectdoc
- - the text storage to use; if this is null, a default will be
provided by calling the createDefaultModel methodtext
- - the initial string to display, or nullcolumns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(Workflow workflow, int columns)
workflow
- - the workflow associated to the objectcolumns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(Workflow workflow, java.lang.String text, int columns)
workflow
- - the workflow associated to the objecttext
- - the initial string to display, or nullcolumns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(Workflow workflow, java.lang.String text)
workflow
- - the workflow associated to the objecttext
- - the initial string to display, or nullpublic JVTextField()
Using this constructor is not recommanded. You should prefer use
JVariableTextField(Workflow)
as the associated workflow
required to be defined in order to work properly. If you do not know the
workflow, does not forget to call the setWorkflow(Workflow)
method once you will know it.
public JVTextField(javax.swing.text.Document doc, java.lang.String text, int columns)
Using this constructor is not recommanded. You should prefer use
JVariableTextField(Workflow, Document, String, int)
as the
associated workflow required to be defined in order to work properly. If
you do not know the workflow, does not forget to call the
setWorkflow(Workflow)
method once you will know it.
doc
- - the text storage to use; if this is null, a default will be
provided by calling the createDefaultModel methodtext
- - the initial string to display, or nullcolumns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(int columns)
Using this constructor is not recommanded. You should prefer use
JVariableTextField(Workflow, int)
as the associated workflow
required to be defined in order to work properly. If you do not know the
workflow, does not forget to call the setWorkflow(Workflow)
method once you will know it.
columns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(java.lang.String text, int columns)
Using this constructor is not recommanded. You should prefer use
JVariableTextField(Workflow, String, int)
as the associated
workflow required to be defined in order to work properly. If you do not
know the workflow, does not forget to call the
setWorkflow(Workflow)
method once you will know it.
text
- - the initial string to display, or nullcolumns
- - the number of columns to use to calculate the preferred
width >= 0; if columns is set to zero, the preferred width
will be whatever naturally results from the component
implementationpublic JVTextField(java.lang.String text)
Using this constructor is not recommanded. You should prefer use
JVariableTextField(Workflow, String)
as the associated
workflow required to be defined in order to work properly. If you do not
know the workflow, does not forget to call the
setWorkflow(Workflow)
method once you will know it.
text
- - the initial string to display, or nullMethod Detail |
---|
public java.lang.String getText()
getText
in class javax.swing.text.JTextComponent
public java.lang.String getLogicalText()
public java.lang.String getLogicalSelectedText()
public java.lang.String getSelectedText()
getSelectedText
in class javax.swing.text.JTextComponent
public java.lang.String getText(int offs, int len) throws javax.swing.text.BadLocationException
getText
in class javax.swing.text.JTextComponent
javax.swing.text.BadLocationException
public void setWorkflow(Workflow workflow)
JVariableTextField
. The
workflow is used to iddentify and link to Variable
s
workflow
- - the workflowpublic Workflow getWorkflow()
public java.util.Properties getProperties()
getProperties
in interface com.jbbres.lib.PropertiesOwner
public void setProperties(java.util.Properties properties)
setProperties
in interface com.jbbres.lib.PropertiesOwner
properties
- - properties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |