Search in sources :

Example 1 with JSPCapableParser

use of org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser in project webtools.sourceediting by eclipse.

the class TLDCMDocumentManager method handlePreludes.

void handlePreludes() {
    IStructuredDocumentRegion anchor = new ZeroStructuredDocumentRegion(null, -1);
    fProcessIncludes = false;
    IPath currentPath = getCurrentParserPath();
    if (currentPath != null) {
        PropertyGroup[] propertyGroups = DeploymentDescriptorPropertyCache.getInstance().getPropertyGroups(currentPath);
        for (int k = 0; k < propertyGroups.length; k++) {
            IPath[] preludes = propertyGroups[k].getIncludePrelude();
            for (int i = 0; i < preludes.length; i++) {
                if (!getIncludes().contains(preludes[i]) && !preludes[i].equals(currentPath)) {
                    getIncludes().push(preludes[i]);
                    if (getParser() != null) {
                        IncludeHelper includeHelper = new IncludeHelper(anchor, getParser());
                        includeHelper.parse(preludes[i]);
                        List references = includeHelper.taglibReferences;
                        fTLDCMReferencesMap.put(preludes[i], references);
                        if (getParser() instanceof JSPCapableParser) {
                            for (int j = 0; j < references.size(); j++) {
                                TLDCMDocumentReference reference = (TLDCMDocumentReference) references.get(j);
                                // $NON-NLS-1$
                                ((JSPCapableParser) getParser()).addNestablePrefix(new TagMarker(reference.prefix + ":"));
                            }
                        }
                    } else
                        // $NON-NLS-1$ //$NON-NLS-2$
                        Logger.log(Logger.WARNING, "Warning: parser text was requested by " + getClass().getName() + " but none was available; taglib support disabled");
                    getIncludes().pop();
                }
            }
        }
    }
    fProcessIncludes = true;
}
Also used : IStructuredDocumentRegion(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion) PropertyGroup(org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup) IPath(org.eclipse.core.runtime.IPath) List(java.util.List) ITextRegionList(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList) ArrayList(java.util.ArrayList) JSPCapableParser(org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser) TagMarker(org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker) ZeroStructuredDocumentRegion(org.eclipse.jst.jsp.core.internal.util.ZeroStructuredDocumentRegion)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 IPath (org.eclipse.core.runtime.IPath)1 PropertyGroup (org.eclipse.jst.jsp.core.internal.contenttype.DeploymentDescriptorPropertyCache.PropertyGroup)1 ZeroStructuredDocumentRegion (org.eclipse.jst.jsp.core.internal.util.ZeroStructuredDocumentRegion)1 JSPCapableParser (org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser)1 TagMarker (org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker)1 IStructuredDocumentRegion (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)1 ITextRegionList (org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList)1