Package org.apache.myfaces.trinidadinternal.share.io

Examples of org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider


        ((darkAccentColor.getRGB() & 0x00ffffff) != 0x00d2d8b0))
    {
      return null;
    }

    InputStreamProvider provider = (InputStreamProvider)properties.get(
                                     SOURCE_INPUT_STREAM_PROVIDER_KEY);
    if (provider != null)
    {
      byte[] data = null;;
View Full Code Here


    if (sourceName == null)
      throw new NullPointerException();
    if (context == null)
      throw new NullPointerException();

    InputStreamProvider provider = resolver.getProvider(sourceName);
    Object cached = provider.getCachedResult();
    if ((cached != null) && expectedType.isInstance(cached))
      return cached;


    InputStream stream = provider.openInputStream();

    try
    {

      // PARSE!
      // create a SkinStyleSheetNode
      // (contains a namespaceMap and a List of SkinSelectorPropertiesNodes
      // and additional information like direction, locale, etc.)
      // (selectorName + a css propertyList))
      BufferedReader in = new BufferedReader(new InputStreamReader(stream));
      List <SkinStyleSheetNode> skinSSNodeList = _parseCSSStyleSheet(in);
      in.close();
 
  
      // process the SkinStyleSheetNodes to create a StyleSheetEntry object
      StyleSheetEntry styleSheetEntry =
        _createStyleSheetEntry(context, sourceName, skinSSNodeList);
 

      // Store the cached result (if successful)
      // otherwise, if we don't do this, we will keep reparsing. Somehow
      // this affects whether the file has been modified. STRANGE!
      //     if (value != null)
      //    provider.setCachedResult(value);

      //    return value;
      provider.setCachedResult(styleSheetEntry);
     
      return styleSheetEntry;
    }
    finally
    {
View Full Code Here

    long timestamp = StyleSheetDocument.UNKNOWN_TIMESTAMP;

    // The only way to get the timestamp is through the
    // InputStreamProvider.
    InputStreamProvider provider = XMLUtils.getInputStreamProvider(parseContext);

    if (provider != null)
    {
      // And this only works if we are using a File-based InputStream
      Object identifier = provider.getIdentifier();
      if (identifier instanceof File)
        timestamp = ((File)identifier).lastModified();
    }

    return timestamp;
View Full Code Here

    // Make sure we have an InputStreamProvider for the source
    // icon.  We need this to check for modifications
    if (_provider == _NULL_PROVIDER)
      return true;

    InputStreamProvider provider = (InputStreamProvider)_provider;

    if (provider == null)
    {
      provider = _getInputStreamProvider(context, request);

      if (provider == null)
      {
        _provider = _NULL_PROVIDER;
        return true;
      }

      _provider = provider;
    }

    return !provider.hasSourceChanged();
  }
View Full Code Here

    )
  {
    Map<Object, Object> properties = request.getRenderProperties(context);
    assert (properties != null);

    InputStreamProvider provider = (InputStreamProvider)properties.get(
                          ImageConstants.SOURCE_INPUT_STREAM_PROVIDER_KEY);
    if (provider == null)
      return null;

    // We need to actually open the input stream in order
    // to establish the original last modified time
    try
    {
      InputStream in = provider.openInputStream();
      in.close();
    }
    catch (IOException e)
    {
      _LOG.severe(e);
View Full Code Here

    boolean disabled = CacheUtils.getBoolean(properties, DISABLED_KEY, false);
    boolean textAntialias = CacheUtils.isTextAntialiased(properties);
    char accessKey = _getChar(properties, ACCESS_KEY_KEY);
    String name = (String)properties.get(NAME_KEY);

    InputStreamProvider startIcon = _getIcon(properties,
                                             BUTTON_START_ICON_KEY);
    InputStreamProvider endIcon = _getIcon(properties,
                                           BUTTON_END_ICON_KEY);
    InputStreamProvider topBackgroundIcon = _getIcon(properties,
                                             BUTTON_TOP_BACKGROUND_ICON_KEY);
    InputStreamProvider bottomBackgroundIcon = _getIcon(properties,
                                            BUTTON_BOTTOM_BACKGROUND_ICON_KEY);


    _init(context,
         lookAndFeelId,
View Full Code Here

    {
      ServletContext servletContext = (ServletContext) objContext;

      NameResolver resolver = new ServletNameResolver( _request,
                                                       servletContext);
      InputStreamProvider provider = resolveSourceIcon(context,
                                                       getSource(),
                                                       resolver);

      properties.put(ImageConstants.SOURCE_INPUT_STREAM_PROVIDER_KEY, provider);
    }
View Full Code Here

  {
    // If we haven't parsed yet, don't bother checking the time stamp
    if (_document == null)
      return true;

    InputStreamProvider provider = _getInputStreamProvider();
    if (provider != null)
      return provider.hasSourceChanged();

    // Couldn't get an InputStreamProvider, what to do?
    return false;
  }
View Full Code Here

    ImageContext context,
    Map<Object, Object> properties,
    Object     key
    )
  {
    InputStreamProvider provider = (InputStreamProvider)
      properties.get(key);

    // If we can't get a provider, we can't get an Image
    if (provider == null)
    {
      _log(properties,
           _PROVIDER_ERROR + " (" + _getKeyName(key) + ")",
           null);

      return null;
    }

    InputStream in = null;

    try
    {
      in = provider.openInputStream();
    }
    catch (IOException e)
    {
      _log(properties, _INPUT_STREAM_ERROR, e);
      return null;
View Full Code Here

  {
    long timestamp = StyleSheetDocument.UNKNOWN_TIMESTAMP;

    // The only way to get the timestamp is through the
    // InputStreamProvider.
    InputStreamProvider provider = XMLUtils.getInputStreamProvider(context);

    if (provider != null)
    {
      // And this only works if we are using a File-based InputStream
      Object identifier = provider.getIdentifier();
      if (identifier instanceof File)
        timestamp = ((File)identifier).lastModified();
    }

    // Merge in timestamps of imported style sheets
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider

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.