You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LazyGQuery.java 92KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626
  1. /*
  2. * Copyright 2011, The gwtquery team.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. * in compliance with the License. You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software distributed under the License
  10. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. * or implied. See the License for the specific language governing permissions and limitations under
  12. * the License.
  13. */
  14. package com.google.gwt.query.client;
  15. import com.google.gwt.dom.client.Element;
  16. import com.google.gwt.dom.client.NativeEvent;
  17. import com.google.gwt.dom.client.Node;
  18. import com.google.gwt.dom.client.NodeList;
  19. import com.google.gwt.query.client.GQuery.Offset;
  20. import com.google.gwt.query.client.css.HasCssValue;
  21. import com.google.gwt.query.client.css.TakesCssValue;
  22. import com.google.gwt.query.client.css.TakesCssValue.CssSetter;
  23. import com.google.gwt.query.client.js.JsNamedArray;
  24. import com.google.gwt.query.client.js.JsNodeArray;
  25. import com.google.gwt.query.client.plugins.Effects;
  26. import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing;
  27. import com.google.gwt.safehtml.shared.SafeHtml;
  28. import com.google.gwt.user.client.ui.Widget;
  29. import java.util.List;
  30. /**
  31. * LazyGQuery.
  32. * @param <T>
  33. */
  34. public interface LazyGQuery<T> extends LazyBase<T> {
  35. /**
  36. * Add elements to the set of matched elements if they are not included yet.
  37. *
  38. * It construct a new GQuery object and does not modify the original ones.
  39. *
  40. * It also update the selector appending the new one.
  41. */
  42. LazyGQuery<T> add(GQuery elementsToAdd);
  43. /**
  44. * Add elements to the set of matched elements if they are not included yet.
  45. */
  46. LazyGQuery<T> add(String selector);
  47. /**
  48. * Add the previous selection to the current selection. Useful for traversing elements, and then
  49. * adding something that was matched before the last traversal.
  50. */
  51. LazyGQuery<T> addBack();
  52. /**
  53. * Adds the specified classes to each matched element.
  54. */
  55. LazyGQuery<T> addClass(String... classes);
  56. /**
  57. * Insert content after each of the matched elements. The elements must already be inserted into
  58. * the document (you can't insert an element after another if it's not in the page).
  59. */
  60. LazyGQuery<T> after(GQuery query);
  61. /**
  62. * Insert content after each of the matched elements. The elements must already be inserted into
  63. * the document (you can't insert an element after another if it's not in the page).
  64. */
  65. LazyGQuery<T> after(Node n);
  66. /**
  67. * Insert content after each of the matched elements. The elements must already be inserted into
  68. * the document (you can't insert an element after another if it's not in the page).
  69. */
  70. LazyGQuery<T> after(String html);
  71. /**
  72. * Insert content after each of the matched elements. The elements must already be inserted into
  73. * the document (you can't insert an element after another if it's not in the page).
  74. */
  75. LazyGQuery<T> after(SafeHtml safeHtml);
  76. /**
  77. *
  78. * The animate() method allows you to create animation effects on any numeric HTML Attribute,
  79. * CSS property, or color CSS property.
  80. *
  81. * Concerning to numeric properties, values are treated as a number of pixels unless otherwise
  82. * specified. The units em and % can be specified where applicable.
  83. *
  84. * By default animate considers css properties, if you wanted to animate element attributes you
  85. * should to prepend the symbol dollar to the attribute name. It's useful to animate svg elements.
  86. *
  87. * NOTE: The ability of animating attribute values is only available in gquery but not jquery
  88. *
  89. * Example:
  90. *
  91. * <pre class="code">
  92. * // move the element from its original position to left:500px
  93. * $("#foo").animate("left:'500'");
  94. *
  95. * // Change the width html attribute of a table, note the symbol '$' to
  96. * // tell gquery which it is an html-attribute instead of a css-property.
  97. * $("table").animate("$width:'500'");
  98. * </pre>
  99. *
  100. * In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'.
  101. * These shortcuts allow for custom hiding and showing animations that take into account the
  102. * display type of the element. Animated properties can also be relative. If a value is supplied
  103. * with a leading += or -= sequence of characters, then the target value is computed by adding or
  104. * subtracting the given number from the current value of the property.
  105. *
  106. * Example:
  107. *
  108. * <pre class="code">
  109. * // move the element from its original position to 500px to the left for 500ms and
  110. * // change the background color of the element at the end of the animation
  111. *
  112. * $("#foo").animate("left:'+=500'", new Function(){
  113. * public void f(Element e){
  114. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED);
  115. * }
  116. * });
  117. * </pre>
  118. *
  119. * The default duration of the animation is 500ms.
  120. *
  121. * For color css properties, values can be specified via hexadecimal or rgb or literal values.
  122. *
  123. * Example:
  124. *
  125. * <pre class="code">
  126. * $("#foo").animate("backgroundColor:'red', color:'#ffffff', borderColor:'rgb(129, 0, 70)'");
  127. * </pre>
  128. *
  129. * @param stringOrProperties the property to animate : "cssName:'value'"
  130. * @param funcs an array of {@link Function} called once the animation is complete
  131. */
  132. LazyGQuery<T> animate(Object stringOrProperties, Function... funcs);
  133. /**
  134. *
  135. * The animate() method allows you to create animation effects on any numeric HTML Attribute,
  136. * CSS property, or color CSS property.
  137. *
  138. * Concerning to numeric properties, values are treated as a number of pixels unless otherwise
  139. * specified. The units em and % can be specified where applicable.
  140. *
  141. * By default animate considers css properties, if you wanted to animate element attributes you
  142. * should to prepend the symbol dollar to the attribute name. It's useful to animate svg elements.
  143. *
  144. * NOTE: The ability of animating attribute values is only available in gquery but not jquery
  145. *
  146. * Example:
  147. *
  148. * <pre class="code">
  149. * // move the element from its original position to left:500px for 500ms using a swing easing
  150. * $("#foo").animate("left:'500'", 500, Easing.SWING);
  151. *
  152. * // Change the width html attribute of a table, note the symbol '$' to
  153. * // tell gquery which it is an html-attribute instead of a css-property.
  154. * // the animation will last 400ms, and we use the LINEAR easing algorithm
  155. * $("table").animate(Properties.create("{$width: '500', $border: '10'}"), 400, Easing.LINEAR);
  156. * </pre>
  157. *
  158. * In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'.
  159. * These shortcuts allow for custom hiding and showing animations that take into account the
  160. * display type of the element. Animated properties can also be relative. If a value is supplied
  161. * with a leading += or -= sequence of characters, then the target value is computed by adding or
  162. * subtracting the given number from the current value of the property.
  163. *
  164. * Example:
  165. *
  166. * <pre class="code">
  167. * // move the element from its original position to 500px to the left and 5OOpx down for 400ms.
  168. * // use a swing easing function for the transition
  169. * $("#foo").animate(Properties.create("{top:'+=500px',left:'+=500px'}"), 400, Easing.SWING);
  170. * </pre>
  171. *
  172. * For color css properties, values can be specified via hexadecimal or rgb or literal values.
  173. *
  174. * Example:
  175. *
  176. * <pre class="code">
  177. * $("#foo").animate("backgroundColor:'red', color:'#ffffff', borderColor:'rgb(129, 0, 70)'"), 400, Easing.SWING);
  178. * </pre>
  179. *
  180. * @param stringOrProperties a String or a {@link Properties} object containing css properties to
  181. * animate.
  182. * @param funcs an array of {@link Function} called once the animation is complete
  183. * @param duration the duration in milliseconds of the animation
  184. * @param easing the easing function to use for the transition
  185. */
  186. LazyGQuery<T> animate(Object stringOrProperties, int duration, Easing easing, Function... funcs);
  187. /**
  188. * The animate() method allows you to create animation effects on any numeric HTML Attribute,
  189. * CSS property, or color CSS property.
  190. *
  191. * Concerning to numeric properties, values are treated as a number of pixels unless otherwise
  192. * specified. The units em and % can be specified where applicable.
  193. *
  194. * By default animate considers css properties, if you wanted to animate element attributes you
  195. * should to prepend the symbol dollar to the attribute name. It's useful to animate svg elements.
  196. *
  197. * NOTE: The ability of animating attribute values is only available in gquery but not jquery
  198. *
  199. * Example:
  200. *
  201. * <pre class="code">
  202. * // move the element from its original position to left:500px for 500ms
  203. * $("#foo").animate("left:'500'", 500);
  204. *
  205. * // Change the width html attribute of a table, note the symbol '$' to
  206. * // tell gquery which it is an html-attribute instead of a css-property.
  207. * // the animation will last 400ms
  208. * $("table").animate("$width:'500'"), 400);
  209. * </pre>
  210. *
  211. * In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'.
  212. * These shortcuts allow for custom hiding and showing animations that take into account the
  213. * display type of the element. Animated properties can also be relative. If a value is supplied
  214. * with a leading += or -= sequence of characters, then the target value is computed by adding or
  215. * subtracting the given number from the current value of the property.
  216. *
  217. * Example:
  218. *
  219. * <pre class="code">
  220. * // move the element from its original position to 500px to the left for 1000ms and
  221. * // change the background color of the element at the end of the animation
  222. * $("#foo").animate("left:'+=500'", 1000, new Function(){
  223. * public void f(Element e){
  224. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED);
  225. * }
  226. * });
  227. * </pre>
  228. *
  229. * For color css properties, values can be specified via hexadecimal or rgb or literal values.
  230. *
  231. * Example:
  232. *
  233. * <pre class="code">
  234. * $("#foo").animate("backgroundColor:'red', color:'#ffffff', borderColor:'rgb(129, 0, 70)', 1000");
  235. * </pre>
  236. *
  237. * @param stringOrProperties the set of properties to animate : "cssName:'value'"
  238. * @param funcs an array of {@link Function} called once the animation is complete.
  239. */
  240. LazyGQuery<T> animate(Object stringOrProperties, int duration, Function... funcs);
  241. /**
  242. * Append content to the inside of every matched element. This operation is similar to doing an
  243. * appendChild to all the specified elements, adding them into the document.
  244. */
  245. LazyGQuery<T> append(GQuery query);
  246. /**
  247. * Append content to the inside of every matched element. This operation is similar to doing an
  248. * appendChild to all the specified elements, adding them into the document.
  249. */
  250. LazyGQuery<T> append(Node n);
  251. /**
  252. * Append content to the inside of every matched element. This operation is similar to doing an
  253. * appendChild to all the specified elements, adding them into the document.
  254. */
  255. LazyGQuery<T> append(String html);
  256. /**
  257. * Append content to the inside of every matched element. This operation is similar to doing an
  258. * appendChild to all the specified elements, adding them into the document.
  259. */
  260. LazyGQuery<T> append(SafeHtml safeHtml);
  261. /**
  262. * All of the matched set of elements will be inserted at the end of the element(s) specified by
  263. * the parameter other.
  264. *
  265. * The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B),
  266. * instead of appending B to A, you're appending A to B.
  267. */
  268. LazyGQuery<T> appendTo(GQuery other);
  269. /**
  270. * All of the matched set of elements will be inserted at the end of the element(s) specified by
  271. * the parameter other.
  272. *
  273. * The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B),
  274. * instead of appending B to A, you're appending A to B.
  275. */
  276. LazyGQuery<T> appendTo(Node n);
  277. /**
  278. * All of the matched set of elements will be inserted at the end of the element(s) specified by
  279. * the parameter other.
  280. *
  281. * The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B),
  282. * instead of appending B to A, you're appending A to B.
  283. */
  284. LazyGQuery<T> appendTo(String html);
  285. /**
  286. * All of the matched set of elements will be inserted at the end of the element(s) specified by
  287. * the parameter other.
  288. *
  289. * The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B),
  290. * instead of appending B to A, you're appending A to B.
  291. */
  292. LazyGQuery<T> appendTo(SafeHtml safeHtml);
  293. /**
  294. * Convert to Plugin interface provided by Class literal.
  295. */
  296. <T extends GQuery> T as(Class<T> plugin);
  297. /**
  298. * Set a key/value object as properties to all matched elements.
  299. *
  300. * Example: $("img").attr(new Properties("src: 'test.jpg', alt: 'Test Image'"))
  301. */
  302. LazyGQuery<T> attr(Properties properties);
  303. /**
  304. * Access a property on the first matched element. This method makes it easy to retrieve a
  305. * property value from the first matched element. If the element does not have an attribute with
  306. * such a name, empty string is returned. Attributes include title, alt, src, href, width, style,
  307. * etc.
  308. */
  309. String attr(String name);
  310. /**
  311. * Set a single property to a computed value, on all matched elements.
  312. */
  313. LazyGQuery<T> attr(String key, Function closure);
  314. /**
  315. * Set a single property to a value, on all matched elements.
  316. */
  317. LazyGQuery<T> attr(String key, Object value);
  318. /**
  319. * Insert content before each of the matched elements. The elements must already be inserted into
  320. * the document (you can't insert an element before another if it's not in the page).
  321. */
  322. LazyGQuery<T> before(GQuery query);
  323. /**
  324. * Insert content before each of the matched elements. The elements must already be inserted into
  325. * the document (you can't insert an element before another if it's not in the page).
  326. */
  327. LazyGQuery<T> before(Node n);
  328. /**
  329. * Insert content before each of the matched elements. The elements must already be inserted into
  330. * the document (you can't insert an element before another if it's not in the page).
  331. */
  332. LazyGQuery<T> before(String html);
  333. /**
  334. * Binds a set of handlers to a particular Event for each matched element.
  335. *
  336. * The event handlers are passed as Functions that you can use to prevent default behavior. To
  337. * stop both default action and event bubbling, the function event handler has to return false.
  338. *
  339. * You can pass an additional Object data to your Function as the second parameter
  340. *
  341. */
  342. LazyGQuery<T> bind(int eventbits, Object data, Function... funcs);
  343. /**
  344. * Binds a set of handlers to a particular Event for each matched element.
  345. *
  346. * The event handlers are passed as Functions that you can use to prevent default behavior. To
  347. * stop both default action and event bubbling, the function event handler has to return false.
  348. *
  349. */
  350. LazyGQuery<T> bind(int eventbits, Function... funcs);
  351. /**
  352. * Binds a set of handlers to a particular Event for each matched element.
  353. *
  354. * The event handlers are passed as Functions that you can use to prevent default behavior. To
  355. * stop both default action and event bubbling, the function event handler has to return false.
  356. *
  357. * You can pass an additional Object data to your Function as the second parameter
  358. *
  359. */
  360. LazyGQuery<T> bind(String eventType, Object data, Function... funcs);
  361. /**
  362. * Binds a set of handlers to a particular Event for each matched element.
  363. *
  364. * The event handlers are passed as Functions that you can use to prevent default behavior. To
  365. * stop both default action and event bubbling, the function event handler has to return false.
  366. *
  367. */
  368. LazyGQuery<T> bind(String eventType, Function... funcs);
  369. /**
  370. * Bind a set of functions to the blur event of each matched element. Or trigger the blur event if
  371. * no functions are provided.
  372. */
  373. LazyGQuery<T> blur(Function... f);
  374. /**
  375. * Bind a set of functions to the change event of each matched element. Or trigger the event if no
  376. * functions are provided.
  377. */
  378. LazyGQuery<T> change(Function... f);
  379. /**
  380. * Get a set of elements containing all of the unique immediate children of each of the matched
  381. * set of elements. Also note: while parents() will look at all ancestors, children() will only
  382. * consider immediate child elements.
  383. */
  384. LazyGQuery<T> children();
  385. /**
  386. * Get a set of elements containing all of the unique children of each of the matched set of
  387. * elements. This set is filtered with the expressions that will cause only elements matching any
  388. * of the selectors to be collected.
  389. */
  390. LazyGQuery<T> children(String... filters);
  391. /**
  392. * Remove from the Effects queue all {@link Function} that have not yet been run.
  393. */
  394. LazyGQuery<T> clearQueue();
  395. /**
  396. * Remove from the queue all {@link Function} that have not yet been run.
  397. */
  398. LazyGQuery<T> clearQueue(String queueName);
  399. /**
  400. * Bind a set of functions to the click event of each matched element. Or trigger the event if no
  401. * functions are provided.
  402. */
  403. LazyGQuery<T> click(Function... f);
  404. /**
  405. * Clone matched DOM Elements and select the clones. This is useful for moving copies of the
  406. * elements to another location in the DOM.
  407. */
  408. LazyGQuery<T> clone();
  409. /**
  410. * Get the first ancestor element that matches the selector (for each matched element), beginning
  411. * at the current element and progressing up through the DOM tree.
  412. *
  413. * @param selector
  414. * @return
  415. */
  416. LazyGQuery<T> closest(String selector);
  417. /**
  418. * Get the first ancestor element that matches the selector (for each matched element), beginning
  419. * at the current element and progressing up through the DOM tree until reach the
  420. * <code>context</code> node.
  421. *
  422. * If no context is passed in then the context of the gQuery object will be used instead.
  423. *
  424. */
  425. LazyGQuery<T> closest(String selector, Node context);
  426. /**
  427. * Returns a {@link Map} object as key a selector and as value the list of ancestor elements
  428. * matching this selectors, beginning at the first matched element and progressing up through the
  429. * DOM. This method allows retrieving the list of ancestors matching many selectors by traversing
  430. * the DOM only one time.
  431. *
  432. * @return
  433. */
  434. JsNamedArray<NodeList<Element>> closest(String[] selectors);
  435. /**
  436. * Returns a {@link Map} object as key a selector and as value the list of ancestor elements
  437. * matching this selectors, beginning at the first matched element and progressing up through the
  438. * DOM until reach the <code>context</code> node.. This method allows retrieving the list of
  439. * ancestors matching many selectors by traversing the DOM only one time.
  440. *
  441. * @return
  442. */
  443. JsNamedArray<NodeList<Element>> closest(String[] selectors, Node context);
  444. /**
  445. * Filter the set of elements to those that contain the specified text.
  446. */
  447. LazyGQuery<T> contains(String text);
  448. /**
  449. * Find all the child nodes inside the matched elements (including text nodes), or the content
  450. * document, if the element is an iframe.
  451. */
  452. LazyGQuery<T> contents();
  453. /**
  454. * Set CSS a single style property on every matched element using type-safe enumerations.
  455. *
  456. * The best way to use this method (i.e. to generate a CssSetter) is to take the desired css
  457. * property defined in {@link CSS} class and call the {@link TakesCssValue#with(HasCssName)}
  458. * method on it.
  459. *
  460. * ex :
  461. *
  462. * <pre class="code">
  463. * $("#myDiv").css(CSS.TOP.with(Length.cm(15)));
  464. * $("#myDiv").css(CSS.BACKGROUND.with(RGBColor.SILVER, ImageValue.url(""),
  465. * BackgroundRepeat.NO_REPEAT, BackgroundAttachment.FIXED,
  466. * BackgroundPosition.CENTER));
  467. * $("#myDiv").css(CSS.BACKGROUND_ATTACHMENT.with(BackgroundAttachment.FIXED));
  468. *
  469. * </pre>
  470. *
  471. */
  472. LazyGQuery<T> css(CssSetter... cssSetter);
  473. /**
  474. * Return a style property on the first matched element using type-safe enumerations.
  475. *
  476. * Ex : $("#myId").css(CSS.BACKGROUND_COLOR);
  477. */
  478. String css(HasCssValue property);
  479. /**
  480. * Return a style property on the first matched element using type-safe enumerations.
  481. *
  482. * The parameter force has a special meaning here: - When force is false, returns the value of the
  483. * css property defined in the style attribute of the element. - Otherwise it returns the real
  484. * computed value.
  485. *
  486. * For instance if you define 'display=none' not in the element style but in the css stylesheet,
  487. * it returns an empty string unless you pass the parameter force=true.
  488. *
  489. * Ex : $("#myId").css(CSS.WIDTH, true);
  490. */
  491. String css(HasCssValue property, boolean force);
  492. /**
  493. * Set a key/value object as style properties to all matched elements. This serves as the best way
  494. * to set a large number of style properties on all matched elements. You can use either js maps
  495. * or pure css syntax.
  496. *
  497. * Example:
  498. *
  499. * <pre class="code">
  500. * $(".item").css(Properties.create("color: 'red', background:'blue'"))
  501. * $(".item").css(Properties.create("color: red; background: blue;"))
  502. * </pre>
  503. */
  504. LazyGQuery<T> css(Properties properties);
  505. /**
  506. * Return a style property on the first matched element.
  507. */
  508. String css(String name);
  509. /**
  510. * Return a style property on the first matched element.
  511. *
  512. * The parameter force has a special meaning here:
  513. * <ul>
  514. * <li>When force is false, returns the value of the css property defined in the style attribute
  515. * of the element.
  516. * <li>Otherwise it returns the real computed value.
  517. * </ul>
  518. *
  519. * For instance if you don't define 'display=none'in the element style but in the css stylesheet,
  520. * it returns an empty string unless you pass the parameter force=true.
  521. */
  522. String css(String name, boolean force);
  523. /**
  524. * Set a single style property to a value, on all matched elements.
  525. *
  526. */
  527. LazyGQuery<T> css(String prop, String val);
  528. /**
  529. * Set CSS a single style property on every matched element using type-safe enumerations. This
  530. * method allows you to set manually the value or set <i>inherit</i> value
  531. *
  532. * ex :
  533. *
  534. * <pre class="code">
  535. * $(#myId).css(CSS.TEXT_DECORATION, CSS.INHERIT);
  536. * </pre>
  537. */
  538. LazyGQuery<T> css(TakesCssValue<?> cssProperty, String value);
  539. /**
  540. * Returns the numeric value of a css property.
  541. */
  542. double cur(String prop);
  543. /**
  544. * Returns the numeric value of a css property.
  545. *
  546. * The parameter force has a special meaning: - When force is false, returns the value of the css
  547. * property defined in the set of style attributes. - When true returns the real computed value.
  548. */
  549. double cur(String prop, boolean force);
  550. /**
  551. * Return the value at the named data store for the first element in the set of matched
  552. * elements.
  553. */
  554. <T> T data(String name);
  555. /**
  556. * Return the value at the named data store for the first element in the set of matched
  557. * elements, as set by data(name, value), with desired return type.
  558. *
  559. * @param clz return type class literal
  560. */
  561. <T> T data(String name, Class<? extends T> clz);
  562. /**
  563. * Store arbitrary data associated with the matched elements in the named data store.
  564. */
  565. LazyGQuery<T> data(String name, Object value);
  566. /**
  567. * Bind a set of functions to the dblclick event of each matched element. Or trigger the event if
  568. * no functions are provided.
  569. */
  570. LazyGQuery<T> dblclick(Function... f);
  571. /**
  572. * Insert a delay (in ms) in the GQuery queue, and optionally execute one o more functions if
  573. * provided when the delay finishes. It uses the effects queue namespace, so you can stack any of
  574. * the methods in the effects plugin.
  575. *
  576. * Example:
  577. *
  578. * <pre class="code">
  579. * $("#foo").slideUp(300)
  580. * .delay(800)
  581. * .fadeIn(400);
  582. * </pre>
  583. *
  584. * When this statement is executed, the element slides up for 300 milliseconds and then pauses for
  585. * 800 milliseconds before fading in for 400 milliseconds. Aditionally after those 800
  586. * milliseconds the element color is set to red.
  587. *
  588. * NOTE that this methods affects only methods which uses the queue like effects. So the following
  589. * example is wrong:
  590. *
  591. * <pre>
  592. * $("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800).css(CSS.COLOR.with(RGBColor.BLACK));
  593. * </pre>
  594. *
  595. * The code above will not insert a delay of 800 ms between the css() calls ! For this kind of
  596. * behavior, you should execute these methods puting them in inline functions passed as argument
  597. * to the delay() method, or adding them to the queue.
  598. *
  599. * <pre>
  600. * $("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800, lazy().css(CSS.COLOR.with(RGBColor.BLACK)).done());
  601. * $("#foo").css(CSS.COLOR.with(RGBColor.RED)).delay(800).queue(lazy().css(CSS.COLOR.with(RGBColor.BLACK)).dequeue().done());
  602. * </pre>
  603. */
  604. LazyGQuery<T> delay(int milliseconds, Function... f);
  605. /**
  606. * Insert a delay (in ms) in the queue identified by the <code>queueName</code> parameter, and
  607. * optionally execute one o more functions if provided when the delay finishes.
  608. *
  609. * If <code>queueName</code> is null or equats to 'fx', the delay will be inserted to the Effects
  610. * queue.
  611. *
  612. * Example :
  613. *
  614. * <pre class="code">
  615. * $("#foo").queue("colorQueue", lazy().css(CSS.COLOR.with(RGBColor.RED)).dequeue("colorQueue").done())
  616. * .delay(800, "colorQueue")
  617. * .queue("colorQueue", lazy().css(CSS.COLOR.with(RGBColor.BLACK)).dequeue("colorQueue").done());
  618. * </pre>
  619. *
  620. * When this statement is executed, the text color of the element changes to red and then wait for
  621. * 800 milliseconds before changes the text color to black.
  622. *
  623. */
  624. LazyGQuery<T> delay(int milliseconds, String queueName, Function... f);
  625. /**
  626. * Attach <code>handlers</code> to one or more events for all elements that match the
  627. * <code>selector</code>, now or in the future, based on a specific set of root elements.
  628. *
  629. * Example:
  630. *
  631. * <pre>
  632. * $("table").delegate("td", Event.ONCLICK, new Function(){
  633. * public void f(Element e){
  634. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  635. * }
  636. * });
  637. * </pre>
  638. *
  639. * This code above add an handler on click event on all cell (the existing oneand the future cell)
  640. * of all table. This code is equivalent to :
  641. *
  642. * <pre>
  643. * $("table").each(new Function(){
  644. * public void f(Element table){
  645. * $("td", table).live(Event.ONCLICK, new Function(){
  646. * public void f(Element e){
  647. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  648. * }
  649. * }
  650. * });
  651. *
  652. * </pre>
  653. *
  654. * You can attach the handlers to many events by using the '|' operator ex:
  655. *
  656. * <pre>
  657. * $("div.main").delegate(".subMain", Event.ONCLICK | Event.ONDBLCLICK, new Function(){...});
  658. * </pre>
  659. * @deprecated use {@link #on(String, String, Function...)}
  660. */
  661. LazyGQuery<T> delegate(String selector, int eventbits, Function... handlers);
  662. /**
  663. * Attach <code>handlers</code> to one or more events for all elements that match the
  664. * <code>selector</code>, now or in the future, based on a specific set of root elements. The
  665. * <code>data</code> parameter allows us to pass data to the handler.
  666. *
  667. * Example:
  668. *
  669. * <pre>
  670. * $("table").delegate("td", "click", new Function(){
  671. * public void f(Element e){
  672. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  673. * }
  674. * });
  675. * </pre>
  676. *
  677. * This code above add an handler on click event on all cell (the existing oneand the future cell)
  678. * of all table. This code is equivalent to :
  679. *
  680. * <pre>
  681. * $("table").each(new Function(){
  682. * public void f(Element table){
  683. * $("td", table).live("click", new Function(){
  684. * public void f(Element e){
  685. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  686. * }
  687. * }
  688. * });
  689. *
  690. * </pre>
  691. *
  692. * You can pass attach the handlers to many events by using the '|' operator ex:
  693. *
  694. * <pre>
  695. * $("div.main").delegate(".subMain", Event.ONCLICK | Event.ONDBLCLICK, new Function(){...});
  696. * </pre>
  697. * @deprecated use {@link #on(String, String, Object, Function...)}
  698. */
  699. LazyGQuery<T> delegate(String selector, int eventbits, Object data, Function... handlers);
  700. /**
  701. * Attach <code>handlers</code> to one or more events for all elements that match the
  702. * <code>selector</code>, now or in the future, based on a specific set of root elements.
  703. *
  704. * Example:
  705. *
  706. * <pre>
  707. * $("table").delegate("td", "click", new Function(){
  708. * public void f(Element e){
  709. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  710. * }
  711. * });
  712. * </pre>
  713. *
  714. * This code above add an handler on click event on all cell (the existing oneand the future cell)
  715. * of all table. This code is equivalent to :
  716. *
  717. * <pre>
  718. * $("table").each(new Function(){
  719. * public void f(Element table){
  720. * $("td", table).live("click", new Function(){
  721. * public void f(Element e){
  722. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  723. * }
  724. * }
  725. * });
  726. *
  727. * </pre>
  728. *
  729. * You can pass attach the handlers to many events by specifying a String with espaced event type.
  730. * ex:
  731. *
  732. * <pre>
  733. * $("div.main").delegate(".subMain", "click dblclick", new Function(){...});
  734. * </pre>
  735. *
  736. * </pre>
  737. * @deprecated use {@link #on(String, String, Function...)}
  738. */
  739. LazyGQuery<T> delegate(String selector, String eventType, Function... handlers);
  740. /**
  741. * Attach <code>handlers</code> to one or more events for all elements that match the
  742. * <code>selector</code>, now or in the future, based on a specific set of root elements.
  743. *
  744. * Example:
  745. *
  746. * <pre>
  747. * $("table").delegate("td", "click", new Function(){
  748. * public void f(Element e){
  749. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  750. * }
  751. * });
  752. * </pre>
  753. *
  754. * This code above add an handler on click event on all cell (the existing oneand the future cell)
  755. * of all table. This code is equivalent to :
  756. *
  757. * <pre>
  758. * $("table").each(new Function(){
  759. * public void f(Element table){
  760. * $("td", table).live("click", new Function(){
  761. * public void f(Element e){
  762. * $(e).css(CSS.BACKGROUND_COLOR.with(RGBColor.RED));
  763. * }
  764. * }
  765. * });
  766. *
  767. * You can pass attach the handlers to many events by specifying a String with espaced event type.
  768. * ex:
  769. *
  770. * <pre>
  771. * $("div.main").delegate(".subMain", "click dblclick", new Function(){...});
  772. * </pre>
  773. *
  774. * </pre>
  775. * @deprecated use {@link #on(String, String, Object, Function...)}
  776. */
  777. LazyGQuery<T> delegate(String selector, String eventType, Object data, Function... handlers);
  778. /**
  779. * Execute the next function on the Effects queue for the matched elements. This method is usefull
  780. * to tell when a function you add in the Effects queue is ended and so the next function in the
  781. * queue can start.
  782. *
  783. * Note: you should be sure to call dequeue() in all functions of a queue chain, otherwise the
  784. * queue execution will be stopped.
  785. */
  786. LazyGQuery<T> dequeue();
  787. /**
  788. * Execute the next function on the queue named as queueName for the matched elements. This method
  789. * is usefull to tell when a function you add in the Effects queue is ended and so the next
  790. * function in the queue can start.
  791. */
  792. LazyGQuery<T> dequeue(String queueName);
  793. /**
  794. * Detach all matched elements from the DOM. This method is the same than {@link #remove()} method
  795. * except all data and event handlers are not remove from the element. This method is useful when
  796. * removed elements are to be reinserted into the DOM at a later time.
  797. */
  798. LazyGQuery<T> detach();
  799. /**
  800. * Detach from the DOM all matched elements filtered by the <code>filter</code>.. This method is
  801. * the same than {@link #remove(String)} method except all data and event handlers are not remove
  802. * from the element. This method is useful when removed elements are to be reinserted into the DOM
  803. * at a later time.
  804. */
  805. LazyGQuery<T> detach(String filter);
  806. /**
  807. * Remove all event handlers previously attached using {@link #live(String, Function)}. In order
  808. * for this method to function correctly, the selector used with it must match exactly the
  809. * selector initially used with {@link #live(String, Function)}.
  810. *
  811. * @deprecated use {@link #off(String, String)} instead
  812. */
  813. LazyGQuery<T> die();
  814. /**
  815. * Remove an event handlers previously attached using {@link #live(int, Function)} In order for
  816. * this method to function correctly, the selector used with it must match exactly the selector
  817. * initially used with {@link #live(int, Function)}.
  818. * @deprecated use {@link #off(String)}
  819. */
  820. LazyGQuery<T> die(int eventbits);
  821. /**
  822. * Remove an event handlers previously attached using {@link #live(String, Function)} In order for
  823. * this method to function correctly, the selector used with it must match exactly the selector
  824. * initially used with {@link #live(String, Function)}.
  825. */
  826. LazyGQuery<T> die(String eventName);
  827. /**
  828. * Run one or more Functions over each element of the GQuery. You have to override one of these
  829. * funcions: public void f(Element e) public String f(Element e, int i)
  830. */
  831. LazyGQuery<T> each(Function... f);
  832. /**
  833. * Returns the working set of nodes as a Java array. <b>Do NOT</b> attempt to modify this array,
  834. * e.g. assign to its elements, or call Arrays.sort()
  835. */
  836. Element[] elements();
  837. /**
  838. * Remove all child nodes from the set of matched elements. In the case of a document element, it
  839. * removes all the content You should call this method whenever you create a new iframe and you
  840. * want to add dynamic content to it.
  841. */
  842. LazyGQuery<T> empty();
  843. /**
  844. * Revert the most recent 'destructive' operation, changing the set of matched elements to its
  845. * previous state (right before the destructive operation).
  846. */
  847. LazyGQuery<T> end();
  848. /**
  849. * Reduce GQuery to element in the specified position. This method accept negative index. A
  850. * negative index is counted from the end of the matched set:
  851. *
  852. * Example:
  853. *
  854. * <pre>
  855. * $("div").eq(0) will reduce the matched set to the first matched div
  856. * $("div").eq(1) will reduce the matched set to the second matched div
  857. *
  858. * $("div").eq(-1) will reduce the matched set to the last matched div
  859. * $("div").eq(-2) will reduce the matched set to the second-to-last matched div
  860. * ...
  861. * </pre>
  862. */
  863. LazyGQuery<T> eq(int pos);
  864. /**
  865. * Bind a set of functions to the error event of each matched element. Or trigger the event if no
  866. * functions are provided.
  867. */
  868. LazyGQuery<T> error(Function... f);
  869. /**
  870. * Fade in all matched elements by adjusting their opacity. The effect will take 1000 milliseconds
  871. * to complete
  872. */
  873. LazyGQuery<T> fadeIn(Function... f);
  874. /**
  875. * Fade in all matched elements by adjusting their opacity.
  876. */
  877. LazyGQuery<T> fadeIn(int millisecs, Function... f);
  878. /**
  879. * Fade the opacity of all matched elements to a specified opacity and firing
  880. * an optional callback after completion. Only the opacity is adjusted for
  881. * this animation, meaning that all of the matched elements should already
  882. * have some form of height and width associated with them.
  883. */
  884. LazyGQuery<T> fadeTo(int millisecs, double opacity, Function... f);
  885. /**
  886. * Fade the opacity of all matched elements to a specified opacity and firing
  887. * an optional callback after completion. Only the opacity is adjusted for
  888. * this animation, meaning that all of the matched elements should already
  889. * have some form of height and width associated with them.
  890. */
  891. LazyGQuery<T> fadeTo(double opacity, Function... f);
  892. /**
  893. * Fade out all matched elements by adjusting their opacity. The effect will take 1000
  894. * milliseconds to complete
  895. */
  896. LazyGQuery<T> fadeOut(Function... f);
  897. /**
  898. * Fade out all matched elements by adjusting their opacity.
  899. */
  900. LazyGQuery<T> fadeOut(int millisecs, Function... f);
  901. /**
  902. * Toggle the visibility of all matched elements by adjusting their opacity and firing an optional
  903. * callback after completion. Only the opacity is adjusted for this animation, meaning that all of
  904. * the matched elements should already have some form of height and width associated with them.
  905. */
  906. Effects fadeToggle(int millisecs, Function... f);
  907. /**
  908. * Removes all elements from the set of matched elements that do not match the specified function.
  909. * The function is called with a context equal to the current element. If the function returns
  910. * false, then the element is removed - anything else and the element is kept.
  911. */
  912. LazyGQuery<T> filter(Predicate filterFn);
  913. /**
  914. * Removes all elements from the set of matched elements that do not pass the specified css
  915. * expression. This method is used to narrow down the results of a search.
  916. * By default it works for either detached and attached elements unless
  917. * {@link SelectorEngine#filterDetached} is set to false.
  918. */
  919. LazyGQuery<T> filter(String... filters);
  920. /**
  921. * Removes all elements from the set of matched elements that do not pass the specified css
  922. * expression. This method is used to narrow down the results of a search.
  923. * Setting filterDetached parameter to true, means that we should consider detached elements
  924. * as well which implies some performance penalty.
  925. */
  926. LazyGQuery<T> filter(boolean filterDetached, String... filters);
  927. /**
  928. * Removes all elements from the set of matched elements that do not pass the specified css
  929. * expression. This method is used to narrow down the results of a search.
  930. * Setting considerDetached parameter to true, means that we should consider detached elements
  931. * as well which implies some performance penalties.
  932. */
  933. LazyGQuery<T> filter(boolean filterDetached, String selector);
  934. /**
  935. * Searches for all elements that match the specified css expression. This method is a good way to
  936. * find additional descendant elements with which to process.
  937. *
  938. * Provide a comma-separated list of expressions to apply multiple filters at once.
  939. */
  940. LazyGQuery<T> find(String... filters);
  941. /**
  942. * Reduce the set of matched elements to the first in the set.
  943. */
  944. LazyGQuery<T> first();
  945. /**
  946. * Bind a set of functions to the focus event of each matched element. Or trigger the event and
  947. * move the input focus to the first element if no functions are provided.
  948. */
  949. LazyGQuery<T> focus(Function... f);
  950. /**
  951. * Return all elements matched in the GQuery as a NodeList. @see #elements() for a method which
  952. * returns them as an immutable Java array.
  953. */
  954. NodeList<Element> get();
  955. /**
  956. * Return the ith element matched. This method accept negative index. A negative index is counted
  957. * from the end of the matched set.
  958. *
  959. * Example:
  960. *
  961. * <pre>
  962. * $("div").get(0) will return the first matched div
  963. * $("div").get(1) will return the second matched div
  964. *
  965. * $("div").get(-1) will return the last matched div
  966. * $("div").get(-2) will return the secont-to-last matched div
  967. * ...
  968. * </pre>
  969. */
  970. Element get(int i);
  971. Node getContext();
  972. /**
  973. * Return the previous set of matched elements prior to the last destructive operation (e.g.
  974. * query)
  975. */
  976. LazyGQuery<T> getPreviousObject();
  977. /**
  978. * Return the selector representing the current set of matched elements.
  979. */
  980. String getSelector();
  981. /**
  982. * Returns true any of the specified classes are present on any of the matched Reduce the set of
  983. * matched elements to all elements after a given position. The position of the element in the set
  984. * of matched elements starts at 0 and goes to length - 1.
  985. */
  986. LazyGQuery<T> gt(int pos);
  987. /**
  988. * Reduce the set of matched elements to those that have a descendant that matches the Element.
  989. */
  990. LazyGQuery<T> has(Element elem);
  991. /**
  992. * Reduce the set of matched elements to those that have a descendant that matches the selector.
  993. */
  994. LazyGQuery<T> has(String selector);
  995. /**
  996. * Returns true any of the specified classes are present on any of the matched elements.
  997. */
  998. boolean hasClass(String... classes);
  999. /**
  1000. * Get the current computed, pixel, height of the first matched element. It does not include
  1001. * margin, padding nor border.
  1002. */
  1003. int height();
  1004. /**
  1005. * Set the height of every element in the matched set.
  1006. */
  1007. LazyGQuery<T> height(int height);
  1008. /**
  1009. * Set the height style property of every matched element. It's useful for using 'percent' or 'em'
  1010. * units Example: $(".a").height("100%")
  1011. */
  1012. LazyGQuery<T> height(String height);
  1013. /**
  1014. * Make invisible all matched elements.
  1015. */
  1016. LazyGQuery<T> hide();
  1017. /**
  1018. * Bind a function to the mouseover event of each matched element. A method for simulating
  1019. * hovering (moving the mouse on, and off, an object). This is a custom method which provides an
  1020. * 'in' to a frequent task. Whenever the mouse cursor is moved over a matched element, the first
  1021. * specified function is fired. Whenever the mouse moves off of the element, the second specified
  1022. * function fires.
  1023. *
  1024. * Since GQuery 1.4.0, this method binds handlers for both mouseenter and mouseleave events.
  1025. */
  1026. LazyGQuery<T> hover(Function fover, Function fout);
  1027. /**
  1028. * Get the innerHTML of the first matched element.
  1029. */
  1030. String html();
  1031. /**
  1032. * Set the innerHTML of every matched element.
  1033. */
  1034. LazyGQuery<T> html(String html);
  1035. /**
  1036. * Set the innerHTML of every matched element.
  1037. */
  1038. LazyGQuery<T> html(SafeHtml safeHtml);
  1039. /**
  1040. * Get the id of the first matched element.
  1041. */
  1042. String id();
  1043. /**
  1044. * Set the id of the first matched element.
  1045. */
  1046. LazyGQuery<T> id(String id);
  1047. /**
  1048. * Find the index of the specified Element.
  1049. */
  1050. int index(Element element);
  1051. /**
  1052. * Return the position of the first matched element in relation with its sibblings.
  1053. */
  1054. int index();
  1055. /**
  1056. * Returns the inner height of the first matched element, including padding but not the vertical
  1057. * scrollbar height, border, or margin.
  1058. */
  1059. int innerHeight();
  1060. /**
  1061. * Returns the inner width of the first matched element, including padding but not the vertical
  1062. * scrollbar width, border, or margin.
  1063. */
  1064. int innerWidth();
  1065. /**
  1066. * Insert all of the matched elements after another, specified, set of elements.
  1067. */
  1068. LazyGQuery<T> insertAfter(Element elem);
  1069. /**
  1070. * Insert all of the matched elements after another, specified, set of elements.
  1071. */
  1072. LazyGQuery<T> insertAfter(GQuery query);
  1073. /**
  1074. * Insert all of the matched elements after another, specified, set of elements.
  1075. */
  1076. LazyGQuery<T> insertAfter(String selector);
  1077. /**
  1078. * Insert all of the matched elements before another, specified, set of elements.
  1079. *
  1080. * The elements must already be inserted into the document (you can't insert an element after
  1081. * another if it's not in the page).
  1082. */
  1083. LazyGQuery<T> insertBefore(Element item);
  1084. /**
  1085. * Insert all of the matched elements before another, specified, set of elements.
  1086. *
  1087. * The elements must already be inserted into the document (you can't insert an element after
  1088. * another if it's not in the page).
  1089. */
  1090. LazyGQuery<T> insertBefore(GQuery query);
  1091. /**
  1092. * Insert all of the matched elements before another, specified, set of elements.
  1093. *
  1094. * The elements must already be inserted into the document (you can't insert an element after
  1095. * another if it's not in the page).
  1096. */
  1097. LazyGQuery<T> insertBefore(String selector);
  1098. /**
  1099. * Checks the current selection against an expression and returns true, if at least one element of
  1100. * the selection fits the given expression. Does return false, if no element fits or the
  1101. * expression is not valid.
  1102. */
  1103. boolean is(String... filters);
  1104. /**
  1105. * Returns true if the number of matched elements is 0.
  1106. */
  1107. boolean isEmpty();
  1108. /**
  1109. * Return true if the first element is visible.isVisible.
  1110. */
  1111. boolean isVisible();
  1112. /**
  1113. * Bind a set of functions to the keydown event of each matched element. Or trigger the event if
  1114. * no functions are provided.
  1115. */
  1116. LazyGQuery<T> keydown(Function... f);
  1117. /**
  1118. * Trigger a keydown event passing the key pushed.
  1119. */
  1120. LazyGQuery<T> keydown(int key);
  1121. /**
  1122. * Bind a set of functions to the keypress event of each matched element. Or trigger the event if
  1123. * no functions are provided.
  1124. */
  1125. LazyGQuery<T> keypress(Function... f);
  1126. /**
  1127. * Trigger a keypress event passing the key pushed.
  1128. */
  1129. LazyGQuery<T> keypress(int key);
  1130. /**
  1131. * Bind a set of functions to the keyup event of each matched element. Or trigger the event if no
  1132. * functions are provided.
  1133. */
  1134. LazyGQuery<T> keyup(Function... f);
  1135. /**
  1136. * Trigger a keyup event passing the key pushed.
  1137. */
  1138. LazyGQuery<T> keyup(int key);
  1139. /**
  1140. * Reduce the set of matched elements to the final one in the set.
  1141. */
  1142. LazyGQuery<T> last();
  1143. /**
  1144. * Returns the computed left position of the first element matched.
  1145. */
  1146. int left();
  1147. /**
  1148. * Returns the number of elements currently matched. The size function will return the same value.
  1149. */
  1150. int length();
  1151. /**
  1152. * Attach a handler for this event to all elements which match the current selector, now and in
  1153. * the future.
  1154. * @deprecated use {@link #on(String, Function...)}
  1155. */
  1156. LazyGQuery<T> live(int eventbits, Function... funcs);
  1157. /**
  1158. * Attach a handler for this event to all elements which match the current selector, now and in
  1159. * the future.
  1160. * @deprecated use {@link #on(String, Object, Function...)}
  1161. */
  1162. LazyGQuery<T> live(int eventbits, Object data, Function... funcs);
  1163. /**
  1164. * <p>
  1165. * Attach a handler for this event to all elements which match the current selector, now and in
  1166. * the future.
  1167. * <p>
  1168. * Ex :
  1169. *
  1170. * <pre>
  1171. * $(".clickable").live("click", new Function(){
  1172. * public void f(Element e){
  1173. * $(e).css(CSS.COLOR.with(RGBColor.RED));
  1174. * }
  1175. * });
  1176. * </pre>
  1177. *
  1178. * With this code, all elements with class "clickable" present in the DOM or added to the DOM in
  1179. * the future will be clickable. The text color will be changed to red when they will be clicked.
  1180. * So if after in the code, you add another element :
  1181. *
  1182. * <pre>
  1183. * $("body").append("<div class='clickable'>Click me and I will be red</div>");
  1184. * </pre>
  1185. *
  1186. * The click on this new element will also trigger the handler.
  1187. * </p>
  1188. * <p>
  1189. * In the same way, if you add "clickable" class on some existing element, these elements will be
  1190. * clickable also.
  1191. * </p>
  1192. * <p>
  1193. * <h3>important remarks</h3>
  1194. * <ul>
  1195. * <li>
  1196. * The live method should be always called after a selector</li>
  1197. * <li>
  1198. * Live events are bound to the context of the {@link GQuery} object :
  1199. *
  1200. * <pre>
  1201. * $(".clickable", myElement).live("click", new Function(){
  1202. * public void f(Element e){
  1203. * $(e).css(CSS.COLOR.with(RGBColor.RED));
  1204. * }
  1205. * });
  1206. * </pre>
  1207. * The {@link Function} will be called only on elements having the class "clickable" and being
  1208. * descendant of myElement.</li>
  1209. * </ul>
  1210. * </p>
  1211. * @deprecated use {@link #on(String, Function...)}
  1212. */
  1213. LazyGQuery<T> live(String eventName, Function... funcs);
  1214. /**
  1215. * <p>
  1216. * Attach a handler for this event to all elements which match the current selector, now and in
  1217. * the future. The <code>data</code> parameter allows us to pass data to the handler.
  1218. * <p>
  1219. * Ex :
  1220. *
  1221. * <pre>
  1222. * $(".clickable").live("click", new Function(){
  1223. * public void f(Element e){
  1224. * $(e).css(CSS.COLOR.with(RGBColor.RED));
  1225. * }
  1226. * });
  1227. * </pre>
  1228. *
  1229. * With this code, all elements with class "clickable" present in the DOM or added to the DOM in
  1230. * the future will be clickable. The text color will be changed to red when they will be clicked.
  1231. * So if after in the code, you add another element :
  1232. *
  1233. * <pre>
  1234. * $("body").append("<div class='clickable'>Click me and I will be red</div>");
  1235. * </pre>
  1236. *
  1237. * The click on this new element will also trigger the handler.
  1238. * </p>
  1239. * <p>
  1240. * In the same way, if you add "clickable" class on some existing element, these elements will be
  1241. * clickable also.
  1242. * </p>
  1243. * <p>
  1244. * <h3>important remarks</h3>
  1245. * <ul>
  1246. * <li>
  1247. * The live method should be always called after a selector</li>
  1248. * <li>
  1249. * Live events are bound to the context of the {@link GQuery} object :
  1250. *
  1251. * <pre>
  1252. * $(".clickable", myElement).live("click", new Function(){
  1253. * public void f(Element e){
  1254. * $(e).css(CSS.COLOR.with(RGBColor.RED));
  1255. * }
  1256. * });
  1257. * </pre>
  1258. * The {@link Function} will be called only on elements having the class "clickable" and being
  1259. * descendant of myElement.</li>
  1260. * </ul>
  1261. * </p>
  1262. * @deprecated use {@link #on(String, Object, Function...)}
  1263. */
  1264. LazyGQuery<T> live(String eventName, Object data, Function... funcs);
  1265. /**
  1266. * Load data from the server and place the returned HTML into the matched element.
  1267. *
  1268. * The url allows us to specify a portion of the remote document to be inserted. This is achieved
  1269. * with a special syntax for the url parameter. If one or more space characters are included in
  1270. * the string, the portion of the string following the first space is assumed to be a GQuery
  1271. * selector that determines the content to be loaded.
  1272. *
  1273. */
  1274. LazyGQuery<T> load(String url);
  1275. /**
  1276. * Load data from the server and place the returned HTML into the matched element.
  1277. *
  1278. * The url allows us to specify a portion of the remote document to be inserted. This is achieved
  1279. * with a special syntax for the url parameter. If one or more space characters are included in
  1280. * the string, the portion of the string following the first space is assumed to be a GQuery
  1281. * selector that determines the content to be loaded.
  1282. *
  1283. */
  1284. LazyGQuery<T> load(String url, IsProperties data, Function onSuccess);
  1285. /**
  1286. * Reduce the set of matched elements to all elements before a given position. The position of the
  1287. * element in the set of matched elements starts at 0 and goes to length - 1.
  1288. */
  1289. LazyGQuery<T> lt(int pos);
  1290. /**
  1291. * Pass each element in the current matched set through a function, producing a new array
  1292. * containing the return values. When the call to the function returns a null it is not added to
  1293. * the array.
  1294. */
  1295. <W> List<W> map(Function f);
  1296. /**
  1297. * Bind a set of functions to the mousedown event of each matched element. Or trigger the event if
  1298. * no functions are provided.
  1299. */
  1300. LazyGQuery<T> mousedown(Function... f);
  1301. /**
  1302. * Bind an event handler to be fired when the mouse enter an element, or trigger that handler on
  1303. * an element if no functions are provided.
  1304. *
  1305. * The mouseenter event differs from mouseover in the way it handles event bubbling. When
  1306. * mouseover is used on an element having inner element(s), then when the mouse pointer moves hover
  1307. * of the Inner element, the handler would be triggered. This is usually undesirable behavior. The
  1308. * mouseenter event, on the other hand, only triggers its handler when the mouse enters the
  1309. * element it is bound to, not a descendant.
  1310. */
  1311. LazyGQuery<T> mouseenter(Function... f);
  1312. /**
  1313. * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on
  1314. * an element if no functions are provided.
  1315. *
  1316. * The mouseleave event differs from mouseout in the way it handles event bubbling. When
  1317. * mouseout is used on an element having inner element(s), then when the mouse pointer moves out
  1318. * of the Inner element, the handler would be triggered. This is usually undesirable behavior. The
  1319. * mouseleave event, on the other hand, only triggers its handler when the mouse leaves the
  1320. * element it is bound to, not a descendant.
  1321. */
  1322. LazyGQuery<T> mouseleave(Function... f);
  1323. /**
  1324. * Bind a set of functions to the mousemove event of each matched element. Or trigger the event if
  1325. * no functions are provided.
  1326. */
  1327. LazyGQuery<T> mousemove(Function... f);
  1328. /**
  1329. * Bind a set of functions to the mouseout event of each matched element. Or trigger the event if
  1330. * no functions are provided.
  1331. */
  1332. LazyGQuery<T> mouseout(Function... f);
  1333. /**
  1334. * Bind a set of functions to the mouseover event of each matched element. Or trigger the event if
  1335. * no functions are provided.
  1336. */
  1337. LazyGQuery<T> mouseover(Function... f);
  1338. /**
  1339. * Bind a set of functions to the mouseup event of each matched element. Or trigger the event if
  1340. * no functions are provided.
  1341. */
  1342. LazyGQuery<T> mouseup(Function... f);
  1343. /**
  1344. * Get a set of elements containing the unique next siblings of each of the given set of elements.
  1345. * next only returns the very next sibling for each element, not all next siblings see {#nextAll}.
  1346. */
  1347. LazyGQuery<T> next();
  1348. /**
  1349. * Get a set of elements containing the unique next siblings of each of the given set of elements
  1350. * filtered by 1 or more selectors. next only returns the very next sibling for each element, not
  1351. * all next siblings see {#nextAll}.
  1352. */
  1353. LazyGQuery<T> next(String... selectors);
  1354. /**
  1355. * Get all following siblings of each element in the set of matched elements.
  1356. */
  1357. LazyGQuery<T> nextAll();
  1358. /**
  1359. * Get all following siblings of each element in the set of matched elements, filtered by a
  1360. * selector.
  1361. */
  1362. LazyGQuery<T> nextAll(String filter);
  1363. /**
  1364. * Get all following siblings of each element up to but not including the element matched by the
  1365. * selector.
  1366. *
  1367. * @param selector
  1368. * @return
  1369. */
  1370. LazyGQuery<T> nextUntil(String selector);
  1371. /**
  1372. * Get all following siblings of each element up to but not including the element matched by the
  1373. * selector, filtered by a selector.
  1374. *
  1375. * @param selector
  1376. * @return
  1377. */
  1378. LazyGQuery<T> nextUntil(String selector, String filter);
  1379. /**
  1380. * Get all following siblings of each element up to but not including the element matched by the
  1381. * DOM node.
  1382. *
  1383. * @param selector
  1384. * @return
  1385. */
  1386. LazyGQuery<T> nextUntil(Element until);
  1387. /**
  1388. * Get all following siblings of each element up to but not including the element matched by the
  1389. * DOM node, filtered by a selector.
  1390. *
  1391. * @return
  1392. */
  1393. LazyGQuery<T> nextUntil(Element until, String filter);
  1394. /**
  1395. * Get all following siblings of each element up to but not including the element matched by the
  1396. * GQuery object.
  1397. *
  1398. * @return
  1399. */
  1400. LazyGQuery<T> nextUntil(GQuery until);
  1401. /**
  1402. * Get all following siblings of each element up to but not including the element matched by the
  1403. * GQuery object, filtered by a selector.
  1404. *
  1405. * @return
  1406. */
  1407. LazyGQuery<T> nextUntil(GQuery until, String filter);
  1408. /**
  1409. * Removes the specified Element from the set of matched elements. This method is used to remove a
  1410. * single Element from a jQuery object.
  1411. */
  1412. LazyGQuery<T> not(Element elem);
  1413. /**
  1414. * Removes any elements inside the passed set of elements from the set of matched elements.
  1415. */
  1416. LazyGQuery<T> not(GQuery gq);
  1417. /**
  1418. * Removes elements matching the specified expression from the set of matched elements.
  1419. */
  1420. LazyGQuery<T> not(String... filters);
  1421. /**
  1422. * Get the current offset of the first matched element, in pixels, relative to the document. The
  1423. * returned object contains two integer properties, top and left. The method works only with
  1424. * visible elements.
  1425. */
  1426. Offset offset();
  1427. /**
  1428. * Set the current coordinates of every element in the set of matched elements, relative to the document.
  1429. */
  1430. LazyGQuery<T> offset(Offset offset);
  1431. /**
  1432. * Set the current coordinates of every element in the set of matched elements, relative to the document.
  1433. */
  1434. LazyGQuery<T> offset(int top, int left);
  1435. /**
  1436. * Returns a GQuery collection with the positioned parent of the first matched element. This is
  1437. * the first parent of the element that has position (as in relative or absolute). This method
  1438. * only works with visible elements.
  1439. */
  1440. LazyGQuery<T> offsetParent();
  1441. /**
  1442. * Attach an event handler function for one or more events to the selected elements.
  1443. */
  1444. LazyGQuery<T> on(String eventName, Function... funcs);
  1445. /**
  1446. * Attach an event handler function for one or more events to the selected elements.
  1447. */
  1448. LazyGQuery<T> on(String eventName, Object data, Function... funcs);
  1449. /**
  1450. * Attach an event handler function for one or more events to the selected elements.
  1451. */
  1452. LazyGQuery<T> on(String eventName, String selector, Function... funcs);
  1453. /**
  1454. * Attach an event handler function for one or more events to the selected elements.
  1455. */
  1456. LazyGQuery<T> on(String eventName, String selector, Object data, Function... funcs);
  1457. /**
  1458. * Remove all event handlers.
  1459. */
  1460. LazyGQuery<T> off();
  1461. /**
  1462. * Remove an event handler.
  1463. */
  1464. LazyGQuery<T> off(String eventName);
  1465. /**
  1466. * Remove an event handler.
  1467. */
  1468. LazyGQuery<T> off(String eventName, Function f);
  1469. /**
  1470. * Remove an event handler.
  1471. */
  1472. LazyGQuery<T> off(String eventName, String selector);
  1473. /**
  1474. * Binds a handler to a particular Event (like Event.ONCLICK) for each matched element. The
  1475. * handler is executed only once for each element.
  1476. *
  1477. * The event handler is passed as a Function that you can use to prevent default behavior. To stop
  1478. * both default action and event bubbling, the function event handler has to return false.
  1479. *
  1480. * You can pass an additional Object data to your Function as the second parameter
  1481. */
  1482. LazyGQuery<T> one(int eventbits, Object data, Function f);
  1483. /**
  1484. * Get the current computed height for the first element in the set of matched elements, including
  1485. * padding, border, but not the margin.
  1486. */
  1487. int outerHeight();
  1488. /**
  1489. * Get the current computed height for the first element in the set of matched elements, including
  1490. * padding, border, and optionally margin.
  1491. */
  1492. int outerHeight(boolean includeMargin);
  1493. /**
  1494. * Get the current computed width for the first element in the set of matched elements, including
  1495. * padding, border, but not the margin.
  1496. */
  1497. int outerWidth();
  1498. /**
  1499. * Get the current computed width for the first element in the set of matched elements, including
  1500. * padding and border and optionally margin.
  1501. */
  1502. int outerWidth(boolean includeMargin);
  1503. /**
  1504. * Get a set of elements containing the unique parents of the matched set of elements.
  1505. */
  1506. LazyGQuery<T> parent();
  1507. /**
  1508. * Get a set of elements containing the unique parents of the matched set of elements. You may use
  1509. * an optional expressions to filter the set of parent elements that will match one of them.
  1510. */
  1511. LazyGQuery<T> parent(String... filters);
  1512. /**
  1513. * Get a set of elements containing the unique ancestors of the matched set of elements (except
  1514. * for the root element).
  1515. */
  1516. LazyGQuery<T> parents();
  1517. /**
  1518. * Get a set of elements containing the unique ancestors of the matched set of elements (except
  1519. * for the root element). The matched elements are filtered, returning those that match any of the
  1520. * filters.
  1521. */
  1522. LazyGQuery<T> parents(String... filters);
  1523. /**
  1524. * Get the ancestors of each element in the current set of matched elements, up to but not
  1525. * including the element matched by the selector.
  1526. */
  1527. LazyGQuery<T> parentsUntil(String selector);
  1528. /**
  1529. * Get the ancestors of each element in the current set of matched elements, up to but not
  1530. * including the node.
  1531. */
  1532. LazyGQuery<T> parentsUntil(Node node);
  1533. /**
  1534. * Gets the top and left position of an element relative to its offset parent. The returned object
  1535. * contains two Integer properties, top and left. For accurate calculations make sure to use pixel
  1536. * values for margins, borders and padding. This method only works with visible elements.
  1537. */
  1538. Offset position();
  1539. /**
  1540. * Prepend content to the inside of every matched element. This operation is the best way to
  1541. * insert elements inside, at the beginning, of all matched elements.
  1542. */
  1543. LazyGQuery<T> prepend(GQuery query);
  1544. /**
  1545. * Prepend content to the inside of every matched element. This operation is the best way to
  1546. * insert elements inside, at the beginning, of all matched elements.
  1547. */
  1548. LazyGQuery<T> prepend(Node n);
  1549. /**
  1550. * Prepend content to the inside of every matched element. This operation is the best way to
  1551. * insert elements inside, at the beginning, of all matched elements.
  1552. */
  1553. LazyGQuery<T> prepend(String html);
  1554. /**
  1555. * All of the matched set of elements will be inserted at the beginning of the element(s)
  1556. * specified by the parameter other.
  1557. *
  1558. * The operation $(A).prependTo(B) is, essentially, the reverse of doing a regular
  1559. * $(A).prepend(B), instead of prepending B to A, you're prepending A to B.
  1560. */
  1561. LazyGQuery<T> prependTo(GQuery other);
  1562. /**
  1563. * All of the matched set of elements will be inserted at the beginning of the element(s)
  1564. * specified by the parameter other.
  1565. *
  1566. * The operation $(A).prependTo(B) is, essentially, the reverse of doing a regular
  1567. * $(A).prepend(B), instead of prepending B to A, you're prepending A to B.
  1568. */
  1569. LazyGQuery<T> prependTo(Node n);
  1570. /**
  1571. * All of the matched set of elements will be inserted at the beginning of the element(s)
  1572. * specified by the parameter other.
  1573. *
  1574. * The operation $(A).prependTo(B) is, essentially, the reverse of doing a regular
  1575. * $(A).prepend(B), instead of prepending B to A, you're prepending A to B.
  1576. */
  1577. LazyGQuery<T> prependTo(String html);
  1578. /**
  1579. * Get a set of elements containing the unique previous siblings of each of the matched set of
  1580. * elements. Only the immediately previous sibling is returned, not all previous siblings.
  1581. */
  1582. LazyGQuery<T> prev();
  1583. /**
  1584. * Get a set of elements containing the unique previous siblings of each of the matched set of
  1585. * elements filtered by selector. Only the immediately previous sibling is returned, not all
  1586. * previous siblings.
  1587. */
  1588. LazyGQuery<T> prev(String... selectors);
  1589. /**
  1590. * Get all preceding siblings of each element in the set of matched elements.
  1591. */
  1592. LazyGQuery<T> prevAll();
  1593. /**
  1594. * Get all preceding siblings of each element in the set of matched elements filtered by a
  1595. * selector.
  1596. */
  1597. LazyGQuery<T> prevAll(String selector);
  1598. /**
  1599. * Get all preceding siblings of each element up to but not including the element matched by the
  1600. * <code>selector</code>.
  1601. *
  1602. * The elements are returned in order from the closest sibling to the farthest.
  1603. */
  1604. LazyGQuery<T> prevUntil(String selector);
  1605. /**
  1606. * Get all preceding siblings of each element up to but not including the <code>until</code>
  1607. * element.
  1608. *
  1609. * The elements are returned in order from the closest sibling to the farthest.
  1610. */
  1611. LazyGQuery<T> prevUntil(Element until);
  1612. /**
  1613. * Get all preceding siblings of each element up to but not including the <code>until</code>
  1614. * element.
  1615. *
  1616. * The elements are returned in order from the closest sibling to the farthest.
  1617. */
  1618. LazyGQuery<T> prevUntil(GQuery until);
  1619. /**
  1620. * Get all preceding siblings of each element matching the <code>filter</code> up to but not
  1621. * including the element matched by the <code>selector</code>.
  1622. *
  1623. * The elements are returned in order from the closest sibling to the farthest.
  1624. */
  1625. LazyGQuery<T> prevUntil(String selector, String filter);
  1626. /**
  1627. * Get all preceding siblings of each element matching the <code>filter</code> up to but not
  1628. * including the <code>until</code> element.
  1629. *
  1630. */
  1631. LazyGQuery<T> prevUntil(Element until, String filter);
  1632. /**
  1633. * Get all preceding siblings of each element matching the <code>filter</code> up to but not
  1634. * including the element matched by the <code>until</code> element.
  1635. *
  1636. */
  1637. LazyGQuery<T> prevUntil(GQuery until, String filter);
  1638. /**
  1639. * Returns a dynamically generated Promise that is resolved once all actions
  1640. * in the queue have ended.
  1641. */
  1642. Promise promise();
  1643. /**
  1644. * Returns a dynamically generated Promise that is resolved once all actions
  1645. * in the named queue have ended.
  1646. */
  1647. Promise promise(String name);
  1648. /**
  1649. * Get the value of a property for the first element in the set of matched elements.
  1650. *
  1651. * @param key the name of the property to be accessed
  1652. * @return the value of the property, in the case the property is a 'boolean' it
  1653. * returns a Boolean object, and a Double if is a 'number', so be prepared
  1654. * if you cast to other numeric objects. In the case of the property is undefined
  1655. * it returns null.
  1656. */
  1657. <T> T prop(String key);
  1658. /**
  1659. * Get the value of a property for the first element in the set of matched elements.
  1660. *
  1661. * @param key the name of the property to be accessed
  1662. * @param clz the class of the type to return
  1663. *
  1664. * @return the value of the property, it safely check the type passed as parameter
  1665. * and preform the aproproate transformations for numbers and booleans.
  1666. * In the case of the property is undefined it returns null.
  1667. */
  1668. <T> T prop(String key, Class<? extends T> clz);
  1669. /**
  1670. * Sets a property to a value on all matched elements.
  1671. *
  1672. * @param key the name of the boolean property to be set
  1673. * @param value the value specified. In the case the value is a Number, it is set
  1674. * as a 'number' in the javascript object and the same with Boolean.
  1675. *
  1676. * @return this <code>GQuery</code> object
  1677. *
  1678. */
  1679. LazyGQuery<T> prop(String key, Object value);
  1680. /**
  1681. * Sets a boolean property to a computed value on all matched elements.
  1682. *
  1683. * @param key the name of the boolean property to be set
  1684. * @param closure the closure to be used to compute the value the specified boolean property
  1685. * should be set to; the <code>closure</code> is
  1686. * {@linkplain Function#f(com.google.gwt.dom.client.Element, int) passed} the target
  1687. * element and its index as arguments and is expected to return either a
  1688. * <code>Boolean</code> value or an object whose textual representation is converted to a
  1689. * <code>Boolean</code> value; <code>null</code> return values are ignored
  1690. *
  1691. * @return this <code>GQuery</code> object
  1692. *
  1693. */
  1694. LazyGQuery<T> prop(String key, Function closure);
  1695. /**
  1696. * Show the number of functions in the efects queue to be executed on the first matched element.
  1697. */
  1698. int queue();
  1699. /**
  1700. * Put a set of {@link Function} at the end of the Effects queue.
  1701. *
  1702. * Example:
  1703. *
  1704. * <pre class="code">
  1705. * $("#foo").animate("left:'+=500'", 400)
  1706. * .queue(new Function(){
  1707. * public void f(Element e){
  1708. * $(e).css(CSS.BACKGROUNG_COLOR.with(RGBColor.RED));
  1709. * $(e).dequeue();
  1710. * }
  1711. * })
  1712. * .animate("left:'-=500'", 400)
  1713. * .queue(lazy().css("color", "yellow");
  1714. *
  1715. * </pre>
  1716. *
  1717. * When this statement is executed, the element move to 500 px to left for 400 ms, then its
  1718. * background color is changed to red and then move to 500px to right for 400ms, and finally its
  1719. * color is set to yellow.
  1720. *
  1721. * Please note that {@link #dequeue()} function is needed at the end of your function to start the
  1722. * next function in the queue. In lazy() methods you should call dequeue() just before the done()
  1723. * call. {@see #dequeue()}
  1724. */
  1725. LazyGQuery<T> queue(Function... f);
  1726. /**
  1727. * Show the number of functions in the queued named as queueName to be executed on the first
  1728. * matched element.
  1729. */
  1730. int queue(String queueName);
  1731. /**
  1732. * Put a set of {@link Function} at the end of a queue.
  1733. *
  1734. * Example:
  1735. *
  1736. * <pre class="code">
  1737. * $("#foo").queue("myQueue", new Function(){
  1738. * public void f(Element e){
  1739. * $(e).css(CSS.BACKGROUNG_COLOR.with(RGBColor.RED));
  1740. * dequeue("myQueue");
  1741. * }
  1742. * })
  1743. * .delay(500, "myQueue")
  1744. * .queue("myQueue", lazy().css(CSS.COLOR.with(RGBColor.YELLOW)).dequeue("myQueue").done());
  1745. * </pre>
  1746. *
  1747. * When this statement is executed, the background color of the element is set to red, then wait
  1748. * 500ms before to set the text color of the element to yellow. right for 400ms.
  1749. *
  1750. * Please note that {@link #dequeue()} function is needed at the end of your function to start the
  1751. * next function in the queue. In lazy() methods you should call dequeue() just before the done()
  1752. * call. {@see #dequeue()}
  1753. */
  1754. LazyGQuery<T> queue(String queueName, Function... f);
  1755. /**
  1756. * Specify a function to execute when the DOM is fully loaded.
  1757. *
  1758. * While JavaScript provides the load event for executing code when a page is rendered, this event
  1759. * is not seen if we attach an event listener after the document has been loaded.
  1760. * This guarantees that our gwt code will be executed either it's executed synchronously before the
  1761. * DOM has been rendered (ie: single script linker in header) or asynchronously.
  1762. */
  1763. Promise ready(Function... fncs);
  1764. /**
  1765. * Removes all matched elements from the DOM.
  1766. */
  1767. LazyGQuery<T> remove();
  1768. /**
  1769. * Removes from the DOM all matched elements filtered by the <code>filter</code>.
  1770. */
  1771. LazyGQuery<T> remove(String filter);
  1772. /**
  1773. * Remove the named attribute from every element in the matched set.
  1774. */
  1775. LazyGQuery<T> removeAttr(String key);
  1776. /**
  1777. * Removes the specified classes to each matched element.
  1778. *
  1779. * If no arguments are provided, it removes all classes like jquery does.
  1780. */
  1781. LazyGQuery<T> removeClass(String... classes);
  1782. /**
  1783. * Removes named data store from an element.
  1784. */
  1785. LazyGQuery<T> removeData(String name);
  1786. /**
  1787. * Remove a property for the set of matched elements.
  1788. */
  1789. LazyGQuery<T> removeProp(String name);
  1790. /**
  1791. * Replaces the element <code>elem</code> by the specified selector with the matched elements.
  1792. * This function is the complement to replaceWith() which does the same task with the parameters
  1793. * reversed.
  1794. *
  1795. * @return a {@link GQuery} object containing the new elements.
  1796. */
  1797. LazyGQuery<T> replaceAll(Element elem);
  1798. /**
  1799. * Replaces the elements matched by the target with the selected elements. This function is the
  1800. * complement to replaceWith() which does the same task with the parameters reversed.
  1801. *
  1802. * @return a {@link GQuery} object containing the new elements.
  1803. */
  1804. LazyGQuery<T> replaceAll(GQuery target);
  1805. /**
  1806. * Replaces the elements matched by the specified selector with the matched elements. This
  1807. * function is the complement to replaceWith() which does the same task with the parameters
  1808. * reversed.
  1809. *
  1810. * @return a {@link GQuery} object containing the new elements.
  1811. */
  1812. LazyGQuery<T> replaceAll(String selector);
  1813. /**
  1814. * Replaces all matched elements with the specified element.
  1815. *
  1816. * @return the GQuery element that was just replaced, which has been removed from the DOM and not
  1817. * the new element that has replaced it.
  1818. */
  1819. LazyGQuery<T> replaceWith(Element elem);
  1820. /**
  1821. * Replaces all matched elements with elements selected by <code>target</code> .
  1822. *
  1823. * @return the GQuery element that was just replaced, which has been removed from the DOM and not
  1824. * the new element that has replaced it.
  1825. */
  1826. LazyGQuery<T> replaceWith(GQuery target);
  1827. /**
  1828. * Replaces all matched elements with the specified HTML.
  1829. *
  1830. * @return the GQuery element that was just replaced, which has been removed from the DOM and not
  1831. * the new element that has replaced it.
  1832. */
  1833. LazyGQuery<T> replaceWith(String html);
  1834. /**
  1835. * Bind a set of functions to the resize event of each matched element, or tigger the resize event
  1836. * if no functions are provided.
  1837. *
  1838. * Note that although all elements can be configured to handle resize events, by default only
  1839. * window will trigger it when it is resized, for an arbitrary element you have to trigger the
  1840. * event after resizing the object.
  1841. *
  1842. */
  1843. LazyGQuery<T> resize(Function... f);
  1844. /**
  1845. * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
  1846. */
  1847. LazyGQuery<T> resize(Function f);
  1848. /**
  1849. * Save a set of Css properties of every matched element.
  1850. */
  1851. void restoreCssAttrs(String... cssProps);
  1852. /**
  1853. * Restore a set of previously saved Css properties in every matched element.
  1854. */
  1855. void saveCssAttrs(String... cssProps);
  1856. /**
  1857. * Bind a set of functions to the scroll event of each matched element. Or trigger the event if no
  1858. * functions are provided.
  1859. */
  1860. LazyGQuery<T> scroll(Function... f);
  1861. /**
  1862. * Scrolls the first matched element into view.
  1863. */
  1864. LazyGQuery<T> scrollIntoView();
  1865. /**
  1866. * Scrolls the first matched element into view.
  1867. *
  1868. * If ensure == true, it crawls up the DOM hierarchy, adjusting the scrollLeft and scrollTop
  1869. * properties of each scroll-able element to ensure that the specified element is completely in
  1870. * view. It adjusts each scroll position by the minimum amount necessary.
  1871. */
  1872. LazyGQuery<T> scrollIntoView(boolean ensure);
  1873. /**
  1874. * Gets the scroll left offset of the first matched element. This method works for both visible
  1875. * and hidden elements.
  1876. */
  1877. int scrollLeft();
  1878. /**
  1879. * The scroll left offset is set to the passed value on all matched elements. This method works
  1880. * for both visible and hidden elements.
  1881. */
  1882. LazyGQuery<T> scrollLeft(int left);
  1883. /**
  1884. *
  1885. * Scrolls the contents of all matched elements to the specified co-ordinate becoming the top left
  1886. * corner of the viewable area.
  1887. *
  1888. * This method is only useful where there are areas of the document not viewable within the
  1889. * current viewable area of the window and the visible property of the window's scrollbar must be
  1890. * set to true.
  1891. *
  1892. */
  1893. LazyGQuery<T> scrollTo(int left, int top);
  1894. /**
  1895. * Gets the scroll top offset of the first matched element. This method works for both visible and
  1896. * hidden elements.
  1897. */
  1898. int scrollTop();
  1899. /**
  1900. * The scroll top offset is set to the passed value on all matched elements. This method works for
  1901. * both visible and hidden elements.
  1902. */
  1903. LazyGQuery<T> scrollTop(int top);
  1904. LazyGQuery<T> select();
  1905. /**
  1906. * Force the current matched set of elements to become the specified array of elements.
  1907. */
  1908. LazyGQuery<T> setArray(NodeList<Element> list);
  1909. LazyGQuery<T> setPreviousObject(GQuery previousObject);
  1910. LazyGQuery<T> setSelector(String selector);
  1911. /**
  1912. * Make all matched elements visible.
  1913. */
  1914. LazyGQuery<T> show();
  1915. /**
  1916. * Get a set of elements containing all of the unique siblings of each of the matched set of
  1917. * elements.
  1918. */
  1919. LazyGQuery<T> siblings();
  1920. /**
  1921. * Get a set of elements containing all of the unique siblings of each of the matched set of
  1922. * elements filtered by the provided set of selectors.
  1923. */
  1924. LazyGQuery<T> siblings(String... selectors);
  1925. /**
  1926. * Return the number of elements in the matched set.
  1927. */
  1928. int size();
  1929. /**
  1930. * Selects a subset of the matched elements.
  1931. */
  1932. LazyGQuery<T> slice(int start, int end);
  1933. /**
  1934. * Reveal all matched elements by adjusting their height and firing an optional callback after
  1935. * completion.
  1936. */
  1937. Effects slideDown(Function... f);
  1938. /**
  1939. * Reveal all matched elements by adjusting their height and firing an optional callback after
  1940. * completion.
  1941. */
  1942. Effects slideDown(int millisecs, Function... f);
  1943. /**
  1944. * Toggle the visibility of all matched elements by adjusting their height and firing an optional
  1945. * callback after completion. Only the height is adjusted for this animation, causing all matched
  1946. * elements to be hidden or shown in a "sliding" manner
  1947. */
  1948. Effects slideToggle(Function... f);
  1949. /**
  1950. * Toggle the visibility of all matched elements by adjusting their height and firing an optional
  1951. * callback after completion. Only the height is adjusted for this animation, causing all matched
  1952. * elements to be hidden or shown in a "sliding" manner
  1953. */
  1954. Effects slideToggle(int millisecs, Function... f);
  1955. /**
  1956. * Hide all matched elements by adjusting their height and firing an optional callback after
  1957. * completion.
  1958. */
  1959. Effects slideUp(Function... f);
  1960. /**
  1961. * Hide all matched elements by adjusting their height and firing an optional callback after
  1962. * completion.
  1963. */
  1964. Effects slideUp(int millisecs, Function... f);
  1965. /**
  1966. * When .stop() is called on an element, the currently-running animation (if any) is immediately
  1967. * stopped. If, for instance, an element is being hidden with .slideUp() when .stop() is called,
  1968. * the element will now still be displayed, but will be a fraction of its previous height.
  1969. * Callback functions are not called but the next animation in the queue begins immediately.
  1970. */
  1971. LazyGQuery<T> stop();
  1972. /**
  1973. * When .stop() is called on an element, the currently-running animation (if any) is immediately
  1974. * stopped. If, for instance, an element is being hidden with .slideUp() when .stop() is called,
  1975. * the element will now still be displayed, but will be a fraction of its previous height.
  1976. * Callback functions are not called but the next animation in the queue begins immediately.
  1977. *
  1978. * If the clearQueue parameter is provided with a value of true, then the rest of the animations
  1979. * in the queue are removed and never run.
  1980. */
  1981. LazyGQuery<T> stop(boolean clearQueue);
  1982. /**
  1983. * When .stop() is called on an element, the currently-running animation (if any) is immediately
  1984. * stopped. If, for instance, an element is being hidden with .slideUp() when .stop() is called,
  1985. * the element will now still be displayed, but will be a fraction of its previous height.
  1986. * Callback functions are not called but the next animation in the queue begins immediately.
  1987. *
  1988. * If the clearQueue parameter is provided with a value of true, then the rest of the animations
  1989. * in the queue are removed and never run.
  1990. *
  1991. * If the jumpToEnd property is provided with a value of true, the current animation stops, but
  1992. * the element is immediately given its target values for each CSS property. The callback
  1993. * functions are then immediately called, if provided.
  1994. */
  1995. LazyGQuery<T> stop(boolean clearQueue, boolean jumpToEnd);
  1996. /**
  1997. * Bind a set of functions to the submit event of each matched element. Or submit a form if no
  1998. * functions are provided.
  1999. */
  2000. LazyGQuery<T> submit(Function... funcs);
  2001. /**
  2002. * Return the concatened text contained in the matched elements.
  2003. */
  2004. String text();
  2005. /**
  2006. * Set the innerText of every matched element.
  2007. */
  2008. LazyGQuery<T> text(String txt);
  2009. /**
  2010. * Toggle visibility of elements.
  2011. */
  2012. LazyGQuery<T> toggle();
  2013. /**
  2014. * Toggle among two or more function calls every other click.
  2015. */
  2016. LazyGQuery<T> toggle(Function... fn);
  2017. /**
  2018. * Adds or removes the specified classes to each matched element depending on the class's
  2019. * presence.
  2020. */
  2021. LazyGQuery<T> toggleClass(String... classes);
  2022. /**
  2023. * Adds or removes the specified classes to each matched element depending on the value of the
  2024. * switch argument.
  2025. *
  2026. * if addOrRemove is true, the class is added and in the case of false it is removed.
  2027. */
  2028. LazyGQuery<T> toggleClass(String clz, boolean addOrRemove);
  2029. /**
  2030. * Returns the computed top position of the first element matched.
  2031. */
  2032. int top();
  2033. /**
  2034. * Produces a string representation of the matched elements.
  2035. */
  2036. String toString();
  2037. /**
  2038. * Produces a string representation of the matched elements.
  2039. */
  2040. String toString(boolean pretty);
  2041. /**
  2042. * Trigger a browser native event on each matched element.
  2043. */
  2044. LazyGQuery<T> trigger(NativeEvent event);
  2045. /**
  2046. * Trigger a set of events on each matched element.
  2047. *
  2048. * For keyboard events you can pass a second parameter which represents the key-code of the pushed
  2049. * key.
  2050. *
  2051. * Example: fire(Event.ONCLICK | Event.ONFOCUS) Example: fire(Event.ONKEYDOWN. 'a');
  2052. */
  2053. LazyGQuery<T> trigger(int eventbits, int... keys);
  2054. /**
  2055. * Trigger a event in all matched elements.
  2056. *
  2057. * @param eventName An string representing the type of the event desired
  2058. * @param datas Additional parameters to pass along to the event handlers.
  2059. */
  2060. LazyGQuery<T> trigger(String eventName, Object... datas);
  2061. /**
  2062. * Removes all events that match the eventbits.
  2063. */
  2064. LazyGQuery<T> unbind(int eventbits);
  2065. /**
  2066. * Removes the function passed from the set of events which match the eventbits.
  2067. */
  2068. LazyGQuery<T> unbind(int eventbits, Function f);
  2069. /**
  2070. * Removes all events that match the eventList.
  2071. */
  2072. LazyGQuery<T> unbind(String eventList);
  2073. /**
  2074. * Removes all events that match the eventList.
  2075. */
  2076. LazyGQuery<T> unbind(String eventList, Function f);
  2077. /**
  2078. * Remove all event delegation that have been bound using
  2079. * {@link #delegate(String, int, Function...)} {@link #live(int, Function...)} methods.
  2080. *
  2081. * @deprecated use {@link #off()}
  2082. */
  2083. LazyGQuery<T> undelegate();
  2084. /**
  2085. * Undelegate is a way of removing event handlers that have been bound using
  2086. * {@link #delegate(String, int, Function...)} method.
  2087. *
  2088. * @deprecated use {@link #off(String)}
  2089. */
  2090. LazyGQuery<T> undelegate(String selector);
  2091. /**
  2092. * Undelegate is a way of removing event handlers that have been bound using
  2093. * {@link #delegate(String, int, Function...)} method.
  2094. *
  2095. * @deprecated use {@link #off(String)}
  2096. */
  2097. LazyGQuery<T> undelegate(String selector, int eventBit);
  2098. /**
  2099. * Undelegate is a way of removing event handlers that have been bound using
  2100. * {@link #delegate(String, int, Function...)} method.
  2101. *
  2102. * @deprecated use {@link #off(String, String)}
  2103. */
  2104. LazyGQuery<T> undelegate(String selector, String eventName);
  2105. /**
  2106. * Remove all duplicate elements from an array of elements. Note that this only works on arrays of
  2107. * DOM elements, not strings or numbers.
  2108. */
  2109. JsNodeArray unique(NodeList<Element> result);
  2110. /**
  2111. * This method removes the element's parent. The matched elements replaces their parents within
  2112. * the DOM structure. It is the inverse of {@link GQuery#wrap(GQuery)} method.
  2113. *
  2114. * @return
  2115. */
  2116. LazyGQuery<T> unwrap();
  2117. /**
  2118. * Gets the content of the value attribute of the first matched element, returns only the first
  2119. * value even if it is a multivalued element. To get an array of all values in multivalues
  2120. * elements use vals().
  2121. *
  2122. * When the first element is a radio-button and is not checked, then it looks for the first
  2123. * checked radio-button that has the same name in the list of matched elements.
  2124. *
  2125. * When there are not matched elements it returns null.
  2126. */
  2127. String val();
  2128. /**
  2129. * Sets the value attribute of every matched element based in the return value of the function
  2130. * evaluated for this element.
  2131. *
  2132. * NOTE: in jquery the function receives the arguments in different way, first index and them the
  2133. * actual value, but we use the normal way in gquery Function, first the element and second the
  2134. * index.
  2135. */
  2136. LazyGQuery<T> val(Function f);
  2137. /**
  2138. * Sets the 'value' attribute of every matched element, but does not set the checked flag to
  2139. * checkboxes or radiobuttons.
  2140. *
  2141. * If you wanted to set values in collections of checkboxes o radiobuttons use val(String[])
  2142. * instead
  2143. */
  2144. LazyGQuery<T> val(String value);
  2145. /**
  2146. * Sets the value of every matched element.
  2147. *
  2148. * There is a different behaviour depending on the element type:
  2149. * <ul>
  2150. * <li>select multiple: options whose value match any of the passed values will be set.
  2151. * <li>select single: the last option whose value matches any of the passed values will be set.
  2152. * <li>input radio: the last input whose value matches any of the passed values will be set.
  2153. * <li>input checkbox: inputs whose value match any of the passed values will be set.
  2154. * <li>textarea, button, and other input: value will set to a string result of joining with coma,
  2155. * all passed values
  2156. * </ul>
  2157. *
  2158. * NOTE: if you wanted call this function with just one parameter, you have to pass an array
  2159. * signature to avoid call the overloaded val(String) method:
  2160. *
  2161. * $(...).val(new String[]{"value"});
  2162. */
  2163. LazyGQuery<T> val(String... values);
  2164. /**
  2165. * Gets the content of the value attribute of the first matched element, returns more than one
  2166. * value if it is a multiple select.
  2167. *
  2168. * When the first element is a radio-button and is not checked, then it looks for a the first
  2169. * checked radio-button that has the same name in the list of matched elements.
  2170. *
  2171. * This method always returns an array. If no valid value can be determined the array will be
  2172. * empty, otherwise it will contain one or more values.
  2173. */
  2174. String[] vals();
  2175. /**
  2176. * Return the first non null attached widget from the matched elements or null if there isn't any.
  2177. */
  2178. <W extends Widget> W widget();
  2179. /**
  2180. * Return the nth non null attached widget from the matched elements or null if there isn't any.
  2181. */
  2182. <W extends Widget> W widget(int n);
  2183. /**
  2184. * return the list of attached widgets matching the query.
  2185. */
  2186. List<Widget> widgets();
  2187. /**
  2188. * Return the list of attached widgets instance of the provided class matching the query.
  2189. *
  2190. * This method is very useful for decoupled views, so as we can access widgets from other views
  2191. * without maintaining methods which export them.
  2192. *
  2193. */
  2194. <W extends Widget> List<W> widgets(Class<W> clazz);
  2195. /**
  2196. * Get the current computed, pixel, width of the first matched element. It does not include
  2197. * margin, padding nor border.
  2198. */
  2199. int width();
  2200. /**
  2201. * Set the width of every matched element.
  2202. */
  2203. LazyGQuery<T> width(int width);
  2204. /**
  2205. * Set the width style property of every matched element. It's useful for using 'percent' or 'em'
  2206. * units Example: $(".a").width("100%")
  2207. */
  2208. LazyGQuery<T> width(String width);
  2209. /**
  2210. * Wrap each matched element with the specified HTML content. This wrapping process is most useful
  2211. * for injecting additional structure into a document, without ruining the original semantic
  2212. * qualities of a document. This works by going through the first element provided (which is
  2213. * generated, on the fly, from the provided HTML) and finds the deepest descendant element within
  2214. * its structure -- it is that element that will enwrap everything else.
  2215. */
  2216. LazyGQuery<T> wrap(Element elem);
  2217. /**
  2218. * Wrap each matched element with the specified HTML content. This wrapping process is most useful
  2219. * for injecting additional structure into a document, without ruining the original semantic
  2220. * qualities of a document. This works by going through the first element provided (which is
  2221. * generated, on the fly, from the provided HTML) and finds the deepest descendant element within
  2222. * its structure -- it is that element that will enwrap everything else.
  2223. */
  2224. LazyGQuery<T> wrap(GQuery query);
  2225. /**
  2226. * Wrap each matched element with the specified HTML content. This wrapping process is most useful
  2227. * for injecting additional structure into a document, without ruining the original semantic
  2228. * qualities of a document. This works by going through the first element provided (which is
  2229. * generated, on the fly, from the provided HTML) and finds the deepest descendant element within
  2230. * its structure -- it is that element that will enwrap everything else.
  2231. */
  2232. LazyGQuery<T> wrap(String html);
  2233. /**
  2234. * Wrap each matched element with the specified SafeHtml content. This wrapping process is most useful
  2235. * for injecting additional structure into a document, without ruining the original semantic
  2236. * qualities of a document. This works by going through the first element provided (which is
  2237. * generated, on the fly, from the provided SafeHtml) and finds the deepest descendant element within
  2238. * its structure -- it is that element that will enwrap everything else.
  2239. */
  2240. LazyGQuery<T> wrap(SafeHtml safeHtml);
  2241. /**
  2242. * Wrap all the elements in the matched set into a single wrapper element. This is different from
  2243. * .wrap() where each element in the matched set would get wrapped with an element. This wrapping
  2244. * process is most useful for injecting additional structure into a document, without ruining the
  2245. * original semantic qualities of a document.
  2246. *
  2247. * This works by going through the first element provided (which is generated, on the fly, from
  2248. * the provided HTML) and finds the deepest descendant element within its structure -- it is that
  2249. * element that will enwrap everything else.
  2250. */
  2251. LazyGQuery<T> wrapAll(Element elem);
  2252. /**
  2253. * Wrap all the elements in the matched set into a single wrapper element. This is different from
  2254. * .wrap() where each element in the matched set would get wrapped with an element. This wrapping
  2255. * process is most useful for injecting additional structure into a document, without ruining the
  2256. * original semantic qualities of a document.
  2257. *
  2258. * This works by going through the first element provided (which is generated, on the fly, from
  2259. * the provided HTML) and finds the deepest descendant element within its structure -- it is that
  2260. * element that will enwrap everything else.
  2261. */
  2262. LazyGQuery<T> wrapAll(GQuery query);
  2263. /**
  2264. * Wrap all the elements in the matched set into a single wrapper element. This is different from
  2265. * .wrap() where each element in the matched set would get wrapped with an element. This wrapping
  2266. * process is most useful for injecting additional structure into a document, without ruining the
  2267. * original semantic qualities of a document.
  2268. *
  2269. * This works by going through the first element provided (which is generated, on the fly, from
  2270. * the provided HTML) and finds the deepest descendant element within its structure -- it is that
  2271. * element that will enwrap everything else.
  2272. */
  2273. LazyGQuery<T> wrapAll(String html);
  2274. /**
  2275. * Wrap all the elements in the matched set into a single wrapper element. This is different from
  2276. * .wrap() where each element in the matched set would get wrapped with an element. This wrapping
  2277. * process is most useful for injecting additional structure into a document, without ruining the
  2278. * original semantic qualities of a document.
  2279. *
  2280. * This works by going through the first element provided (which is generated, on the fly, from
  2281. * the provided SafeHtml) and finds the deepest descendant element within its structure -- it is that
  2282. * element that will enwrap everything else.
  2283. */
  2284. LazyGQuery<T> wrapAll(SafeHtml safeHtml);
  2285. /**
  2286. * Wrap the inner child contents of each matched element (including text nodes) with an HTML
  2287. * structure. This wrapping process is most useful for injecting additional structure into a
  2288. * document, without ruining the original semantic qualities of a document. This works by going
  2289. * through the first element provided (which is generated, on the fly, from the provided HTML) and
  2290. * finds the deepest ancestor element within its structure -- it is that element that will enwrap
  2291. * everything else.
  2292. */
  2293. LazyGQuery<T> wrapInner(Element elem);
  2294. /**
  2295. * Wrap the inner child contents of each matched element (including text nodes) with an HTML
  2296. * structure. This wrapping process is most useful for injecting additional structure into a
  2297. * document, without ruining the original semantic qualities of a document. This works by going
  2298. * through the first element provided (which is generated, on the fly, from the provided HTML) and
  2299. * finds the deepest ancestor element within its structure -- it is that element that will enwrap
  2300. * everything else.
  2301. */
  2302. LazyGQuery<T> wrapInner(GQuery query);
  2303. /**
  2304. * Wrap the inner child contents of each matched element (including text nodes) with an HTML
  2305. * structure. This wrapping process is most useful for injecting additional structure into a
  2306. * document, without ruining the original semantic qualities of a document. This works by going
  2307. * through the first element provided (which is generated, on the fly, from the provided HTML) and
  2308. * finds the deepest ancestor element within its structure -- it is that element that will enwrap
  2309. * everything else.
  2310. */
  2311. LazyGQuery<T> wrapInner(String html);
  2312. /**
  2313. * Wrap the inner child contents of each matched element (including text nodes) with an SafeHtml
  2314. * structure. This wrapping process is most useful for injecting additional structure into a
  2315. * document, without ruining the original semantic qualities of a document. This works by going
  2316. * through the first element provided (which is generated, on the fly, from the provided SafeHtml) and
  2317. * finds the deepest ancestor element within its structure -- it is that element that will enwrap
  2318. * everything else.
  2319. */
  2320. LazyGQuery<T> wrapInner(SafeHtml safeHtml);
  2321. }