Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swtbot.eclipse.gef.finder.widgets
Class SWTBotGefViewer

    java.lang.Object
      org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefViewer

    public class SWTBotGefViewer

extends Object

represent a graphical viewer that uses the GEF framework.

Author:
  David Green

Field Summary
`protected SWTBotGefFigureCanvas` | `canvas`
`protected org.eclipse.gef.EditDomain` | `editDomain`
`protected org.eclipse.gef.GraphicalViewer` | `graphicalViewer`

Constructor Summary
`SWTBotGefViewer(org.eclipse.gef.GraphicalViewer graphicalViewer)` Create a new bot GEF graphical viewer instance.

Method Summary
`void` | `activateDefaultTool()` Activate the default tool.
`SWTBotGefViewer` | `activateTool(String label)` Activate the tool with the specified label.
`SWTBotGefViewer` | `activateTool(String label, int index)` Activate the tool with the specified label and the specified index.
`SWTBot` | `bot()`
`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.
`SWTBotGefViewer` | `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 active tool.
`protected SWTBotGefFigureCanvas` | `getCanvas()` Get the canvas to do low-level operations.
`protected Control` | `getControl()`
`SWTBotGefEditPart` | `getEditPart(String label)` get this edit part with the label as a single selection.
`SWTBotGefEditPart` | `getEditpart(String label, List<SWTBotGefEditPart> allEditParts)` Deprecated.
`protected void` | `init()`
`SWTBotGefEditPart` | `mainEditPart()`
`SWTBotGefEditPart` | `rootEditPart()` retrieve the root edit part.
`SWTBotGefViewer` | `select(Collection<SWTBotGefEditPart> parts)` select this edit part as a single selection
`SWTBotGefViewer` | `select(String label)` select the edit part with the label as a single selection.
`SWTBotGefViewer` | `select(SWTBotGefEditPart... parts)` select this edit part as a single selection
`List<SWTBotGefEditPart>` | `selectedEditParts()` Get the selected edit parts.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### graphicalViewer

    protected org.eclipse.gef.GraphicalViewer graphicalViewer

### editDomain

    protected org.eclipse.gef.EditDomain editDomain

### canvas

    protected SWTBotGefFigureCanvas canvas

Constructor Detail

### SWTBotGefViewer

    public SWTBotGefViewer(org.eclipse.gef.GraphicalViewer graphicalViewer)
                    throws WidgetNotFoundException

  Create a new bot GEF graphical viewer instance.

  Parameters:
    `graphicalViewer` - the graphical viewer to wrap
  Throws:
    `WidgetNotFoundException` - if graphical viewer is null

Method Detail

### bot

    public SWTBot bot()

### clear

    public void clear()

  clear the cache of edit parts

### init

    protected void init()
                 throws WidgetNotFoundException

  Throws:
    `WidgetNotFoundException`

### mainEditPart

    public SWTBotGefEditPart mainEditPart()
                                   throws WidgetNotFoundException

  Throws:
    `WidgetNotFoundException`

### rootEditPart

    public SWTBotGefEditPart rootEditPart()
                                   throws WidgetNotFoundException

  retrieve the root edit part.

  Returns:
    the root edit part
  Throws:
    `WidgetNotFoundException` - if root edit part could not be found
  See Also:
    `GraphicalViewer#getRootEditPart()}`

### selectedEditParts

    public List<SWTBotGefEditPart> selectedEditParts()

  Get the selected edit parts.

  Returns:
    the selected edit parts

### createEditPart

    protected SWTBotGefEditPart createEditPart(org.eclipse.gef.EditPart part)

  lazily creates a `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.

  Parameters:
    `part` - the edit part to create a `SWTBotGefEditPart` for
  Returns:
    the created `SWTBotGefEditPart`

### createEditPart

    protected SWTBotGefConnectionEditPart createEditPart(org.eclipse.gef.ConnectionEditPart part)

  lazily creates a `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.

  Parameters:
    `part` - a connection edit part connecting graphical nodes
  Returns:
    a `SWTBotGefConnectionEditPart` encapsulating the connection edit part

### activateDefaultTool

    public void activateDefaultTool()

  Activate the default tool.

### activateTool

    public SWTBotGefViewer activateTool(String label)
                                 throws WidgetNotFoundException

  Activate the tool with the specified label. If there is many tools with the same label the first one will be used. See `activateTool(String, int)`

  Parameters:
    `label` - the label of the tool to activate
  Returns:
    the editor bot
  Throws:
    `WidgetNotFoundException` - if the tool with label specified could not be found

### activateTool

    public SWTBotGefViewer activateTool(String label,
                                        int index)
                                 throws WidgetNotFoundException

  Activate the tool with the specified label and the specified index. This method should be used only if there is many tools with the same label. See `activateTool(String)`

  Parameters:
    `label` - the label of the tool to activate
    `index` - the index to use in order to make the selection.
  Returns:
    the editor bot
  Throws:
    `WidgetNotFoundException` - if the tool with label specified could not be found

### directEditType

    public void directEditType(String text)
                        throws WidgetNotFoundException

  type the given text into the graphical editor, presuming that it is already in 'direct edit' mode.

  Parameters:
    `text` - the text to type.
  Throws:
    `WidgetNotFoundException`

### editParts

    public List<SWTBotGefEditPart> editParts(Matcher<? extends org.eclipse.gef.EditPart> matcher)
                                      throws WidgetNotFoundException

  Parameters:
    `matcher` - the matcher that matches on `EditPart`
  Returns:
    a collection of `SWTBotGefEditPart`
  Throws:
    `WidgetNotFoundException`

### getCanvas

    protected SWTBotGefFigureCanvas getCanvas()

  Get the canvas to do low-level operations.

  Returns:
    the canvas

### getControl

    protected Control getControl()

### getActiveTool

    public org.eclipse.gef.palette.ToolEntry getActiveTool()

  Get active tool.

  Returns:
    the active tool

### select

    public SWTBotGefViewer select(SWTBotGefEditPart... parts)

  select this edit part as a single selection

### select

    public SWTBotGefViewer select(Collection<SWTBotGefEditPart> parts)

  select this edit part as a single selection

### clickContextMenu

    public SWTBotGefViewer clickContextMenu(String text)
                                     throws WidgetNotFoundException

  Throws:
    `WidgetNotFoundException`

### click

    public void click(int xPosition,
                      int yPosition)

  Click on the editor at the specified location.

  Parameters:
    `xPosition` - the x relative position
    `yPosition` - the y relative position

### click

    public void click(SWTBotGefEditPart editPart)

  Click on the specified edit part at the top left hand corner of its bounds.

  Parameters:
    `editPart` - the edit part to click on

### click

    public void click(String label)

  Click on the edit part which owns the specified label at the top left hand corner of its bounds.

  Parameters:
    `label` - the label to retrieve edit part to click on

### doubleClick

    public void doubleClick(int xPosition,
                            int yPosition)

  Double click on the editor at the specified location.

  Parameters:
    `xPosition` - the x relative position
    `yPosition` - the y relative position

### doubleClick

    public 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.

  Parameters:
    `editPart` - the edit part to double click on

### doubleClick

    public 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.

  Parameters:
    `label` - the label to retrieve edit part to double click on

### drag

    public void drag(int fromXPosition,
                     int fromYPosition,
                     int toXPosition,
                     int toYPosition)

  Drag and drop from the specified to the specified location.

  Parameters:
    `toXPosition` - the x relative location
    `toYPosition` - the y relative location

### drag

    public void drag(SWTBotGefEditPart editPart,
                     int toXPosition,
                     int toYPosition)

  Drag and drop the specified edit part to the specified location.

  Parameters:
    `editPart` - the edit part to drag and drop
    `toXPosition` - the x relative location
    `toYPosition` - the y relative location

### drag

    public void drag(String label,
                     int toXPosition,
                     int toYPosition)

  Drag and drop the edit part which owns the specified label to the specified location

  Parameters:
    `label` - the label to retrieve the edit part to drag and drop
    `toXPosition` - the x relative position
    `toYPosition` - the y relative position

### select

    public SWTBotGefViewer select(String label)

  select the edit part with the label as a single selection.

### getEditPart

    public SWTBotGefEditPart getEditPart(String label)

  get this edit part with the label as a single selection.

### getEditpart

    @Deprecated
    public SWTBotGefEditPart getEditpart(String label,
                                                    List<SWTBotGefEditPart> allEditParts)

  Deprecated.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD