@Inherited @Documented @Target(value=METHOD) @Retention(value=RUNTIME) public @interface SinkNative
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
Modifier and Type | Required Element and Description |
---|---|
int |
value
Specifies the types of
Event instances that are handled by the annotated handler method. |
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 }
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.