Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2014 Cristian Rinaldi & Andres Testi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package gwt.material.design.jquery.client.api;
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
import com.google.gwt.user.client.ui.UIObject;
import gwt.material.design.jquery.client.api.Functions.Func;
import gwt.material.design.jquery.client.api.Functions.Func2;
import gwt.material.design.jquery.client.api.Functions.Func3;
import gwt.material.design.jquery.client.api.Functions.FuncRet2;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
/**
* Represent a JQuery access model.
*
* @author Ben Dol
*/
@JsType(isNative = true)
public class JQuery {
@JsOverlay
public static Element window() {
return ScriptInjector.TOP_WINDOW.cast();
}
// Plain Object Query
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $();
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Object plainObject);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Object plainObject, Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Object plainObject, gwt.material.design.jscore.client.api.core.Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Object plainObject, JQueryElement context);
@JsOverlay
public static JQueryElement $(Object plainObject, UIObject context) {
return $(plainObject, context.getElement());
}
// String Selector Query
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(String selector);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(String selector, Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(String selector, gwt.material.design.jscore.client.api.core.Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(String selector, JQueryElement context);
@JsOverlay
public static JQueryElement $(String selector, UIObject context) {
return $(selector, context.getElement());
}
// JQueryElement Query
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(JQueryElement element);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(JQueryElement element, Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(JQueryElement element, gwt.material.design.jscore.client.api.core.Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(JQueryElement element, JQueryElement context);
@JsOverlay
public static JQueryElement $(JQueryElement element, UIObject context) {
return $(element, context.getElement());
}
// Element Query
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Element element);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Element element, Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Element element, gwt.material.design.jscore.client.api.core.Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Element element, JQueryElement context);
@JsOverlay
public static JQueryElement $(Element element, UIObject context) {
return $(element, context.getElement());
}
// Node Query
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Node element);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Node element, Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Node element, gwt.material.design.jscore.client.api.core.Element context);
@JsMethod(namespace = JsPackage.GLOBAL)
public static native JQueryElement $(Node element, JQueryElement context);
@JsOverlay
public static JQueryElement $(Node element, UIObject context) {
return $(element, context.getElement());
}
// Generic UIObject Query
@JsOverlay
@SuppressWarnings("unchecked")
public static JQueryElement $(T uiObject) {
return $(uiObject.getElement());
}
@JsOverlay
@SuppressWarnings("unchecked")
public static JQueryElement $(T uiObject, Element context) {
return $(uiObject.getElement(), context);
}
@JsOverlay
@SuppressWarnings("unchecked")
public static JQueryElement $(T uiObject, gwt.material.design.jscore.client.api.core.Element context) {
return $(uiObject.getElement(), context);
}
@JsOverlay
@SuppressWarnings("unchecked")
public static JQueryElement $(T uiObject, JQueryElement context) {
return $(uiObject.getElement(), context);
}
@JsOverlay
@SuppressWarnings("unchecked")
public static JQueryElement $(T uiObject, UIObject context) {
return $(uiObject.getElement(), context.getElement());
}
// JQuery Global Functions
/**
* Get arbitrary data associated with the element.
* @return self {@link JQueryElement}
*/
@JsMethod(namespace = "$")
public static native JQueryElement _data(JQueryElement element, String key);
/**
* Check to see if a DOM element is a descendant of another DOM element.
* @param container The DOM element that may contain the other element.
* @param contained The DOM element that may be contained by (a descendant of) the other element.
* @return returns true if the DOM element provided by the second argument is a descendant of the DOM
* element provided by the first argument, whether it is a direct child or nested more deeply
*/
@JsMethod(namespace = "$")
public static native boolean contains(Element container, Element contained);
/**
* Execute the next function on the queue for the matched element.
* @param element A DOM element from which to remove and execute a queued function.
*/
@JsMethod(namespace = "$")
public static native void dequeue(Element element);
/**
* Execute the next function on the queue for the matched element.
* @param element A DOM element from which to remove and execute a queued function.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
@JsMethod(namespace = "$")
public static native void dequeue(Element element, String queueName);
/**
* A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.
* Arrays and array-like objects with a length property (such as a function's arguments object) are
* iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
* @param array The array to iterate over.
* @param callback The function that will be executed on every object.
*/
@JsMethod(namespace = "$")
public static native Object each(Object[] array, Func2 callback);
/**
* A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.
* Arrays and array-like objects with a length property (such as a function's arguments object) are
* iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
* @param object The object to iterate over.
* @param callback The function that will be executed on every object.
*/
@JsMethod(namespace = "$")
public static native Object each(Object object, Func2 callback);
/**
* Takes a string and throws an exception containing it.
* @param message The message to send out.
*/
@JsMethod(namespace = "$")
public static native void error(String message);
/**
* Load JSON-encoded data from the server using a GET HTTP request.
* @param url A string containing the URL to which the request is sent.
*/
@JsMethod(namespace = "$")
public static native Object getJSON(String url);
/**
* Load JSON-encoded data from the server using a GET HTTP request.
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds.
*/
@JsMethod(namespace = "$")
public static native Object getJSON(String url, Func3