Package org.sgx.yuigwt.yui.node

Examples of org.sgx.yuigwt.yui.node.Node$NodeLoadCallbackArg


      "        <td>soda</td>\n"+
      "        <td>1.00</td>\n"+
      "    </tr>\n"+
      "    </table>");
   
    Node table = Y.one("#simple");
   
    Schema schema = Schema.create().resultListLocator("tr").resultFields(new Field[]{
      Field.create().key("beverage").locator("td[1]"),
      Field.create().key("price").locator("td[2]")
    });
   
    DataSchemaResult ret = Y.DataSchemaXML().apply(schema, table.getDOMNode());
   
    if(ret.error()!=null)
      throw new JavaScriptException(ret.error());
    Window.alert(Y.dump(ret));
     
View Full Code Here


@Override
public void test(final Node parent) {
YUI.Use(new String[]{"button", "imageloader"}, new YUICallback() {
  @Override
  public void ready(final YuiContext Y) {
    Node trigger = parent.appendChild("<p id=\"trigger1\">clickme will trigger or wait 5s</p>");
    Node img = parent.appendChild("<p id=\"delayedImg\">this is a<br/>delayed img</p>");
    ImgLoadGroup myFirstGroup = Y.newImgLoadGroup(ImgLoadGroupConfig.create().timeLimit(5));
    myFirstGroup.registerImage(ImgLoadImgObjConfig.create().
      domId("delayedImg").
      bgUrl("http://code.google.com/p/yuigwt/logo"));
View Full Code Here

YUI.Use(new String[]{"transition"}, new YUICallback() {
  @Override
  public void ready(final YuiContext Y) {
   
    //rebuilding parent node with Y.one(parent.getDOMNode()) so poblate is available in this yui sandbox
    Node node1 = Y.one(parent.getDOMNode()).appendChild("<p>The online cache tester: </p>");
    node1.setStyles(Style.create().backgroundColor("red").display("block").
      height("300px").width("100px"));
   
    node1.transition(Transition.create().
      duration(1).easing("ease-out").delay(1).
      width(TransitionVal.create("300px").easing(Transition.EASING_EASE_IN)).
      height(TransitionVal.create("100px").easing(Transition.EASING_EASE_OUT))
    );
  }
View Full Code Here

public void test(final Node parent) {
YUI.Use(new String[]{"dd-drag", "console", "dd-plugin"}, new YUICallback() {

  @Override
  public void ready(final YuiContext Y) {
    Node node1 = parent.appendChild("<p>dragme1</p>");
    Drag dd = Y.newDDDrag(DragConfig.create().node(node1));
   
    //now a console dragable only at its title - using drag handle
    final Console console1 = Y.newConsole(ConsoleConfig.create()).render().cast();
    console1.plug(Y.Plugin().Drag(), DragConfig.create().handles(new String[]{"h4"}));
View Full Code Here

  @UiField MainMenu mainMenu;
 
  public UIBinderComposing(YuiContext y) {
    super(y);
    //not yui binding required : we can start working with the MainMenu widget right away
    Node n = y.one(mainMenu.getElement());
    n.delegate("click", new NodeEventDelegateCallback() {
     
      @Override
      public void call(Node n, YuiEvent evt, Object arg) {
        Window.alert("anchor clicked");
      }
View Full Code Here

    /* ahaha - we need to work with a new parent node instance so we use Y.one(parent.getDOMNode()).
     * This is because we are loading the module "node-event-simulate" in this new / inner YUI sandbox -
     * we need to recreate  another instance of the parent so this node plugin is loaded in the new element to work with.
     * @see http://yuilibrary.com/forum/viewtopic.php?f=92&t=10439&p=34110#p34110
     * */
    Node el1 = Y.one(parent.getDOMNode()).appendChild("<b>SampleEl</b>");
    //now we are sure that el2 Node has the "node-event-simulate" plugin loaded
   
    el1.on("click", new NodeEventCallback() {     
      @Override
      public void call(YuiEvent e) {
        Window.alert("simulated click. AltKey is "+e.altlKey()+" - clientX is "+e.clientX());
      }
    });
    el1.on("keydown", new NodeEventCallback() {
     
      @Override
      public void call(YuiEvent e) {
        Window.alert("keydown simulate keycode is "+e.keyCode());
      }
    });
   
    el1.simulate("click", YuiEvent.create().altlKey(true).clientX(22).clientY(23));
    el1.simulate("keydown", YuiEvent.create().keyCode(97));
   
  }
});
}
View Full Code Here

  public void ready(final YuiContext Y) {

    final Console console1 = Y.newConsole(ConsoleConfig.create());
    console1.render();
   
    Node sv1Node = parent.appendChild("<div id=\"scrollview1\"></div>");    
   
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < 100; i++) {
      sb.append("<p>This is a long line "+i+" </p>");
    }
    sv1Node.set("innerHTML", sb.toString());
   
    sv1 = Y.newScrollView(ScrollViewConfig.create().
      flick(Flick.create().minDistance(8).minVelocity(0.3).axis("y")).
      srcNode(sv1Node).height("100px"));
    sv1.render();
View Full Code Here

    public void render(Node parent) {
      GridRow row = new GridRow();
      row.add(new GridEntry("u-7-24", "left"));
      row.add(new GridEntry("u-17-24", "right"));
      row.render(y, parent);
      Node leftPanel = row.getSource().one(".left"), rightPanel = row.getSource().one(".right");

      editorPanel = rightPanel.appendChild("<div></div>");

      y.newButton(ButtonConfig.create().label("Add new " + entityName).render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
        @Override
        public void call(ButtonEvent e) {
          doAddNewEntity();
        }
      }));
      y.newButton(ButtonConfig.create().label("Show All " + entityName +"s").render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
        @Override
        public void call(ButtonEvent e) {
          JsArray<JavaScriptObject> data = getDataTableData(all);
          resultTable.data(data);
          resultTable.caption("All "+entityName+"s");
        }
      }));
      parent.append("<p></p>"); //separator
      y.newButton(ButtonConfig.create().label("Search " + entityName +"s").render(leftPanel).on("click", new EventCallback<ButtonEvent>() {
        @Override
        public void call(ButtonEvent e) {
          String keywords = ac.value();
          List<T> results = search(keywords);
          JsArray dtResults = toDataTableSource(results);
          resultTable.data(dtResults);
          resultTable.render();
          resultTable.caption("results for "+keywords);
        }
      }));
      acInput = leftPanel.appendChild("<input type=\"text\"></input>");
      ac = y.newAutoComplete(AutoCompleteConfig.create()
        .resultHighlighter("phraseMatch").resultFilters("phraseMatch")
        .inputNode(acInput)
//        .source(getAllAutocompleteNames()
      );
View Full Code Here

      })).render().cast();
      panel.addButton(acceptButton);
     

      panel.render(y.one("body"));
      Node bodyNode2 = panel.srcNode().one(".bodyContent");
      entityEditor.render(bodyNode2);
      entityEditor.load(sampleEntity);
    }
View Full Code Here

YUI.Use(new String[]{"node"}, new YUICallback() { 
   
  @Override
  public void ready(final YuiContext Y) {
    //create a node from another node (parent) - only simple types
    Node child1 = parent.appendChild("<div></div>");
   
    //cerate an arbitrary deepth html markup inside a node
    child1.append("<span><b id='hello'>hello</b> world</span>");
    Node hello = parent.one("#hello");
   
    //TODO: select using css3-selectors example
   
    //test descendant - contains()
    System.out.println(parent.contains(child1));
   
    //test ancestor
    Node parentb = child1.ancestor(new Node.AncestorCallback() {
     
      @Override
      public boolean call(Node n) {
        return n == parent;
      }
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.node.Node$NodeLoadCallbackArg

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.