本文整理汇总了Java中com.intellij.refactoring.listeners.RefactoringElementListener.elementMoved方法的典型用法代码示例。如果您正苦于以下问题:Java RefactoringElementListener.elementMoved方法的具体用法?Java RefactoringElementListener.elementMoved怎么用?Java RefactoringElementListener.elementMoved使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.refactoring.listeners.RefactoringElementListener
的用法示例。
在下文中一共展示了RefactoringElementListener.elementMoved方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: move
import com.intellij.refactoring.listeners.RefactoringElementListener; //导入方法依赖的package包/类
@Override
public boolean move(PsiFile file,
PsiDirectory moveDestination,
Map<PsiElement, PsiElement> oldToNewElementsMapping,
List<PsiFile> movedFiles,
RefactoringElementListener listener) {
if (!(file instanceof PsiClassOwner)) {
return false;
}
final PsiClass[] classes = ((PsiClassOwner)file).getClasses();
if (classes.length == 0) {
return false;
}
if (FileTypeUtils.isInServerPageFile(file)) {
return false;
}
for (PsiClass psiClass : classes) {
final PsiClass newClass = MoveClassesOrPackagesUtil.doMoveClass(psiClass, moveDestination);
oldToNewElementsMapping.put(psiClass, newClass);
listener.elementMoved(newClass);
}
return true;
}
示例2: move
import com.intellij.refactoring.listeners.RefactoringElementListener; //导入方法依赖的package包/类
@Override
public boolean move(PsiFile psiFile,
PsiDirectory moveDestination,
Map<PsiElement, PsiElement> oldToNewElementsMapping,
List<PsiFile> movedFiles,
RefactoringElementListener listener) {
if (moveDestination.equals(psiFile.getContainingDirectory())) {
return false;
}
MoveFileHandler.forElement(psiFile).prepareMovedFile(psiFile, moveDestination, oldToNewElementsMapping);
PsiFile moving = moveDestination.findFile(psiFile.getName());
if (moving == null) {
MoveFilesOrDirectoriesUtil.doMoveFile(psiFile, moveDestination);
}
moving = moveDestination.findFile(psiFile.getName());
movedFiles.add(moving);
listener.elementMoved(psiFile);
return true;
}
示例3: move
import com.intellij.refactoring.listeners.RefactoringElementListener; //导入方法依赖的package包/类
@Override
public boolean move(PsiFile file,
PsiDirectory moveDestination,
Map<PsiElement, PsiElement> oldToNewElementsMapping,
List<PsiFile> movedFiles,
RefactoringElementListener listener) {
if (!(file instanceof PsiClassOwner)) {
return false;
}
if (!JspPsiUtil.isInJspFile(file)) {
return false;
}
for (PsiClass psiClass : ((PsiClassOwner)file).getClasses()) {
final PsiClass newClass = MoveClassesOrPackagesUtil.doMoveClass(psiClass, moveDestination);
oldToNewElementsMapping.put(psiClass, newClass);
listener.elementMoved(newClass);
}
return true;
}