Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## org.eclipse.swtbot.swt.finder
Annotation Type SWTBotWidget

    @Retention(value=RUNTIME)
    @Target(value=TYPE)
    public @interface SWTBotWidget

Marks a SWTBot widget so tools recognise them. This anotation is primarily used to describe the convinience API that should be generated for a class annotated with the specified widget.

Usage:

     @SWTBotWidget(clasz = Button.class, style = @Style(name = "SWT.PUSH", value = SWT.PUSH), preferredName = "button", referenceBy = { ReferenceBy.LABEL, ReferenceBy.MNEMONIC, ReferenceBy.TOOLTIP })
     public class SWTBotButton ...{
       // the implement
     }

The above represents:

- widget of type 'Button.class'
- with style bits 'SWT.PUSH'
- the preferred name for the generated API would be 'button'
- the widget can be referenced by: a combination of LABEL, MNEMONIC, TOOLTIP, in addition to the defaults described in `defaultReferenceBy()`

This annotation will generate the following convinience API to find buttons:

- public SWTBotButton buttonWithLabel(String label)
- public SWTBotButton buttonWithLabel(String label, int index)
- public SWTBotButton button(String mnemonicText)
- public SWTBotButton button(String mnemonicText, int index)
- public SWTBotButton buttonWithTooltip(String tooltip)
- public SWTBotButton buttonWithTooltip(String tooltip, int index)
- public SWTBotButton buttonWithId(String key, String value)
- public SWTBotButton buttonWithId(String key, String value, int index)
- public SWTBotButton buttonWithId(String value)
- public SWTBotButton buttonWithId(String value, int index)
- public SWTBotButton buttonInGroup(String inGroup)
- public SWTBotButton buttonInGroup(String inGroup, int index)
- public SWTBotButton button()
- public SWTBotButton button(int index)
- public SWTBotButton buttonWithLabelInGroup(String label, String inGroup)
- public SWTBotButton buttonWithLabelInGroup(String label, String inGroup, int index)
- public SWTBotButton buttonInGroup(String mnemonicText, String inGroup)
- public SWTBotButton buttonInGroup(String mnemonicText, String inGroup, int index)
- public SWTBotButton buttonWithTooltipInGroup(String tooltip, String inGroup)
- public SWTBotButton buttonWithTooltipInGroup(String tooltip, String inGroup, int index)

Since:
  2.0
Version:
  $Id$
Author:
  Ketan Padegaonkar <KetanPadegaonkar [at] gmail [dot] com>

Required Element Summary
`Class<? extends Widget>` | `clasz` Widget is of the specified class
`String` | `preferredName` The preferred name for the widget

Optional Element Summary
`ReferenceBy[]` | `defaultReferenceBy` Default reference by
`ReferenceBy[]` | `referenceBy` Widget can be found using the following methods
`Class<?>` | `returnType`
`Style` | `style` If a the specified widget can have different styles, specify one of the styles in `SWT`

Element Detail

### clasz

    public abstract Class<? extends Widget> clasz

  Widget is of the specified class

### preferredName

    public abstract String preferredName

  The preferred name for the widget

### referenceBy

    public abstract ReferenceBy[] referenceBy

  Widget can be found using the following methods

  Default:
    {org.eclipse.swtbot.swt.finder.ReferenceBy.ID_KEY_VALUE, org.eclipse.swtbot.swt.finder.ReferenceBy.ID_VALUE, org.eclipse.swtbot.swt.finder.ReferenceBy.IN_GROUP, org.eclipse.swtbot.swt.finder.ReferenceBy.LABEL, org.eclipse.swtbot.swt.finder.ReferenceBy.MNEMONIC, org.eclipse.swtbot.swt.finder.ReferenceBy.NONE, org.eclipse.swtbot.swt.finder.ReferenceBy.TEXT, org.eclipse.swtbot.swt.finder.ReferenceBy.TOOLTIP}

### style

    public abstract Style style

  If a the specified widget can have different styles, specify one of the styles in `SWT`

  Default:
    @org.eclipse.swtbot.swt.finder.Style

### defaultReferenceBy

    public abstract ReferenceBy[] defaultReferenceBy

  Default reference by

  Default:
    {org.eclipse.swtbot.swt.finder.ReferenceBy.ID_KEY_VALUE, org.eclipse.swtbot.swt.finder.ReferenceBy.ID_VALUE, org.eclipse.swtbot.swt.finder.ReferenceBy.IN_GROUP, org.eclipse.swtbot.swt.finder.ReferenceBy.NONE}

### returnType

    public abstract Class<?> returnType

  Default:
    java.lang.Object.class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT