|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swtbot.eclipse.finder.widgets.SWTBotWorkbenchPart<IEditorReference> org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor
public class SWTBotEclipseEditor
This represents an eclipse editor item.
Field Summary |
---|
Fields inherited from class org.eclipse.swtbot.eclipse.finder.widgets.SWTBotWorkbenchPart |
---|
bot, log, partReference |
Constructor Summary | |
---|---|
SWTBotEclipseEditor(IEditorReference editorReference,
SWTWorkbenchBot bot)
Constructs an instance of the given object. |
|
SWTBotEclipseEditor(IEditorReference editorReference,
SWTWorkbenchBot bot,
SelfDescribing description)
Constructs an instance for the given editorReference. |
Method Summary | |
---|---|
void |
autoCompleteProposal(String insertText,
String proposalText)
Auto completes the given proposal. |
Color |
backgroundColor()
Gets the background color of the widget. |
SWTBotMenu |
contextMenu(String text)
Gets the context menu in the editor. |
Position |
cursorPosition()
Gets the current position of the cursor. |
Color |
foregroundColor()
Gets the foreground color of the widget. |
List<String> |
getAutoCompleteProposals(String insertText)
Gets the auto completion proposal matching the given text.. |
Bullet |
getBulletOnCurrentLine()
|
Bullet |
getBulletOnLine(int line)
|
IEditorReference |
getEditorReference()
Deprecated. use SWTBotWorkbenchPart.getReference() instead |
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. |
List<String> |
getQuickFixes()
Finds all the quickfixes in the quickfix list. |
int |
getQuickfixListItemCount()
Gets the quick fix item count. |
String |
getSelection()
Gets the current selection. |
StyleRange |
getStyle(int line,
int column)
Gets the style text. |
SWTBotStyledText |
getStyledText()
|
StyleRange[] |
getStyles(int line,
int column,
int length)
|
String |
getText()
Gets the text of this object's widget. |
String |
getTextOnCurrentLine()
|
String |
getTextOnLine(int line)
Get the text on line number given as parameter. |
String |
getToolTipText()
Gets the tooltip of this object's widget. |
boolean |
hasBulletOnCurrentLine()
|
boolean |
hasBulletOnLine(int line)
|
void |
insertText(int line,
int column,
String text)
|
void |
insertText(String text)
|
boolean |
isEnabled()
Gets if the object's widget is enabled. |
void |
navigateTo(int line,
int column)
|
void |
navigateTo(Position position)
Sets the caret at the specified location. |
void |
notifyKeyboardEvent(int modificationKeys,
char c)
Deprecated. use pressShortcut(int, char) instead. This api will be removed. |
void |
notifyKeyboardEvent(int modificationKeys,
char c,
int keyCode)
Deprecated. use pressShortcut(int, int, char) instead. This api will be removed. |
void |
pressShortcut(int modificationKeys,
char c)
Presses the shortcut specified by the given keys. |
void |
pressShortcut(int modificationKeys,
int keyCode,
char c)
Presses the shortcut specified by the given keys. |
void |
pressShortcut(KeyStroke... keys)
Presses the shortcut specified by the given keys. |
void |
quickfix(int quickFixIndex)
Applys a quick fix item at the given index. |
void |
quickfix(String quickFixName)
Applys a quick fix item with the given name. |
void |
selectCurrentLine()
Selects the text on the current line. |
void |
selectLine(int line)
|
void |
selectRange(int line,
int column,
int length)
|
void |
setFocus()
Sets focus on the current part. |
void |
setText(String text)
|
void |
typeText(int line,
int column,
String text)
|
void |
typeText(String text)
|
void |
typeText(String text,
int interval)
|
Methods inherited from class org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor |
---|
close, isActive, isDirty, save, saveAndClose, show, toTextEditor |
Methods inherited from class org.eclipse.swtbot.eclipse.finder.widgets.SWTBotWorkbenchPart |
---|
assertActive, bot, findWidget, findWidgets, getReference, getTitle, getToolbarButtons, getWidget, toolbarButton, toolbarDropDownButton, toolbarPushButton, toolbarRadioButton, toolbarToggleButton |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SWTBotEclipseEditor(IEditorReference editorReference, SWTWorkbenchBot bot) throws WidgetNotFoundException
editorReference
- the editor reference.bot
- the instance of SWTWorkbenchBot
which will be used to drive operations on behalf of this
object.
WidgetNotFoundException
- if the widget is null
or widget has been disposed.public SWTBotEclipseEditor(IEditorReference editorReference, SWTWorkbenchBot bot, SelfDescribing description)
editorReference
- the part reference.bot
- the helper bot.description
- the description of the editor part.Method Detail |
---|
public SWTBotStyledText getStyledText()
public IEditorReference getEditorReference()
SWTBotWorkbenchPart.getReference()
instead
public void quickfix(int quickFixIndex)
quickFixIndex
- the index of the quickfix item to apply.
WidgetNotFoundException
- if the quickfix could not be found.public void quickfix(String quickFixName)
quickFixName
- the name of the quick fix to apply.public List<String> getQuickFixes()
public int getQuickfixListItemCount()
public List<String> getAutoCompleteProposals(String insertText)
insertText
- the proposal text to type before auto completing
TimeoutException
- if the autocomplete shell did not close in time.public void autoCompleteProposal(String insertText, String proposalText)
insertText
- the text to be inserted before activating the auto-complete.proposalText
- the auto-completion proposal to select from the list.public SWTBotMenu contextMenu(String text) throws WidgetNotFoundException
text
- the context menu item.
WidgetNotFoundException
- if the menu with the specified text could not be found.AbstractSWTBot.contextMenu(java.lang.String)
public Position cursorPosition()
SWTBotStyledText.cursorPosition()
public boolean isEnabled()
true
if the widget is enabled.AbstractSWTBot.isEnabled()
public String getSelection()
public StyleRange getStyle(int line, int column)
line
- the line number, 0 based.column
- the column number, 0 based.
StyleRange
at the specified locationSWTBotStyledText.getStyle(int, int)
public String getText()
AbstractSWTBot.getText()
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 locationSWTBotStyledText.typeText(int, int, java.lang.String)
public void typeText(String text)
text
- the text to be typed at the location of the caret. *SWTBotStyledText.typeText(java.lang.String)
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 locationSWTBotStyledText.insertText(int, int, java.lang.String)
public void insertText(String text)
text
- the text to be inserted at the location of the caret.SWTBotStyledText.insertText(java.lang.String)
public void typeText(String text, int interval)
text
- the text to be typed at the location of the caret.interval
- the interval between consecutive key strokes.SWTBotStyledText.typeText(java.lang.String, int)
public void navigateTo(Position position)
position
- the position of the caret.public void navigateTo(int line, int column)
line
- the line number, 0 based.column
- the column number, 0 based.SWTBotStyledText.navigateTo(int, int)
public void notifyKeyboardEvent(int modificationKeys, char c)
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
public void notifyKeyboardEvent(int modificationKeys, char c, int keyCode)
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 pressShortcut(int modificationKeys, char c)
modificationKeys
- the combination of SWT.ALT
| SWT.CTRL
| SWT.SHIFT
|
SWT.COMMAND
.c
- the character.Keyboard.pressShortcut(KeyStroke...)
,
Keystrokes.toKeys(int, char)
public void pressShortcut(int modificationKeys, int keyCode, char c)
modificationKeys
- the combination of SWT.ALT
| SWT.CTRL
| SWT.SHIFT
|
SWT.COMMAND
.keyCode
- the keyCode, these may be special keys like F1-F12, or navigation keys like HOME, PAGE_UPc
- the characterKeystrokes.toKeys(int, char)
public void pressShortcut(KeyStroke... keys)
keys
- the keys to pressKeyboard.pressShortcut(KeyStroke...)
,
Keystrokes
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.SWTBotStyledText.selectRange(int, int, int)
public void selectLine(int line)
line
- the line number to select, 0 based.SWTBotStyledText.selectLine(int)
public void selectCurrentLine()
SWTBotStyledText.selectCurrentLine()
public void setFocus()
SWTBotWorkbenchPart
setFocus
in class SWTBotEditor
AbstractSWTBot.setFocus()
public void setText(String text)
text
- the text to set.SWTBotStyledText.setText(java.lang.String)
public Bullet getBulletOnCurrentLine()
SWTBotStyledText.getBulletOnCurrentLine()
public Bullet getBulletOnLine(int line)
line
- the line number, 0 based.
SWTBotStyledText.getBulletOnLine(int)
public StyleRange[] getStyles(int line, int column, int length)
line
- the line number, 0 based.column
- the column number, 0 based.length
- the length.
SWTBotStyledText.getStyles(int, int, int)
public String getTextOnCurrentLine()
SWTBotStyledText.getTextOnCurrentLine()
public String getTextOnLine(int line)
line
- the line number, 0 based.
SWTBotStyledText.getTextOnLine(int)
public boolean hasBulletOnCurrentLine()
true
if the styledText has a bullet on the given line, false
otherwise.SWTBotStyledText.hasBulletOnCurrentLine()
public boolean hasBulletOnLine(int line)
line
- the line number, 0 based.
true
if the styledText has a bullet on the given line, false
otherwise.SWTBotStyledText.hasBulletOnLine(int)
public Color backgroundColor()
null
if the widget is not an instance of
Control
.AbstractSWTBot.backgroundColor()
public Color foregroundColor()
null
if the widget is not an instance of
Control
.AbstractSWTBot.foregroundColor()
public RGB getLineBackground(int line)
line
- the line number, 0 based.
SWTBotStyledText.getLineBackground(int)
public int getLineCount()
StyledText
.
StyledText
.public List<String> getLines()
public String getToolTipText()
AbstractSWTBot.getToolTipText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |