Package org.apache.myfaces.trinidadinternal.agent

Examples of org.apache.myfaces.trinidadinternal.agent.TrinidadAgent


    if (encoding != null)
      return encoding;

    // Pick an encoding based on the Configuration/Agent
    Configuration config = context.getConfiguration();
    TrinidadAgent agent = context.getAgent();
    //encodings was part of old Agent capabilities, not in new Agent Caps. So replaced
    //Object encodingsObj = agent.getCapability(AdfFacesAgent.CAP_IMAGE_ENCODINGS);
    //int encodings = ((encodingsObj == null)
    //                 ? (AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF |
    //                    AdfFacesAgent.IMAGE_ENCODINGS_CAP_PNG)
    //                 : ((Number) encodingsObj).intValue());

    // If GIF is enabled and supported, use it
    //if (((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF) != 0) &&
    //      !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)))
    //{
    //  return ImageEncoderManager.GIF_TYPE;
    //}
    if ((agent.getCapability(TrinidadAgent.CAP_GIF_TYPE_IMAGE) == Boolean.TRUE) &&
            !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)))
    {
      return ImageEncoderManager.GIF_TYPE;
    }

    //encodings was part of old Agent capabilities, not in new Agent Caps. So replaced
    //if ((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_PNG) != 0)
    //{
    //  return ImageEncoderManager.PNG_TYPE;
    //}
    if (agent.getCapability(TrinidadAgent.CAP_PNG_TYPE_IMAGE) == Boolean.TRUE)
    {
      return ImageEncoderManager.PNG_TYPE;
    }

View Full Code Here


   */
  public static boolean supportsTransparentImages(
    UIXRenderingContext context
    )
  {
    TrinidadAgent agent = context.getAgent();

    // =-=ags Temporarily disabling the use of transparent images
    // on ICE due to problems with tiling transparent images that
    // are affecting UIXVE.  This code should be removed once the
    // underlying ICE bug is fixed (supposedly ICE 5.4.1)
    if (TrinidadAgent.Application.ICE == agent.getAgentApplication())
      return false;

    //int encodings = ((Integer)agent.getCapability(
    //                                  AdfFacesAgent.CAP_IMAGE_ENCODINGS)).intValue();

    // If the Agent suports transparent PNG, we are good to go...
    //if ((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_TRANSPARENT_PNG) != 0)
    //  return true;

    if (agent.getCapability(TrinidadAgent.CAP_TRANSPARENT_PNG_TYPE_IMAGE) == Boolean.TRUE)
       return true;

    // Otherwise, check GIF suport...
    Configuration config = context.getConfiguration();

    //return (((encodings & AdfFacesAgent.IMAGE_ENCODINGS_CAP_GIF) != 0) &&
    //          !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)));
    return ((agent.getCapability(TrinidadAgent.CAP_GIF_TYPE_IMAGE) == Boolean.TRUE) &&
               !Boolean.FALSE.equals(config.getProperty(_GIF_ENABLED)));

  }
View Full Code Here

    if (deprecatedScore == NO_MATCH)
      return _NO_MATCH_SCORE;

    int nameScore = _scoreName(lafName);

    TrinidadAgent agent = context. getAgent();
   
    int typeScore = NO_MATCH;
    int agentType = agent.getAgentType();
    for (int type: _agentTypes)
    {
      typeScore = Math.max(typeScore, _score(type, agentType));
    }
   
    int appScore = _score(_agentApplication, agent.getAgentApplication().ordinal());
    int versScore = _score(_agentMajorVersion, agent.getAgentMajorVersion());
    int osScore = _score(_agentOS, agent.getAgentOS());

    return new ScoreImpl(nameScore,
                         typeScore,
                         appScore,
                         versScore,
View Full Code Here

    return l;
  }

  private boolean _supportsSeparateWindow(FacesContext context)
  {
    TrinidadAgent agent = AgentUtil.getAgent(context);
    return XhtmlUtils.supportsSeparateWindow(agent);
  }
View Full Code Here

   */
  protected boolean useEmbed(
    RenderingContext rc
    )
  {
    TrinidadAgent agent = (TrinidadAgent) rc.getAgent();

    // =-= bts only desktop IE seems to support this
    //         Move this to capability
    return !((agent.getAgentType()       == TrinidadAgent.TYPE_DESKTOP) &&
            (agent.getAgentApplication() == TrinidadAgent.Application.IEXPLORER) &&
            (agent.getAgentOS()          == TrinidadAgent.OS_WINDOWS));
  }
View Full Code Here

    String           primaryMimeType
    )
  {
    PlayerData playerData = null;
    // the default player is the link player
    TrinidadAgent agent = (TrinidadAgent) rc.getAgent();
    int agentOSInt = agent.getAgentOS();

    // get the set of supported players for this OS
    HashSet<Object> supportedPlayers = _sSupportedOSPlayers.get(agentOSInt);

    // are we trying to display an image?
View Full Code Here

  {
    ResponseWriter writer = context.getResponseWriter();

    // IE6 does not support stretching by setting both top & bottom or left & right,
    // so we have to use some ugly code.
    TrinidadAgent agent = (TrinidadAgent)rc.getAgent();
    boolean isIE6 = Agent.AGENT_IE.equals(agent.getAgentName()) &&
      agent.getAgentMajorVersion() == 6;
    if (isIE6)
    {
      // send down the JS that we need to stretch the components
      XhtmlUtils.addLib(context, rc, PanelBorderIE6Scriptlet.sharedInstance().getScriptletKey());
    }
View Full Code Here

        if (_BUTTON_PART.equals(part))
        {
          // Force partial rendering (if we're launching a window)
          // =-=AEW I don't believe this is necessary;  I believe
          // we've already got "partial" turned on
          TrinidadAgent agent = AgentUtil.getAgent(facesContext);
          if (XhtmlUtils.supportsSeparateWindow(agent))
            PartialPageUtils.forcePartialRendering(facesContext);

          queueActionEvent(facesContext, component);
        }
View Full Code Here

  {
    // First, get an TrinidadAgent out of the plain Agent
    // =-=AEW In theory, we should only be getting a plain Agent
    // out of the RequestContext:  for some reason, we're going
    // straight to an TrinidadAgent in RequestContext
    TrinidadAgent agent;
    if (base instanceof TrinidadAgent)
      agent = (TrinidadAgent) base;
    else
      agent = new TrinidadAgentImpl(context, base);
View Full Code Here

  }

  // Get the version as a String
  private static String _getVersionString(StyleContext context)
  {
    TrinidadAgent agent = context.getAgent();
    String version = agent.getAgentVersion();

    if (version == null)
      return _UNKNOWN_NAME;

    return version;
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.agent.TrinidadAgent

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.