@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Alias
This annotation is used to assign global name to some specific control. The global name will be accessible at any place of code.
Initialization example:
public class Test1LevelWindow extends MainWindow { @Alias(name="Sample Text") @Locator(winClass="Edit",caption="Sample text",index=0) public Edit edtText; @Alias(name="Sample Button") @Locator(winClass="Button",caption="Test Button",index=2) public Button btnTestButton; public Test1LevelWindow(Win32Client client) { super(client, new Win32Locator("Test",0)); } }After that the annotated controls are accessed from
Aliases
object
by given alias name.
Usage example:
Win32Client client = new Win32Client(); Test1LevelWindow win = new Test1LevelWindow(client); ((Edit)Aliases.get("Sample Text")).setText("Hello");
NOTE: global aliases storage is initialized together with locators initialization.
So, it's recommended using aliases together with Locator
annotations.
Also, the external storage requires unique names for the aliases. Otherwise they will be overwritten.
Aliases}
,
Locator}
public abstract String name
Copyright © 2013. All rights reserved.