Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.controls.completionfield
Class CompletionTextField

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 oracle.javatools.controls.completionfield.CompletionTextField

All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, javax.swing.SwingConstants, CompletionTextComponent
Direct Known Subclasses:
FileField, MacroTextField

Deprecated. completion code moved to UIC, this code will no longer be enhanced

@Deprecated
public class CompletionTextField
extends javax.swing.JTextField
implements CompletionTextComponent

CompletionTextField is a JTextField with built in support for displaying a completion list. In many ways, this behaves like the code insight support provided by the code editor, but for a text field.

The completion provided by the field is configured via one or more pluggable FieldInsightProvider instances. Each insight provider describes when to trigger insight, which items appear in the insight list for a given position in the field, how to complete insight when requested by the user, and how items in the insight list should appear.

It's acceptible to register multiple FieldInsightProviders with a CompletionTextField. Each provider will be queried in turn whenever a character is typed into the field.

This field supports red underline validation. You can enable this by subclassing and overridding the isTextValid() method.

See Also:
Serialized Form

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

 

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
CompletionTextField()
          Deprecated. Constructs a completion text field with a default popup handler.
CompletionTextField(CompletionPopupHandler popupHandler)
          Deprecated. Constructs a completion text field with a custom popup handler.

 

Method Summary
protected  int[][] getInvalidCharacterRanges()
          Deprecated. Returns the character ranges which are invalid.
 CompletionPopupHandler getPopupHandler()
          Deprecated. Get the popup handler for this completion text field.
protected  boolean isTextValid()
          Deprecated. Returns true if the current text in this field is valid.
protected  void paintComponent(java.awt.Graphics g)
          Deprecated.  
 void removeNotify()
          Deprecated. Overridden to ensure that the insight list is hidden when the component is removed from its parent.
 void setAlignWithField(boolean isAlignWithField)
          Deprecated. replaced by CompletionPopupHandler.setAlignWithField(boolean)
 void setInsightVisible(boolean isVisible)
          Deprecated. replaced by CompletionPopupHandler.setInsightVisible(boolean)
 void setText(java.lang.String text)
          Deprecated. Override to prevent programmatic setting of text from triggering the insight list.
 void setWidthOfField(boolean isWidthOfField)
          Deprecated. replaced by CompletionPopupHandler.setWidthOfField(boolean)

 

Methods inherited from class javax.swing.JTextField
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset

 

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, addNotify, 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, 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, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, 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, processFocusEvent, 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

 

Constructor Detail

CompletionTextField

public CompletionTextField()
Deprecated. 
Constructs a completion text field with a default popup handler.

CompletionTextField

public CompletionTextField(CompletionPopupHandler popupHandler)
Deprecated. 
Constructs a completion text field with a custom popup handler.
Parameters:
popupHandler - the popup handler to use.

Method Detail

getPopupHandler

public final CompletionPopupHandler getPopupHandler()
Deprecated. 
Get the popup handler for this completion text field.
Specified by:
getPopupHandler in interface CompletionTextComponent
Returns:
the popup handler for this completion text field.

removeNotify

public void removeNotify()
Deprecated. 
Overridden to ensure that the insight list is hidden when the component is removed from its parent. If you override this method, be sure to call super.removeNotify().
Overrides:
removeNotify in class javax.swing.text.JTextComponent

setText

public final void setText(java.lang.String text)
Deprecated. 
Override to prevent programmatic setting of text from triggering the insight list.
Overrides:
setText in class javax.swing.text.JTextComponent
Parameters:
text - the text to set on the component.

paintComponent

protected void paintComponent(java.awt.Graphics g)
Deprecated. 
Overrides:
paintComponent in class javax.swing.JComponent

getInvalidCharacterRanges

protected int[][] getInvalidCharacterRanges()
Deprecated. 
Returns the character ranges which are invalid. The return value is a two dimensional array indicating the start and end index of invalid substrings in the field.

For example, in the string "This is a test", where the words "is" and "test" are invalid, this method might return the following array:

   { { 5, 6 }, { 10, 13 } }
 

The default implementation returns a single range that represents the whole string, i.e. for the example above:

   { { 0, 13 } }
 
Returns:
an array of character ranges that are invalid.
Since:
11.0

isTextValid

protected boolean isTextValid()
Deprecated. 
Returns true if the current text in this field is valid. If the text is not valid, then the text in the field will be highlighted with a wavy red underline.

This method will be called periodically to determine whether the current contens are invalid.

You can further customize the red underlining by specifying specific character ranges to underline by overriding the getInvalidCharacterRanges() method. The default implementation underlines the whole string.

This implementation always returns true.

Returns:
true if the text is valid.
Since:
11.0

setAlignWithField

public final void setAlignWithField(boolean isAlignWithField)
Deprecated. replaced by CompletionPopupHandler.setAlignWithField(boolean)
Set whether the insight popup of this field should be left aligned with the text field. The default value of this property is false, and the insight popup will appear in a location close to the caret.

setWidthOfField

public final void setWidthOfField(boolean isWidthOfField)
Deprecated. replaced by CompletionPopupHandler.setWidthOfField(boolean)
Set whether the drop down list for this field will be automatically adjusted so that it is at least as wide as the text field. If set false, the drop down list will always use its preferred width regardless of the width of the text field.
Parameters:
isWidthOfField - if true, the drop down list width will always be at least the width of the field.

setInsightVisible

public final void setInsightVisible(boolean isVisible)
Deprecated. replaced by CompletionPopupHandler.setInsightVisible(boolean)
Programmatically show or hide the insight list.
Parameters:
isVisible - param isVisible whether the insight list should be visible

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.