Package org.apache.myfaces.trinidadinternal.image

Examples of org.apache.myfaces.trinidadinternal.image.ImageProvider


  {
    // First, normalize the path to make sure that lookups don't
    // fail due to insignificant path incosistencies.
    realPath = _getCanonicalPath(realPath);

    ImageProvider cache = _sSharedCaches.get(realPath);

    // If we didn't find a shared cache, create a new cache
    // and cache it in the shared cache cache.  :-)
    if (cache == null)
    {
      // Create the new cache
      cache = new FileSystemImageCache(realPath);

      // Before we save the new cache, make sure another thread hasn't
      // already cached a different instance.  Synchronize to lock up
      // _sSharedCaches.
      synchronized (_sSharedCaches)
      {
        ImageProvider tmp = _sSharedCaches.get(realPath);
        if (tmp != null)
        {
          // Stick with tmp
          cache = tmp;
        }
View Full Code Here


    {
      if (ImageConstants.TECATE_NAMESPACE == namespace)
      {
        if (ImageConstants.IMAGE_PROVIDER_PROPERTY == key)
        {
          ImageProvider imageProvider = _getDefaultImageProvider();

          setProperty(ImageConstants.TECATE_NAMESPACE,
                      ImageConstants.IMAGE_PROVIDER_PROPERTY,
                      imageProvider);
View Full Code Here

  // Creates a default Tecate's FileSystemImageCache.
  // Uses the web server root and base image uri to determine the
  // location of the default cache
  private ImageProvider _getDefaultImageProvider()
  {
    ImageProvider provider = null;
    Configuration config = getConfiguration();
    try
    {
      // We explicitly avoid using the SHARED_CONTEXT_PATH for the
      // image cache.  That way, we can ensure that each application
View Full Code Here

    UIXRenderingContext context,
    UINode           node
    )
  {
    // First, make sure we have an ImagePRovider
    ImageProvider provider = (ImageProvider)
      context.getProperty(TECATE_NAMESPACE, IMAGE_PROVIDER_PROPERTY);
    if (provider == null)
      return null;

    // Round up all of our properties
View Full Code Here

  public ImageProviderResponse getColorizedIcon(
    UIXRenderingContext context,
    IconKey iconKey
    )
  {
    ImageProvider provider = (ImageProvider)
      context.getProperty(ImageConstants.TECATE_NAMESPACE,
                          ImageConstants.IMAGE_PROVIDER_PROPERTY);

    Icon icon = getIcon(iconKey);
    String iconName = null;

    if ( icon != null )
      iconName = icon.getName();

    if (provider == null)
    {
      if (_LOG.isWarning())
        _LOG.warning("Could not get image provider for icon: " + iconName);

      return null;
    }

    // Get the context and request objects
    ImageContext imageContext = context.getImageContext();
    ImageProviderRequest request = _getIconRequest(context, iconKey);

    // Make the request
    ImageProviderResponse response = provider.getImage(imageContext, request);

    // Log any problems
    if (response == null)
    {
      if (_LOG.isWarning())
View Full Code Here

  public static ImageProviderResponse getFlippedIcon(
    UIXRenderingContext context,
    String           sourceURI
    )
  {
    ImageProvider provider = (ImageProvider)
      context.getProperty(ImageConstants.TECATE_NAMESPACE,
                          ImageConstants.IMAGE_PROVIDER_PROPERTY);

    if (provider == null)
    {
      return null;
    }

    // Get the context and request objects
    ImageContext imageContext = context.getImageContext();
    ImageProviderRequest request = new FlippedIconRequest(
                                  context,
                                  sourceURI);

    // Make the request
    ImageProviderResponse response = provider.getImage(imageContext, request);

    // Log any problems
    if (response == null)
    {
      if (_LOG.isWarning())
View Full Code Here

  public ImageProviderResponse getColorizedIcon(
    UIXRenderingContext context,
    IconKey iconKey
    )
  {
    ImageProvider provider = (ImageProvider)
      context.getProperty(ImageConstants.TECATE_NAMESPACE,
                          ImageConstants.IMAGE_PROVIDER_PROPERTY);

    Icon icon = getIcon(iconKey);
    String iconName = null;

    if ( icon != null )
      iconName = icon.getName();

    if (provider == null)
    {
      if (_LOG.isWarning())
        _LOG.warning("CANNOT_GET_IMAGE_PROVIDER_FOR_ICON", iconName);

      return null;
    }

    // Get the context and request objects
    ImageContext imageContext = context.getImageContext();
    ImageProviderRequest request = _getIconRequest(context, iconKey);

    // Make the request
    ImageProviderResponse response = provider.getImage(imageContext, request);

    // Log any problems
    if (response == null)
    {
      if (_LOG.isWarning())
View Full Code Here

    UIXRenderingContext context,
    UINode           node
    )
  {
    // First, make sure we have an ImagePRovider
    ImageProvider provider = (ImageProvider)
      context.getProperty(TECATE_NAMESPACE, IMAGE_PROVIDER_PROPERTY);
    if (provider == null)
      return null;

    // Round up all of our properties
View Full Code Here

    UIXRenderingContext context,
    UINode           node
    )
  {
    // First, make sure we have an ImagePRovider
    ImageProvider provider = (ImageProvider)
      context.getProperty(TECATE_NAMESPACE, IMAGE_PROVIDER_PROPERTY);
    if (provider == null)
      return null;

    // Round up all of our properties
View Full Code Here

  public static ImageProviderResponse getFlippedIcon(
    UIXRenderingContext context,
    String           sourceURI
    )
  {
    ImageProvider provider = (ImageProvider)
      context.getProperty(ImageConstants.TECATE_NAMESPACE,
                          ImageConstants.IMAGE_PROVIDER_PROPERTY);

    if (provider == null)
    {
      return null;
    }

    // Get the context and request objects
    ImageContext imageContext = context.getImageContext();
    ImageProviderRequest request = new FlippedIconRequest(
                                  context,
                                  sourceURI);

    // Make the request
    ImageProviderResponse response = provider.getImage(imageContext, request);

    // Log any problems
    if (response == null)
    {
      if (_LOG.isWarning())
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.image.ImageProvider

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.