001/* 002 * Copyright 2014 Cristian Rinaldi & Andres Testi. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package gwt.material.design.jscore.client.api; 017 018import gwt.material.design.jscore.client.api.core.Element; 019import gwt.material.design.jscore.client.api.core.NodeList; 020import gwt.material.design.jscore.client.api.html.HTMLBodyElement; 021import gwt.material.design.jscore.client.api.html.HTMLElement; 022import gwt.material.design.jscore.client.api.html.StyleSheetList; 023import jsinterop.annotations.JsMethod; 024import jsinterop.annotations.JsOverlay; 025import jsinterop.annotations.JsProperty; 026import jsinterop.annotations.JsType; 027 028/** 029 * Represent a Document 030 * 031 * @author Cristian Rinaldi <a 032 * href="mailto:csrinaldi@gmail.com?Subject=JQuery">csrinaldi@gmail.com</a> 033 * @author Andres Testi <a 034 * href="mailto:andres.a.testi@gmail.com?Subject=JQuery">andres.a.testi@gmail.com</a> 035 */ 036@JsType(isNative = true) 037public class Document { 038 039 public native HTMLElement createElement(String element); 040 041 public native HTMLElement getElementsByTagName(String body); 042 043 @JsProperty 044 public native HTMLBodyElement getBody(); 045 046 public native Element querySelector(String selector); 047 048 public native NodeList querySelectorAll(String selector); 049 050 @JsProperty 051 public native StyleSheetList getStyleSheets(); 052 053 @JsMethod(namespace = "document") 054 public static native void execCommand(String command); 055}