Package org.sgx.yuigwt.yui.widget.tabview

Examples of org.sgx.yuigwt.yui.widget.tabview.TabView


    final Console console = Y.newConsole(ConsoleConfig.create() );
    console.render();
   
    final HistoryBase history = Y.newHistoryHash();
   
    final TabView tb = Y.newTabView(TabViewConfig.create(new TabConfig[]{
      TabConfig.create().label("tab1").content("<p>11111111111 foo content</p>"),
      TabConfig.create().label("tab2").content("<p>2222222222222222<b>Hello</b>foo <i>content</i></p>"),
      TabConfig.create().label("tab3").content("<p>3333333333333<b>ben parker</b>foo <i>holla dooba do</i></p>"),
    }));
    tb.render(parent);
   
    tb.after("selectionChange", new EventCallback<TabViewEvent>() {

      @Override
      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+"");
      }
    });    
   
    tb.selectChild(parseInt(history.get("tab"), 0));
    Y.on("history:change", new EventCallback<HistoryEvent>() {
      @Override
      public void call(HistoryEvent e) {
        // Ignore changes we make ourselves, since we don't need
          // to update the selection state for those. We're only
          // interested in outside changes, such as the ones generated
          // when the user clicks the browser's back or forward buttons.
        if(e.src().equals(Y.HistoryHash().SRC_HASH())) {
          if(e.changed().objGetObj("tab")!=null) {
            //e.changed.tab.newVal is a string containing the tab index
            int i = parseInt(e.changed().objGetObj("tab").objGetString("newVal"), 0);         
            tb.selectChild(i);
          }
          else if(e.removed().objGetString("tab")!=null) {
            // The tab selection was removed in the new state, so
              // select the first tab by default.
            tb.selectChild(0);
          }
          else {
          }
        }
      }
View Full Code Here


        Test test = util.getTestByName(inputEl.get("value"));
        setCurrentTest(test);
      }
    });

    TabView tb = Y.newTabView(TabViewConfig.create(new TabConfig[] {
        // TabConfig.create().label("Categories TreeView").content("<div id=\"testcategoriesTreeView\"></div>"),
        TabConfig.create().label("Categories Accordion").content("<div id=\"testcategories\"></div>"),
        TabConfig.create().label("all").content("<div id=\"testall\"></div>") }));
    tb.render(getNavContent());

    getNavContent().setStyles(Style.create().overflow("scroll"));

    drawAccordionTest(Y, Y.one("#testcategories"));
    drawAllTest(Y, Y.one("#testall"));

    tb.selectChild(0);

  }
View Full Code Here

    for (int i = 0; i < tabConfig.length; i++) {
      String header = headerContent.get(i); // [i];
      String body = bodyContent.get(i); // [i];
      tabConfig[i] = TabConfig.create().label(header).content(body);
    }
    final TabView tb = Y.newTabView(TabViewConfig.create(tabConfig));
    tb.render(tbEl);

    // now render the panel
    PanelConfig panelConfig = (PanelConfig) PanelConfig.create().centered(true).srcNode(panelEl).width("80%").height("450px");
    panelConfig.headerContent("Example Sources");
    panelConfig.bodyContent(tbEl);
View Full Code Here

    for (int i = 0; i < tabConfig.length; i++) {
      String header = headers.get(i); // [i];
      String body = bodies.get(i); // [i];
      tabConfig[i] = TabConfig.create().label(header).content(body);
    }
    final TabView tb = y.newTabView(TabViewConfig.create(tabConfig));
    tb.render(parent);
    UIBinderUserGuide.prettyPrint();
  }
View Full Code Here

  @Override
  public void ready(final YuiContext Y) {
   
    parent.append("<p id=\"sometabcontent\">I will be a tab content some day</p>");
   
    final TabView tb = Y.newTabView(TabViewConfig.create(new TabConfig[]{
      TabConfig.create().label("foo").content("<p>foo content</p>"),
      TabConfig.create().label("bar").content("<p><b>Hello</b>foo <i>content</i></p>"),
      TabConfig.create().label("ben").content("<p><b>ben parker</b>foo <i>holla dooba do</i></p>"),
      TabConfig.create().label("from markup").content(Y.one("#sometabcontent")),
    }));
   
    tb.render(parent);
   
    tb.selectChild(1);
   
//    Y.newButton(ButtonConfig.create().label("add new tab").render(parent).
//      on("click", new EventCallback<ButtonEvent>() {       
//        @Override
//        public void call(ButtonEvent e) {
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.widget.tabview.TabView

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.