(no message)

This commit is contained in:
Alexey Kudravtsev
2005-01-26 17:07:10 +03:00
parent ff2e8a9f2d
commit 12ad0f5cf9
3 changed files with 94 additions and 6 deletions
@@ -27,7 +27,7 @@ public class ChameleonTransforming implements Constants {
TreeElement newElement = chameleon.transform(file.getTreeElement().getCharTable(), file.createLexer());
final TreeElement treeNext = chameleon.getTreeNext();
TreeUtil.replace(chameleon, newElement);
TreeUtil.replaceWithList(chameleon, newElement);
if (DebugUtil.CHECK) {
if (newElement != null) {
DebugUtil.checkTreeStructure(newElement);
@@ -13,17 +13,17 @@ import com.intellij.psi.PsiSubstitutor;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlTag;
import com.intellij.xml.XmlAttributeDescriptor;
import com.intellij.xml.XmlNSDescriptor;
import com.intellij.xml.XmlElementDescriptor;
import com.intellij.util.ArrayUtil;
import com.intellij.xml.XmlAttributeDescriptor;
import com.intellij.xml.XmlElementDescriptor;
import com.intellij.xml.XmlNSDescriptor;
public class AnyXmlElementDescriptor implements XmlElementDescriptor {
private final XmlElementDescriptor myParentDescriptor;
private final XmlNSDescriptor myXmlNSDescriptor;
public AnyXmlElementDescriptor(XmlElementDescriptor parentDescriptor, XmlNSDescriptor xmlNSDescriptor) {
myParentDescriptor = parentDescriptor;
myParentDescriptor = parentDescriptor == null ? NullElementDescriptor.getInstance() : parentDescriptor;
myXmlNSDescriptor = xmlNSDescriptor;
}
@@ -67,7 +67,7 @@ public class AnyXmlElementDescriptor implements XmlElementDescriptor {
}
public XmlElementDescriptor getElementDescriptor(XmlTag tag){
return myParentDescriptor!=null ? myParentDescriptor.getElementDescriptor(tag):null;
return myParentDescriptor.getElementDescriptor(tag);
}
public XmlAttributeDescriptor[] getAttributesDescriptors() {
@@ -0,0 +1,88 @@
/**
* @author cdr
*/
package com.intellij.xml.impl.schema;
import com.intellij.xml.XmlElementDescriptor;
import com.intellij.xml.XmlAttributeDescriptor;
import com.intellij.xml.XmlNSDescriptor;
import com.intellij.psi.xml.XmlTag;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiSubstitutor;
import com.intellij.psi.scope.PsiScopeProcessor;
public class NullElementDescriptor implements XmlElementDescriptor {
private static final NullElementDescriptor INSTANCE = new NullElementDescriptor();
public static NullElementDescriptor getInstance() {
return INSTANCE;
}
private NullElementDescriptor() {
}
public String getQualifiedName() {
return null;
}
public String getDefaultName() {
return null;
}
//todo: refactor to support full DTD spec
public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) {
return new XmlElementDescriptor[0];
}
public XmlElementDescriptor getElementDescriptor(XmlTag childTag) {
return null;
}
public XmlAttributeDescriptor[] getAttributesDescriptors() {
return new XmlAttributeDescriptor[0];
}
public XmlAttributeDescriptor getAttributeDescriptor(String attributeName) {
return null;
}
public XmlAttributeDescriptor getAttributeDescriptor(XmlAttribute attribute) {
return null;
}
public XmlNSDescriptor getNSDescriptor() {
return null;
}
public int getContentType() {
return 0;
}
public PsiElement getDeclaration() {
return null;
}
public boolean processDeclarations(PsiElement context,
PsiScopeProcessor processor,
PsiSubstitutor substitutor,
PsiElement lastElement,
PsiElement place) {
return false;
}
public String getName(PsiElement context) {
return null;
}
public String getName() {
return null;
}
public void init(PsiElement element) {
}
public Object[] getDependences() {
return new Object[0];
}
}