Examples of Skin


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

  {
    iconName = getSkinResourceMappedKey(iconName);
    if (iconName == null)
      return null;

    Skin skin = getSkin();

    // If we're in right-to-left, and the code asking us hasn't
    // already slapped on a right-to-left suffix, then go looking
    // in right-to-left land
    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)
        {
          // cache regular icon so we don't need to get it again!
          skin.registerIcon(rtlIconName, rtlIcon);
        }
      }

      return rtlIcon;
    }
    else
    {
      return skin.getIcon(iconName);
    }
  }
View Full Code Here

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

      if (_LOG.isWarning())
        _LOG.warning("There is no SkinFactory");
      return;
    }

    Skin skin = null;

    // see if there is a skinID on the requestParameterMap. If there is, then
    // we want to use that skin. Otherwise, use find the skin as usual, using the portlet
    // renderKitId.
    if (CoreRenderKit.OUTPUT_MODE_PORTLET.equals(getOutputMode()))
View Full Code Here

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

    )
  {
    String mappedIconName = getSkinResourceMappedKey(iconName);
    Icon rtlIcon = null;
    Icon defaultRTLIcon = null;
    Skin skin = getSkin();
    if (mappedIconName != null)
    {
      if (getLocaleContext().isRightToLeft() &&
          (!mappedIconName.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 = mappedIconName+StyleUtils.RTL_CSS_SUFFIX;
        // @todo I could optimize this a bit by having a method on SkinExtension
        // which doesn't create a NullIcon when the icon is not found, if I
        // know I want to set it to something else anyway.
        rtlIcon = skin.getIcon(rtlIconName);

        if (rtlIcon == null)
        {
          // we want :rtl icons to default to regular icons, not a NullIcon,
          //  which is what the Skin does.
          // Couldn't find rtl icon, so default it to the regular icon
          defaultRTLIcon = skin.getIcon(mappedIconName);
          if (defaultRTLIcon != null)
          {
            // cache regular icon so we don't need to get it again!
            skin.registerIcon(rtlIconName, defaultRTLIcon);
          }

        }
        return (rtlIcon != null) ? rtlIcon : defaultRTLIcon;

      }
      else
      {
        // no rtl icon
        return skin.getIcon(mappedIconName);
      }


    }
    else
View Full Code Here

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

    if (icons == null)
    {
      // Next, check to see if the IconData has already been
      // stored on the Skin
      Skin skin = context.getSkin();
      icons = (IconData)skin.getProperty(_ICONS_KEY);
      Icon enabledStart = context.getIcon(
                                    AF_MENU_TABS_ENABLED_START_ICON_NAME);
  
      if (icons == null || enabledStart == null
                        || !enabledStart.equals(icons.enabledStart))
      {
        // If we still haven't found the IconData, create it now
        icons = _createIconData(context);

        // Store the IconData as a property on the Skin,
        // so that we don't have to re-create it next time round
        skin.setProperty(_ICONS_KEY, icons);

        // Store the IconData as a local property, since we'll be
        // looking it up many times for each globalHeader render.
        context.setLocalProperty(_ICONS_KEY, icons);
      }
View Full Code Here

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

    UIXRenderingContext context
    )
  {
    // Check to see whether we have already created
    // the IconData for this background color
    Skin skin = context.getSkin();
    IconData icons    = (IconData)skin.getProperty(_ICONS_KEY);
    Icon bottomStart  = context.getIcon(AF_MESSAGES_BOTTOM_START_ICON_NAME);
    // Add check to see if cached icon is same as icon required for a composite
    // context. Else re-create
    if (icons == null || bottomStart == null ||!(icons.bottomStart.equals(bottomStart)))
    {
      // If we haven't created the IconData yet, create it now

      Icon bottomEnd        = context.getIcon(
                                    AF_MESSAGES_BOTTOM_END_ICON_NAME);
      Icon bottomBackground = context.getIcon(
                                    AF_MESSAGES_BOTTOM_BACKGROUND_ICON_NAME);
      Icon topStart         = context.getIcon(
                                    AF_MESSAGES_TOP_START_ICON_NAME);
      Icon topEnd           = context.getIcon(
                                    AF_MESSAGES_TOP_END_ICON_NAME);
      Icon topBackground    = context.getIcon(
                                    AF_MESSAGES_TOP_BACKGROUND_ICON_NAME);
      Icon startBackground  = context.getIcon(
                                    AF_MESSAGES_START_BACKGROUND_ICON_NAME);
      Icon endBackground    = context.getIcon(
                                    AF_MESSAGES_END_BACKGROUND_ICON_NAME);

      icons = new IconData(bottomStart,
                           bottomEnd,
                           bottomBackground,
                           topStart,
                           topEnd,
                           topBackground,
                           startBackground,
                           endBackground);

      // Stash away the IconData so that we don't have to re-create
      // it on the next render
      skin.setProperty(_ICONS_KEY, icons);
    }

    return icons;
  }
View Full Code Here

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

    UIXRenderingContext context
    )
  {
    // Check to see whether we have already created
    // the IconData for this background color
    Skin skin = context.getSkin();
    IconData icons = (IconData)skin.getProperty(_ICONS_KEY);
   
    Icon bottomStart      = context.getIcon(
                              AF_PANEL_SIDE_BAR_BOTTOM_START_ICON_NAME);   

    if (icons == null || bottomStart == null ||
        (!icons.bottomStart.equals(bottomStart)))
    {
      // If we haven't created the IconData yet, create it now
      // OR if the ones we created are not the ones we need to create
      // (this can happen if sidebar is used in a composite component.)
      // we then cache it away as an optimization.

      Icon bottomEnd        = context.getIcon(
                                AF_PANEL_SIDE_BAR_BOTTOM_END_ICON_NAME);
      Icon bottomBackground = context.getIcon(
                                AF_PANEL_SIDE_BAR_BOTTOM_BACKGROUND_ICON_NAME);
      Icon topStart         = context.getIcon(
                                AF_PANEL_SIDE_BAR_TOP_START_ICON_NAME);
      Icon topEnd           = context.getIcon(
                                AF_PANEL_SIDE_BAR_TOP_END_ICON_NAME);
      Icon topBackground    = context.getIcon(
                                AF_PANEL_SIDE_BAR_TOP_BACKGROUND_ICON_NAME);
      Icon startBackground  = context.getIcon(
                                AF_PANEL_SIDE_BAR_START_BACKGROUND_ICON_NAME);
      Icon endBackground    = context.getIcon(
                                AF_PANEL_SIDE_BAR_END_BACKGROUND_ICON_NAME);

      icons = new IconData(bottomStart,
                           bottomEnd,
                           bottomBackground,
                           topStart,
                           topEnd,
                           topBackground,
                           startBackground,
                           endBackground);

      // Stash away the IconData so that we don't have to re-create
      // it on the next render
      skin.setProperty(_ICONS_KEY, icons);
    }

    return icons;
  }
View Full Code Here

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

    if (localValue != _NULL_ICON)
      return (Icon)localValue;

    // If we didn't find a local property, get the Icon from
    // the Skin
    Skin skin = context.getSkin();
    Icon icon = skin.getIcon(AF_MENU_BUTTONS_SEPARATOR_ICON_NAME);

    // Stash the Icon away so that we don't have to
    // look it up in the laf again next time.
    context.setLocalProperty(_SEPARATOR_ICON_KEY, icon);
View Full Code Here

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

    {
      _LOG.warning("Can't get Skin with null skinId");
      return null;
    }

    Skin skin = null;
    synchronized (_skins)
    {
      if (_skins.containsKey(skinId))
      {
        skin = _skins.get(skinId);
View Full Code Here

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

      else
      {
        iconName   = AF_TABLE_NB_NEXT_DISABLED_ICON_NAME;
      }
    }
    Skin skin = context.getSkin();
    RenderingContext arc = RenderingContext.getCurrentInstance();
    FacesContext fContext = context.getFacesContext();

    String iconURI = (String)(skin.getIcon(
                                          iconName).getImageURI(fContext, arc));

    return iconURI;
  }
View Full Code Here

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

    else
    {
      String iconName = getIconName();
      assert (iconName != null);
     
      Skin skin = context.getSkin();
      Icon icon = skin.getIcon(iconName);
     
      if (icon != null)
      {
        BaseDesktopUtils.renderIcon(context,
                                    icon,
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.