Examples of UITab


Examples of org.richfaces.component.UITab

    }

    public void encodeBegin(FacesContext context, UIComponent component)
            throws IOException {

        UITab tab = (UITab) component;
        if (shouldRenderTab(tab)) {
            super.encodeBegin(context, component);
        }
    }
View Full Code Here

Examples of org.richfaces.component.UITab

    }

    public void encodeEnd(FacesContext context, UIComponent component)
            throws IOException {

        UITab tab = (UITab) component;
        if (shouldRenderTab(tab)) {
            super.encodeEnd(context, component);
        }
    }
View Full Code Here

Examples of org.richfaces.component.UITab

        }
    }

    public void encodeChildren(FacesContext context, UIComponent component) throws IOException {

        UITab tab = (UITab) component;
        if (shouldRenderTab(tab)) {
            if ((tab.getChildren() != null) && (tab.getChildren().size() > 0)) {
                renderChildren(context, component);
            } else {
                ResponseWriter out = context.getResponseWriter();
                out.write(" ");
            }
View Full Code Here

Examples of org.richfaces.component.UITab

        UITabPanel panel = (UITabPanel) component;

        String clientId = component.getClientId(context);
        Map requestParameterMap = context.getExternalContext().getRequestParameterMap();

        UITab eventTab = null;

        for (Iterator tabsIterator = panel.getRenderedTabs();
             tabsIterator.hasNext() && eventTab == null;) {

            UITab tab = (UITab) tabsIterator.next();
            if (tab.isDisabled()) {
                continue;
            }

            String tabClientId = tab.getClientId(context);
            if (null != requestParameterMap.get(tabClientId) ||
                    null != requestParameterMap.get(tabClientId + "_server_submit"))
            {

                eventTab = tab;
View Full Code Here

Examples of org.richfaces.component.UITab

        tabPanel.setRenderedValue(null);
       
        Object checkedValue = checkValue(tabPanel.getValue());

        UITabPanel pane = tabPanel;
        UITab activeTab = null;

        TabsIteratorHelper helper = new TabsIteratorHelper(pane.getRenderedTabs(), checkedValue);
        activeTab = helper.getTab();

        if (activeTab == null) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel has no enabled or rendered tabs!";
          context.getExternalContext().log(message);
          return ;
        }

        if (helper.isFallback()) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel [@selectedTab=" + checkedValue +
              "] has no enabled or rendered tab with such name. Tab: " + activeTab.getName() +
              " will be used instead!";
          context.getExternalContext().log(message);
          tabPanel.setRenderedValue(activeTab.getName());
      } else if (checkedValue == null) {
          tabPanel.setRenderedValue(activeTab.getName());
      } else {
        tabPanel.setRenderedValue(null);
      }
       
        helper = null;

        ArrayList tabs = new ArrayList();
        boolean clientSide = UISwitchablePanel.CLIENT_METHOD.equals(pane.getSwitchType());

        TabInfoCollector tabInfoCollector = getTabInfoCollector();
       
        UITab prevTab = null;
       
        for (Iterator iter = pane.getRenderedTabs(); iter.hasNext();) {
            UITab tab = (UITab) iter.next();
            boolean active = activeTab == tab;
            tab.setActive(active);

            if (!clientSide) {
                clientSide = UISwitchablePanel.CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault());
            }
           
            if(prevTab != null){
              if(prevTab.getName().equals(tab.getName())){
                throw  new FacesException(TABS_WITH_SAME_NAMES_ERROR);
                 };
            }
                       
            tab.encodeTab(context, active);

            if (!tab.isDisabled()) {
                tabs.add(tabInfoCollector.collectTabInfo(context, tab));
            }
           
            prevTab = tab;
        }
View Full Code Here

Examples of org.richfaces.component.UITab

      this.tabs = tabs;
     
      if (name != null) {
        //findTabByName
        while (tabs.hasNext()) {
          UITab tab = nextTab();
          if (name.equals(tab.getName())) {
            this.namedTab = tab;
            break;
          }
        }
      }
     
      if (namedTab == null) {
        if (name != null) {
                //tried but failed
          fallback = true;
        }
       
        this.namedTab = findAnyTab();
      } else if (namedTab.isDisabled()) {
            UITab tab = findAnyTab();
            if (this.namedTab != tab && tab != null && !tab.isDisabled()) {
                fallback = true;
                this.namedTab = tab;
            } else {
              //use disabled tab found by name
            }
View Full Code Here

Examples of org.richfaces.component.UITab

            }
      }
    }
   
    private UITab nextTab() {
      UITab tab = (UITab) tabs.next();
     
      if (firstApplicableTab == null) {
        firstApplicableTab = tab;
      } else if (firstApplicableTab.isDisabled() && !tab.isDisabled()) {
        //more appropriate
        firstApplicableTab = tab;
      }
     
      return tab;
View Full Code Here

Examples of org.richfaces.component.UITab

        UITabPanel panel = (UITabPanel) component;

        String clientId = component.getClientId(context);
        Map requestParameterMap = context.getExternalContext().getRequestParameterMap();

        UITab eventTab = null;

        for (Iterator tabsIterator = panel.getRenderedTabs();
             tabsIterator.hasNext() && eventTab == null;) {

            UITab tab = (UITab) tabsIterator.next();
            if (tab.isDisabled()) {
                continue;
            }

            String tabClientId = tab.getClientId(context);
            if (null != requestParameterMap.get(tabClientId) ||
                    null != requestParameterMap.get(tabClientId + "_server_submit"))
            {

                eventTab = tab;
View Full Code Here

Examples of org.richfaces.component.UITab

        tabPanel.setRenderedValue(null);
       
        Object checkedValue = checkValue(tabPanel.getValue());

        UITabPanel pane = tabPanel;
        UITab activeTab = null;

        TabsIteratorHelper helper = new TabsIteratorHelper(pane.getRenderedTabs(), checkedValue);
        activeTab = helper.getTab();

        if (activeTab == null) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel has no enabled or rendered tabs!";
          context.getExternalContext().log(message);
          return ;
        }

        if (helper.isFallback()) {
          Object label = MessageUtil.getLabel(context, tabPanel);
          String message = label + ": tab panel [@selectedTab=" + checkedValue +
              "] has no enabled or rendered tab with such name. Tab: " + activeTab.getName() +
              " will be used instead!";
          context.getExternalContext().log(message);
          tabPanel.setRenderedValue(activeTab.getName());
      } else if (checkedValue == null) {
          tabPanel.setRenderedValue(activeTab.getName());
      } else {
        tabPanel.setRenderedValue(null);
      }
       
        helper = null;

        ArrayList tabs = new ArrayList();
        boolean clientSide = UISwitchablePanel.CLIENT_METHOD.equals(pane.getSwitchType());

        TabInfoCollector tabInfoCollector = getTabInfoCollector();
       
        UITab prevTab = null;
       
        for (Iterator iter = pane.getRenderedTabs(); iter.hasNext();) {
            UITab tab = (UITab) iter.next();
            boolean active = activeTab == tab;
            tab.setActive(active);

            if (!clientSide) {
                clientSide = UISwitchablePanel.CLIENT_METHOD.equals(tab.getSwitchTypeOrDefault());
            }
           
            if(prevTab != null){
              if(prevTab.getName().equals(tab.getName())){
                throw  new FacesException(TABS_WITH_SAME_NAMES_ERROR);
                 };
            }
                       
            tab.encodeTab(context, active);

            if (!tab.isDisabled()) {
                tabs.add(tabInfoCollector.collectTabInfo(context, tab));
            }
           
            prevTab = tab;
        }
View Full Code Here

Examples of org.richfaces.component.UITab

      this.tabs = tabs;
     
      if (name != null) {
        //findTabByName
        while (tabs.hasNext()) {
          UITab tab = nextTab();
          if (name.equals(tab.getName())) {
            this.namedTab = tab;
            break;
          }
        }
      }
     
      if (namedTab == null) {
        if (name != null) {
                //tried but failed
          fallback = true;
        }
       
        this.namedTab = findAnyTab();
      } else if (namedTab.isDisabled()) {
            UITab tab = findAnyTab();
            if (this.namedTab != tab && tab != null && !tab.isDisabled()) {
                fallback = true;
                this.namedTab = tab;
            } else {
              //use disabled tab found by name
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.