Package org.eclipse.jst.jsp.core.internal.contentmodel.tld

Examples of org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$IncludeHelper


    }

    @Override
    public String getPrefix(String namespace, IDocument doc)
    {
        TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(doc);
        if (m == null)
            return null;
        List trackers = m.getTaglibTrackers();
        for (Iterator iter = trackers.iterator(); iter.hasNext();) {
            TaglibTracker tracker = (TaglibTracker) iter.next();
            if (namespace.equals(tracker.getURI())) {
                return tracker.getPrefix();
            }
View Full Code Here


    DocumentInfo info = new DocumentInfo();
    info.document = (IStructuredDocument) document;
    info.textFileBuffer = null; // will be supplied later
    info.location = location;
    info.locationKind = locationKind;
    info.tldDocumentManager = new TLDCMDocumentManager();
    synchronized (_instance.fDocumentMap) {
      _instance.fDocumentMap.put(document, info);
    }
    info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
    if (document instanceof BasicStructuredDocument && document.getLength() > 0) {
View Full Code Here

          info = new DocumentInfo();
          info.document = (IStructuredDocument) document;
          info.textFileBuffer = (ITextFileBuffer) buffer;
          info.location = buffer.getLocation();
          info.locationKind = LocationKind.NORMALIZE;
          info.tldDocumentManager = new TLDCMDocumentManager();
          info.tldDocumentManager.setSourceParser((XMLSourceParser) info.document.getParser());
          synchronized (_instance.fDocumentMap) {
            _instance.fDocumentMap.put(document, info);
          }
          TaglibIndex.addTaglibIndexListener(info);
View Full Code Here

   * @param model
   * @param uri
   * @return null means this is tld is not declared in the jsp file
   */
  public static String getPrefix(IDOMModel model, String uri) {
    TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
        .getStructuredDocument());
    if (m == null) {
        // if the doc manager has nothing but the type is XML,
        // then see if the prefix is encoded as a namespace in
        // the doc root
        if (model.getDocument().isXMLType())
        {
            Element root = getRootElement(model);
              if (root != null){             
                  NamedNodeMap attrs = root.getAttributes();
                  for (int i=0;i<attrs.getLength();i++){
                      Attr a = (Attr)attrs.item(i);
                      //is the taglib uri already declared?
                      if (a.getValue().equals(uri)
                              && a.getName().startsWith("xmlns:")) //$NON-NLS-1$
                      {
                          String prefix =  a.getNodeName().substring("xmlns:".length()); //$NON-NLS-1$
                         
                          if ("".equals(prefix)) //$NON-NLS-1$
                          {
                              prefix = null;
                          }
                          return prefix;
                      }
                  }
              }
        }
      return null;
    }
    List trackers = m.getTaglibTrackers();
    for (Iterator iter = trackers.iterator(); iter.hasNext();) {
      TaglibTracker tracker = (TaglibTracker) iter.next();
      if (uri.equals(tracker.getURI())) {
        return tracker.getPrefix();
      }
View Full Code Here

   */
  public static String findUnusedPrefix(IDOMModel model, String suggestion) {
    if (suggestion == null) {
      suggestion = "p"; //$NON-NLS-1$
    }
    TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
        .getStructuredDocument());
    if (m == null) {
      return suggestion;
    }
    List trackers = m.getTaglibTrackers();
    Set map = new HashSet();
    for (Iterator iter = trackers.iterator(); iter.hasNext();) {
      TaglibTracker tracker = (TaglibTracker) iter.next();
      map.add(tracker.getPrefix());
    }
View Full Code Here

   */
  public static String findURIForPrefix(IDOMModel model, String prefix) {
    if (prefix == null || model == null) {
      return null;
    }
    TLDCMDocumentManager m = TaglibController.getTLDCMDocumentManager(model
        .getStructuredDocument());
    if (m == null) {
      return null;
    }
    List trackers = m.getTaglibTrackers();
    for (Iterator iter = trackers.iterator(); iter.hasNext();) {
      TaglibTracker tracker = (TaglibTracker) iter.next();
      if (prefix.equals(tracker.getPrefix())) {
        CMDocument cmdoc = tracker.getDocument();
        if (cmdoc instanceof TLDDocument) {
View Full Code Here

   * @param offset
   * @return
   */
  private List getFunctionProposals(String prefix, ITextViewer viewer,
      int offset) {
    TLDCMDocumentManager docMgr = TaglibController
        .getTLDCMDocumentManager(viewer.getDocument());
    ArrayList completionList = new ArrayList();
    if (docMgr == null)
      return null;

    Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
    while (taglibs.hasNext()) {
      TaglibTracker tracker = (TaglibTracker) taglibs.next();
      if (tracker.getPrefix().equals(prefix)) {
        CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();

View Full Code Here

          textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
      }
      else {
        textInsertionOffset = ((IDOMNode) node).getStartOffset();
      }
      TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
      if (mgr != null) {
        List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
        if (moreCMDocuments != null) {
          for (int i = 0; i < moreCMDocuments.size(); i++) {
            CMDocument doc = (CMDocument) moreCMDocuments.get(i);
            CMNamedNodeMap elements = doc.getElements();
            if (elements != null) {
View Full Code Here

  public char[] getCompletionProposalAutoActivationCharacters() {
    return elCompletionProposalAutoActivationCharacters;
  }

  protected List getFunctionProposals(String prefix, StructuredTextViewer viewer, int offset) {
    TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(viewer.getDocument());
    ArrayList completionList = new ArrayList();
    if (docMgr == null)
      return null;

    Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
    while (taglibs.hasNext()) {
      TaglibTracker tracker = (TaglibTracker) taglibs.next();
      if (tracker.getPrefix().equals(prefix)) {
        CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();
View Full Code Here

    String teiClass = null;
    if (problems == null)
      problems = new ArrayList();
    ModelQuery mq = getModelQuery(structuredDoc);
    if (mq != null) {
      TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(structuredDoc);

      if (mgr != null) {

        List trackers = mgr.getCMDocumentTrackers(-1);
        Iterator taglibs = trackers.iterator();
 
        CMDocument doc = null;
        CMNamedNodeMap elements = null;
        while (taglibs.hasNext()) {
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager$IncludeHelper

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.