Package org.eclipse.wst.sse.core.internal.ltk.parser

Examples of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker


  }

  public BlockMarker getBlockMarker(String tagName) {
    List markers = getTokenizer().getBlockMarkers();
    for (int i = 0; i < markers.size(); i++) {
      BlockMarker marker = (BlockMarker) markers.get(i);
      if (marker.isCaseSensitive()) {
        if (marker.getTagName().equals(tagName))
          return marker;
      }
      else {
        if (marker.getTagName().equalsIgnoreCase(tagName))
          return marker;
      }
    }
    return null;
  }
View Full Code Here


  /**
   * Convenience method to add tag names using BlockMarker object
   */
  private void addHTMLishTag(BlockTagParser parser, String tagname) {
    BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
    parser.addBlockMarker(bm);
  }
View Full Code Here

     */
    protected void addBlockTag(String tagnameNS, ITextRegionCollection marker) {
      if (getParser() == null)
        return;
      if (getParser().getBlockMarker(tagnameNS) == null) {
        getParser().addBlockMarker(new BlockMarker(tagnameNS, marker, DOMRegionContext.BLOCK_TEXT, true, false));
        if (_debug) {
          System.out.println("TLDCMDocumentManager added block marker: " + tagnameNS + "@" + marker.getStartOffset()); //$NON-NLS-2$//$NON-NLS-1$
        }
      }
    }
View Full Code Here

    private void resetBlockTags() {
      if (getParser() == null)
        return;
      Iterator names = getParser().getBlockMarkers().iterator();
      while (names.hasNext()) {
        BlockMarker marker = (BlockMarker) names.next();
        if (!marker.isGlobal() && marker.getContext() == DOMRegionContext.BLOCK_TEXT) {
          if (_debug) {
            System.out.println("TLDCMDocumentManager removing block tag named: " + marker.getTagName()); //$NON-NLS-1$
          }
          names.remove();
        }
      }
    }
View Full Code Here

  /**
   * Convenience method to add tag names using BlockMarker object
   */
  protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
    BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
    parser.addBlockMarker(bm);
  }
View Full Code Here

  /**
   * Convenience method to add tag names using BlockMarker object
   */
  protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
    BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
    parser.addBlockMarker(bm);
  }
View Full Code Here

    setId(ModelHandlerID);
    setAssociatedContentTypeId(AssociatedContentTypeID);
  }

  protected void addJSPTagName(JSPSourceParser parser, String tagname) {
    BlockMarker bm = new BlockMarker(tagname, null, DOMJSPRegionContexts.JSP_CONTENT, true);
    parser.addBlockMarker(bm);
  }
View Full Code Here

   * @return
   */
  private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
    XMLSourceParser parser = new XMLSourceParser();
    // use JSP_CONTENT for region type
    parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
    parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
    parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
    parser.reset(blockText);
    return parser.getDocumentRegions();
  }
View Full Code Here

        List docs = documentManager.getCMDocumentTrackers(prefix, this.fTranslator.getCurrentNode().getStartOffset());
        Iterator it = docs.iterator();
        Iterator elements = null;
        CMNode node = null;
        CMDocument doc = null;
        BlockMarker marker = null;
        while (it.hasNext()) {
          doc = (CMDocument) it.next();
          elements = doc.getElements().iterator();
          while (elements.hasNext()) {
            node = (CMNode) elements.next();
            marker = new BlockMarker(node.getNodeName(), null, DOMJSPRegionContexts.JSP_CONTENT, true);
            // global scope is OK because we have encountered this
            // <@taglib> directive
            // so it all markers from it should will be in scope
            // add to this local parser
            addBlockMarker(marker);
View Full Code Here

   * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
   * @return
   */
  void decodeScriptBlock(String blockText, int startOfBlock) {
    XMLJSPRegionHelper helper = new XMLJSPRegionHelper(this, false);
    helper.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
    helper.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
    helper.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
    helper.addBlockMarker(new BlockMarker("jsp:directive.include", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
    helper.addBlockMarker(new BlockMarker("jsp:directive.taglib", null, DOMJSPRegionContexts.JSP_CONTENT, false)); //$NON-NLS-1$
    helper.reset(blockText, startOfBlock);
    // force parse
    helper.forceParse();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker

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.