org.xwiki.portlet.view
Class CSSStreamFilter
java.lang.Object
org.xwiki.portlet.view.CSSStreamFilter
- All Implemented Interfaces:
- StreamFilter
public class CSSStreamFilter
- extends Object
- implements StreamFilter
Rewrites a CSS stream so that it can be used by a portlet in a portal page without affecting other portlets or the
portal page itself. The following transformations are executed:
- Name-space all CSS selectors by prefixing them with a given string (e.g. the identifier of the portlet content
container)
- Rename identifiers used in selectors to ensure their uniqueness inside the portal page
- Rewrite import URLs so that CSS style sheets are requested through the portlet
.
- Version:
- $Id: 9313f650c7e8a006c03603130b5bcd9eb833f4ad $
|
Constructor Summary |
CSSStreamFilter(String namespace,
URLRewriter urlRewriter)
Creates a new CSS stream filter that uses the given URL rewriter to transform import URLs and the given
name-space to prevent style rules from affecting other portlets or the portal page itself. |
|
Method Summary |
void |
filter(Reader reader,
Writer writer)
Filters the given character stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSSStreamFilter
public CSSStreamFilter(String namespace,
URLRewriter urlRewriter)
- Creates a new CSS stream filter that uses the given URL rewriter to transform import URLs and the given
name-space to prevent style rules from affecting other portlets or the portal page itself.
- Parameters:
namespace - the portlet name-spaceurlRewriter - the object used to rewrite servlet URLs
filter
public void filter(Reader reader,
Writer writer)
- Description copied from interface:
StreamFilter
- Filters the given character stream.
- Specified by:
filter in interface StreamFilter
- Parameters:
reader - the character stream to be filteredwriter - the resulting character stream
Copyright © 2004-2013 XWiki. All Rights Reserved.