Package com.sencha.gxt.widget.core.client.toolbar

Source Code of com.sencha.gxt.widget.core.client.toolbar.SeparatorToolItem

/**
* Sencha GXT 3.1.0-beta - Sencha for GWT
* Copyright(c) 2007-2014, Sencha, Inc.
* licensing@sencha.com
*
* http://www.sencha.com/products/gxt/license/
*/
package com.sencha.gxt.widget.core.client.toolbar;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.sencha.gxt.core.client.dom.XDOM;
import com.sencha.gxt.widget.core.client.Component;

/**
* A tool bar separator.
*/
public class SeparatorToolItem extends Component {

  public interface SeparatorToolItemAppearance {
    void render(SafeHtmlBuilder sb);
  }

  @SuppressWarnings("unused")
  private final SeparatorToolItemAppearance appearance;

  public SeparatorToolItem() {
    this(GWT.<SeparatorToolItemAppearance>create(SeparatorToolItemAppearance.class));
  }

  public SeparatorToolItem(SeparatorToolItemAppearance appearance) {
    this.appearance = appearance;

    SafeHtmlBuilder markupBuilder = new SafeHtmlBuilder();
    appearance.render(markupBuilder);

    setElement((Element) XDOM.create(markupBuilder.toSafeHtml()));
  }

}
TOP

Related Classes of com.sencha.gxt.widget.core.client.toolbar.SeparatorToolItem

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.