|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot<StyledText>
org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText
public class SWTBotStyledText
| Field Summary |
|---|
| Fields inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot |
|---|
description, display, log, widget |
| Constructor Summary | |
|---|---|
SWTBotStyledText(StyledText styledText)
Constructs a new instance of this object. |
|
SWTBotStyledText(StyledText styledText,
SelfDescribing description)
Constructs a new instance of this object. |
|
| Method Summary | |
|---|---|
Position |
cursorPosition()
Gets the current position of the cursor. |
Bullet |
getBulletOnCurrentLine()
Gets the bullet on the current line. |
Bullet |
getBulletOnLine(int line)
Gets the bullet on the given line. |
RGB |
getLineBackground(int line)
Gets the color of the background on the specified line. |
int |
getLineCount()
Gets the number of lines in the StyledText. |
List<String> |
getLines()
Gets all the lines in the editor. |
String |
getSelection()
Gets the current selection text. |
StyleRange |
getStyle(int line,
int column)
Gets the style for the given line. |
StyleRange[] |
getStyles(int line,
int column,
int length)
Gets the style information. |
int |
getTabs()
Gets the tab width of the StyledText measured in characters. |
String |
getTextOnCurrentLine()
Gets the text on the current line. |
String |
getTextOnLine(int line)
Gets the text on the line. |
boolean |
hasBulletOnCurrentLine()
Checks if this has a bullet on the current line. |
boolean |
hasBulletOnLine(int line)
Gets if this has a bullet on the specific line. |
void |
insertText(int line,
int column,
String text)
Inserts text at the given location. |
void |
insertText(String text)
Inserts text at the end. |
void |
navigateTo(int line,
int column)
Sets the caret at the specified location. |
void |
navigateTo(Position position)
Sets the caret at the specified location. |
void |
notifyKeyboardEvent(int modificationKeys,
char c)
Deprecated. use AbstractSWTBot.pressShortcut(int, char) instead. This api will be removed. |
void |
notifyKeyboardEvent(int modificationKeys,
char c,
int keyCode)
Deprecated. use AbstractSWTBot.pressShortcut(int, int, char) instead. This api will be removed. |
protected int |
offset(int line,
int column)
Gets the offset. |
void |
selectCurrentLine()
Selects the text on the current line. |
void |
selectLine(int line)
Selects the text on the specified line. |
void |
selectRange(int line,
int column,
int length)
Selects the range. |
void |
setText(String text)
Sets the text into the styled text. |
void |
typeText(int line,
int column,
String text)
Types the text at the given location. |
void |
typeText(String text)
Types the text. |
void |
typeText(String text,
int interval)
Types the text. |
| Methods inherited from class org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot |
|---|
absoluteLocation, assertEnabled, asyncExec, backgroundColor, click, click, clickXY, contextMenu, contextMenu, createEvent, createMouseEvent, createSelectionEvent, doubleClickXY, foregroundColor, getId, getText, getToolTipText, hasStyle, isActive, isEnabled, isEnabledInternal, isVisible, keyboard, notify, notify, notify, pressShortcut, pressShortcut, pressShortcut, rightClick, rightClick, setFocus, sleep, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, syncExec, toString, traverse, waitForEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SWTBotStyledText(StyledText styledText)
throws WidgetNotFoundException
styledText - the widget.
WidgetNotFoundException - if the widget is null or widget has been disposed.
public SWTBotStyledText(StyledText styledText,
SelfDescribing description)
throws WidgetNotFoundException
styledText - the widget.description - the description of the widget, this will be reported by AbstractSWTBot.toString()
WidgetNotFoundException - if the widget is null or widget has been disposed.| Method Detail |
|---|
public void setText(String text)
text - the text to set.
@Deprecated
public void notifyKeyboardEvent(int modificationKeys,
char c)
AbstractSWTBot.pressShortcut(int, char) instead. This api will be removed.
FIXME need some work for CTRL|SHIFT + 1 the 1 is to be sent as '!' in this case.
modificationKeys - the modification keys.c - the character.Event.character,
Event.stateMask
@Deprecated
public void notifyKeyboardEvent(int modificationKeys,
char c,
int keyCode)
AbstractSWTBot.pressShortcut(int, int, char) instead. This api will be removed.
modificationKeys - the modification key.c - the character.keyCode - any special keys (function keys, arrow or navigation keys etc.)Event.keyCode,
Event.character,
Event.stateMask
public void navigateTo(int line,
int column)
line - the line number, 0 based.column - the column number, 0 based.public void navigateTo(Position position)
position - the position of the caret.public Position cursorPosition()
public void typeText(int line,
int column,
String text)
line - the line number, 0 based.column - the column number, 0 based.text - the text to be typed at the specified location
public void insertText(int line,
int column,
String text)
line - the line number, 0 based.column - the column number, 0 based.text - the text to be inserted at the specified locationpublic void insertText(String text)
FIXME handle line endings
text - the text to be inserted at the location of the caret.public void typeText(String text)
FIXME handle line endings
text - the text to be typed at the location of the caret.
public void typeText(String text,
int interval)
FIXME handle line endings
text - the text to be typed at the location of the caret.interval - the interval between consecutive key strokes.
public StyleRange getStyle(int line,
int column)
line - the line number, 0 based.column - the column number, 0 based.
StyleRange at the specified location
protected int offset(int line,
int column)
line - the line number, 0 based.column - the column number, 0 based.
StyledTextContent.getOffsetAtLine(int)
public void selectRange(int line,
int column,
int length)
line - the line number, 0 based.column - the column number, 0 based.length - the length of the selection.public String getSelection()
public StyleRange[] getStyles(int line,
int column,
int length)
line - the line number, 0 based.column - the column number, 0 based.length - the length.
StyledText.getStyleRanges(int, int)public String getTextOnCurrentLine()
getTextOnLine(int)public String getTextOnLine(int line)
TODO: throw exception if the line is out of range.
line - the line number, 0 based.
public boolean hasBulletOnCurrentLine()
true if the styledText has a bullet on the given line, false otherwise.StyledText.getLineBullet(int)public boolean hasBulletOnLine(int line)
line - the line number, 0 based.
true if the styledText has a bullet on the given line, false otherwise.StyledText.getLineBullet(int)public Bullet getBulletOnCurrentLine()
StyledText.getLineBullet(int)public Bullet getBulletOnLine(int line)
line - the line number, 0 based.
StyledText.getLineBullet(int)public void selectLine(int line)
line - the line number, 0 based.public void selectCurrentLine()
public RGB getLineBackground(int line)
line - the line number, 0 based.
public int getLineCount()
StyledText.
StyledText.public List<String> getLines()
public int getTabs()
StyledText measured in characters.
StyledText measured in characters.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||