Examples of MarlinBean


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

    BoundValue isLocatorRendered,
    BoundValue isUserInfoRendered
    )
  {
    // render table only if userInfo and no end region
    MarlinBean locatorUserTable = _sCreateLocatorUserInfoTable();
    BoundValue isUserInfoAndNoEnd = new AndBoundValue(isUserInfoRendered,
                                    new NotBoundValue(isEndRendered));
    locatorUserTable.setAttributeValue(RENDERED_ATTR, isUserInfoAndNoEnd);

    // render only the locator if locator and (no userInfo or end)
    MarlinBean locatorOnlyLayout = new MarlinBean(FLOW_LAYOUT_NAME);
    locatorOnlyLayout.addIndexedChild(
                        ContextPoppingUINode.getUINode(LOCATION_CHILD));
    BoundValue isEndOrNoUserInfo =
                    new OrBoundValue(isEndRendered,
                      new NotBoundValue(isUserInfoRendered));
    locatorOnlyLayout.setAttributeValue(
                        RENDERED_ATTR,
                          new AndBoundValue(isLocatorRendered,
                                              isEndOrNoUserInfo));
    // place these two possibilities in a flowLayoutBean
    // one or the other child will be rendered
    MarlinBean locatorUserLayout = new MarlinBean(FLOW_LAYOUT_NAME);
    locatorUserLayout.addIndexedChild(locatorUserTable);
    locatorUserLayout.addIndexedChild(locatorOnlyLayout);

    locatorUserLayout.setAttributeValue(
                          RENDERED_ATTR,
                          new OrBoundValue(isLocatorRendered,
                                           isUserInfoAndNoEnd));
    return locatorUserLayout;
  }
View Full Code Here

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

    BoundValue shortDescBoundValue =
      new SkinTranslatedBoundValue(_GO_BUTTON_TIP_KEY);
    BoundValue onClickBoundValue =
                       new ContextPropertyBoundValue( MARLIN_NAMESPACE,
                                                      _ON_CLICK_PROPERTY);
    MarlinBean button = new MarlinBean(BUTTON_NAME);
    button.setAttributeValue(TEXT_ATTR, buttonTextBV);
    button.setAttributeValue(ACCESS_KEY_ATTR, buttonAccessKeyBV);
    button.setAttributeValue(SHORT_DESC_ATTR, shortDescBoundValue);
    button.setAttributeValue(ON_CLICK_ATTR, onClickBoundValue);

    return button;
  }
View Full Code Here

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

    Object           buttonText,
    Object           buttonAccessKey,
    String           destinationURL
    )
  {
    MarlinBean urlButton = new MarlinBean(BUTTON_NAME);

    urlButton.setAttributeValue(TEXT_ATTR, buttonText);
    urlButton.setAttributeValue(ACCESS_KEY_ATTR, buttonAccessKey);
    urlButton.setAttributeValue(DESTINATION_ATTR, destinationURL);

    return urlButton;
  }
View Full Code Here

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

    Object           buttonText,
    Object           buttonAccessKey,
    String           onClickJS
    )
  {
    MarlinBean submitButton = new MarlinBean(BUTTON_NAME);

    submitButton.setAttributeValue(TEXT_ATTR, buttonText);
    submitButton.setAttributeValue(ACCESS_KEY_ATTR, buttonAccessKey);

    submitButton.setOnClick(onClickJS);

    return submitButton;
  }
View Full Code Here

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

                                             currentValue,
                                             SINGLE_STEP,
                                             totalItems,
                                             null);

        MarlinBean stepLabel = new MarlinBean(STYLED_TEXT_NAME);
        stepLabel.setAttributeValue(TEXT_ATTR, rangeString);
        stepLabel.setStyleClass(NAV_BAR_VIEW_STYLE_CLASS);
        stepLabel.render(context);
      }
    }
    else
    {
      // Gather the children
      DataObjectList links = LinkDataObject.getLinkDataList(context,
                                                            navBar);
      MarlinBean     choice = new MarlinBean(CHOICE_NAME);

      int maxVisited = (int) currentValue;
      Object maxVisitedObj = navBar.getAttributeValue(context,
                                                      MAX_VISITED_ATTR);
      if (maxVisitedObj instanceof Number)
        maxVisited = ((Number) maxVisitedObj).intValue();

      // Sanity check the "maxVisited" attribute
      maxVisited = Math.min(maxVisited,
                            links == null ? 0 : links.getLength());
      // Add one option per link, but only go up to the "maxVisited"
      // value.  (BTW, since maxVisited is 1-indexed, but i is 0-indexed,
      // this is an _inclusive_ range here)
      for (int i = 0; i < maxVisited; i++)
      {
        DataObject link = links.getItem(i);
        MarlinBean option = new MarlinBean(OPTION_NAME);
        option.setAttributeValue(TEXT_ATTR,
                                 link.selectValue(context, TEXT_ATTR));
        option.setAttributeValue(VALUE_ATTR, IntegerUtils.getString(i + 1));

        if (currentValue == i + 1)
          option.setAttributeValue(SELECTED_ATTR, Boolean.TRUE);
        choice.addIndexedChild(option);
      }

      if (choice.getIndexedChildCount(context) > 0)
      {
View Full Code Here

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

                                           currentValue,
                                           blockSize,
                                           maxValue,
                                           null);

      MarlinBean rangeLabel = new MarlinBean(STYLED_TEXT_NAME);
     
      rangeLabel.setAttributeValue(TEXT_ATTR, rangeString);
      rangeLabel.setAttributeValue(STYLE_CLASS_ATTR, NAV_BAR_VIEW_STYLE_CLASS);

      rangeNode = rangeLabel;
    }
    else
    {
      // we know the size, so use the choice control
      MarlinBean choice = new MarlinBean(CHOICE_NAME);

      choice.setAttributeValue(SHORT_DESC_ATTR,
                               getTranslatedValue(context, _CHOICE_TIP_KEY));

      String onChange = null;
      int selectedIndex;

      if (form == null)
      {
        // Bug #1765747: if we're trying to render a choice,
        // Netscape will get very unhappy if there isn't a form,
        // and render wacky output that pretty much trashes the
        // navbar.
        // If a client was _directly_ adding a choice, then this
        // would be their fault, and we wouldn't try to work around
        // it.  But the NavigationBar implicitly adds the choice
        // for them, and the Back/Next buttons are still useable
        // even without the choice.  So, the nice thing to do
        // is just make the choice read-only.
        if (requiresForm(context))
        {
          if (getParentFormName(context) == null)
          {
            // No form - turn on read-only
            choice.setAttributeValue(READ_ONLY_ATTR, Boolean.TRUE);
          }
        }

        // create each of the choice options for parameterized URLs
        selectedIndex = _addNavigationOptions(context, navBar, choice, false,
                                          minValue, maxValue, currentValue,
                                          blockSize, sizeKey);
        int count = choice.getIndexedChildCount(context);
        if (count > 1)
        {
          onChange = _getChoiceOnChange(context,
                                        destination,
                                        sourceKey,
                                        eventKey,
                                        name,
                                        partialTargets,
                                        partialTargetsKey);
        }
        else
        {
          choice.setAttributeValue(READ_ONLY_ATTR, Boolean.TRUE);
        }
      }
      else
      {
        // create each of the choice options for form submit
        selectedIndex = _addNavigationOptions(context, navBar, choice, true,
                                          minValue, maxValue, currentValue,
                                          blockSize, sizeKey);
        int count = choice.getIndexedChildCount(context);
        if (count > 1)
        {
          onChange = _getChoiceOnChangeFormSubmitted(
                        context,
                        navBar,
                        form,
                        eventKey,
                        sourceKey,
                        name,
                        partialTargetsKey,
                        partialTargets);
        }
        else
        {
          choice.setAttributeValue(READ_ONLY_ATTR, Boolean.TRUE);
        }
      }

      if (onChange != null)
      {
        // set the onchange handler
        choice.setAttributeValue(ON_CHANGE_ATTR, onChange);

        // set the onfocus handler to save the initial value
        choice.setAttributeValue(ON_FOCUS_ATTR, _CHOICE_FORM_ON_FOCUS);
      }

      if (supportsID(context) &&
          (selectedIndex >= 0) &&
          !Boolean.TRUE.equals(choice.getAttributeValue(READ_ONLY_ATTR)))
      {
        String choiceId = XhtmlLafUtils.generateUniqueID(context);
        choice.setID(choiceId);

        StringBuffer text = new StringBuffer(26 + choiceId.length());
        text.append("_setSelectIndexById(\"");
        text.append(choiceId);
        text.append("\",");
        text.append(IntegerUtils.getString(selectedIndex));
        text.append(")");

        MarlinBean sb = new MarlinBean(SCRIPT_NAME);
        sb.setAttributeValue(TEXT_ATTR, text.toString());

        MarlinBean flb = new MarlinBean(FLOW_LAYOUT_NAME);
        flb.addIndexedChild(choice);
        flb.addIndexedChild(sb);

        rangeNode = flb;
      }
      else
      {
View Full Code Here

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

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

  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

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

    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

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

    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
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.