Package org.sgx.yuigwt.yui.widget

Examples of org.sgx.yuigwt.yui.widget.Widget


      public void call(TabViewEvent e) {
       
        /* note e.newVal is the selected child widget - we cast directly.
         * @see http://yuilibrary.com/yui/docs/api/classes/WidgetParent.html#attr_selection
         */
        Widget selChild = e.newValObj().cast();
       
        int newTabIndex = selChild.getInt("index");
       
        console.log("tabview selectionChange: "+newTabIndex);
       
        history.addValue("tab", newTabIndex==0 ? null : newTabIndex+"");
      }
View Full Code Here


  @Override
  public void ready(final YuiContext Y) {
    final Console console = Y.newConsole();
    console.render();
    Widget button1 = Y.newButton(
      ButtonConfig.create().label("a simple button 123")
    ).render(parent)
    //register a click listener that will unregister itself after the first event
    handle1 = button1.on("click", new EventCallback<ButtonEvent>() {     
      @Override
      public void call(ButtonEvent e) {
        console.log("button pressed at x  ="+e.domEvent().getClientX()+".\n And this will be THE LAST TIME !!!");
        handle1.detach(); //unregister this event listener!
      }
    });
    console.log("button's region is : " + button1.boundingBox().region().print());
    button1.boundingBox().setStyles(Style.create().border("3px solid green"));
   
    //another way of register an event listener, this time passing it to the config object
    Button b2 = Y.newButton(ButtonConfig.create().label("another button").render(parent).
      on("click", new EventCallback<ButtonEvent>() {       
        @Override
View Full Code Here

  /**
   * @return
   * @see org.sgx.yuigwt.yui.widget.Widget#render()
   */
  public Widget render() {
    Widget ret = _wrappedWidget().render();
    afterRender();
    return ret;
  }
View Full Code Here

   * @param parentNode
   * @return
   * @see org.sgx.yuigwt.yui.widget.Widget#render(org.sgx.yuigwt.yui.node.Node)
   */
  public Widget render(Node parentNode) {
    Widget ret = _wrappedWidget().render(parentNode);
    afterRender();
    return ret;
  }
View Full Code Here

   * @param parentNode
   * @return
   * @see org.sgx.yuigwt.yui.widget.Widget#render(java.lang.String)
   */
  public Widget render(String parentNode) {
    Widget ret = _wrappedWidget().render(parentNode);
    afterRender();
    return ret;
//    return _wrappedWidget().render(parentNode);
  }
View Full Code Here

  public void ready(final YuiContext Y) {

    final Console console1 = Y.newConsole(ConsoleConfig.create());
    console1.render();
   
    Widget button1 = Y.newButton(
      ButtonConfig.create().label("a simple button")
    ).render(parent)
   
    parent.append("<input type=\"text\" value=\"editme1\"></input><br/>" +
        "<input type=\"text\" value=\"editme2\"></input>");
View Full Code Here

      @Override
      public void call(AnimEvent e) {
        Window.alert("anim ended ");
      }
    });
    Widget button1 = Y.newButton(
      ButtonConfig.create().label("start")
    ).render(parent)
    button1.on("click", new EventCallback<ButtonEvent>() {     
      @Override
      public void call(ButtonEvent e) {
        anim1.run();       
      }
    })
View Full Code Here

    n.setStyles(Style.create().height("100px").position("relative").
        width("80px").backgroundColor("red").margin("30px"));
    Resize r = Y.newResize(ResizeConfig.create().node("#resizable1"));
   
    //and now a resizable button using Resize plugin
    Widget button = Y.newButton(ButtonConfig.create().label("resizable button").on("click", new EventCallback<EventFacade>() {
      @Override
      public void call(EventFacade e) {
      }
    })).render(parent);
    button.plug(Y.Plugin().Resize());
  }
});
}
View Full Code Here

  @Override
  public void ready(final YuiContext Y) {
final Console console = Y.newConsole().render().cast();

Widget button1 = Y.newButton(
  ButtonConfig.create().label("button1")
).render(parent);

//using "normal" yuigwt infrastructure
button1.on(new String[]{"click", "mouseover"}, new EventCallback<ButtonEvent>() {
  @Override
  public void call(ButtonEvent e) {
    console.log("1 "+e.type()+" at X="+e.domEvent().clientX());
  }
});

Widget button2 = Y.newButton(
  ButtonConfig.create().label("button2")
).render(parent);
//using util.Callback generic callback definition
button2.on("click", new Callback() {     
  @Override
  public void call(JsArrayMixed args) {
    ButtonEvent e = args.getObject(0).cast();
    console.log("2 clicked at X="+e.domEvent().clientX());
  }
});
   
Widget button3 = Y.newButton(
  ButtonConfig.create().label("button3")
).render(parent);
//creating a native javascript function
JsFunction fn = new JsFunctionBuilder() {     
  @Override
  public native final JsFunction buildFunction()/*-{
    return function(e) {
      $wnd.alert("3 "+e.type+" at: "+e.domEvent.clientX);
    }
  }-*/;
}.buildFunction();
button3.on(new String[]{"mouseover", "mouseout"}, fn);
  }
});
}
View Full Code Here

public void test(final Node parent) {
YUI.Use(new String[]{"calendar"}, new YUICallback() { 
   
  @Override
  public void ready(final YuiContext Y) {
    Widget calendar = Y.newCalendar(CalendarConfig.create().
      showNextMonth(true).
      showPrevMonth(true).
      date(JsDate.create()).
      width("500px").
      height("300px")).render(parent);
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.widget.Widget

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.