Java 类com.intellij.lang.java.JavaRefactoringSupportProvider 实例源码

项目:intellij-ce-playground    文件:RenameLocalTest.java   
private void doTestInplaceRename(final String newName) throws Exception {
  configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");

  final PsiElement element = TargetElementUtil
    .findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
  assertNotNull(element);
  assertTrue("In-place rename not allowed for " + element,
             JavaRefactoringSupportProvider.mayRenameInplace(element, null));

  CodeInsightTestUtil.doInlineRename(new VariableInplaceRenameHandler(), newName, getEditor(), element);

  checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
}
项目:tools-idea    文件:RenameLocalTest.java   
private void doTestInplaceRename(final String newName) throws Exception {
  configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");

  final PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED | TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED);
  assertNotNull(element);
  assertTrue("In-place rename not allowed for " + element,
             JavaRefactoringSupportProvider.mayRenameInplace(element, null));

  CodeInsightTestUtil.doInlineRename(new VariableInplaceRenameHandler(), newName, getEditor(), element);

  checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
}
项目:consulo-java    文件:JavaVetoRenameCondition.java   
@Override
public boolean value(final PsiElement element)
{
    return JavaRefactoringSupportProvider.isDisableRefactoringForLightElement(element) ||
            element instanceof PsiJavaFile &&
            //  !JspPsiUtil.isInJspFile(element) &&
            !JavaProjectRootsUtil.isOutsideSourceRoot((PsiFile) element) &&
            ((PsiJavaFile) element).getClasses().length > 0;
}
项目:consulo-java    文件:JavaChangeSignatureHandler.java   
@Override
public PsiElement findTargetMember(PsiElement element)
{
    PsiElement target = findTargetImpl(element);
    if(JavaRefactoringSupportProvider.isDisableRefactoringForLightElement(target))
    {
        return null;
    }
    return target;
}
项目:consulo-java    文件:RenameLocalTest.java   
private void doTestInplaceRename(final String newName) throws Exception {
  configureByFile(BASE_PATH + "/" + getTestName(false) + ".java");

  final PsiElement element = TargetElementUtil.findTargetElement(myEditor, ContainerUtil.newHashSet(TargetElementUtilEx.ELEMENT_NAME_ACCEPTED, TargetElementUtilEx.REFERENCED_ELEMENT_ACCEPTED));
  assertNotNull(element);
  assertTrue("In-place rename not allowed for " + element,
             JavaRefactoringSupportProvider.mayRenameInplace(element, null));

  CodeInsightTestUtil.doInlineRename(new VariableInplaceRenameHandler(), newName, getEditor(), element);

  checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
}