|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Inherited @Documented @Target(value=METHOD) @Retention(value=RUNTIME) public @interface SinkNative
This annotation may only be used in subclasses of Composite
that has been annotated with Templated
,
or in a super-class of said Composite
types.
Indicate the types of events to be handled when used in conjunction with a corresponding method that has been
annotated with EventHandler
; these types are specified using a bit mask in the value()
attribute.
Native events on DOM Elements
This use of this annotation does not require that target Element
instances be referenced via
DataField
in the Templated
Composite
component; they may also target un-referenced
data-field
elements from the corresponding HTML template.
Example:
@Templated public class QuickHandlerComponent extends Composite { @DataField private AnchorElement link = DOM.createAnchor().cast(); @EventHandler("link") @SinkNative(Event.ONMOUSEOVER) public void doSomething(Event e) { // do something } @EventHandler("div") @SinkNative(Event.ONCLICK | Event.ONMOUSEOVER) public void doSomethingElse(Event e) { // do something with an element not otherwise referenced in our component } }
See also: EventHandler
, Templated
, DataField
Required Element Summary | |
---|---|
int |
value
Specifies the types of Event instances that are handled by the annotated handler method. |
Element Detail |
---|
public abstract int value
Event
instances that are handled by the annotated handler method. Multiple event
types may be handled using a bit-mask of the form:
@EventHandler("div") @SinkNative(Event.ONCLICK | Event.ONMOUSEOVER) public void doSomething(Event e) { // do something }
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |