Package org.eclipse.wst.xml.core.internal.contentmodel

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument


  }
 

  public void handleElementNS(Element element)
  {                            
    CMDocument parentInferredCMDocument = inferredCMDocument;
    CMElementDeclaration parentInferredCMElementDeclaration = inferredCMElementDeclaration;
       
    inferredCMDocument = null;                                                           
    inferredCMElementDeclaration = null;
View Full Code Here


  /**
   *
   */
  public CMDocument getCMDocument(String grammarURI)
  {
    CMDocument result = null;
    if (grammarURI != null)
    { 
      Entry entry = (Entry)hashtable.get(grammarURI);
      if (entry != null)
      {
View Full Code Here

  public static void showDialog(Shell shell, IFile file, IStructuredSelection structuredSelection) {
    String[] errorInfo = new String[2];
    // (cs) the URI argument to createCMDocument needs to be a fully
    // qualified URI
    //
    CMDocument cmDocument = NewXMLGenerator.createCMDocument(URIHelper.getPlatformURI(file), errorInfo);
    if (errorInfo[0] == null) {
      NewXMLWizard wizard = new NewXMLWizard(file, cmDocument);
      wizard.init(PlatformUI.getWorkbench(), structuredSelection);
      wizard.setNeedsProgressMonitor(true);
      WizardDialog dialog = new WizardDialog(shell, wizard);
View Full Code Here

    }

    protected String getKey(CMNode cmNode)
    {
      String key = cmNode.getNodeName();
      CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
      if (cmDocument != null)
      {                        
        String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
        if (namespaceURI != null)
        {  
          key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$
        }
      }
View Full Code Here

        {
          v.addAll(childNodeTable.values());
        }
        else if (contentType == CMElementDeclaration.ANY)
        {     
          CMDocument cmDocument =  (CMDocument)rootElementDeclaration.getProperty("CMDocument"); //$NON-NLS-1$
          if (cmDocument != null)
          {
            CMNamedNodeMap elements = cmDocument.getElements();           
            for (Iterator i = elements.iterator(); i.hasNext(); )
            {
              v.add(i.next());
            }
          }
View Full Code Here

    {           
      String uri = anyElement.getNamespaceURI();                         
      List list = getCMDocumentList(rootElement, rootElementDeclaration, uri);
      for (Iterator iterator = list.iterator(); iterator.hasNext(); )
      {
        CMDocument cmdocument = (CMDocument)iterator.next();
        if (cmdocument != null)
        {                         
          CMNamedNodeMap map = cmdocument.getElements();
          int size = map.getLength();
          for (int i = 0; i < size; i++)
          {                      
            CMNode ed = map.item(i);                 
            addToTable(childNodeTable,ed);
View Full Code Here

  // This is a temporary hack!!
  //
  protected String getFallbackNamepaceURI(CMElementDeclaration ed)
  {  
    String fallbackNamepaceURI = null;
    CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
    if (cmDocument != null)
    {
      fallbackNamepaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");   //$NON-NLS-1$
   
    return fallbackNamepaceURI;
  }
View Full Code Here

  /**
   *
   */             
  protected String createContentSpecificationForCMElementDeclaration(CMElementDeclaration ed)
  { 
    CMDocument document = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
    String uri = document != null ? (String)document.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") : null; //$NON-NLS-1$
    String string = ed.getNodeName();
    if (uri != null)
    {           
      string = "[" + uri + "]" + string; //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

      {           
        if (prefix == null)                
        {
          // todo... add getCMDocument() method to CMNode
          // for now use this getProperty() hack
          CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
          if (cmDocument != null)         
          {    
            String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
            if (namespaceURI != null)
            {  
              // use the NamespaceTable to figure out the correct prefix for this namespace uri
              //     
              if (namespaceTable == null)
View Full Code Here

    return getCorrespondingCMDocument(node, true);
  }

  protected CMDocument getCorrespondingCMDocument(Node node, boolean getDocumentFromCMNode)
  {           
    CMDocument result = null;
    try
    {
      Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document)node : node.getOwnerDocument();
  
      String[] doctypeInfo = getDoctypeInfo(document);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.CMDocument

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.