|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
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
oracle.javatools.ui.search.PromptedTextField
oracle.javatools.ui.ExtendedTextField
public final class ExtendedTextField
A custom text component for use where the contents of a text field may be considerably longer than the visible area of the text field, and where using a larger JTextArea is not suitable.
When the field has focus and its contents are too large to display: a popup window will appear containing a multi-line text area that shows the contents of the field. This text area is fully editable and will un-pop when either:
- the focus is lost (see below)
- the contents are deleted so they can all fit in the standard field.
- the user hits Esc, Enter or Tab
To prevent the extended area from automatically hiding when it loses focus:
- Mark an individual component with the "don't hide" constant: component.putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE)
- or mark a whole window by putting the "don't hide" constant in it's rootPane: window.getJRootPane().putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
javax.swing.JTextField.AccessibleJTextField |
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.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE Add this constant with Boolean.TRUE to a components client properties to prevent the extended text area from hiding when it loses focus to the component: component.putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE) or use: window.getJRootPane().putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE) to prevent the text area from hiding when a window gets focus |
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 |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
ExtendedTextField() |
|
ExtendedTextField(boolean allowTabs) Create a ExtendedTextArea |
Method Summary | |
---|---|
void |
addNotify() |
boolean |
canAllowBreaks() If false line breaks are filtered like in a standard text field and the default dialog action is called instead (JTextField.NotifyAction) |
static java.lang.String |
getClipString(java.awt.FontMetrics fm, java.lang.String string, int availTextWidth) |
javax.swing.BoundedRangeModel |
getHorizontalVisibility() |
javax.swing.JTextArea |
getLargerTextArea() |
java.awt.Dimension |
getMinimumSize() |
java.awt.Dimension |
getPreferredSize() |
protected int |
getRowHeight() |
protected void |
paintComponent(java.awt.Graphics g) |
protected void |
processFocusEvent(java.awt.event.FocusEvent e) |
void |
removeNotify() |
void |
scrollRectToVisible(java.awt.Rectangle r) |
void |
setAllowBreaks(boolean allowBreaks) Determines whether the control allows inputing of line breaks ('\n', enter) like a text field (no - they are filtered and the default dialog action can be called instead) or like a text area (yes). |
void |
setBackground(java.awt.Color color) |
void |
setDocument(javax.swing.text.Document doc) |
void |
setFont(java.awt.Font font) |
void |
setForeground(java.awt.Color color) |
void |
setLargerAreaVisible(boolean visible) |
void |
setScrollOffset(int scrollOffset) |
void |
setText(java.lang.String text) |
Methods inherited from class oracle.javatools.ui.search.PromptedTextField |
---|
getBaseDocument, getPrompt, getPromptForeground, isPromptVisible, setPrompt, setPromptForeground |
Methods inherited from class javax.swing.JTextField |
---|
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, setAction, setActionCommand, setColumns, setHorizontalAlignment |
Methods inherited from class javax.swing.text.JTextComponent |
---|
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, 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, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, 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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE
component.putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE)
window.getJRootPane().putClientProperty(ExtendedTextField.DONT_HIDE_COMPONENT_ON_FOCUS_CHANGE, Boolean.TRUE)
Constructor Detail |
---|
public ExtendedTextField()
public ExtendedTextField(boolean allowTabs)
allowTabs
- If true tab will insert a tab ('\t') into the document and ctrl-tab will be required to move focus. If false tab act as focus traversal key (depending on look and feel).Method Detail |
---|
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.text.JTextComponent
protected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
public void setDocument(javax.swing.text.Document doc)
setDocument
in class javax.swing.JTextField
public void setLargerAreaVisible(boolean visible)
public void setForeground(java.awt.Color color)
setForeground
in class javax.swing.JComponent
public void setBackground(java.awt.Color color)
setBackground
in class javax.swing.JComponent
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JTextField
public void setText(java.lang.String text)
setText
in class javax.swing.text.JTextComponent
public javax.swing.JTextArea getLargerTextArea()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JTextField
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
protected int getRowHeight()
public javax.swing.BoundedRangeModel getHorizontalVisibility()
getHorizontalVisibility
in class javax.swing.JTextField
public void setScrollOffset(int scrollOffset)
setScrollOffset
in class javax.swing.JTextField
public void scrollRectToVisible(java.awt.Rectangle r)
scrollRectToVisible
in class javax.swing.JTextField
public void setAllowBreaks(boolean allowBreaks)
allowBreaks
-public boolean canAllowBreaks()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class PromptedTextField
public static java.lang.String getClipString(java.awt.FontMetrics fm, java.lang.String string, int availTextWidth)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |