Package org.apache.myfaces.trinidadinternal.ui

Examples of org.apache.myfaces.trinidadinternal.ui.MutableUINode


    }
  }
 
  public void clearUINodes()
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      mutableNode.clearIndexedChildren();
    }
    else
    {
      throw new UnsupportedOperationException(_LOG.getMessage(
        "ILLEGAL_TO_REMOVE_CHILDREN", _getClassName()));
View Full Code Here


        boolean immediate = Boolean.TRUE.equals(
                          stamp.getAttributes().get(UIXCommand.IMMEDIATE_KEY));
        Object destination = stamp.getAttributes().get("destination");
        component.setRowIndex(currentIndex);

        MutableUINode mutableNextButton =
        createSingleItemSubmitButton(false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     destination,
                                     ProcessUtils.getSubmitScriptCall(
                                        context,
                                        formName,
                                        eventKey,
                                        sourceKey,
                                        nameString,
                                        valueKey,
                                        selectedIndex + 1,
                                        sizeKey,
                                        1,
                                        !immediate, null, null));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
        context.setLocalProperty(_NEXT_BUTTON_KEY, nextButton);
      }
      else
View Full Code Here

      String buttonID = _getIDForFocus(context, navBar);

      if (formName == null)
      {

        MutableUINode mutableNextButton =
            createSingleItemURLButton(
                                     context,
                                     false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     getSingleDestinationURL(context,
                                                             navBar,
                                                             eventKey,
                                                             sourceKey,
                                                             nameString,
                                                             valueKey,
                                                             currentValue+1));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
      }
      else
      {

        // set the destination
        if (supportsScripting)
        {
          MutableUINode mutableNextButton =
          createSingleItemSubmitButton(
                                       context,
                                       false,
                                       buttonTextBV,
                                       buttonAccessKeyBV,
                                       getSingleDestinationSubmit(
                                                  context,
                                                  navBar,
                                                  formName,
                                                  nameString,
                                                  currentValue + 1,
                                                  true));
          if (buttonID != null)
          {
            mutableNextButton.setID(buttonID);
          }
          nextButton = mutableNextButton;
        }
        else
        {
View Full Code Here

    int              records
    )
  {
    String text = getBlockString(context, isBack, records);

    MutableUINode link;

    if (records > 0)
    {
      link = new MarlinBean(LINK_NAME);
      link.setAttributeValue(DESTINATION_ATTR, destination);
      link.setAttributeValue(ON_CLICK_ATTR, onClick);
      link.setAttributeValue(STYLE_CLASS_ATTR, NAV_BAR_ALINK_STYLE_CLASS);
    }
    else
    {
      link = new MarlinBean(STYLED_TEXT_NAME);
      link.setAttributeValue(STYLE_CLASS_ATTR, NAV_BAR_ILINK_STYLE_CLASS);
    }

    link.setAttributeValue(TEXT_ATTR, text);

    // The navBar needs its initial focus to be on the Next button,
    // according to the BLAF. Render a special id on the Next button
    // if this navBar is to have the initial focus. (unless it needs
    // initial focus, the Next button does not have an id on it)
    if (!isBack)
    {
      String linkID = _getIDForFocus(context, navBar);
      if (linkID != null)
      {
        link.setID(linkID);
      }
    }

    return link;
  }
View Full Code Here

    boolean          isBack,
    Object           buttonText,
    String           onClickJS
    )
  {
    MutableUINode submitButton = createSingleItemURLButton(
                                                    context,
                                                    isBack,
                                                    buttonText,
                                                    null);
                                                   
    submitButton.setAttributeValue(ON_CLICK_ATTR, onClickJS);
   
    return submitButton;                                  
  }
View Full Code Here

    boolean          isBack,
    Object           buttonText,
    String           onClickJS
    )
  {
    MutableUINode submitButton = _createSingleItemURLButton(
                                                    buttonText,
                                                    null);
                                                   
    submitButton.setAttributeValue(ON_CLICK_ATTR, onClickJS);
   
    return submitButton;                                  
  }
View Full Code Here

  private static UINode  _createCompositeUINode()
  {
    // add the tabs
    MarlinBean pageLayout = new MarlinBean(UIConstants.PAGE_LAYOUT_NAME);
    MutableUINode navigationGlobal =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_BUTTONS_NAME);
    pageLayout.setNamedChild(UIConstants.NAVIGATION_GLOBAL_CHILD, navigationGlobal);

    // add the bar
    MutableUINode menuTabs =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_TABS_NAME);
    menuTabs.setAttributeValue(UIConstants.LEVEL_ATTR,
                               1);
    pageLayout.setNamedChild(UIConstants.NAVIGATION1_CHILD, menuTabs);
    MutableUINode menuBar =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_BAR_NAME);
    menuBar.setAttributeValue(UIConstants.LEVEL_ATTR,
                              2);
    pageLayout.setNamedChild(UIConstants.NAVIGATION2_CHILD, menuBar);

    // add the tree

    MutableUINode navigationTree =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_NAVIGATION_TREE_NAME);
    navigationTree.setAttributeValue(UIConstants.START_LEVEL_ATTR,
                              3);

    BoundValue treeRenderedBV = new HasDataBoundValue(
                                  RootBoundValue.getBoundValue(), 3, true);
    navigationTree.setAttributeValue(UIConstants.RENDERED_ATTR, treeRenderedBV);
    // for PPR, an ID is required:
    navigationTree.setAttributeValue(UIConstants.ID_ATTR, new BoundValue()
    {
      public Object getValue(UIXRenderingContext context)
      {
        UINode pageNode = context.getParentContext().getAncestorNode(0);
        UIComponent component = pageNode.getUIComponent();
        return component.getClientId(context.getFacesContext()) +
               org.apache.myfaces.trinidadinternal.renderkit.uix.PageRenderer.TREE_SUFFIX;
      }
    }
                              );


    // add the list
    MutableUINode menuList =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_LIST_NAME);
    menuList.setAttributeValue(UIConstants.LEVEL_ATTR,
                              3);
    BoundValue listRenderedBV = new HasDataBoundValue(
                                  RootBoundValue.getBoundValue(), 3, false);
    menuList.setAttributeValue(UIConstants.RENDERED_ATTR, listRenderedBV);


    MarlinBean navigation3Flow = new MarlinBean(UIConstants.FLOW_LAYOUT_NAME);
    navigation3Flow.addIndexedChild(menuList);
    navigation3Flow.addIndexedChild(navigationTree);
    navigation3Flow.setAttributeValue(UIConstants.RENDERED_ATTR,
                           new OrBoundValue(treeRenderedBV,listRenderedBV));
    pageLayout.setNamedChild(UIConstants.NAVIGATION3_CHILD, navigation3Flow);



    // add the path
    MutableUINode navigationPath =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_NAVIGATION_PATH_NAME);

    BoundValue hasLocation =
          XhtmlLafUtils.createIsRenderedBoundValue(UIConstants.LOCATION_CHILD);
    navigationPath.setAttributeValue(UIConstants.RENDERED_ATTR,
                               new NotBoundValue(hasLocation));


    UINode location = ContextPoppingUINode.getUINode(UIConstants.LOCATION_CHILD);
    MarlinBean locationFlow = new MarlinBean(UIConstants.FLOW_LAYOUT_NAME);
View Full Code Here

      String buttonID = _getIDForFocus(context, navBar);

      if (formName == null)
      {

        MutableUINode mutableNextButton =
            createSingleItemURLButton(
                                     context,
                                     false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     getSingleDestinationURL(context,
                                                             navBar,
                                                             eventKey,
                                                             sourceKey,
                                                             nameString,
                                                             valueKey,
                                                             currentValue+1));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
      }
      else
      {

        // set the destination
        if (supportsScripting)
        {
          MutableUINode mutableNextButton =
          createSingleItemSubmitButton(
                                       context,
                                       false,
                                       buttonTextBV,
                                       buttonAccessKeyBV,
                                       getSingleDestinationSubmit(
                                                  context,
                                                  navBar,
                                                  formName,
                                                  nameString,
                                                  currentValue + 1,
                                                  true));
          if (buttonID != null)
          {
            mutableNextButton.setID(buttonID);
          }
          nextButton = mutableNextButton;
        }
        else
        {
View Full Code Here

    int              records
    )
  {
    String text = getBlockString(context, isBack, records);

    MutableUINode link;

    if (records > 0)
    {
      link = new MarlinBean(LINK_NAME);
      link.setAttributeValue(DESTINATION_ATTR, destination);
      link.setAttributeValue(ON_CLICK_ATTR, onClick);
      link.setAttributeValue(STYLE_CLASS_ATTR, NAV_BAR_ALINK_STYLE_CLASS);
    }
    else
    {
      link = new MarlinBean(STYLED_TEXT_NAME);
      link.setAttributeValue(STYLE_CLASS_ATTR, NAV_BAR_ILINK_STYLE_CLASS);
    }

    link.setAttributeValue(TEXT_ATTR, text);

    // The navBar needs its initial focus to be on the Next button,
    // according to the BLAF. Render a special id on the Next button
    // if this navBar is to have the initial focus. (unless it needs
    // initial focus, the Next button does not have an id on it)
    if (!isBack)
    {
      String linkID = _getIDForFocus(context, navBar);
      if (linkID != null)
      {
        link.setID(linkID);
      }
    }

    return link;
  }
View Full Code Here

        boolean immediate = Boolean.TRUE.equals(
                          stamp.getAttributes().get(UIXCommand.IMMEDIATE_KEY));
        Object destination = stamp.getAttributes().get("destination");
        component.setRowIndex(currentIndex);

        MutableUINode mutableNextButton =
        createSingleItemSubmitButton(false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     destination,
                                     ProcessUtils.getSubmitScriptCall(
                                        context,
                                        formName,
                                        eventKey,
                                        sourceKey,
                                        nameString,
                                        valueKey,
                                        selectedIndex + 1,
                                        sizeKey,
                                        1,
                                        !immediate, null, null));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
        context.setLocalProperty(_NEXT_BUTTON_KEY, nextButton);
      }
      else
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.MutableUINode

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.