|
||||||||||
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.gef.finder.widgets.SWTBotGefEditor
public class SWTBotGefEditor
represent a graphical editor that uses the GEF framework. The underlying editor must adapt to a
GraphicalViewer
which must extend GraphicalViewerImpl
(this is the default for all GEF-based editors
that extend GraphicalEditor
). Unlike most of SWTBot, this editor uses
edit parts
to target UI events instead of SWT widgets. This is due to the fact that
GEF editors paint on a canvas and rarely use widgets at all.
Field Summary | |
---|---|
protected SWTBotGefViewer |
viewer
|
Fields inherited from class org.eclipse.swtbot.eclipse.finder.widgets.SWTBotWorkbenchPart |
---|
bot, log, partReference |
Constructor Summary | |
---|---|
SWTBotGefEditor(IEditorReference reference,
SWTWorkbenchBot bot)
Create a new bot GEF editor instance. |
Method Summary | |
---|---|
void |
activateDefaultTool()
Activate the default tool. |
SWTBotGefEditor |
activateTool(String label)
Activate the tool with the specified label. |
SWTBotGefEditor |
activateTool(String label,
int index)
Activate the tool with the specified label and the specified index. |
void |
clear()
clear the cache of edit parts |
void |
click(int xPosition,
int yPosition)
Click on the editor at the specified location. |
void |
click(String label)
Click on the edit part which owns the specified label at the top left hand corner of its bounds. |
void |
click(SWTBotGefEditPart editPart)
Click on the specified edit part at the top left hand corner of its bounds. |
SWTBotGefEditor |
clickContextMenu(String text)
|
protected SWTBotGefConnectionEditPart |
createEditPart(org.eclipse.gef.ConnectionEditPart part)
lazily creates a SWTBotGefConnectionEditPart if this edit part does not exist yet. |
protected SWTBotGefEditPart |
createEditPart(org.eclipse.gef.EditPart part)
lazily creates a SWTBotGefEditPart if this edit part does not exist yet. |
void |
directEditType(String text)
type the given text into the graphical editor, presuming that it is already in 'direct edit' mode. |
void |
doubleClick(int xPosition,
int yPosition)
Double click on the editor at the specified location. |
void |
doubleClick(String label)
Double click on the edit part which owns the specified label at the top left hand corner (with an offset) of its bounds. |
void |
doubleClick(SWTBotGefEditPart editPart)
Double click on the edit part which owns the specified label at the top left hand corner (with an offset) of its bounds. |
void |
drag(int fromXPosition,
int fromYPosition,
int toXPosition,
int toYPosition)
Drag and drop from the specified to the specified location. |
void |
drag(String label,
int toXPosition,
int toYPosition)
Drag and drop the edit part which owns the specified label to the specified location |
void |
drag(SWTBotGefEditPart editPart,
int toXPosition,
int toYPosition)
Drag and drop the specified edit part to the specified location. |
List<SWTBotGefEditPart> |
editParts(Matcher<? extends org.eclipse.gef.EditPart> matcher)
|
org.eclipse.gef.palette.ToolEntry |
getActiveTool()
Get the active tool. |
SWTBotGefEditPart |
getEditPart(String label)
get this edit part with the label as a single selection. |
SWTBotGefEditPart |
getEditpart(String label,
List<SWTBotGefEditPart> allEditParts)
Deprecated. |
SWTBotGefViewer |
getSWTBotGefViewer()
Get the wrapped SWTBotGefViewer instance. |
boolean |
isActive()
|
SWTBotGefEditPart |
mainEditPart()
|
void |
mouseDrag(int fromXPosition,
int fromYPosition,
int toXPosition,
int toYPosition)
Deprecated. |
void |
mouseDrag(String label,
int toXPosition,
int toYPosition)
Deprecated. |
void |
mouseMoveDoubleClick(int xPosition,
int yPosition)
Deprecated. |
void |
mouseMoveDoubleClick(String label)
Deprecated. |
void |
mouseMoveLeftClick(int xPosition,
int yPosition)
Deprecated. |
void |
mouseMoveLeftClick(String label)
Deprecated. |
SWTBotGefEditPart |
rootEditPart()
retrieve the root edit part. |
SWTBotGefEditor |
select(Collection<SWTBotGefEditPart> parts)
select this edit part as a single selection |
SWTBotGefEditor |
select(String label)
select the edit part with the label as a single selection. |
SWTBotGefEditor |
select(SWTBotGefEditPart... parts)
select this edit part as a single selection |
List<SWTBotGefEditPart> |
selectedEditParts()
Get the selected edit parts. |
void |
setFocus()
Sets focus on the current part. |
Methods inherited from class org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor |
---|
close, 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 |
Field Detail |
---|
protected final SWTBotGefViewer viewer
Constructor Detail |
---|
public SWTBotGefEditor(IEditorReference reference, SWTWorkbenchBot bot) throws WidgetNotFoundException
reference
- the editor referencebot
- the workbench bot
WidgetNotFoundException
- if widget could not be foundMethod Detail |
---|
public SWTBotGefViewer getSWTBotGefViewer()
public void clear()
public SWTBotGefEditPart mainEditPart() throws WidgetNotFoundException
WidgetNotFoundException
public SWTBotGefEditPart rootEditPart() throws WidgetNotFoundException
WidgetNotFoundException
- if root edit part could not be foundGraphicalViewer#getRootEditPart()}
public List<SWTBotGefEditPart> selectedEditParts()
protected SWTBotGefEditPart createEditPart(org.eclipse.gef.EditPart part)
SWTBotGefEditPart
if this edit part does not exist yet. If an instance encapsulating the
specified edit part has been created before, that instance is returned.
part
- the edit part to create a SWTBotGefEditPart
for
SWTBotGefEditPart
protected SWTBotGefConnectionEditPart createEditPart(org.eclipse.gef.ConnectionEditPart part)
SWTBotGefConnectionEditPart
if this edit part does not exist yet. If an instance
encapsulating the specified edit part has been created before, that instance is returned.
part
- a connection edit part connecting graphical nodes
SWTBotGefConnectionEditPart
encapsulating the connection edit partpublic org.eclipse.gef.palette.ToolEntry getActiveTool()
public void activateDefaultTool()
public SWTBotGefEditor activateTool(String label) throws WidgetNotFoundException
activateTool(String, int)
label
- the label of the tool to activate
WidgetNotFoundException
- if the tool with label specified could not be foundpublic SWTBotGefEditor activateTool(String label, int index) throws WidgetNotFoundException
activateTool(String)
label
- the label of the tool to activateindex
- the index to use in order to make the selection.
WidgetNotFoundException
- if the tool with label specified could not be foundpublic void directEditType(String text) throws WidgetNotFoundException
text
- the text to type.
WidgetNotFoundException
public List<SWTBotGefEditPart> editParts(Matcher<? extends org.eclipse.gef.EditPart> matcher) throws WidgetNotFoundException
matcher
- the matcher that matches on EditPart
SWTBotGefEditPart
WidgetNotFoundException
public SWTBotGefEditor select(SWTBotGefEditPart... parts)
public SWTBotGefEditor select(Collection<SWTBotGefEditPart> parts)
public boolean isActive()
isActive
in class SWTBotEditor
true
if the part is currently active.public void setFocus()
SWTBotWorkbenchPart
setFocus
in class SWTBotEditor
public SWTBotGefEditor clickContextMenu(String text) throws WidgetNotFoundException
WidgetNotFoundException
public void click(int xPosition, int yPosition)
xPosition
- the x relative positionyPosition
- the y relative positionpublic void click(SWTBotGefEditPart editPart)
editPart
- the edit part to click onpublic void click(String label)
label
- the label to retrieve edit part to click onpublic void doubleClick(int xPosition, int yPosition)
xPosition
- the x relative positionyPosition
- the y relative positionpublic void doubleClick(SWTBotGefEditPart editPart)
editPart
- the edit part to double click onpublic void doubleClick(String label)
label
- the label to retrieve edit part to double click onpublic void drag(int fromXPosition, int fromYPosition, int toXPosition, int toYPosition)
toXPosition
- the x relative locationtoYPosition
- the y relative locationpublic void drag(SWTBotGefEditPart editPart, int toXPosition, int toYPosition)
editPart
- the edit part to drag and droptoXPosition
- the x relative locationtoYPosition
- the y relative locationpublic void drag(String label, int toXPosition, int toYPosition)
label
- the label to retrieve the edit part to drag and droptoXPosition
- the x relative positiontoYPosition
- the y relative positionpublic SWTBotGefEditor select(String label)
public SWTBotGefEditPart getEditPart(String label)
@Deprecated public SWTBotGefEditPart getEditpart(String label, List<SWTBotGefEditPart> allEditParts)
@Deprecated public void mouseDrag(int fromXPosition, int fromYPosition, int toXPosition, int toYPosition)
@Deprecated public void mouseDrag(String label, int toXPosition, int toYPosition)
@Deprecated public void mouseMoveDoubleClick(int xPosition, int yPosition)
@Deprecated public void mouseMoveDoubleClick(String label)
@Deprecated public void mouseMoveLeftClick(int xPosition, int yPosition)
@Deprecated public void mouseMoveLeftClick(String label)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |