Package org.timepedia.chronoscopesamples.client

Source Code of org.timepedia.chronoscopesamples.client.ChartDemoJS$ClientExceptionHandler

package org.timepedia.chronoscopesamples.client;

import java.util.ArrayList;

import org.timepedia.chronoscope.client.ChronoscopeOptions;
import org.timepedia.chronoscope.client.browser.Chronoscope;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.user.client.Element;

/**
* @author Manolo Carrasco <manolo@timepedia.org>
*/
public class ChartDemoJS implements EntryPoint {

  public void onModuleLoad() {
//    GWT.setUncaughtExceptionHandler(new ClientExceptionHandler());

    NodeList nl = Document.get().getElementsByTagName("style");
    final ArrayList<String> toLoad = new ArrayList<String>();
    for (int i = 0; i < nl.getLength(); i++) {
      Element e = (Element) nl.getItem(i);
      if ("text/gss".equals(e.getAttribute("type"))) {
        GWT.log("Style = " + e.getInnerText(), null);
      }
    }

    Chronoscope.setMicroformatsEnabled(true);
    ChronoscopeOptions.setErrorReporting(true);
    Chronoscope.getInstance();
  }

  private class ClientExceptionHandler implements GWT.UncaughtExceptionHandler {
    public void onUncaughtException(Throwable cause) {
      System.out.println(cause.toString());
      GWT.log(cause.toString(), cause);
    }
  }

}
TOP

Related Classes of org.timepedia.chronoscopesamples.client.ChartDemoJS$ClientExceptionHandler

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.