Package org.sgx.yuigwt.yui.widget.panel

Examples of org.sgx.yuigwt.yui.widget.panel.Panel


        }
      });

    }

    Panel panel = showPanel2(Y, headers, bodies);
    // Node pn = panel.srcNode();
    // pn.setX(pn.getX()+(80*index));
    // pn.setY(pn.getY()+(50*index));

    // now make this panel draggable by its header
View Full Code Here


  }

  public Panel showPanel(YuiContext Y, String headerContent, String bodyContent) {
    Node parent = Y.one("body");
    Node parentBody = parent.appendChild("<p></p>");
    final Panel panel1 = Y.newPanel((PanelConfig) PanelConfig.create()
    // .centered(true)
        .srcNode(parentBody).width("70%").height("400px").render(true));

    panel1.headerContent(headerContent);
    panel1.bodyContent(bodyContent);
    panel1.contentBox().setStyle("zIndex", 99999);
    panel1.contentBox().setY(10).setX(10);// Math.max(panel1.contentBox().getY()-100,
                        // 5));
    return panel1;
  }
View Full Code Here

    // now render the panel
    PanelConfig panelConfig = (PanelConfig) PanelConfig.create().centered(true).srcNode(panelEl).width("80%").height("450px");
    panelConfig.headerContent("Example Sources");
    panelConfig.bodyContent(tbEl);
    final Panel panel1 = Y.newPanel(panelConfig);
    // panel1.contentBox().setY(0);
    panel1.render();

    // make it draggable by the header.
    panel1.plug(Y.Plugin().Drag(), DragConfig.create().handles(new String[] { ".yui3-widget-hd" }));
    return panel1;
  }
View Full Code Here

        tb.on("click", new EventCallback<EventFacade>() {

          @Override
          public void call(EventFacade e) {

            final Panel panel = y.newPanel((PanelConfig) PanelConfig.create().centered(true).width("400px"));
            panel.headerContent("<h1>" + name + "</h1>");
            panel.bodyContent("<div class=\"bodyContent\"></div>");
            panel.footerContent("<i>small</i>");

            Button acceptButton = getContext().newButton(ButtonConfig.create().label("Accept").on("click", new EventCallback<ButtonEvent>() {
              @Override
              public void call(ButtonEvent e) {
                panel.hide();
              }
            })).render().cast();
            panel.addButton(acceptButton);

            panel.render(y.one("body"));
//            Node bodyNode = (Node) panel.bodyContent();
            Node bodyNode2 = panel.srcNode().one(".bodyContent");
            finalEd.render(bodyNode2);
            finalEd.load(val);

          }
        });
View Full Code Here

      public void call(CalendarEvent e) {
        Window.alert("clicked " + e.date());
      }
    });

    Panel panel1 = binderUtil.getWidget(panel1El).cast();
    panel1.show();
//    panel1.h
  }
View Full Code Here

    }

    protected void doAddNewEntity() {
      final PropertyHaverEditor2<T> entityEditor = new PropertyHaverEditor2<T>(y);

      final Panel panel = y.newPanel((PanelConfig) PanelConfig.create().centered(true).width("400px"));
      panel.headerContent("<h1>Add new " + entityName + "</h1>");
      panel.bodyContent("<div class=\"bodyContent\"></div>");
      panel.footerContent("<i>small</i>");


      Button cancelButton = y.newButton(ButtonConfig.create().label("Cancel").on("click", new EventCallback<ButtonEvent>() {
        @Override
        public void call(ButtonEvent e) {
          panel.hide();
          panel.contentBox().remove();
        }
      })).render().cast();
      panel.addButton(cancelButton);
     
      Button acceptButton = y.newButton(ButtonConfig.create().label("Accept").on("click", new EventCallback<ButtonEvent>() {
        @Override
        public void call(ButtonEvent e) {
          T edited = entityEditor.flush();
          all.add(edited);
          notifyAllChange();
          // Person1 editedPerson = (Person1) edited;
          // Window.alert("edited person name : "+editedPerson.getName());
          panel.hide();
          panel.contentBox().remove();
        }
      })).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

  @Override
  public void ready(YuiContext Y) {
    // a panel with a button which content is taken from markup
    Node parentBody = parent.appendChild("<p>This is the content of the <b>panel</b><i>jhalllll</i>. Well good day...</p>");
    final Panel panel1 = Y.newPanel((PanelConfig) PanelConfig.create().centered(true).srcNode(parentBody).width("400px").render(true));

    Button acceptButton = Y.newButton((WidgetButtonsConfig) WidgetButtonsConfig.create().label("Accept").on("click", new EventCallback<EventFacade>() {
      @Override
      public void call(EventFacade e) {
        Window.alert("clicked");
        panel1.hide();

      }
    }));
    acceptButton.render();
    panel1.addButton(acceptButton.srcNode());

    // a panel initially empty but being poblated using the panel
    // api
    Panel panel2 = Y.newPanel((PanelConfig) PanelConfig.create().xy(10, 10).srcNode(parent.appendChild("<p></p>")).width("400px").render(true));
    panel2.headerContent("<h1>Panel header string</h1>");
    panel2.bodyContent(parent.appendChild("<p>Body <b>content</b> from an other node. Sl asdkljlksajd lfklaj serfjkjd slfj klajsdk fj klaj dsf. </p>"));
    panel2.footerContent("<i>small</i>");
    panel2.align(Align.create().node(parent).points(new Point[] { Point.create(0, 0), Point.create(0, 0) }));
    panel2.render(); // apply the align

    // now make this panel draggable by its header
    panel2.plug(Y.Plugin().Drag(), DragConfig.create().handles(new String[] { ".yui3-widget-hd" }));

    // and resizable
    panel2.plug(Y.Plugin().Resize());

  }
});

}
View Full Code Here

   
     //new GalleryUtil(null);
   
    final Button button1 = getYUIBinder().getWidget(buttonEl).cast();
    final Button acceptButton = getYUIBinder().getWidget(acceptButtonEl).cast();
    final Panel panel1 = getYUIBinder().getWidget(panel1El).cast();
   
    button1.on("click", new EventCallback<EventFacade>() {
      @Override
      public void call(EventFacade e) {
        //cannot work directly in panel1.getStdModNode("body") because we cannot call asHTMLPanel() if the node is already inside a GWT Widget.
//        test.test(panel1.getStdModNode("body"));  
        Node p = y.one("body").appendChild("<div></div>");
//        p.generateID();
        test.test(p);  
       
        panel1.setStdModContent("body", p);
//        panel1.render();
        panel1.show();
      }
    });
    acceptButton.on("click", new EventCallback<EventFacade>() {
      @Override
      public void call(EventFacade e) {
        panel1.hide();
      }
    });
    
   
   
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.widget.panel.Panel

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.