Class TextAssist

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.nebula.widgets.opal.textassist.TextAssist
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class TextAssist
extends org.eclipse.swt.widgets.Composite
Instances of this class are selectable user interface objects that allow the user to enter and modify text. The difference with the Text widget is that when the user types something, some propositions are displayed.
See Also:
Text
  • Field Summary

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors 
    Constructor Description
    TextAssist​(org.eclipse.swt.widgets.Composite parent, int style, TextAssistContentProvider contentProvider)
    Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
  • Method Summary

    Modifier and Type Method Description
    void addListener​(int eventType, org.eclipse.swt.widgets.Listener listener)  
    void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)  
    void addSelectionListener​(org.eclipse.swt.events.SelectionListener listener)  
    void addVerifyListener​(org.eclipse.swt.events.VerifyListener listener)  
    void append​(java.lang.String string)  
    void clearSelection()  
    org.eclipse.swt.graphics.Point computeSize​(int wHint, int hHint, boolean changed)  
    org.eclipse.swt.graphics.Rectangle computeTrim​(int x, int y, int width, int height)  
    void copy()  
    void cut()  
    org.eclipse.swt.graphics.Color getBackground()  
    int getCaretLineNumber()  
    org.eclipse.swt.graphics.Point getCaretLocation()  
    int getCaretPosition()  
    int getCharCount()  
    TextAssistContentProvider getContentProvider()  
    boolean getDoubleClickEnabled()  
    char getEchoChar()  
    boolean getEditable()  
    boolean getEnabled()  
    org.eclipse.swt.graphics.Color getForeground()  
    int getLineCount()  
    java.lang.String getLineDelimiter()  
    int getLineHeight()  
    java.lang.String getMessage()  
    int getNumberOfLines()  
    int getOrientation()  
    org.eclipse.swt.graphics.Point getSelection()  
    int getSelectionCount()  
    java.lang.String getSelectionText()  
    int getTabs()  
    java.lang.String getText()  
    java.lang.String getText​(int start, int end)  
    int getTextLimit()  
    int getTopIndex()  
    int getTopPixel()  
    boolean getUseSingleClick()
    Returns the single click enabled flag.
    void insert​(java.lang.String string)  
    void paste()  
    void removeModifyListener​(org.eclipse.swt.events.ModifyListener listener)  
    void removeSelectionListener​(org.eclipse.swt.events.SelectionListener listener)  
    void removeVerifyListener​(org.eclipse.swt.events.VerifyListener listener)  
    void selectAll()  
    void setBackground​(org.eclipse.swt.graphics.Color color)  
    void setContentProvider​(TextAssistContentProvider contentProvider)  
    void setDoubleClickEnabled​(boolean doubleClick)  
    void setEchoChar​(char echo)  
    void setEditable​(boolean editable)  
    void setEnabled​(boolean value)  
    boolean setFocus()  
    void setFont​(org.eclipse.swt.graphics.Font font)  
    void setForeground​(org.eclipse.swt.graphics.Color color)  
    void setMessage​(java.lang.String string)  
    void setNumberOfLines​(int numberOfLines)  
    void setOrientation​(int orientation)  
    void setRedraw​(boolean redraw)  
    void setSelection​(int start)  
    void setSelection​(int start, int end)  
    void setSelection​(org.eclipse.swt.graphics.Point selection)  
    void setTabs​(int tabs)  
    void setText​(java.lang.String text)  
    void setTextLimit​(int textLimit)  
    void setTopIndex​(int topIndex)  
    void setUseSingleClick​(boolean singleClick)
    Sets the single click enabled flag.
    void showSelection()  

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getFont, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setMenu, setParent, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Constructor Details

    • TextAssist

      public TextAssist​(org.eclipse.swt.widgets.Composite parent, int style, TextAssistContentProvider contentProvider)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

      The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

      Parameters:
      parent - a composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      contentProvider - the content provider
      Throws:
      java.lang.IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      org.eclipse.swt.SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      See Also:
      SWT.SINGLE, SWT.MULTI, SWT.READ_ONLY, SWT.WRAP, SWT.LEFT, SWT.RIGHT, SWT.CENTER, SWT.PASSWORD, SWT.SEARCH, SWT.ICON_SEARCH, SWT.ICON_CANCEL, Widget.checkSubclass(), Widget.getStyle()
  • Method Details

    • getBackground

      public org.eclipse.swt.graphics.Color getBackground()
      Overrides:
      getBackground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.getBackground()
    • getContentProvider

      public TextAssistContentProvider getContentProvider()
      Returns:
      the contentProvider
    • getForeground

      public org.eclipse.swt.graphics.Color getForeground()
      Overrides:
      getForeground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.getForeground()
    • setBackground

      public void setBackground​(org.eclipse.swt.graphics.Color color)
      Overrides:
      setBackground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setBackground(org.eclipse.swt.graphics.Color)
    • setContentProvider

      public void setContentProvider​(TextAssistContentProvider contentProvider)
      Parameters:
      contentProvider - the contentProvider to set
    • getNumberOfLines

      public int getNumberOfLines()
      Returns:
      the numberOfLines
    • setNumberOfLines

      public void setNumberOfLines​(int numberOfLines)
      Parameters:
      numberOfLines - the numberOfLines to set
    • addListener

      public void addListener​(int eventType, org.eclipse.swt.widgets.Listener listener)
      Overrides:
      addListener in class org.eclipse.swt.widgets.Widget
      See Also:
      Widget.addListener(int,org.eclipse.swt.widgets.Listener)
    • addModifyListener

      public void addModifyListener​(org.eclipse.swt.events.ModifyListener listener)
      See Also:
      Text.addModifyListener(org.eclipse.swt.events.ModifyListener)
    • addSelectionListener

      public void addSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
      See Also:
      Text.addSelectionListener(org.eclipse.swt.events.SelectionListener)
    • addVerifyListener

      public void addVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
      See Also:
      Text.addVerifyListener(org.eclipse.swt.events.VerifyListener)
    • append

      public void append​(java.lang.String string)
      See Also:
      Text.append(java.lang.String)
    • clearSelection

      public void clearSelection()
      See Also:
      Text.clearSelection()
    • computeSize

      public org.eclipse.swt.graphics.Point computeSize​(int wHint, int hHint, boolean changed)
      Overrides:
      computeSize in class org.eclipse.swt.widgets.Control
      See Also:
      Control.computeSize(int, int, boolean)
    • computeTrim

      public org.eclipse.swt.graphics.Rectangle computeTrim​(int x, int y, int width, int height)
      Overrides:
      computeTrim in class org.eclipse.swt.widgets.Scrollable
      See Also:
      Scrollable.computeTrim(int, int, int, int)
    • copy

      public void copy()
      See Also:
      Text.copy()
    • cut

      public void cut()
      See Also:
      Text.cut()
    • getCaretLineNumber

      public int getCaretLineNumber()
      See Also:
      Text.getCaretLineNumber()
    • getCaretLocation

      public org.eclipse.swt.graphics.Point getCaretLocation()
      See Also:
      Text.getCaretLocation()
    • getCaretPosition

      public int getCaretPosition()
      See Also:
      Text.getCaretPosition()
    • getCharCount

      public int getCharCount()
      See Also:
      Text.getCharCount()
    • getDoubleClickEnabled

      public boolean getDoubleClickEnabled()
      See Also:
      Text.getDoubleClickEnabled()
    • getEchoChar

      public char getEchoChar()
      See Also:
      Text.getEchoChar()
    • getEditable

      public boolean getEditable()
      See Also:
      Text.getEditable()
    • getEnabled

      public boolean getEnabled()
      Overrides:
      getEnabled in class org.eclipse.swt.widgets.Control
      See Also:
      Control.getEnabled()
    • getLineCount

      public int getLineCount()
      See Also:
      Text.getLineCount()
    • getLineDelimiter

      public java.lang.String getLineDelimiter()
      See Also:
      Text.getLineDelimiter()
    • getLineHeight

      public int getLineHeight()
      See Also:
      Text.getLineHeight()
    • getMessage

      public java.lang.String getMessage()
      See Also:
      Text.getMessage()
    • getOrientation

      public int getOrientation()
      Overrides:
      getOrientation in class org.eclipse.swt.widgets.Control
      See Also:
      Text.getOrientation()
    • getSelection

      public org.eclipse.swt.graphics.Point getSelection()
      See Also:
      Text.getSelection()
    • getSelectionCount

      public int getSelectionCount()
      See Also:
      Text.getSelectionCount()
    • getSelectionText

      public java.lang.String getSelectionText()
      See Also:
      Text.getSelectionText()
    • getTabs

      public int getTabs()
      See Also:
      Text.getTabs()
    • getText

      public java.lang.String getText()
      See Also:
      Text.getText()
    • getText

      public java.lang.String getText​(int start, int end)
      See Also:
      Text.getText(int, int)
    • getTextLimit

      public int getTextLimit()
      See Also:
      Text.getTextLimit()
    • getTopIndex

      public int getTopIndex()
      See Also:
      Text.getTopIndex()
    • getTopPixel

      public int getTopPixel()
      See Also:
      Text.getTopPixel()
    • getUseSingleClick

      public boolean getUseSingleClick()
      Returns the single click enabled flag.

      If the the single click flag is true, the user can select an entry with a single click. Otherwise, the user can select an entry with a double click.

      Returns:
      whether or not single is enabled
      Throws:
      org.eclipse.swt.SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • insert

      public void insert​(java.lang.String string)
      See Also:
      Text.insert(java.lang.String)
    • paste

      public void paste()
      See Also:
      Text.paste()
    • removeModifyListener

      public void removeModifyListener​(org.eclipse.swt.events.ModifyListener listener)
      See Also:
      Text.removeModifyListener(org.eclipse.swt.events.ModifyListener)
    • removeSelectionListener

      public void removeSelectionListener​(org.eclipse.swt.events.SelectionListener listener)
      See Also:
      Text.removeSelectionListener(org.eclipse.swt.events.SelectionListener)
    • removeVerifyListener

      public void removeVerifyListener​(org.eclipse.swt.events.VerifyListener listener)
      See Also:
      Text.removeVerifyListener(org.eclipse.swt.events.VerifyListener)
    • selectAll

      public void selectAll()
      See Also:
      Text.selectAll()
    • setDoubleClickEnabled

      public void setDoubleClickEnabled​(boolean doubleClick)
      See Also:
      Text.setDoubleClickEnabled(boolean)
    • setEchoChar

      public void setEchoChar​(char echo)
      See Also:
      Text.setEchoChar(char)
    • setEditable

      public void setEditable​(boolean editable)
      See Also:
      Text.setEditable(boolean)
    • setEnabled

      public void setEnabled​(boolean value)
      Overrides:
      setEnabled in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setEnabled(boolean)
    • setFocus

      public boolean setFocus()
      Overrides:
      setFocus in class org.eclipse.swt.widgets.Composite
      See Also:
      Composite.setFocus()
    • setFont

      public void setFont​(org.eclipse.swt.graphics.Font font)
      Overrides:
      setFont in class org.eclipse.swt.widgets.Control
      See Also:
      Text.setFont(org.eclipse.swt.graphics.Font)
    • setForeground

      public void setForeground​(org.eclipse.swt.graphics.Color color)
      Overrides:
      setForeground in class org.eclipse.swt.widgets.Control
      See Also:
      Control.setForeground(org.eclipse.swt.graphics.Color)
    • setMessage

      public void setMessage​(java.lang.String string)
      See Also:
      Text.setMessage(java.lang.String)
    • setOrientation

      public void setOrientation​(int orientation)
      Overrides:
      setOrientation in class org.eclipse.swt.widgets.Control
      See Also:
      Text.setOrientation(int)
    • setRedraw

      public void setRedraw​(boolean redraw)
      Overrides:
      setRedraw in class org.eclipse.swt.widgets.Control
      See Also:
      Text.setRedraw(boolean)
    • setSelection

      public void setSelection​(int start, int end)
      See Also:
      Text.setSelection(int, int)
    • setSelection

      public void setSelection​(int start)
      See Also:
      Text.setSelection(int)
    • setSelection

      public void setSelection​(org.eclipse.swt.graphics.Point selection)
      See Also:
      Text.setSelection(org.eclipse.swt.graphics.Point)
    • setTabs

      public void setTabs​(int tabs)
      See Also:
      Text.setTabs(int)
    • setText

      public void setText​(java.lang.String text)
      See Also:
      Text.setText(java.lang.String)
    • setTextLimit

      public void setTextLimit​(int textLimit)
      See Also:
      Text.setTextLimit(int)
    • setUseSingleClick

      public void setUseSingleClick​(boolean singleClick)
      Sets the single click enabled flag.

      If the the single click flag is true, the user can select an entry with a single click. Otherwise, the user can select an entry with a double click.

      Parameters:
      singleClick - the new single click flag
      Throws:
      org.eclipse.swt.SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
    • setTopIndex

      public void setTopIndex​(int topIndex)
      See Also:
      Text.setTopIndex(int)
    • showSelection

      public void showSelection()
      See Also:
      Text.showSelection()