当前位置: 首页>>代码示例>>Java>>正文


Java BaseRefactoringProcessor类代码示例

本文整理汇总了Java中com.intellij.refactoring.BaseRefactoringProcessor的典型用法代码示例。如果您正苦于以下问题:Java BaseRefactoringProcessor类的具体用法?Java BaseRefactoringProcessor怎么用?Java BaseRefactoringProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseRefactoringProcessor类属于com.intellij.refactoring包,在下文中一共展示了BaseRefactoringProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProcessor

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Override
protected BaseRefactoringProcessor createProcessor(final String newQName,
                                                   Project project,
                                                   final PsiDirectory[] dirsToRename,
                                                   boolean searchInComments, boolean searchInNonJavaFiles) {
  return new MoveDirectoryWithClassesProcessor(project, dirsToRename, null, searchInComments, searchInNonJavaFiles, false, null) {
    @Override
    public TargetDirectoryWrapper getTargetDirectory(final PsiDirectory dir) {
      return new TargetDirectoryWrapper(dir.getParentDirectory(), StringUtil.getShortName(newQName));
    }

    @Override
    protected String getTargetName() {
      return newQName;
    }

    @Override
    protected String getCommandName() {
      return RefactoringBundle.message(dirsToRename.length == 1 ? "rename.directory.command.name" : "rename.directories.command.name");
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DirectoryAsPackageRenameHandler.java

示例2: renameDirs

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
private void renameDirs(final Project project,
                        final PsiElement nameSuggestionContext,
                        final Editor editor,
                        final PsiDirectory contextDirectory,
                        final T aPackage,
                        final PsiDirectory... dirsToRename) {
  final RenameDialog dialog = new RenameDialog(project, contextDirectory, nameSuggestionContext, editor) {
    @Override
    protected void doAction() {
      String newQName = StringUtil.getQualifiedName(StringUtil.getPackageName(getQualifiedName(aPackage)), getNewName());
      BaseRefactoringProcessor moveProcessor = createProcessor(newQName, project, dirsToRename, isSearchInComments(),
                                                               isSearchInNonJavaFiles());
      invokeRefactoring(moveProcessor);
    }
  };
  dialog.show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DirectoryAsPackageRenameHandlerBase.java

示例3: testIndirectGlobReferencesNotIncluded

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Test
public void testIndirectGlobReferencesNotIncluded() {
  PsiFile javaFile =
      workspace.createPsiFile(
          new WorkspacePath("com/google/Test.java"),
          "package com.google;",
          "public class Test {}");

  PsiClass javaClass = PsiUtils.findFirstChildOfClassRecursive(javaFile, PsiClass.class);

  createBuildFile(
      new WorkspacePath("com/google/BUILD"),
      "java_library(",
      "    name = 'lib'",
      "    srcs = glob(['*.java'])",
      ")");

  try {
    SafeDeleteHandler.invoke(getProject(), new PsiElement[] {javaClass}, true);
  } catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    Assert.fail("Glob reference was incorrectly included");
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:24,代码来源:SafeDeleteTest.java

示例4: testDirectGlobReferencesIncluded

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Test
public void testDirectGlobReferencesIncluded() {
  PsiFile javaFile =
      workspace.createPsiFile(
          new WorkspacePath("com/google/Test.java"),
          "package com.google;",
          "public class Test {}");

  PsiClass javaClass = PsiUtils.findFirstChildOfClassRecursive(javaFile, PsiClass.class);

  createBuildFile(
      new WorkspacePath("com/google/BUILD"),
      "java_library(",
      "    name = 'lib'",
      "    srcs = glob(['Test.java'])",
      ")");

  try {
    SafeDeleteHandler.invoke(getProject(), new PsiElement[] {javaClass}, true);
  } catch (BaseRefactoringProcessor.ConflictsInTestsException expected) {
    return;
  }
  Assert.fail("Expected an unsafe usage to be found");
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:25,代码来源:SafeDeleteTest.java

示例5: createRefactoringProcessor

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Override
@RequiredDispatchThread
protected BaseRefactoringProcessor createRefactoringProcessor()
{
	CSharpChangeInfo changeInfo = generateChangeInfo();

	return new ChangeSignatureProcessorBase(getProject(), changeInfo)
	{
		@NotNull
		@Override
		protected UsageViewDescriptor createUsageViewDescriptor(UsageInfo[] usages)
		{
			return new ChangeSignatureViewDescriptor(myMethod.getMethod());
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:17,代码来源:CSharpChangeSignatureDialog.java

示例6: invokeRefactoring

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Override
protected void invokeRefactoring(final BaseRefactoringProcessor processor) {
  if (myMethodsToPropagateExceptions != null && !mayPropagateExceptions()) {
    Messages.showWarningDialog(myProject, RefactoringBundle.message("changeSignature.exceptions.wont.propagate"), REFACTORING_NAME);
    myMethodsToPropagateExceptions = null;
  }
  super.invokeRefactoring(processor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaChangeSignatureDialog.java

示例7: createRefactoringProcessor

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
@Override
protected BaseRefactoringProcessor createRefactoringProcessor() {
  final List<ParameterInfoImpl> parameters = getParameters();
  return new ChangeSignatureProcessor(myProject,
                                      myMethod.getMethod(),
                                      isGenerateDelegate(),
                                      getVisibility(),
                                      getMethodName(),
                                      getReturnType(),
                                      parameters.toArray(new ParameterInfoImpl[parameters.size()]),
                                      getExceptions(),
                                      myMethodsToPropagateParameters,
                                      myMethodsToPropagateExceptions);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JavaChangeSignatureDialog.java

示例8: doTestConflict

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
private void doTestConflict() {
  try {
    doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
    fail("Conflict expected");
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException ignored) { }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ChangeSignatureTouchLambdaTest.java

示例9: testVisibilityConflict

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testVisibilityConflict() throws Exception {
  try {
    doTest(0, PsiModifier.PRIVATE);
    fail("Conflict was not detected");
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Method <b><code>Test.foo(Bar)</code></b> is private and will not be accessible from instance initializer of class class <b><code>Test</code></b>.", e.getMessage()); 
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ConvertToInstanceMethodTest.java

示例10: testMethodReference

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testMethodReference() throws Exception {
  try {
    doTest(true, 0);
    fail("Conflict was not detected");
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Method reference would be broken after move", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:MoveInstanceMethodTest.java

示例11: testRefOuterThis

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testRefOuterThis() throws Exception {
  try {
    doTest(false);
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Parameter initializer depends on this which is not available inside the method and cannot be inlined", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InlineParameterTest.java

示例12: testRefNewInner

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testRefNewInner() throws Exception {
  try {
    doTest(false);
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Parameter initializer depends on class <b><code>User.Local</code></b> which is not available inside method and cannot be inlined", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InlineParameterTest.java

示例13: testRefNewInnerFromMethod

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testRefNewInnerFromMethod() throws Exception {
  try {
    doTest(false);
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Parameter initializer depends on class <b><code>Local</code></b> which is not available inside method and cannot be inlined", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InlineParameterTest.java

示例14: testRefNewLocal

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testRefNewLocal() throws Exception {
  try {
    doTest(false);
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Parameter initializer depends on class <b><code>Local</code></b> which is not available inside method and cannot be inlined", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InlineParameterTest.java

示例15: testRefArrayAccess

import com.intellij.refactoring.BaseRefactoringProcessor; //导入依赖的package包/类
public void testRefArrayAccess() throws Exception {
  try {
    doTest(false);
  }
  catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
    assertEquals("Parameter initializer depends on value which is not available inside method and cannot be inlined", e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:InlineParameterTest.java


注:本文中的com.intellij.refactoring.BaseRefactoringProcessor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。