001/*
002 * #%L
003 * GwtMaterial
004 * %%
005 * Copyright (C) 2015 - 2017 GwtMaterialDesign
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 * 
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 * 
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020    /*
021 * Copyright 2014 Cristian Rinaldi & Andres Testi.
022 *
023 * Licensed under the Apache License, Version 2.0 (the "License");
024 * you may not use this file except in compliance with the License.
025 * You may obtain a copy of the License at
026 *
027 *      http://www.apache.org/licenses/LICENSE-2.0
028 *
029 * Unless required by applicable law or agreed to in writing, software
030 * distributed under the License is distributed on an "AS IS" BASIS,
031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
032 * See the License for the specific language governing permissions and
033 * limitations under the License.
034 */
035package gwt.material.design.client.jquery;
036
037import com.google.gwt.dom.client.Element;
038import gwt.material.design.jquery.client.api.JQueryElement;
039import jsinterop.annotations.JsMethod;
040import jsinterop.annotations.JsOverlay;
041import jsinterop.annotations.JsPackage;
042import jsinterop.annotations.JsType;
043
044/**
045 * Represent materials JQuery Extension API.
046 *
047 * @author Ben Dol
048 */
049@JsType(isNative = true)
050public class JQueryExtension {
051
052    @JsMethod(namespace = JsPackage.GLOBAL)
053    public static native JQueryExtElement $(JQueryElement element);
054
055    @JsMethod(namespace = JsPackage.GLOBAL)
056    public static native JQueryExtElement $(Element element);
057
058    /**
059     * Get the scroll bar width within a given container.
060     * @param container the container you would like to test the scrollbar in.
061     */
062    @JsMethod(namespace = "$")
063    public static native int scrollBarWidth(Element container);
064
065    @JsOverlay
066    public static int scrollBarWidth() {
067        return scrollBarWidth(null);
068    }
069}