Search in sources :

Example 1 with TagMarker

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

the class DocumentFactoryForJSP method addNestablePrefix.

private void addNestablePrefix(JSPSourceParser parser, String tagName) {
    TagMarker bm = new TagMarker(tagName);
    parser.addNestablePrefix(bm);
}
Also used : TagMarker(org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker)

Example 2 with TagMarker

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

the class JSPDocumentLoader method addNestablePrefix.

protected void addNestablePrefix(JSPSourceParser parser, String tagName) {
    TagMarker bm = new TagMarker(tagName);
    parser.addNestablePrefix(bm);
}
Also used : TagMarker(org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker)

Example 3 with TagMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker 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)

Example 4 with TagMarker

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

the class StructuredTextPartitionerForJSP method isAction.

/**
 * @param sdRegion
 * @param offset
 * @return
 */
private boolean isAction(IStructuredDocumentRegion sdRegion, int offset) {
    if (!sdRegion.getType().equals(DOMRegionContext.XML_TAG_NAME))
        return false;
    /*
		 * shouldn't get a tag name region type unless a tag name region
		 * exists at [1]
		 */
    ITextRegion tagNameRegion = sdRegion.getRegions().get(1);
    String tagName = sdRegion.getText(tagNameRegion);
    RegionParser parser = fStructuredDocument.getParser();
    if (parser instanceof JSPSourceParser) {
        if (tagName.equals(fLastCheckedPrefix))
            return true;
        List fCustomActionPrefixes = ((JSPSourceParser) parser).getNestablePrefixes();
        for (int i = 0; i < fCustomActionPrefixes.size(); i++) if (tagName.startsWith(((TagMarker) fCustomActionPrefixes.get(i)).getTagName())) {
            fLastCheckedPrefix = ((TagMarker) fCustomActionPrefixes.get(i)).getTagName();
            return true;
        }
    }
    return false;
}
Also used : ITextRegion(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion) ITextRegionList(org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList) ArrayList(java.util.ArrayList) List(java.util.List) RegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser) JSPSourceParser(org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser) TagMarker(org.eclipse.wst.sse.core.internal.ltk.parser.TagMarker)

Aggregations

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