Package org.sgx.yuigwt.yui.event

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


    footer = body.one("#ft");

    drawTestNav(Y);

    // //java source button
    Button showJavaButton = Y.newButton(Button.config().label(constants.showJava()).render(extraContent).on("click", new EventCallback() {
      @Override
      public void call(EventFacade e) {
        doShowCurrentTestSources2();
      }
    }));
    showJavaButton.srcNode().setStyles(Style.create().fontSize("1.2em").fontWeight("bolder").textDecoration("underline").margin("10px 0px"));

    // test description button
    Button descrButton = Y.newButton(Button.config().label("Test description")).render(extraContent).on("click", new EventCallback() {
      @Override
      public void call(EventFacade e) {
        showCurrentTestDescription(Y);
      }
    }).cast();
    // descrButton.contentBox().setStyle("width", "100%");

    // this gallery sources button
    Button showSurceButton = Y.newButton(Button.config().label(constants.thisExampleGallerySources())).render(extraContent).on("click", new EventCallback() {
      @Override
      public void call(EventFacade e) {
        Map<String, ResourcePrototype> r = new HashMap<String, ResourcePrototype>();
        r.put(constants.thisExampleGallerySources(), TestResources.instance.Gallery());
        doShowSources2(r);
        // showJavaSource2(Y, TestResources.instance.Gallery(),
        // constants.thisExampleGallerySources(), 0);
      }
    }).cast();
    // showSurceButton.contentBox().setStyle("width", "100%");

    Button aboutButton = Y.newButton(Button.config().label("About")).render(extraContent).on("click", new EventCallback() {
      @Override
      public void call(EventFacade e) {
        showAboutThisApplication(Y);
      }
    }).cast();
View Full Code Here


  }

  private void drawAllTest(YuiGalleryContext Y, Node parent) {

    for (final Test test : util.getTests()) {
      Y.newButton(Button.config().label(test.getName()).render(parent).on("click", new EventCallback() {
        @Override
        public void call(EventFacade e) {
          setCurrentTest(test);
        }
      }));
View Full Code Here

      acc1.addItem(item1);

      Node testParent = Y.one("#" + parentId);
      for (final Test test : tests) {
        Y.newButton(Button.config().label(test.getName()).render(testParent).on("click", new EventCallback() {
          @Override
          public void call(EventFacade e) {
            setCurrentTest(test);
          }
        }));
View Full Code Here

  final static int vdiff = 105;
  final static String sel = "#nav .content, #main .content, #extra .content";

  private void installHeightHack(final YuiContext Y) {
    Y.on("windowresize", new EventCallback() {
      @Override
      public void call(EventFacade e) {
        ssheet1.set(sel, Style.create().height((getMainContent().winHeight() - vdiff) + "px"));
      }
    });
View Full Code Here

    // Using round to round sub-pixel values for FF3 just
      // to make the text box values prettier.
      xInput.set("value", overlay.getInt("x"));
      yInput.set("value", overlay.getInt("y"));
     
      Y.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        double x = Double.parseDouble(xInput.getString("value")),
          y = Double.parseDouble(yInput.getString("value"));
        overlay.move(x, y);
View Full Code Here

    //create a draggable console
    final Console console1 = Y.newConsole(ConsoleConfig.create());
    console1.plug(Y.Plugin().Drag());
   
    //be a nasty console catching each log entry and asking for confirmation.
    console1.before(Console.EVENT_ENTRY, new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        if(!Window.confirm("Do you really want to add the msg: "+((ConsoleEvent)e).message().message()+" ? "))  {
          Window.alert("preventing");
          e.preventDefault();
View Full Code Here

 
 
  final static int vdiff=105;
  final static String sel = "#nav .content, #main .content, #extra .content";
  private void installHeightHack(final YuiContext Y) { 
    Y.on("windowresize", new EventCallback() {   
      @Override
      public void call(EventFacade e) {
        styleSheet.set(sel, Style.create().height((getMainContent().winHeight()-vdiff)+"px"));
      }
    });
View Full Code Here

    parentNode.addClass("yui3-skin-sam");
   
    Button button1 = (Button) Y.newButton(
      ButtonConfig.create().label("a YUI3 button widget")
    ).render(parentNode)
    button1.on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        Window.alert(e.domEvent().getClientX()+"");
      }
    });
View Full Code Here

  public void ready(final YuiContext Y) { 
   
    final StyleSheet ss1 = Y.newStyleSheet();
    Slider sl1 = Y.newSlider(SliderConfig.create().min(8).max(34).value(11));
    sl1.render(parent);
    sl1.on(Slider.EVENT_THUMBMOVE, new EventCallback() {
     
      @Override
      public void call(EventFacade e_) {
        SliderEvent e = (SliderEvent)e_;
        String fsize = (e.offset()+8)+"px";
View Full Code Here

    final String cacheKey1 = "cachetestkey1", cacheKey2 = "cachetestkey2"
    parent.append("<p>The online cache tester: </p>");
    final Node p = parent.appendChild(
      "<input type=\"text\" value=\"value to store\"></input>");
    final Cache cache1 = Y.newCache(CacheConfig.create().max(5).expires(3600000));
    Y.newButton(ButtonConfig.create().label("Save").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        cache1.add(cacheKey1, p.get("value"));
      }
    }));
    Y.newButton(ButtonConfig.create().label("Load").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        p.set("value", cache1.retrieve(cacheKey1).responseString());
      }
    }));
   
    parent.append("<p>and the offline cache tester (html5): </p>");
    final Node p2 = parent.appendChild(
      "<input type=\"text\" value=\"value to store\"></input>");
    CacheOfflineConfig occ = (CacheOfflineConfig)CacheOfflineConfig.create();
    final Cache cache2 = Y.newCacheOffline(occ.sandbox("foobar4455z").max(5).expires(3600000));
    Y.newButton(ButtonConfig.create().label("Save").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        cache2.add(cacheKey2, p2.get("value"));
      }
    }));
    Y.newButton(ButtonConfig.create().label("Load").render(parent).on("click", new EventCallback() {     
      @Override
      public void call(EventFacade e) {
        p2.set("value", cache2.retrieve(cacheKey2).responseString());
      }
    }));
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.