001package org.gwtbootstrap3.extras.fullcalendar.client.ui;
002
003/*
004 * #%L
005 * GwtBootstrap3
006 * %%
007 * Copyright (C) 2013 - 2014 GwtBootstrap3
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import com.google.gwt.core.client.JavaScriptObject;
024
025/**
026 * http://arshaw.com/fullcalendar/docs/display/header/
027 * <p/>
028 * Setting the header options to false will display no header.
029 * An object can be supplied with properties left, center, and right.
030 * These properties contain strings with comma/space separated values.
031 * Values separated by a comma will be displayed adjacently.
032 * Values separated by a space will be displayed with a small gap in between.
033 * Strings can contain any of the following values:
034 * <code>
035 * {
036 * left:   'title',
037 * center: '',
038 * right:  'today prev,next'
039 * }
040 * </code>
041 *
042 * @author Jeff Isenhart
043 */
044public class Header {
045
046    private JavaScriptObject header;
047
048    public Header() {
049        newInstance();
050    }
051
052    private native void newInstance() /*-{
053        var theInstance = this;
054        theInstance.@org.gwtbootstrap3.extras.fullcalendar.client.ui.Header::header = {left: 'title', center: '', right: 'today prev,next'};
055    }-*/;
056
057    public native void setNoHeader() /*-{
058        var theInstance = this;
059        theInstance.@org.gwtbootstrap3.extras.fullcalendar.client.ui.Header::header = null;
060    }-*/;
061
062    public native void setLeft(String left) /*-{
063        var theInstance = this;
064        theInstance.@org.gwtbootstrap3.extras.fullcalendar.client.ui.Header::header.left = left;
065    }-*/;
066
067    public native void setCenter(String center) /*-{
068        var theInstance = this;
069        theInstance.@org.gwtbootstrap3.extras.fullcalendar.client.ui.Header::header.center = center;
070    }-*/;
071
072    public native void setRight(String right) /*-{
073        var theInstance = this;
074        theInstance.@org.gwtbootstrap3.extras.fullcalendar.client.ui.Header::header.right = right;
075    }-*/;
076
077    public JavaScriptObject toJavaScript() {
078        return header;
079    }
080}