Java 类com.intellij.psi.ElementManipulator 实例源码

项目:intellij-ce-playground    文件:CachingReference.java   
@NotNull
public static <T extends PsiElement> ElementManipulator<T> getManipulator(T currentElement){
  ElementManipulator<T> manipulator = ElementManipulators.getManipulator(currentElement);
  if (manipulator == null) {
    throw new IncorrectOperationException("Manipulator for this element is not defined: " + currentElement + "; " + currentElement.getClass());
  }
  return manipulator;
}
项目:tools-idea    文件:CachingReference.java   
@NotNull
public static <T extends PsiElement> ElementManipulator<T> getManipulator(T currentElement){
  ElementManipulator<T> manipulator = ElementManipulators.getManipulator(currentElement);
  if (manipulator == null) {
    throw new IncorrectOperationException("Manipulator for this element is not defined: " + currentElement + "; " + currentElement.getClass());
  }
  return manipulator;
}
项目:consulo-haxe    文件:HaxePsiPackageReference.java   
@Override
public PsiElement bindToElement(@NotNull final PsiElement element) throws IncorrectOperationException
{
    if(!(element instanceof HaxePackage))
    {
        throw new IncorrectOperationException("Cannot bind to " + element);
    }
    final String newName = ((HaxePackage) element).getQualifiedName();
    final TextRange range = new TextRange(getReferenceSet().getReference(0).getRangeInElement().getStartOffset(),
            getRangeInElement().getEndOffset());
    final ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(getElement());
    return manipulator.handleContentChange(getElement(), range, newName);
}
项目:consulo    文件:CachingReference.java   
@Nonnull
public static <T extends PsiElement> ElementManipulator<T> getManipulator(T currentElement){
  ElementManipulator<T> manipulator = ElementManipulators.getManipulator(currentElement);
  if (manipulator == null) {
    throw new IncorrectOperationException("Manipulator for this element is not defined: " + currentElement + "; " + currentElement.getClass());
  }
  return manipulator;
}
项目:consulo-javascript    文件:JSDocTagImpl.java   
@Override
public PsiElement handleElementRename(final String newElementName) throws IncorrectOperationException
{
    JSDocTag jsDocTag = (JSDocTag) myJsDocTagValue.getParent();
    final ElementManipulator<JSDocTag> manipulator = ElementManipulators.getManipulator(jsDocTag);
    jsDocTag = manipulator.handleContentChange(jsDocTag, myRange, newElementName);
    reset((JSDocTagImpl) jsDocTag);
    return myJsDocTagValue;
}
项目:consulo-java    文件:GenericReference.java   
@Override
@Nullable
public PsiElement handleElementRename(String string) throws IncorrectOperationException
{
    final PsiElement element = getElement();
    if(element != null)
    {
        ElementManipulator<PsiElement> man = ElementManipulators.getManipulator(element);
        if(man != null)
        {
            return man.handleContentChange(element, getRangeInElement(), string);
        }
    }
    return element;
}
项目:consulo-java    文件:PsiPackageReference.java   
@Override
public PsiElement bindToElement(@NotNull final PsiElement element) throws IncorrectOperationException
{
    if(!(element instanceof PsiJavaPackage))
    {
        throw new IncorrectOperationException("Cannot bind to " + element);
    }
    final String newName = ((PsiJavaPackage) element).getQualifiedName();
    final TextRange range = new TextRange(getReferenceSet().getReference(0).getRangeInElement().getStartOffset(), getRangeInElement().getEndOffset());
    final ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(getElement());
    return manipulator.handleContentChange(getElement(), range, newName);
}
项目:hybris-integration-intellij-idea-plugin    文件:ImpexMacrosReferenceBase.java   
private ElementManipulator<PsiElement> getManipulator() {
    return new ImpexMacrosManipulator();
}
项目:intellij-ce-playground    文件:XmlValueReference.java   
protected void replaceContent(final String str) throws IncorrectOperationException {
  final ElementManipulator<XmlTag> manipulator = ElementManipulators.getManipulator(myTag);
  manipulator.handleContentChange(myTag, myRange, str);
  myRange = manipulator.getRangeInElement(myTag);
}
项目:tools-idea    文件:XmlValueReference.java   
protected void replaceContent(final String str) throws IncorrectOperationException {
  final ElementManipulator<XmlTag> manipulator = ElementManipulators.getManipulator(myTag);
  manipulator.handleContentChange(myTag, myRange, str);
  myRange = manipulator.getRangeInElement(myTag);
}
项目:consulo-xml    文件:XmlValueReference.java   
protected void replaceContent(final String str) throws IncorrectOperationException {
  final ElementManipulator<XmlTag> manipulator = ElementManipulators.getManipulator(myTag);
  manipulator.handleContentChange(myTag, myRange, str);
  myRange = manipulator.getRangeInElement(myTag);
}