Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-462

Add import support to skinning's css files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0.1-incubating-core-SNAPSHOT
    • 2.0.0-beta-1
    • Skinning
    • None

    Description

      Add @import support to the skinning's css file. It should behave exactly the same as the include support that we have in the XSS files.

      Here are some code snippets where the import happens.

      See StyleSheetDocumentParser.java

      -An included xss file is parsed in _handleImports and stored as a StyleSheetDocument in "_imports" that is an Arraylist of elements of type StyleSheetDocument.

      // Handle an import - parse the imported XSS document
      private void _handleImport(
      ParseContext context,
      String href
      ) throws SAXParseException, IOException
      {
      if (href == null)

      { _LOG.warning("Import missing required href attribute"); return; }

      // Now, parse the imported document
      StyleSheetDocument doc = null;

      try

      { doc = (StyleSheetDocument)XMLUtils.parseInclude(context, href, StyleSheetDocument.class); }

      catch (SAXException e)

      { _LOG.severe(e); }

      if (doc != null)

      { if (_imports == null) _imports = new ArrayList<StyleSheetDocument>(); _imports.add(doc); }

      }

      And also this:
      // Return all style sheet nodes - this includes imported style sheets
      // as well as style sheets from this document. Imported style
      // sheets have lower precedence - they come first.
      private StyleSheetNode[] _getStyleSheets()
      ...

      Attachments

        Activity

          People

            jeanne.waldman@oracle.com Jeanne Waldman
            jeanne.waldman@oracle.com Jeanne Waldman
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: