Package org.apache.myfaces.trinidadinternal.ui.data

Examples of org.apache.myfaces.trinidadinternal.ui.data.BoundValue


                  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));

View Full Code Here


    UINode backButton = null;

    // set up the back button
    if (showBackButton)
    {
      BoundValue buttonTextandAccessKeyBV =
                           new SkinTranslatedBoundValue( _SINGLE_BACK_TEXT_KEY);


      Object buttonTextBV = new AccessKeyBoundValue(buttonTextandAccessKeyBV,
                                                    false);

      Object buttonAccessKeyBV = new AccessKeyBoundValue(
                                                    buttonTextandAccessKeyBV,
                                                    true);

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

        backButton = createSingleItemSubmitButton(
                                true,
                                buttonTextBV,
                                buttonAccessKeyBV,
                                destination,
                                ProcessUtils.getSubmitScriptCall(
                                    context,
                                    formName,
                                    eventKey,
                                    sourceKey,
                                    nameString,
                                    valueKey,
                                    selectedIndex - 1,
                                    sizeKey,
                                    0,
                                    !immediate,
                                    null,
                                    null));
      }
      else
      {
        backButton = ProcessUtils.createSubmitButton(context,
                                                     buttonTextBV,
                                                     buttonAccessKeyBV,
                                                     null,
                                                     formName,
                                                     false,
                                                     eventKey,
                                                     sourceKey,
                                                     nameString,
                                                     valueKey,
                                                     selectedIndex - 1,
                                                     sizeKey,
                                                     0);
      }
    }

    UINode nextButton = null;

     // set up the next button
    if (showNextButton)
    {

      String buttonTextKey = ((totalItems == 2)
                              ? _SINGLE_CONTINUE_TEXT_KEY
                              : _SINGLE_NEXT_TEXT_KEY);

      BoundValue buttonTextandAccessKeyBV =
                           new SkinTranslatedBoundValue(buttonTextKey);


      Object buttonTextBV = new AccessKeyBoundValue( buttonTextandAccessKeyBV,
                                                     false);
View Full Code Here

{
  @Override
  protected AttributeMap createAttributeMap(String componentFamily)
  {
    AttributeMap attrMap = super.createAttributeMap(componentFamily);
    BoundValue unvalidatedBV = new PropertyBoundValue(this,
                                             CoreCommandButton.IMMEDIATE_KEY);

    BoundValue partialBV = new PropertyBoundValue(this,
                                CoreCommandButton.PARTIAL_SUBMIT_KEY);

    attrMap.setAttribute(UIConstants.PRIMARY_CLIENT_ACTION_ATTR,
                         new FireActionBoundValue(getUIXComponent(),
                                                  unvalidatedBV,
View Full Code Here

  @Override
  protected AttributeMap createAttributeMap(String componentFamily)
  {
    AttributeMap attrMap = super.createAttributeMap(componentFamily);

    BoundValue unvalidatedBV = new PropertyBoundValue(this,
                                             CoreCommandLink.IMMEDIATE_KEY);
    BoundValue partialBV = new PropertyBoundValue(this,
                                CoreCommandLink.PARTIAL_SUBMIT_KEY);                                                                

    attrMap.setAttribute(UIConstants.PRIMARY_CLIENT_ACTION_ATTR,
                         getPrimaryClientActionBoundValue(getUIXComponent(),
                                                  unvalidatedBV,
View Full Code Here

    UIXComponent component,
    BoundValue   unvalidatedBV,
    BoundValue   partialBV
  )
  {
    BoundValue bv = new FireActionBoundValue(component,
                                             unvalidatedBV,
                                             partialBV);
    return bv;
  }
View Full Code Here

    Object accessKey = null;

    if (text == null)
    {

      BoundValue buttonTextandAccessKeyBV =
        new SkinTranslatedBoundValue("PPR_TRIGGER_LABEL");


      text = new AccessKeyBoundValue( buttonTextandAccessKeyBV, false);
View Full Code Here

  private void _setURLAttribute(
    AttributeMap attrMap,
    PropertyKey  propKey,
    AttributeKey attrKey)
  {
    BoundValue propBV = new PropertyBoundValue(this, propKey);
    attrMap.setAttribute(attrKey, new URLBoundValue(propBV));
  }
View Full Code Here

    // Create the page header area
    //
    MarlinBean globalHeaders = _sCreateGlobalHeader();

    // If no start child add quickSearch
    BoundValue hasNavigation3 = BaseDesktopUtils.createIsRenderedBoundValue(NAVIGATION3_CHILD);
    BoundValue hasSearch =
                      BaseDesktopUtils.createIsRenderedBoundValue(SEARCH_CHILD);
    BoundValue hasSearchAndNoNavigation3 =
                              new AndBoundValue( new NotBoundValue(hasNavigation3),
                                                 hasSearch);
    BoundValue hasNavigation3AndSearch = new AndBoundValue( hasNavigation3, hasSearch);

    MarlinBean qsNoStartFlow = new MarlinBean(FLOW_LAYOUT_NAME);
    UINode quickSearch = ContextPoppingUINode.getUINode(SEARCH_CHILD);
    qsNoStartFlow.addIndexedChild( quickSearch );
    qsNoStartFlow.setAttributeValue(RENDERED_ATTR,
                                    hasSearchAndNoNavigation3);

    MarlinBean pageHeader = _sCreatePageHeader(globalHeaders,
                                                         qsNoStartFlow);


    // @todo if there is a navigation3 child, the search should go in the sideBar,
    // however we need a search component that will lay itself out properly
    // for the reduced space of a sideBar before we do that.
    MarlinBean startRegionLayout = new MarlinBean(SIDE_BAR_NAME);
    startRegionLayout.addIndexedChild(
                                ContextPoppingUINode.getUINode(NAVIGATION3_CHILD));

    startRegionLayout.setAttributeValue(RENDERED_ATTR, hasNavigation3);

    //
    // Create the page content area
    //

    // If a start child quickSearch rendered on the top of content area
    MarlinBean qsStartStack = new MarlinBean(STACK_LAYOUT_NAME);
    MarlinBean qsSeparator = new MarlinBean(SEPARATOR_NAME);
    qsStartStack.addIndexedChild(quickSearch);
    qsStartStack.addIndexedChild(qsSeparator);
    qsStartStack.setAttributeValue(RENDERED_ATTR, hasNavigation3AndSearch);


    //
    // Create layout used for locators at the top of the page
    //
    MarlinBean locatorLayout = new MarlinBean(STACK_LAYOUT_NAME);

    MarlinBean topSpacer = new MarlinBean(SPACER_NAME);
    topSpacer.setAttributeValue(HEIGHT_ATTR,"5");

    BoundValue locatorBoundValue =
      RootChildBoundValue.getBoundValue(LOCATION_CHILD);

    BoundValue isLocatorRendered =
      BaseDesktopUtils.createIsRenderedBoundValue(locatorBoundValue);

    BoundValue isUserInfoRendered =
      BaseDesktopUtils.createIsRenderedBoundValue(INFO_USER_CHILD);

    BoundValue isEndRendered =
      BaseDesktopUtils.createIsRenderedBoundValue(INFO_SUPPLEMENTAL_CHILD);

    BoundValue hasTrainBean =
     new PageLayoutRenderer.TreeWalkerBoundValue( locatorBoundValue,
                                                  PROCESS_TRAIN_NAME );

    BoundValue isTrainRendered =
      new AndBoundValue(isLocatorRendered,
                        hasTrainBean);


    // only render the top spacer if the Locator is rendered
    topSpacer.setAttributeValue(RENDERED_ATTR, isLocatorRendered);

    MutableUINode locatorUserInfoLayout = _sCreateLocatorUserInfoLayout(
                                        isEndRendered,
                                        isLocatorRendered,
                                        isUserInfoRendered);

    // the train separator is only rendered if the train is rendered
    MarlinBean trainSeparator = new MarlinBean(SEPARATOR_NAME);
    trainSeparator.setAttributeValue(RENDERED_ATTR, isTrainRendered);

    locatorLayout.addIndexedChild(topSpacer);
    locatorLayout.addIndexedChild(qsStartStack);
    locatorLayout.addIndexedChild(locatorUserInfoLayout);
    locatorLayout.addIndexedChild(trainSeparator);
    locatorLayout.addIndexedChild(
                             ContextPoppingUINode.getUINode( MESSAGES_CHILD ));

    //
    // Create the content footer
    //

    // if content footer child has returnNavigation child and/or
    // pageButtons child use these, otherwise
    // if the content footer child is a MarlinBean or
    // has a contentMarlinBean as a descendent
    // add it directly, otherwise create a MarlinBean and add the
    // content footer child as its indexed child

    MarlinBean contentFooterSwitcher = new MarlinBean(SWITCHER_NAME);

    BoundValue contentFooterBoundValue =
                       RootChildBoundValue.getBoundValue(CONTENT_FOOTER_CHILD);

    // Is there a MarlinBean inside of the CONTENT_FOOTER_CHILD
    BoundValue hasContentMarlinBean =
                       new PageLayoutRenderer.TreeWalkerBoundValue( contentFooterBoundValue,
                                                 CONTENT_FOOTER_NAME );

    // Create MarlinBean using what's in ACTIONS_CHILD
    // and INFO_RETURN_CHILD
    MarlinBean pageNavContentFooter = new MarlinBean(CONTENT_FOOTER_NAME);


    pageNavContentFooter.addIndexedChild(
                       ContextPoppingUINode.getUINode(ACTIONS_CHILD));
    pageNavContentFooter.setNamedChild(START_CHILD,
                       ContextPoppingUINode.getUINode(INFO_RETURN_CHILD));

    // Create MarlinBean using what's in CONTENT_FOOTER_CHILD
    MarlinBean contentMarlinBean = new MarlinBean(CONTENT_FOOTER_NAME);
    contentMarlinBean.addIndexedChild(
                       ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));

    // Use content footer created with
    // ACTIONS_CHILD and INFO_RETURN_CHILD
    contentFooterSwitcher.setNamedChild( _HAS_PAGE_NAV, pageNavContentFooter);

    // Use content footer already in CONTENT_FOOTER_CHILD
    contentFooterSwitcher.setNamedChild(
                         _HAS_CONTENT_FOOTER,
                         ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));

    // Use content footer created with what's in CONTENT_FOOTER_CHILD
    contentFooterSwitcher.setNamedChild( _NO_CONTENT_FOOTER, contentMarlinBean);

    // figure out which one to use:
    //     First Choice: Use the one created with ACTIONS_CHILD
    //                   and INFO_RETURN_CHILD if these children exist.
    //    Second Choice: Use one already in CONTENT_FOOTER_CHILD.
    //     Third Choice: Use one created with what's in CONTENT_FOOTER_CHILD
    BoundValue pageButtonsExistBV =
                      BaseDesktopUtils.createIsRenderedBoundValue(ACTIONS_CHILD);
    BoundValue returnNavExistsBV =
                  BaseDesktopUtils.createIsRenderedBoundValue(INFO_RETURN_CHILD);

    OrBoundValue newChildrenExist = new OrBoundValue( pageButtonsExistBV,
                                                      returnNavExistsBV);
View Full Code Here

  private static MarlinBean _sCreateSkipNavigationLink(
    String skipNavigationAnchor
    )
  {
    MarlinBean skipNavigationLink = new MarlinBean(LINK_NAME);
    BoundValue skipNavigationText =
      new SkinTranslatedBoundValue(_SKIP_PAST_NAVIGATION);
    skipNavigationLink.setAttributeValue(DESTINATION_ATTR, "#"+skipNavigationAnchor);
    skipNavigationLink.setAttributeValue(UIConstants.TEXT_ATTR,
                                         skipNavigationText);
    skipNavigationLink.setAttributeValue(UIConstants.RENDERED_ATTR,
View Full Code Here

  {

    // create an empty global header
    MarlinBean emptyGlobalHeader = new MarlinBean(GLOBAL_HEADER_NAME);
    // bind rendered to false if there is page header child
    BoundValue rendered = new NotBoundValue(
           BaseDesktopUtils.createIsRenderedBoundValue(NAVIGATION2_CHILD));
    emptyGlobalHeader.setAttributeValue(RENDERED_ATTR,rendered);

    MarlinBean globalHeaders = new MarlinBean(STACK_LAYOUT_NAME);
    globalHeaders.addIndexedChild(
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.data.BoundValue

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.