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 */ 020package gwt.material.design.client.js; 021 022import com.google.gwt.dom.client.Element; 023import gwt.material.design.jquery.client.api.JQueryElement; 024import gwt.material.design.client.ui.table.MaterialDataTable; 025import jsinterop.annotations.JsMethod; 026import jsinterop.annotations.JsPackage; 027import jsinterop.annotations.JsProperty; 028import jsinterop.annotations.JsType; 029 030/** 031 * @author Ben Dol 032 */ 033@JsType(name = "TableSubHeaders", isNative = true, namespace = JsPackage.GLOBAL) 034public class JsTableSubHeaders { 035 036 @JsType 037 public static class SubHeaderOptions { 038 @JsProperty public int marginTop = 0; 039 @JsProperty public int marginLeft = 0; 040 @JsProperty public int scrollThrottle = 20; 041 @JsProperty public int resizeThrottle = 100; 042 } 043 044 @JsMethod 045 public static native JsTableSubHeaders newInstance(JQueryElement table, String selector); 046 047 @JsMethod public native void load(); 048 049 @JsMethod public native void load(SubHeaderOptions opts); 050 051 @JsMethod public native void unload(); 052 053 @JsMethod public native void reload(); 054 055 @JsMethod public native void detect(); 056 057 @JsMethod public native void toggle(JQueryElement subheader); 058 059 @JsMethod public native void open(JQueryElement subheader); 060 061 @JsMethod public native void close(JQueryElement subheader); 062 063 @JsMethod public native void recalculate(boolean fireEvents); 064 065 @JsMethod public native void alignment(SmartScrollBlock scroll); 066 067 @JsMethod public native void updateWidths(); 068 069 @JsMethod public native void updateHeights(); 070 071 @JsMethod public native void updateHeight(Element el, String height); 072 073 @JsMethod public native void setMarginTop(int marginTop); 074 075 @JsMethod public native void setMarginLeft(int marginLeft); 076 077 @JsMethod public native boolean isLoaded(); 078}