Package org.apache.myfaces.trinidad.skin

Examples of org.apache.myfaces.trinidad.skin.Icon


      boolean leftToRight
  )
  {
    if (!isLine || !isShowLines(rc))
      return null;
    Icon icon = rc.getIcon(SkinSelectors.AF_TREE_LINE_ICON);
    return (icon == null) ? null : icon.getImageURI(context, rc).toString();
  }
View Full Code Here


  )
  {
    Object showLines = rc.getSkin().getProperty(SkinProperties.AF_TREE_SHOW_LINES);
    if (!isShowLines(rc))
      return null;
    Icon nodeBackgroundIcon = rc.getIcon(isLastSibling
        ? SkinSelectors.AF_TREE_LINE_LAST_ICON : SkinSelectors.AF_TREE_LINE_MIDDLE_ICON);
    return (nodeBackgroundIcon != null)
        ? nodeBackgroundIcon.getImageURI(context, rc).toString() : null;
  }
View Full Code Here

      String onclick
  )
      throws IOException
  {

    Icon icon = null;
    String iconURI = null;

    String backgroundIconURI;
    String nodeBackgroundIconURI;

    boolean isAbsoluteImageURI = true;

    String iconHeight = null;

    Object altText = null;

    String text = null;
   
    boolean isMacOS =
               Agent.PLATFORM_MACOS.equals(rc.getAgent().getPlatformName());
    // add in the expandability
    switch (expanded)
    {
      case NO_CHILDREN:
        icon = rc.getIcon(SkinSelectors.AF_TREE_NO_CHILDREN_ICON);
        if (icon == null || icon.getImageURI(context, rc) == null)
        {
          iconURI = TRANSPARENT_GIF;
          iconHeight = _ICON_HEIGHT;
          isAbsoluteImageURI = false;
        }
        break;
      case EXPAND_CLOSED:
        // "\u21D2"; // Double Arrow right

        if (isMacOS)
          // single arrow left
          text = rc.isRightToLeft() ? "\u2190" : "\u2192"; // single arrow right
        else if (isPDA(rc))
          //for PDAs use a simple "+" or "-" since miscellaneous unicode characters
          //are not supported
          text = "[+]"; //plus sign
        else // triangle left
          text = rc.isRightToLeft() ? "\u25C4" : "\u25BA"; // triangle right

        altText = rc.getTranslatedString(_EXPAND_TIP_KEY);
        icon = rc.getIcon(SkinSelectors.AF_TREE_COLLAPSED_ICON);
        break;
      case EXPAND_OPEN:
        //"\u21D3"; // double arrow down
        if (isMacOS)
          text = "\u2193"; // single arrow down
        else if (isPDA(rc))
          //for PDAs use a simple "+" or "-" since miscellaneous unicode characters
          //are not supported
          text = "[-]"; //plus sign
        else
          text = "\u25BC"; // triangle down

        altText = rc.getTranslatedString(_COLLAPSE_TIP_KEY);
        icon = rc.getIcon(SkinSelectors.AF_TREE_EXPANDED_ICON);
        break;
      case EXPAND_ALWAYS:
        if (isMacOS)
          text = "\u2193"; // single arrow down
        else if (isPDA(rc))
          text = "[-]"; //plus sign
        else
          text = "\u25BC"; // triangle down
        //for PDAs use a simple "+" or "-" since miscellaneous unicode character
        //s are not supported

        altText = rc.getTranslatedString(_DISABLED_COLLAPSE_TIP_KEY);
        icon = rc.getIcon(SkinSelectors.AF_TREE_EXPANDED_ICON);
        break;
    }

    if (iconURI == null && icon != null)
    {
      //This can be null so we need to check for it before doing toString
      Object o = icon.getImageURI(context, rc);
      if(o != null)
      {
        iconURI = o.toString();
      }
    }
View Full Code Here

      UIXHierarchy tree,
      int expand
  ) throws IOException
  {
    String nodeType = getNodeType(tree);
    Icon nodeIcon = getNodeIcon(rc, nodeType, expand);

    ResponseWriter writer = context.getResponseWriter();
    // render the node icon
    if (nodeIcon != null)
    {
      writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
      writer.writeAttribute(XhtmlConstants.WIDTH_ATTRIBUTE, _ICON_WIDTH, null);
      writer.writeAttribute(XhtmlConstants.HEIGHT_ATTRIBUTE, _ICON_HEIGHT, null);
      writer.writeAttribute(XhtmlConstants.VALIGN_ATTRIBUTE, XhtmlConstants.V_ALIGN_TOP,
                            null);

      _renderIcon(context, rc, nodeIcon.getImageURI(context, rc).toString(),
                  true, null, null, null);

      writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
    }
  }
View Full Code Here

    if (isRightToLeft() && !iconName.endsWith(StyleUtils.RTL_CSS_SUFFIX))
    {
      // append :rtl to the mappedIconName. If no icon with that name,
      // default to getting the icon with the original mappedIconName.
      String rtlIconName = iconName + StyleUtils.RTL_CSS_SUFFIX;
      Icon rtlIcon = skin.getIcon(rtlIconName);

      if ((rtlIcon == null) || rtlIcon.isNull())
      {
        // we want :rtl icons to default to regular icons, not a NullIcon,
        //  which is what the Skin does.
        rtlIcon = skin.getIcon(iconName);
        if (rtlIcon != null)
View Full Code Here

                 ? SkinSelectors.AF_SELECT_INPUT_DATE_NEXT_ICON_NAME
                 : SkinSelectors.AF_SELECT_INPUT_DATE_NEXT_DISABLED_ICON_NAME;
      }
    }

    Icon icon = arc.getIcon(iconName);

    // If we've got an Icon, render it
    if (icon != null)
    {
      OutputUtils.renderIcon(context,
View Full Code Here

    writer.writeText(title, "title");

    writer.endElement(XhtmlConstants.DIV_ELEMENT);

    Icon icon = rc.getIcon(SkinSelectors.AF_PANEL_POPUP_CLOSE_ICON_STYLE_CLASS);

    if (isModal(component, bean))
    {
      // Render the skinnable container div
      writer.startElement(XhtmlConstants.DIV_ELEMENT, null);
      renderStyleClass(context, rc, SkinSelectors.AF_PANEL_POPUP_CLOSE_ICON_STYLE_CLASS);

      writer.startElement(XhtmlConstants.LINK_ELEMENT, null);
      writer.writeAttribute(XhtmlConstants.HREF_ATTRIBUTE, "#", null);

      writer.writeAttribute(XhtmlConstants.ONCLICK_ATTRIBUTE,
          "TrPanelPopup.hidePopup(event); return false;",
          null);

      if (icon != null && !icon.isNull())
      {
        String closeText = rc.getTranslatedString("af_panelPopup.CLOSE");
        OutputUtils.renderIcon(context, rc, icon, closeText, null);
      }
      else
View Full Code Here

    // Note: no synchronization needed since we are in a
    // a request-specific object.
    Map<String, Icon> icons = _getRequestIcons();
    assert(icons != null);

    Icon icon = icons.get(iconName);

    if (icon == null)
    {
      icon = _skin.getIcon(iconName, false);
View Full Code Here

  {
    // First check to see if we already have an Icon registered.
    // it might be a ReferenceIcon. If so, resolve the reference and
    // register the true icon (if resolve is true)

    Icon icon = super.getIcon(iconName, false);

    if (icon != null)
    {
      if (icon == _NULL_ICON)
        return null;

      if (resolve)
      {
        // if icon is a ReferenceIcon, I need to get the actual icon, and
        // re-register it.
        if (icon instanceof ReferenceIcon)
        {
          // go find the actual icon
          Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
                                                     null);

          // register icon so we don't have to resolve reference next time.
          registerIcon(iconName, resolvedIcon);

          return resolvedIcon;
        }
      }
      return icon;
    }

    // If we don't have the icon locally, check the base skin.

    Skin baseSkin = getBaseSkin();
    // get baseSkin's icon. Don't resolve to a real icon. If it is a
    // ReferenceIcon, return the ReferenceIcon.
    icon = baseSkin.getIcon(iconName, false);

    // we found the icon on the base Skin, but it is a ReferenceIcon.
    // find the actual icon
    if (resolve)
    {
      if (icon instanceof ReferenceIcon)
      {
        Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
                                                   null);
        // register icon so we don't have to resolve reference next time.
        registerIcon(iconName, resolvedIcon);

        return resolvedIcon;
View Full Code Here

    referencedIconStack.push(refName);
    //

    // see if the referenced icon is registered already registered in this skin.
    Icon icon = super.getIcon(refName, false);

    if (icon != null)
    {
      if (icon instanceof ReferenceIcon)
      {
          Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
                                                     referencedIconStack);
          return resolvedIcon;
      }
      else
      {
        return icon;
      }
    }
    else
    {

      Skin baseSkin = getBaseSkin();
      icon = baseSkin.getIcon(refName, false);

      if (icon instanceof ReferenceIcon)
      {
        Icon resolvedIcon = _resolveReferenceIcon((ReferenceIcon)icon,
                                                   referencedIconStack);
        return resolvedIcon;
      }
      else
      {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.skin.Icon

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.