Package org.apache.myfaces.trinidadinternal.ui.beans

Examples of org.apache.myfaces.trinidadinternal.ui.beans.MarlinBean


      else
      {
        text = null;
      }

      MarlinBean currOption = _createNavigationOption(context,
                                                  navBar,
                                                  isForm,
                                                  blockStart,
                                                  currentRecordSize,
                                                  maxValue,
                                                  // Don't select
                                                  atShowAll ?
                                                    minValue - 1 : value,
                                                  sizeKey,
                                                  text,
                                                  indexNames);
      choice.addIndexedChild(currOption);
      if (Boolean.TRUE.equals(currOption.getAttributeValue(SELECTED_ATTR)))
        selectedIndex = choice.getIndexedChildCount(context) - 1;
    }

    return selectedIndex;
  }
View Full Code Here


  private UINode _createShowAllOption(
    UIXRenderingContext context,
    long             maxValue,
    boolean          atShowAll)
  {
    MarlinBean option = new MarlinBean(OPTION_NAME);
    option.setAttributeValue(VALUE_ATTR, VALUE_SHOW_ALL);
    String[] parameters = new String[]{IntegerUtils.getString(maxValue)};
    String showAllText = formatString(context,
                                      getTranslatedString(context,
                                                          _SHOW_ALL_KEY),
                                      parameters);

    option.setAttributeValue(TEXT_ATTR, showAllText);
    if (atShowAll)
      option.setAttributeValue(SELECTED_ATTR, Boolean.TRUE);

    return option;
  }
View Full Code Here

    String           sizeKey,
    Object           text,
    DataObject       indexNames
    )
  {
    MarlinBean option = new MarlinBean(OPTION_NAME);

    if (text == null)
      text = _getRangeString(context,
                             navBar,
                             blockStart,
                             blockSize,
                             maxValue,
                             indexNames);
    option.setAttributeValue(TEXT_ATTR, text);

    int actualBlockSize;

    if (maxValue == MAX_VALUE_UNKNOWN)
    {
      actualBlockSize = blockSize;
    }
    else
    {
      actualBlockSize = (int)(maxValue - blockStart + 1);
      if (actualBlockSize > blockSize)
        actualBlockSize = blockSize;
    }

    // add the value for javascript
    option.setAttributeValue(VALUE_ATTR, _getMultiDestinationURLEnd(blockStart,
                                               sizeKey,
                                               actualBlockSize,
                                               isForm));

    // select the correct one
    if ((currValue >= blockStart) &&
        (currValue <  (blockStart + blockSize)))
      option.setAttributeValue(SELECTED_ATTR, Boolean.TRUE);

    return option;
  }
View Full Code Here

    long             value,
    String           sizeKey,
    int              size
    )
  {
    MarlinBean submitButton =  new MarlinBean(SUBMIT_BUTTON_NAME);
    submitButton.setID(buttonID);
    submitButton.setAttributeValue(FORM_NAME_ATTR, formName);
    submitButton.setAttributeValue(UNVALIDATED_ATTR, !validate);
    submitButton.setAttributeValue(TEXT_ATTR, buttonText);
    submitButton.setAttributeValue(ACCESS_KEY_ATTR, buttonAccessKey);
    submitButton.setAttributeValue(NAME_VALUES_ATTR,
                                   _createKeyValueArray(eventKey,
                                                        sourceKey,
                                                        source,
                                                        valueKey,
                                                        value,
View Full Code Here

    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);
View Full Code Here

      {
        shortDesKey = _DISABLED_NEXT_DESC_KEY;
      }
    }

    MarlinBean arrow = new MarlinBean(IMAGE_NAME);
    arrow.setAttributeValue(SOURCE_ATTR, iconURI);
    arrow.setAttributeValue(SHORT_DESC_ATTR,
                            getTranslatedValue(context, shortDesKey));

    // if not a link, we're done;
    if (destination != null)
    {
      arrow.setAttributeValue(DESTINATION_ATTR, destination);
      arrow.setOnClick(onClick);
    }

    return arrow;
  }
View Full Code Here

    Object           buttonAccessKey,
    Object           destination,
    String           onClickJS
    )
  {
    MarlinBean submitButton = new MarlinBean(BUTTON_NAME);
    submitButton.setAttributeValue(TEXT_ATTR, buttonText);
    submitButton.setAttributeValue(ACCESS_KEY_ATTR, buttonAccessKey);

    if (destination != null)
      submitButton.setAttributeValue(DESTINATION_ATTR, destination.toString());
    else
      submitButton.setOnClick(onClickJS);

    return submitButton;
  }
View Full Code Here

                  implements UIConstants, XhtmlLafConstants
{
  private static UINode _createCompositeUINode()
  {

    MarlinBean globalNavigation = new MarlinBean(TABLE_LAYOUT_NAME);
    globalNavigation.setAttributeValue(WIDTH_ATTR, ONE_HUNDRED_PERCENT_ATTRIBUTE_VALUE);
    globalNavigation.addIndexedChild(_fullWidthTableRow(NAVIGATION_GLOBAL_CHILD));
    //
    // Create the page header layout
    //
    MarlinBean headerLayout = new MarlinBean(PAGE_HEADER_LAYOUT_NAME);

    headerLayout.setNamedChild(MENU_SWITCH_CHILD,
                    ContextPoppingUINode.getUINode(MENU_SWITCH_CHILD));

    headerLayout.setNamedChild(BRANDING_CHILD,
                    ContextPoppingUINode.getUINode(BRANDING_CHILD));
   
    headerLayout.setNamedChild(BRANDING_APP_CHILD,
                    ContextPoppingUINode.getUINode(BRANDING_APP_CHILD));
   
    headerLayout.setNamedChild(BRANDING_APP_CONTEXTUAL_CHILD,
                    ContextPoppingUINode.getUINode(BRANDING_APP_CONTEXTUAL_CHILD));

    headerLayout.setNamedChild(NAVIGATION1_CHILD,
                    ContextPoppingUINode.getUINode(NAVIGATION1_CHILD));

    headerLayout.setNamedChild(NAVIGATION2_CHILD, _createGlobalHeaders());

    headerLayout.setNamedChild(SEARCH_CHILD,
                    ContextPoppingUINode.getUINode(SEARCH_CHILD));

    // =-= bts a little bogus since this isn't really an attribute of PageHeader
    headerLayout.setAttributeValue(WIDTH_ATTR, "100%");

    //
    // Create layout used for locators at the top of the page
    //
    MarlinBean locatorLayout = new MarlinBean(STACK_LAYOUT_NAME);
    locatorLayout.addIndexedChild(
                   ContextPoppingUINode.getUINode(LOCATION_CHILD));
    locatorLayout.addIndexedChild(
                   ContextPoppingUINode.getUINode(INFO_USER_CHILD));
    locatorLayout.addIndexedChild(
                   ContextPoppingUINode.getUINode(MESSAGES_CHILD));
    locatorLayout.addIndexedChild(
                   ContextPoppingUINode.getUINode(INFO_SUPPLEMENTAL_CHILD));
    locatorLayout.addIndexedChild(
                   ContextPoppingUINode.getUINode(INFO_STATUS_CHILD));

    //
    // Create the content container containing all of the indexed children
    //
    //  MarlinBean contentRoot = new MarlinBean(FLOW_LAYOUT_NAME);

    // use stackLayout as the default layout as it is the layout used in
    // the desktop version.
    MarlinBean contentRoot = new MarlinBean(STACK_LAYOUT_NAME);
    contentRoot.setIndexedNodeList(RootUINodeList.getNodeList());

    //
    // add the page buttons line
    //
    MarlinBean pageButtonsLine = new MarlinBean(SEPARATOR_NAME);
    pageButtonsLine.setAttributeValue(
            RENDERED_ATTR,
             new OrBoundValue(new BoundValue[]{
         PdaHtmlLafUtils.createIsRenderedBoundValue(INFO_RETURN_CHILD)}));

    // Create the area containing the footer

    MarlinBean footerTable = new MarlinBean(TABLE_LAYOUT_NAME);
    footerTable.setAttributeValue( WIDTH_ATTR, ONE_HUNDRED_PERCENT_ATTRIBUTE_VALUE);
    footerTable.addIndexedChild(_fullWidthTableRow(APP_COPYRIGHT_CHILD));
    footerTable.addIndexedChild(_fullWidthTableRow(APP_PRIVACY_CHILD));
    footerTable.addIndexedChild(_fullWidthTableRow(APP_ABOUT_CHILD));

    MarlinBean footer = new MarlinBean(FLOW_LAYOUT_NAME);
    MarlinBean footerLine = new MarlinBean(CONTENT_FOOTER_NAME);
    footer.addIndexedChild(footerLine);
    footer.addIndexedChild(footerTable);

    BoundValue renderFooter = new OrBoundValue(new BoundValue[]{
               PdaHtmlLafUtils.createIsRenderedBoundValue(APP_PRIVACY_CHILD),
               PdaHtmlLafUtils.createIsRenderedBoundValue(APP_ABOUT_CHILD),
               PdaHtmlLafUtils.createIsRenderedBoundValue(APP_COPYRIGHT_CHILD)});
              
    footer.setAttributeValue( RENDERED_ATTR, renderFooter);

    MarlinBean content = new MarlinBean(STACK_LAYOUT_NAME);
    content.addIndexedChild(contentRoot);
    content.addIndexedChild(
                  ContextPoppingUINode.getUINode(INFO_FOOTNOTE_CHILD));


    content.addIndexedChild(pageButtonsLine);

    //
    // Add the footer children
    //
    content.addIndexedChild(
                       ContextPoppingUINode.getUINode(INFO_RETURN_CHILD));


    MarlinBean action = new MarlinBean(TABLE_LAYOUT_NAME);
    action.setAttributeValue( WIDTH_ATTR, ONE_HUNDRED_PERCENT_ATTRIBUTE_VALUE);

    MarlinBean actionButtonRow = new MarlinBean(ROW_LAYOUT_NAME);
    MarlinBean actionButtonCell = new MarlinBean(CELL_FORMAT_NAME);
    actionButtonCell.setAttributeValue( H_ALIGN_ATTR, CENTER_ATTRIBUTE_VALUE);
    actionButtonCell.addIndexedChild(
                        ContextPoppingUINode.getUINode(ACTIONS_CHILD));
    actionButtonRow.addIndexedChild( actionButtonCell);
    action.addIndexedChild( actionButtonRow);


    MarlinBean compositeRoot = new MarlinBean(FLOW_LAYOUT_NAME);

    // delegate all of the attributes to the RootAttribtueMap
    compositeRoot.setAttributeMap(RootAttributeMap.getAttributeMap());

    compositeRoot.addIndexedChild(globalNavigation);
    compositeRoot.addIndexedChild(headerLayout);
    compositeRoot.addIndexedChild(locatorLayout);
    compositeRoot.addIndexedChild(content);
    compositeRoot.addIndexedChild(action);
    compositeRoot.addIndexedChild(footer);

    return compositeRoot;
  }
View Full Code Here

   * facet name in the parameter.
   */
  private static MarlinBean _fullWidthTableRow (
    String childName)
  {
    MarlinBean row = new MarlinBean(ROW_LAYOUT_NAME);
    MarlinBean cell = new MarlinBean(CELL_FORMAT_NAME);
    cell.setAttributeValue(H_ALIGN_ATTR, CENTER_ATTRIBUTE_VALUE);
    cell.addIndexedChild(
                        ContextPoppingUINode.getUINode(childName));
    row.addIndexedChild(cell);
    return row;
  }
View Full Code Here

   * header to use if the first client global header doesn't exist or
   * isn't rendered.
   */
  private static UINode _createGlobalHeaders()
  {
    MarlinBean globalHeaders = new MarlinBean(FLOW_LAYOUT_NAME);

    //
    // add the client header
    //
    globalHeaders.addIndexedChild(
                       ContextPoppingUINode.getUINode(NAVIGATION2_CHILD));

    //
    // create and add the default header
    //
    MarlinBean defaultHeader = new MarlinBean(GLOBAL_HEADER_NAME);

    defaultHeader.setAttributeValue(
            RENDERED_ATTR,
            new NotBoundValue(
               PdaHtmlLafUtils.createIsRenderedBoundValue(NAVIGATION2_CHILD)));

    globalHeaders.addIndexedChild(defaultHeader);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.beans.MarlinBean

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.