com.sencha.gxt.theme.blue.client.tabs.BluePlainTabPanelAppearance.java Source code

Java tutorial

Introduction

Here is the source code for com.sencha.gxt.theme.blue.client.tabs.BluePlainTabPanelAppearance.java

Source

/**
 * Sencha GXT 4.0.0 - Sencha for GWT
 * Copyright (c) 2006-2015, Sencha Inc.
 *
 * licensing@sencha.com
 * http://www.sencha.com/products/gxt/license/
 *
 * ================================================================================
 * Open Source License
 * ================================================================================
 * This version of Sencha GXT is licensed under the terms of the Open Source GPL v3
 * license. You may use this license only if you are prepared to distribute and
 * share the source code of your application under the GPL v3 license:
 * http://www.gnu.org/licenses/gpl.html
 *
 * If you are NOT prepared to distribute and share the source code of your
 * application under the GPL v3 license, other commercial and oem licenses
 * are available for an alternate download of Sencha GXT.
 *
 * Please see the Sencha GXT Licensing page at:
 * http://www.sencha.com/products/gxt/license/
 *
 * For clarification or additional options, please contact:
 * licensing@sencha.com
 * ================================================================================
 *
 *
 * ================================================================================
 * Disclaimer
 * ================================================================================
 * THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND
 * REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
 * IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY,
 * FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE AND
 * THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING.
 * ================================================================================
 */
package com.sencha.gxt.theme.blue.client.tabs;

import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.sencha.gxt.widget.core.client.PlainTabPanel;
import com.sencha.gxt.widget.core.client.PlainTabPanel.PlainTabPanelAppearance;

/**
 * A blue-colored appearance for {@link PlainTabPanel}. This appearance differs
 * from {@link BlueTabPanelAppearance} in that it has a simplified tab strip.
 */
public class BluePlainTabPanelAppearance extends BlueTabPanelAppearance implements PlainTabPanelAppearance {

    public interface BluePlainTabPanelResources extends BlueTabPanelResources {

        @Source({ "com/sencha/gxt/theme/base/client/tabs/TabPanel.gss", "BlueTabPanel.gss",
                "com/sencha/gxt/theme/base/client/tabs/PlainTabPanel.gss", "BluePlainTabPanel.gss" })
        BluePlainTabPanelStyle style();

    }

    public interface BluePlainTabPanelStyle extends BlueTabPanelStyle {

        String tabStripSpacer();

    }

    public interface PlainTabPanelTemplates extends Template {

        @XTemplate(source = "com/sencha/gxt/theme/base/client/tabs/TabPanel.html")
        SafeHtml render(TabPanelStyle style);

        @XTemplate(source = "com/sencha/gxt/theme/base/client/tabs/PlainTabPanel.html")
        SafeHtml renderPlain(BluePlainTabPanelStyle style);

    }

    private final PlainTabPanelTemplates template;
    private final BluePlainTabPanelStyle style;

    public BluePlainTabPanelAppearance() {
        this(GWT.<BluePlainTabPanelResources>create(BluePlainTabPanelResources.class),
                GWT.<PlainTabPanelTemplates>create(PlainTabPanelTemplates.class),
                GWT.<ItemTemplate>create(ItemTemplate.class));
    }

    public BluePlainTabPanelAppearance(BluePlainTabPanelResources resources, PlainTabPanelTemplates template,
            ItemTemplate itemTemplate) {
        super(resources, template, itemTemplate);
        this.style = resources.style();
        this.template = template;
    }

    @Override
    public void render(SafeHtmlBuilder builder) {
        builder.append(template.renderPlain(style));
    }

}