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.CompositeInstances 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 Modifier and Type Field Description private TextAssistContentProvidercontentProviderprivate intnumberOfLinesprivate org.eclipse.swt.widgets.Shellpopupprivate static java.lang.StringSETTEXT_KEYprivate org.eclipse.swt.widgets.Tabletableprivate org.eclipse.swt.widgets.Texttextprivate booleanuseSingleClick
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(int eventType, org.eclipse.swt.widgets.Listener listener)voidaddModifyListener(org.eclipse.swt.events.ModifyListener listener)voidaddSelectionListener(org.eclipse.swt.events.SelectionListener listener)private voidaddTableListener()private voidaddTextListener()voidaddVerifyListener(org.eclipse.swt.events.VerifyListener listener)voidappend(java.lang.String string)voidclearSelection()org.eclipse.swt.graphics.PointcomputeSize(int wHint, int hHint, boolean changed)org.eclipse.swt.graphics.RectanglecomputeTrim(int x, int y, int width, int height)voidcopy()private org.eclipse.swt.widgets.ListenercreateFocusOutListener()private org.eclipse.swt.widgets.ListenercreateKeyDownListener()private org.eclipse.swt.widgets.ListenercreateModifyListener()voidcut()org.eclipse.swt.graphics.ColorgetBackground()intgetCaretLineNumber()org.eclipse.swt.graphics.PointgetCaretLocation()intgetCaretPosition()intgetCharCount()TextAssistContentProvidergetContentProvider()booleangetDoubleClickEnabled()chargetEchoChar()booleangetEditable()booleangetEnabled()org.eclipse.swt.graphics.ColorgetForeground()intgetLineCount()java.lang.StringgetLineDelimiter()intgetLineHeight()java.lang.StringgetMessage()intgetNumberOfLines()intgetOrientation()org.eclipse.swt.graphics.PointgetSelection()intgetSelectionCount()java.lang.StringgetSelectionText()intgetTabs()java.lang.StringgetText()java.lang.StringgetText(int start, int end)intgetTextLimit()intgetTopIndex()intgetTopPixel()booleangetUseSingleClick()Returns the single click enabled flag.voidinsert(java.lang.String string)voidpaste()voidremoveModifyListener(org.eclipse.swt.events.ModifyListener listener)voidremoveSelectionListener(org.eclipse.swt.events.SelectionListener listener)voidremoveVerifyListener(org.eclipse.swt.events.VerifyListener listener)voidselectAll()voidsetBackground(org.eclipse.swt.graphics.Color color)voidsetContentProvider(TextAssistContentProvider contentProvider)voidsetDoubleClickEnabled(boolean doubleClick)voidsetEchoChar(char echo)voidsetEditable(boolean editable)voidsetEnabled(boolean value)booleansetFocus()voidsetFont(org.eclipse.swt.graphics.Font font)voidsetForeground(org.eclipse.swt.graphics.Color color)voidsetMessage(java.lang.String string)voidsetNumberOfLines(int numberOfLines)voidsetOrientation(int orientation)voidsetRedraw(boolean redraw)voidsetSelection(int start)voidsetSelection(int start, int end)voidsetSelection(org.eclipse.swt.graphics.Point selection)voidsetTabs(int tabs)voidsetText(java.lang.String text)voidsetTextLimit(int textLimit)voidsetTopIndex(int topIndex)voidsetUseSingleClick(boolean singleClick)Sets the single click enabled flag.voidshowSelection()-
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, isAutoScalable, 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
-
-
-
-
Field Detail
-
SETTEXT_KEY
private static final java.lang.String SETTEXT_KEY
- See Also:
- Constant Field Values
-
text
private final org.eclipse.swt.widgets.Text text
-
popup
private final org.eclipse.swt.widgets.Shell popup
-
table
private final org.eclipse.swt.widgets.Table table
-
contentProvider
private TextAssistContentProvider contentProvider
-
numberOfLines
private int numberOfLines
-
useSingleClick
private boolean useSingleClick
-
-
Constructor Detail
-
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
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle 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 constructcontentProvider- 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 Detail
-
addTextListener
private void addTextListener()
-
addTableListener
private void addTableListener()
-
createKeyDownListener
private org.eclipse.swt.widgets.Listener createKeyDownListener()
- Returns:
- a listener for the keydown event
-
createModifyListener
private org.eclipse.swt.widgets.Listener createModifyListener()
- Returns:
- a listener for the modify event
-
createFocusOutListener
private org.eclipse.swt.widgets.Listener createFocusOutListener()
- Returns:
- a listener for the FocusOut event
-
getBackground
public org.eclipse.swt.graphics.Color getBackground()
- Overrides:
getBackgroundin classorg.eclipse.swt.widgets.Control- See Also:
Control.getBackground()
-
getContentProvider
public TextAssistContentProvider getContentProvider()
- Returns:
- the contentProvider
-
getForeground
public org.eclipse.swt.graphics.Color getForeground()
- Overrides:
getForegroundin classorg.eclipse.swt.widgets.Control- See Also:
Control.getForeground()
-
setBackground
public void setBackground(org.eclipse.swt.graphics.Color color)
- Overrides:
setBackgroundin classorg.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:
addListenerin classorg.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:
computeSizein classorg.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:
computeTrimin classorg.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:
getEnabledin classorg.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:
getOrientationin classorg.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:
setEnabledin classorg.eclipse.swt.widgets.Control- See Also:
Control.setEnabled(boolean)
-
setFocus
public boolean setFocus()
- Overrides:
setFocusin classorg.eclipse.swt.widgets.Composite- See Also:
Composite.setFocus()
-
setFont
public void setFont(org.eclipse.swt.graphics.Font font)
- Overrides:
setFontin classorg.eclipse.swt.widgets.Control- See Also:
Control.setFont(org.eclipse.swt.graphics.Font)
-
setForeground
public void setForeground(org.eclipse.swt.graphics.Color color)
- Overrides:
setForegroundin classorg.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:
setOrientationin classorg.eclipse.swt.widgets.Control- See Also:
Text.setOrientation(int)
-
setRedraw
public void setRedraw(boolean redraw)
- Overrides:
setRedrawin classorg.eclipse.swt.widgets.Control- See Also:
Control.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()
-
-