Package org.apache.myfaces.trinidad.skin

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


    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

    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

    {
      _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

      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

    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

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

      if (icons == null)
      {
        // 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

    // if the skin is a portlet skin.
     String disableContentCompression =
       FacesContext.getCurrentInstance().getExternalContext().
       getInitParameter(StyleSheetRenderer.DISABLE_CONTENT_COMPRESSION);
     // we do not compress if it is a portlet skin
     Skin skin = RenderingContext.getCurrentInstance().getSkin();
     boolean isPortletSkin =
     CoreRenderKit.OUTPUT_MODE_PORTLET.equals(skin.getRenderKitId());

     boolean compressStyles = (!"true".equals(disableContentCompression)) &&
                                              !isPortletSkin;

View Full Code Here

    //   This will be Boolean.TRUE if
    // we have all three icons, Boolean.FALSE if we
    // don't, or null if we haven't checked yet.
    boolean rtl = _isRightToLeft(context);
    Boolean value;
    Skin skin = context.getSkin();
    if (rtl)
      value = (Boolean)skin.getProperty(_IMAGE_BUTTON_RTL_KEY);
    else
      value = (Boolean)skin.getProperty(_IMAGE_BUTTON_KEY);

    if (value != null)
      return (Boolean.TRUE == value);

    // we fetch different icons if we are in the
    // right-to-left reading direction. context.getIcon takes care of
    // this, by adding the :rtl suffix to the icon name if the
    // reading direction is rtl.
    Icon startIcon = context.getIcon(
                                  BUTTON_START_ICON_NAME);
    Icon endIcon = context.getIcon(
                                  BUTTON_END_ICON_NAME);
    Icon topBackgroundIcon = context.getIcon(
                                  BUTTON_TOP_BACKGROUND_ICON_NAME);
    Icon bottomBackgroundIcon = context.getIcon(
                                  BUTTON_BOTTOM_BACKGROUND_ICON_NAME);
    // List of missing icons
    String missing = null;

    if (startIcon == null)
      missing = _addMissingIcon(missing, BUTTON_START_ICON_NAME);
    if (endIcon == null)
      missing = _addMissingIcon(missing, BUTTON_END_ICON_NAME);
    if (topBackgroundIcon == null)
      missing = _addMissingIcon(missing, BUTTON_TOP_BACKGROUND_ICON_NAME);
    if (bottomBackgroundIcon == null)
      missing = _addMissingIcon(missing, BUTTON_BOTTOM_BACKGROUND_ICON_NAME);
    // If we are missing any of the icons, we don't render
    // the button image.
    if (missing != null)
    {
      // Only bother logging a message if one or more of the button
      // icons were actually specified.  If no button icons were
      // specified, than the user probably just wants to use
      // browser-based buttons.

      if ((startIcon != null)         ||
          (endIcon != null)           ||
          (topBackgroundIcon != null) ||
          (bottomBackgroundIcon != null))
      {
        if (_LOG.isWarning())
        {
          if (rtl)
            missing += "(Add :rtl to the icon names since locale is rtl)";
          _LOG.warning(_MISSING_ICON_ERROR + missing);
        }
      }

      if (rtl)
        skin.setProperty(_IMAGE_BUTTON_RTL_KEY, Boolean.FALSE);
      else
        skin.setProperty(_IMAGE_BUTTON_KEY, Boolean.FALSE);

      return false;
    }
    if (rtl)
      skin.setProperty(_IMAGE_BUTTON_RTL_KEY, Boolean.TRUE);
    else
      skin.setProperty(_IMAGE_BUTTON_KEY, Boolean.TRUE);

    return true;
  }
View Full Code Here

    {
      comment += ", Accessibility:"+accessibilityMode;
    }

    // Tack on the Skin id
    Skin skin = arc.getSkin();
    String skinId = skin.getId();
    if (skinId != null)
    {
      comment += ", skin:" + skinId;

      // Also log preferred Skin if we have one
View Full Code Here

TOP

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

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.