Package org.sgx.yuigwt.yui.event

Examples of org.sgx.yuigwt.yui.event.EventCallback


    diamond1.lineTo(80, 80);
    diamond1.lineTo(60, 60);
    diamond1.end();
   
    //register a clicl listener
    Y.one(diamond1.node()).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Window.alert("clicked");
      }
    });   
View Full Code Here


    final Node p = parent.appendChild(
      "<input type=\"text\" value=\"value to store\"></input>");
//    final Cookie cookie1 = Y.newcookie(cookieConfig.create().max(5).expires(3600000));
   
   
    Y.newButton(ButtonConfig.create().label("Save").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Y.Cookie().set(cookieKey1, p.get("value"));
      }
    }));
    Y.newButton(ButtonConfig.create().label("Load").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        p.set("value", Y.Cookie().getString(cookieKey1));
      }
    }));
View Full Code Here

  public void ready(final YuiContext Y) {
    final Console console1 = Y.newConsole(ConsoleConfig.create());
    console1.render();
   
    Button b1 = Y.newButton(ButtonConfig.create().label("loadScript1")).render(parent).cast();
    b1.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Y.Get().js(GWT.getModuleBaseURL()+"testfiles/script1.js");
      }
    }).cast();
   
    Button b2 = Y.newButton(ButtonConfig.create().label("loadcss1")).render(parent).cast();
    b2.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Y.Get().css(GWT.getModuleBaseURL()+"testfiles/css1.css");
      }
    });   
   
    //now try to load a non existing file - catch the error using the normal callback for accessing the error
    Button b3 = Y.newButton(ButtonConfig.create().label("nonExisting1")).render(parent).cast();
    b3.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Y.Get().css(GWT.getModuleBaseURL()+"testfiles/jsNotExists123.css", GetConfig.create(), new GetCallback() {         
          @Override
          public void call(JsArray err_, Transaction tx) {
            JsArray<GetError> err = (JsArray<GetError>)err_;
            Window.alert("error count: "+err.length()+" - first error: "+
                err.get(0).error());
          }
        });
      };
    });
   
    //or, the same as as above but using the Get's options object for registering an onFailure listener: 
    Button b4 = Y.newButton(ButtonConfig.create().label("nonExisting2")).render(parent).cast();
    b4.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Y.Get().css(GWT.getModuleBaseURL()+"testfiles/jsNotExists123.css", GetConfig.create().onFailure(new GetOptionsCallback() {
         
          @Override
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.event.EventCallback

Copyright © 2018 www.massapicom. 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.