com.intellij.psi.ElementManipulator Java Examples

The following examples show how to use com.intellij.psi.ElementManipulator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractBashFileReference.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@NotNull
private ElementManipulator<AbstractBashCommand<?>> getManipulator() {
    ElementManipulator<AbstractBashCommand<?>> manipulator = ElementManipulators.<AbstractBashCommand<?>>getManipulator(cmd);
    if (manipulator == null) {
        throw new IncorrectOperationException("No element manipulator found for " + cmd);
    }

    return manipulator;
}
 
Example #2
Source File: AbstractFunctionReference.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
@NotNull
private ElementManipulator<AbstractBashCommand<?>> getManipulator() {
    ElementManipulator<AbstractBashCommand<?>> manipulator = ElementManipulators.<AbstractBashCommand<?>>getManipulator(cmd);
    if (manipulator == null) {
        throw new IncorrectOperationException("No element manipulator found for " + cmd);
    }
    return manipulator;
}
 
Example #3
Source File: CachingReference.java    From consulo with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #4
Source File: BeanSelfReference.java    From camel-idea-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public PsiElement handleElementRename(@NotNull String newElementName) throws IncorrectOperationException {
    ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(myElement);
    return manipulator.handleContentChange(myElement, TextRange.from(1, id.length()), newElementName);
}
 
Example #5
Source File: DirectEndpointReference.java    From camel-idea-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public PsiElement handleElementRename(@NotNull String newElementName) throws IncorrectOperationException {
    ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(myElement);
    return manipulator.handleContentChange(myElement, endpoint.getNameTextRange().shiftRight(1), newElementName);
}
 
Example #6
Source File: DirectEndpointStartSelfReference.java    From camel-idea-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public PsiElement handleElementRename(@NotNull String newElementName) throws IncorrectOperationException {
    ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(myElement);
    return manipulator.handleContentChange(myElement, endpoint.getNameTextRange().shiftRight(1), newElementName);
}