Package com.intellij.util

Examples of com.intellij.util.IncorrectOperationException


  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
    throw new IncorrectOperationException("Not implemented yet");
  }

  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
    throw new IncorrectOperationException("Not implemented yet");
  }
View Full Code Here


    return getText();
  }

  @Override
  public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
    throw new IncorrectOperationException("Can't rename a keyword");
  }
View Full Code Here

    throw new IncorrectOperationException("Can't rename a keyword");
  }

  @Override
  public PsiElement bindToElement(@NotNull PsiElement element) throws IncorrectOperationException {
    throw new IncorrectOperationException("Can't bind a keyword");
  }
View Full Code Here

  private static Header createHeader(Project project, String headerName, String valueText) {
    String text = String.format("%s: %s\n", headerName, valueText);
    PsiFile file = PsiFileFactory.getInstance(project).createFileFromText("DUMMY.MF", ManifestFileTypeFactory.MANIFEST, text);
    Header header = ((ManifestFile)file).getHeader(headerName);
    if (header == null) {
      throw new IncorrectOperationException("Bad header: '" + text + "'");
    }
    return header;
  }
View Full Code Here

    throws IncorrectOperationException {
    PsiElement source = elements[0];

    final DartExpression parenthExprNode = getSurroundedNode(source);
    if (parenthExprNode == null) {
      throw new IncorrectOperationException("Can't create expression for: " + source.getText());
    }

    final PsiElement replace = source.replace(parenthExprNode);
    final int endOffset = replace.getTextRange().getEndOffset();
    return TextRange.create(endOffset, endOffset);
View Full Code Here

    throws IncorrectOperationException {
    PsiElement parent = elements[0].getParent();

    PsiElement surrounder = createSurrounder(project);
    if (surrounder == null) {
      throw new IncorrectOperationException("Can't surround statements!");
    }

    surrounder = parent.addBefore(surrounder, elements[0]);
    final PsiElement elementToAdd = findElementToAdd(surrounder);

    if (elementToAdd == null) {
      parent.deleteChildRange(surrounder, surrounder);
      throw new IncorrectOperationException("Can't surround statements!");
    }

    for (PsiElement element : elements) {
      ASTNode node = element.getNode();
      final ASTNode copyNode = node.copyElement();
View Full Code Here

    }
    return result;
  }

  public void checkSetModifierProperty(@PsiModifier.ModifierConstant @NotNull @NonNls String name, boolean value) throws IncorrectOperationException {
    throw new IncorrectOperationException();
  }
View Full Code Here

        String fileName = fileNameFromTypeName(typeName, parameterName);

        VirtualFile targetFile = dir.getVirtualFile().findFileByRelativePath(fileName);
        if  ( targetFile != null ) {
            throw new IncorrectOperationException(GoBundle.message("target.file.exists", targetFile.getPath()));
        }
    }
View Full Code Here

        // check to see if a file with the same name already exists
        PsiFile files[] = dir.getFiles();
        for (PsiFile file : files) {
            if (file.getFileType() == GoFileType.INSTANCE &&
                file.getVirtualFile().getNameWithoutExtension().equals(className)) {
                throw new IncorrectOperationException();
            }
        }
    }
View Full Code Here

        String fileName = fileNameFromTypeName(typeName, parameterName);

        VirtualFile targetFile = dir.getVirtualFile()
                                    .findFileByRelativePath(fileName);
        if (targetFile != null) {
            throw new IncorrectOperationException(
                GoBundle.message("target.file.exists", targetFile.getPath()));
        }
    }
View Full Code Here

TOP

Related Classes of com.intellij.util.IncorrectOperationException

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.