001package react4j.dom.proptypes.html;
002
003import javax.annotation.Nonnull;
004import javax.annotation.Nullable;
005import jsinterop.annotations.JsOverlay;
006import jsinterop.annotations.JsPackage;
007import jsinterop.annotations.JsType;
008import react4j.dom.events.DragEventHandler;
009import react4j.dom.events.FocusEventHandler;
010import react4j.dom.events.KeyboardEventHandler;
011import react4j.dom.events.MouseEventHandler;
012import react4j.dom.events.TouchEventHandler;
013
014/**
015 * Props for input elements. Refer to http://www.w3schools.com/tags/tag_label.asp
016 */
017@JsType( isNative = true, namespace = JsPackage.GLOBAL, name = "Object" )
018public class LabelProps
019  extends HtmlGlobalFields<LabelProps>
020{
021  @JsOverlay
022  @Nonnull
023  public final LabelProps htmlFor( String s )
024  {
025    setHtmlFor( s );
026    return self();
027  }
028
029  @JsOverlay
030  @Nonnull
031  public final LabelProps form( String s )
032  {
033    setForm( s );
034    return self();
035  }
036
037  //Applicable Event Handlers
038
039  //TODO Refine
040  // Focus Events
041  @JsOverlay
042  @Nonnull
043  public final LabelProps onBlur( @Nullable final FocusEventHandler handler )
044  {
045    setOnBlur( handler );
046    return self();
047  }
048
049  @JsOverlay
050  @Nonnull
051  public final LabelProps onFocus( @Nullable final FocusEventHandler handler )
052  {
053    setOnFocus( handler );
054    return self();
055  }
056
057  // Keyboard Events
058  @JsOverlay
059  @Nonnull
060  public final LabelProps onKeyDown( @Nullable final KeyboardEventHandler handler )
061  {
062    setOnKeyDown( handler );
063    return self();
064  }
065
066  @JsOverlay
067  @Nonnull
068  public final LabelProps onKeyPress( @Nullable final KeyboardEventHandler handler )
069  {
070    setOnKeyPress( handler );
071    return self();
072  }
073
074  @JsOverlay
075  @Nonnull
076  public final LabelProps onKeyUp( @Nullable final KeyboardEventHandler handler )
077  {
078    setOnKeyUp( handler );
079    return self();
080  }
081
082  @JsOverlay
083  @Nonnull
084  public final LabelProps onClick( @Nullable final MouseEventHandler handler )
085  {
086    setOnClick( handler );
087    return self();
088  }
089
090  @JsOverlay
091  @Nonnull
092  public final LabelProps onContextMenu( @Nullable final MouseEventHandler handler )
093  {
094    setOnContextMenu( handler );
095    return self();
096  }
097
098  @JsOverlay
099  @Nonnull
100  public final LabelProps onDoubleClick( @Nullable final MouseEventHandler handler )
101  {
102    setOnDoubleClick( handler );
103    return self();
104  }
105
106  @JsOverlay
107  @Nonnull
108  public final LabelProps onDrag( @Nullable final DragEventHandler handler )
109  {
110    setOnDrag( handler );
111    return self();
112  }
113
114  @JsOverlay
115  @Nonnull
116  public final LabelProps onDragEnd( @Nullable final DragEventHandler handler )
117  {
118    setOnDragEnd( handler );
119    return self();
120  }
121
122  @JsOverlay
123  @Nonnull
124  public final LabelProps onDragEnter( @Nullable final DragEventHandler handler )
125  {
126    setOnDragEnter( handler );
127    return self();
128  }
129
130  @JsOverlay
131  @Nonnull
132  public final LabelProps onDragExit( @Nullable final DragEventHandler handler )
133  {
134    setOnDragExit( handler );
135    return self();
136  }
137
138  @JsOverlay
139  @Nonnull
140  public final LabelProps onDragLeave( @Nullable final DragEventHandler handler )
141  {
142    setOnDragLeave( handler );
143    return self();
144  }
145
146  @JsOverlay
147  @Nonnull
148  public final LabelProps onDragOver( @Nullable final DragEventHandler handler )
149  {
150    setOnDragOver( handler );
151    return self();
152  }
153
154  @JsOverlay
155  @Nonnull
156  public final LabelProps onDragStart( @Nullable final DragEventHandler handler )
157  {
158    setOnDragStart( handler );
159    return self();
160  }
161
162  @JsOverlay
163  @Nonnull
164  public final LabelProps onDrop( @Nullable final DragEventHandler handler )
165  {
166    setOnDrop( handler );
167    return self();
168  }
169
170  @JsOverlay
171  @Nonnull
172  public final LabelProps onMouseDown( @Nullable final MouseEventHandler handler )
173  {
174    setOnMouseDown( handler );
175    return self();
176  }
177
178  @JsOverlay
179  @Nonnull
180  public final LabelProps onMouseEnter( @Nullable final MouseEventHandler handler )
181  {
182    setOnMouseEnter( handler );
183    return self();
184  }
185
186  @JsOverlay
187  @Nonnull
188  public final LabelProps onMouseLeave( @Nullable final MouseEventHandler handler )
189  {
190    setOnMouseLeave( handler );
191    return self();
192  }
193
194  @JsOverlay
195  @Nonnull
196  public final LabelProps onMouseMove( @Nullable final MouseEventHandler handler )
197  {
198    setOnMouseMove( handler );
199    return self();
200  }
201
202  @JsOverlay
203  @Nonnull
204  public final LabelProps onMouseOut( @Nullable final MouseEventHandler handler )
205  {
206    setOnMouseOut( handler );
207    return self();
208  }
209
210  @JsOverlay
211  @Nonnull
212  public final LabelProps onMouseOver( @Nullable final MouseEventHandler handler )
213  {
214    setOnMouseOver( handler );
215    return self();
216  }
217
218  @JsOverlay
219  @Nonnull
220  public final LabelProps onMouseUp( @Nullable final MouseEventHandler handler )
221  {
222    setOnMouseUp( handler );
223    return self();
224  }
225
226  // Touch Events
227  @JsOverlay
228  @Nonnull
229  public final LabelProps onTouchCancel( @Nullable final TouchEventHandler handler )
230  {
231    setOnTouchCancel( handler );
232    return self();
233  }
234
235  @JsOverlay
236  @Nonnull
237  public final LabelProps onTouchEnd( @Nullable final TouchEventHandler handler )
238  {
239    setOnTouchEnd( handler );
240    return self();
241  }
242
243  @JsOverlay
244  @Nonnull
245  public final LabelProps onTouchMove( @Nullable final TouchEventHandler handler )
246  {
247    setOnTouchMove( handler );
248    return self();
249  }
250
251  @JsOverlay
252  @Nonnull
253  public final LabelProps onTouchStart( @Nullable final TouchEventHandler handler )
254  {
255    setOnTouchStart( handler );
256    return self();
257  }
258}