-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJQueryElement.java
3944 lines (3449 loc) · 172 KB
/
JQueryElement.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2014 Cristian Rinaldi & Andres Testi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package gwt.material.design.jquery.client.api;
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.google.gwt.dom.client.Element;
import gwt.material.design.jquery.client.api.Functions.EventFunc;
import gwt.material.design.jquery.client.api.Functions.EventFunc1;
import gwt.material.design.jquery.client.api.Functions.EventFunc2;
import gwt.material.design.jquery.client.api.Functions.EventFunc3;
import gwt.material.design.jquery.client.api.Functions.Func;
import gwt.material.design.jquery.client.api.Functions.Func1;
import gwt.material.design.jquery.client.api.Functions.Func2;
import gwt.material.design.jquery.client.api.Functions.Func3;
import gwt.material.design.jquery.client.api.Functions.FuncRet1;
import gwt.material.design.jquery.client.api.Functions.FuncRet2;
import gwt.material.design.jquery.client.api.Functions.FuncRet3;
import gwt.material.design.jquery.client.api.Functions.KeyEventFunc;
import gwt.material.design.jquery.client.api.Functions.MouseEventFunc;
import gwt.material.design.jscore.client.api.core.Node;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* Represent a JQuery Element.
*
* @author Cristian Rinaldi
* @author Ben Dol
*/
@JsType(name = "jQuery", isNative = true)
public class JQueryElement extends Node {
/**
* A helper method to enable cross-casting from any {@link JQueryElement}
* type to any other {@link JQueryElement} type.
*
* @param <T> the target type
* @return this object as a different type
*/
@JsOverlay
public final <T extends JQueryElement> T cast() {
return (T) this;
}
/**
* A string containing the jQuery version number.
*/
@JsProperty(name="jquery")
public native int jquery();
/**
* The number of elements in the jQuery object.
*/
@JsProperty(name="length")
public native int length();
/**
* Use as the raw 0 index element.
*/
@JsOverlay
public final Element asElement() {
return get(0);
}
/**
* Create a new jQuery object with elements added to the set of matched elements.
* @param selectorOrHtml A string representing a selector expression to find
* additional elements to add to the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement add(String selectorOrHtml);
/**
* Create a new jQuery object with elements added to the set of matched elements.
* @param element One or more elements to add to the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement add(Element element);
/**
* Create a new jQuery object with elements added to the set of matched elements.
* @param selection An existing jQuery object to add to the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement add(JQueryElement selection);
/**
* Create a new jQuery object with elements added to the set of matched elements.
* @param selector A string representing a selector expression to find additional
* elements to add to the set of matched elements.
* @param context The point in the document at which the selector should begin matching;
* similar to the context argument of the $(selector, context) method.
* @return self {@link JQueryElement}
*/
public native JQueryElement add(String selector, Element context);
/**
* Add the previous set of elements on the stack to the current set, optionally
* filtered by a selector.
* @param selector A string containing a selector expression to match the current
* set of elements against.
* @return self {@link JQueryElement}
*/
public native JQueryElement addBack(String... selector);
/**
* Adds the specified class(es) to each element in the set of matched elements.
* @param className One or more space-separated classes to be added to the class
* attribute of each matched element.
* @return self {@link JQueryElement}
*/
public native JQueryElement addClass(String className);
/**
* Adds the specified class(es) to each element in the set of matched elements.
* @param function A function returning one or more space-separated class names
* to be added to the existing class name(s). Receives the index
* position of the element in the set and the existing class name(s)
* as arguments. Within the function, this refers to the current
* element in the set.
* @return self {@link JQueryElement}
*/
public native JQueryElement addClass(Func2<Integer, String> function);
/**
* Insert content, specified by the parameter, after each element in the
* set of matched elements.
* @param content HTML string to insert after each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement after(String content);
/**
* Insert content, specified by the parameter, after each element in the
* set of matched elements.
* @param content DOM elements to insert after each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement after(Element... content);
/**
* Insert content, specified by the parameter, after each element in the
* set of matched elements.
* @param content jQuery object to insert after each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement after(JQueryElement content);
/**
* Insert content, specified by the parameter, after each element in the
* set of matched elements.
* @param function A function that returns an HTML string, DOM element(s), or jQuery
* object to insert after each element in the set of matched elements.
* Receives the index position of the element in the set as an argument.
* Within the function, this refers to the current element in the set.
* @return self {@link JQueryElement}
*/
public native JQueryElement after(Func1<Integer> function);
/**
* Insert content, specified by the parameter, after each element in the
* set of matched elements.
* @param function A function that returns an HTML string, DOM element(s), or jQuery
* object to insert after each element in the set of matched elements.
* Receives the index position of the element in the set and the old
* HTML value of the element as arguments. Within the function, this
* refers to the current element in the set.
* @return self {@link JQueryElement}
*/
public native JQueryElement after(Func2<Integer, String> function);
/**
* TODO: Reserved for AJAX:
* https://api.jquery.com/ajaxComplete/
* https://api.jquery.com/ajaxError/
* https://api.jquery.com/ajaxSend/
* https://api.jquery.com/ajaxStart/
* https://api.jquery.com/ajaxStop/
* https://api.jquery.com/ajaxSuccess/
*/
/**
* Add the previous set of elements on the stack to the current set.
* Note: This function has been deprecated and is now an alias for .addBack(), which
* should be used with jQuery 1.8 and later.
* @deprecated use {@link #addBack(String...)}
*/
public native JQueryElement andSelf();
/**
* Perform a custom animation of a set of CSS properties.
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @return self {@link JQueryElement}
*/
public native JQueryElement animate(Object properties, double duration);
/**
* Perform a custom animation of a set of CSS properties.
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @return self {@link JQueryElement}
*/
public native JQueryElement animate(Object properties, double duration, String easing);
/**
* Perform a custom animation of a set of CSS properties.
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param function A function to call once the animation is complete, called once per matched element.
* @return self {@link JQueryElement}
*/
public native JQueryElement animate(Object properties, double duration, String easing, Func function);
/**
* Perform a custom animation of a set of CSS properties.
* @param properties An object of CSS properties and values that the animation will move toward.
* @param options A map of additional options to pass to the method.
* @return self {@link JQueryElement}
*/
public native JQueryElement animate(Object properties, AnimateOptions options);
/**
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
* @param htmlString HTML string to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement append(String htmlString);
/**
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
* @param element jQuery objects to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement append(JQueryElement element);
/**
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
* @param element DOM elements to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement append(Element... element);
/**
* Insert every element in the set of matched elements to the end of the target.
* @param htmlString HTML string the matched set of elements will be inserted at the end of the
* element(s) specified by this parameter.
* @return self {@link JQueryElement}
*/
public native JQueryElement appendTo(String htmlString);
/**
* Insert every element in the set of matched elements to the end of the target.
* @param element jQuery objects the matched set of elements will be inserted at the end of the
* element(s) specified by this parameter.
* @return self {@link JQueryElement}
*/
public native JQueryElement appendTo(JQueryElement element);
/**
* Insert every element in the set of matched elements to the end of the target.
* @param element DOM elements the matched set of elements will be inserted at the end of the
* element(s) specified by this parameter.
* @return self {@link JQueryElement}
*/
public native JQueryElement appendTo(Element... element);
/**
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
* @param htmlString HTML string to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prepend(String htmlString);
/**
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
* @param element jQuery objects to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prepend(JQueryElement element);
/**
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
* @param element DOM elements to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prepend(Element... element);
/**
* Insert every element in the set of matched elements to the beginning of the target.
* @param htmlString HTML string to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prependTo(String htmlString);
/**
* Insert every element in the set of matched elements to the beginning of the target.
* @param element jQuery objects to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prependTo(JQueryElement element);
/**
* Insert every element in the set of matched elements to the beginning of the target.
* @param element DOM elements to insert at the end of each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement prependTo(Element... element);
/**
* Get the value of an attribute for the first element in the set of matched elements.
* @param attr The name of the attribute to get.
*/
public native Object attr(String attr);
/**
* Set one or more attributes for the set of matched elements.
* @param attr The name of the attribute to set.
* @param value A value to set for the attribute.
* @return self {@link JQueryElement}
*/
public native JQueryElement attr(String attr, Object value);
/**
* Set one or more attributes for the set of matched elements.
* @param attr The name of the attribute to set.
* @param function A function returning the value to set. this is the current element.
* Receives the index position of the element in the set and the old
* attribute value as arguments.
* @return self {@link JQueryElement}
*/
public native JQueryElement attr(String attr, Func2<Integer, Object> function);
/**
* Insert content, specified by the parameter, before each element in the set of matched elements.
* @param htmlString HTML string to insert before each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement before(String htmlString);
/**
* Insert content, specified by the parameter, before each element in the set of matched elements.
* @param element jQuery object to insert before each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement before(JQueryElement element);
/**
* Insert content, specified by the parameter, before each element in the set of matched elements.
* @param element DOM elements to insert before each element in the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement before(Element... element);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, EventFunc handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, EventFunc1 handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, EventFunc2 handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, Object eventData, EventFunc handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, Object eventData, EventFunc1 handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, Object eventData, EventFunc2 handler);
/**
* Attach a handler to an event for the elements.
* @param eventType A string containing one or more DOM event types, such as "click" or
* "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param preventBubble Setting the third argument to false will attach a function that prevents
* the default action from occurring and stops the event from bubbling.
* The default is true.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(String eventType, Object eventData, boolean preventBubble);
/**
* Attach a handler to an event for the elements.
* @param events An object containing one or more DOM event types and functions to execute for them.
* @return self {@link JQueryElement}
*/
public native JQueryElement bind(Object events);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur(EventFunc1 handler);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur(EventFunc2 handler);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur(Object eventData, EventFunc handler);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur(Object eventData, EventFunc1 handler);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur(Object eventData, EventFunc2 handler);
/**
* Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
* @return self {@link JQueryElement}
*/
public native JQueryElement blur();
/**
* TODO: Reserved for Callbacks:
* https://api.jquery.com/callbacks.add/
*/
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement change(EventFunc1 handler);
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement change(EventFunc2 handler);
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement change(Object eventData, EventFunc handler);
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement change(Object eventData, EventFunc1 handler);
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement change(Object eventData, EventFunc2 handler);
/**
* Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
* @return self {@link JQueryElement}
*/
public native JQueryElement change();
/**
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
* @param selector A string containing a selector expression to match elements against.
* @return self {@link JQueryElement}
*/
public native JQueryElement children(String selector);
/**
* Remove from the queue all items that have not yet been run.
* @return self {@link JQueryElement}
*/
public native JQueryElement clearQueue();
/**
* Remove from the queue all items that have not yet been run.
* @param queueName A string containing the name of the queue. Defaults to fx, the
* standard effects queue.
* @return self {@link JQueryElement}
*/
public native JQueryElement clearQueue(String queueName);
/**
* Bind an event handler to the "click" JavaScript event, or trigger that
* event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement click(MouseEventFunc handler);
/**
* Bind an event handler to the "click" JavaScript event, or trigger that
* event on an element.
* @return self {@link JQueryElement}
*/
public native JQueryElement click();
/**
* Create a deep copy of the set of matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement clone();
/**
* Create a deep copy of the set of matched elements.
* @param withDataAndEvents A Boolean indicating whether event handlers should be copied along with
* the elements. As of jQuery 1.4, element data will be copied as well.
* @return self {@link JQueryElement}
*/
public native JQueryElement clone(boolean withDataAndEvents);
/**
* Create a deep copy of the set of matched elements.
* @param withDataAndEvents A Boolean indicating whether event handlers should be copied along with
* the elements. As of jQuery 1.4, element data will be copied as well.
* @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children
* of the cloned element should be copied. By default its value matches
* the first argument's value (which defaults to false).
* @return self {@link JQueryElement}
*/
public native JQueryElement clone(boolean withDataAndEvents, boolean deepWithDataAndEvents);
/**
* For each element in the set, get the first element that matches the selector by testing the
* element itself and traversing up through its ancestors in the DOM tree.
* @param selector A string containing a selector expression to match elements against.
* @return self {@link JQueryElement}
*/
public native JQueryElement closest(String selector);
/**
* For each element in the set, get the first element that matches the selector by testing the
* element itself and traversing up through its ancestors in the DOM tree.
* @param selector A string containing a selector expression to match elements against.
* @param context A DOM element within which a matching element may be found. If no context is passed
* in then the context of the jQuery set will be used instead.
* @return self {@link JQueryElement}
*/
public native JQueryElement closest(String selector, Element context);
/**
* For each element in the set, get the first element that matches the selector by testing the
* element itself and traversing up through its ancestors in the DOM tree.
* @param selection A jQuery object to match elements against.
* @return self {@link JQueryElement}
*/
public native JQueryElement closest(JQueryElement selection);
/**
* For each element in the set, get the first element that matches the selector by testing the
* element itself and traversing up through its ancestors in the DOM tree.
* @param element An element to match elements against.
* @return self {@link JQueryElement}
*/
public native JQueryElement closest(Element element);
/**
* Get the children of each element in the set of matched elements, including text and comment nodes.
* @return self {@link JQueryElement}
*/
public native JQueryElement contents();
/**
* Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement contextmenu(MouseEventFunc handler);
/**
* Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement contextmenu(Object eventData, MouseEventFunc handler);
/**
* Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element.
* @return self {@link JQueryElement}
*/
public native JQueryElement contextmenu();
/**
* Get the computed style properties for the first element in the set of matched elements.
* @param propertyName A CSS property.
*/
public native String css(String... propertyName);
/**
* Set one or more CSS properties for the set of matched elements.
* @param propertyName A CSS property.
* @param value A value to set for the property.
* @return self {@link JQueryElement}
*/
public native JQueryElement css(String propertyName, String value);
/**
* Set one or more CSS properties for the set of matched elements.
* @param propertyName A CSS property.
* @param function A function returning the value to set. this is the current element. Receives
* the index position of the element in the set and the old value as arguments.
* @return self {@link JQueryElement}
*/
public native JQueryElement css(String propertyName, FuncRet2<Integer, Object> function);
/**
* Set one or more CSS properties for the set of matched elements.
* @param properties An object of property-value pairs to set.
* @return self {@link JQueryElement}
*/
public native JQueryElement css(Object properties);
/**
* Get the computed style properties for the first element in the set of matched elements.
* @param propertyName A CSS property.
* @return {@link String} property value.
*/
public native String css(String propertyName);
/**
* Store arbitrary data associated with the matched elements.
* @param key A string naming the piece of data to set.
* @param value The new data value; this can be any Javascript type except undefined.
* @return self {@link JQueryElement}
*/
public native JQueryElement data(String key, String value);
/**
* Store arbitrary data associated with the matched elements.
* @param obj An object of key-value pairs of data to update.
* @return self {@link JQueryElement}
*/
public native JQueryElement data(Object obj);
/**
* Return the value at the named data store for the first element in the jQuery collection,
* as set by data(name, value) or by an HTML5 data-* attribute.
* @param key Name of the data stored.
* @return data object value.
*/
public native Object data(String key);
/**
* Return the value at the named data store for the first element in the jQuery collection,
* as set by data(name, value) or by an HTML5 data-* attribute.
* @return data object value.
*/
public native Object data();
/**
* Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement dblclick(MouseEventFunc handler);
/**
* Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement dblclick(Object eventData, MouseEventFunc handler);
/**
* Set a timer to delay execution of subsequent items in the queue.
* @param duration An integer indicating the number of milliseconds to delay execution of the next
* item in the queue.
* @return self {@link JQueryElement}
*/
public native JQueryElement delay(int duration);
/**
* Set a timer to delay execution of subsequent items in the queue.
* @param duration An integer indicating the number of milliseconds to delay execution of the next
* item in the queue.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
* @return self {@link JQueryElement}
*/
public native JQueryElement delay(int duration, String queueName);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType, EventFunc handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType, EventFunc1 handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType, EventFunc2 handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType, Object eventData, EventFunc handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType, Object eventData, EventFunc1 handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param eventType A string containing one or more space-separated JavaScript event types, such as
* "click" or "keydown," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute at the time the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, String eventType,
Object eventData, EventFunc2 handler);
/**
* Attach a handler to one or more events for all elements that match the selector, now or in the
* future, based on a specific set of root elements.
* @param selector A selector to filter the elements that trigger the event.
* @param events A plain object of one or more event types and functions to execute for them.
* @return self {@link JQueryElement}
*/
public native JQueryElement delegate(String selector, Object events);
/**
* Execute the next function on the queue for the matched elements.
* @return self {@link JQueryElement}
*/
public native JQueryElement dequeue();
/**
* Execute the next function on the queue for the matched elements.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
* @return self {@link JQueryElement}
*/
public native JQueryElement dequeue(String queueName);
/**
* Remove the set of matched elements from the DOM.
* @return self {@link JQueryElement}
*/
public native JQueryElement detach();
/**
* Remove the set of matched elements from the DOM.
* @param selector A selector expression that filters the set of matched elements to be removed.
* @return self {@link JQueryElement}
*/
public native JQueryElement detach(String selector);
/**
* Iterate over a jQuery object, executing a function for each matched element.
* @param function A function to execute for each matched element.
* @return self {@link JQueryElement}
*/
public native JQueryElement each(Func2<Object, Element> function);
/**
* Remove all child nodes of the set of matched elements from the DOM.
* @return self {@link JQueryElement}
*/
public native JQueryElement empty();
/**
* End the most recent filtering operation in the current chain and return the set of
* matched elements to its previous state.
* @return self {@link JQueryElement}
*/
public native JQueryElement end();
/**
* Reduce the set of matched elements to the one at the specified index.
* @param index An integer indicating the 0-based position of the element. or,
* An integer indicating the position of the element, counting backwards
* from the last element in the set.
* @return self {@link JQueryElement}
*/
public native JQueryElement eq(int index);
/**
* Bind an event handler to the "error" JavaScript event.
* @param handler A function to execute when the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement error(EventFunc1 handler);
/**
* Bind an event handler to the "error" JavaScript event.
* @param handler A function to execute when the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement error(EventFunc2 handler);
/**
* Bind an event handler to the "error" JavaScript event.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement error(Object eventData, EventFunc handler);
/**
* Bind an event handler to the "error" JavaScript event.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement error(Object eventData, EventFunc1 handler);
/**
* Bind an event handler to the "error" JavaScript event.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
* @return self {@link JQueryElement}
*/
public native JQueryElement error(Object eventData, EventFunc2 handler);
/**
* Display the matched elements by fading them to opaque.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn();
/**
* Display the matched elements by fading them to opaque.
* @param duration A string or number determining how long the animation will run.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn(double duration);
/**
* Display the matched elements by fading them to opaque.
* @param complete A function to call once the animation is complete, called once per matched element.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn(Func complete);
/**
* Display the matched elements by fading them to opaque.
* @param easing A string indicating which easing function to use for the transition.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn(String easing);
/**
* Display the matched elements by fading them to opaque.
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete, called once per matched element.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn(double duration, Func complete);
/**
* Display the matched elements by fading them to opaque.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @return self {@link JQueryElement}
*/
public native JQueryElement fadeIn(double duration, String easing);
/**
* Display the matched elements by fading them to opaque.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.