Package com.volantis.styling.impl.engine.sheet

Examples of com.volantis.styling.impl.engine.sheet.IndexableStylerList


        // Make sure that the matcher is prepared for the cascade.
        MatcherContext matcherContext = stylerContext.getMatcherContext();
        matcherContext.prepareForCascade(attributes);

        if (iterator instanceof IndexableStylerList) {
            IndexableStylerList styler = (IndexableStylerList) iterator;
            BitSet indexRef = styler.createIndexRef();
            styler.lookupElement(indexRef, matcherContext.getLocalName());
            String classes = attributes.getAttributeValue(null, "class");
            if (classes != null) {
                if (classes.indexOf(' ') > -1) {
                    // TODO later - this can probably be more efficient
                    StringTokenizer tokenizer = new StringTokenizer(classes, " ");
                    while (tokenizer.hasMoreTokens()) {
                        String token = tokenizer.nextToken();
                        styler.lookupClass(indexRef, token);
                    }
                } else {
                    styler.lookupClass(indexRef, classes);
                }
            }

            // Exclude stylers which require state that isn't present
            BitSet requiresState = styler.stateRequired();
            Iterator it = matcherContext.stateMarkers();
            if (it != null && it.hasNext()) {
                BitSet stateActive = new BitSet();
                while (it.hasNext()) {
                    StateMarker marker = (StateMarker) it.next();
                    if (marker.isActive()) {
                        styler.lookupState(stateActive, marker.getState());
                    }
                }
                requiresState.andNot(stateActive);
            }
            indexRef.andNot(requiresState);

            styler.iterateIndexed(this, indexRef);
        } else {
            // Iterate over the stylers asking them to match.
            iterator.iterate(this);
        }
View Full Code Here

TOP

Related Classes of com.volantis.styling.impl.engine.sheet.IndexableStylerList

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.