Package com.claymus.site.module.theme.pages.gwt

Source Code of com.claymus.site.module.theme.pages.gwt.ManageThemes

package com.claymus.site.module.theme.pages.gwt;

import com.claymus.gwt.Alert;
import com.claymus.gwt.AsyncCallbackWithMsg;
import com.claymus.site.module.theme.gwt.ThemeService;
import com.claymus.site.module.theme.gwt.ThemeServiceAsync;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;

public class ManageThemes implements EntryPoint {

  private final static ThemeServiceAsync themeService = GWT.create(ThemeService.class);

  @Override
  public void onModuleLoad() {
    ManageThemes.exportStaticMethods();
  }

  public static void setActive(String className) {
    ManageThemes.themeService.setActive(className, new AsyncCallbackWithMsg<Void>() {

      @Override
      public void onCallSuccess(Void result) {
        Window.Location.reload();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addHideButton();
        alert.show();
      }

    });
  }

  public static native void exportStaticMethods() /*-{
    $wnd.claymus_theme_setActive = $entry(@com.claymus.site.module.theme.pages.gwt.ManageThemes::setActive(Ljava/lang/String;));
  }-*/;

}
 
TOP

Related Classes of com.claymus.site.module.theme.pages.gwt.ManageThemes

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.