本文整理汇总了Java中com.intellij.refactoring.move.MoveClassesOrPackagesCallback类的典型用法代码示例。如果您正苦于以下问题:Java MoveClassesOrPackagesCallback类的具体用法?Java MoveClassesOrPackagesCallback怎么用?Java MoveClassesOrPackagesCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MoveClassesOrPackagesCallback类属于com.intellij.refactoring.move包,在下文中一共展示了MoveClassesOrPackagesCallback类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performPsiSpoilingRefactoring
import com.intellij.refactoring.move.MoveClassesOrPackagesCallback; //导入依赖的package包/类
protected void performPsiSpoilingRefactoring() {
RenameUtil.renameNonCodeUsages(myProject, myNonCodeUsages);
if (myMoveCallback != null) {
if (myMoveCallback instanceof MoveClassesOrPackagesCallback) {
((MoveClassesOrPackagesCallback) myMoveCallback).classesOrPackagesMoved(myMoveDestination);
}
myMoveCallback.refactoringCompleted();
}
}
示例2: performPsiSpoilingRefactoring
import com.intellij.refactoring.move.MoveClassesOrPackagesCallback; //导入依赖的package包/类
protected void performPsiSpoilingRefactoring() {
if (myNonCodeUsages != null) {
RenameUtil.renameNonCodeUsages(myProject, myNonCodeUsages);
}
if (myMoveCallback != null) {
if (myMoveCallback instanceof MoveClassesOrPackagesCallback) {
((MoveClassesOrPackagesCallback) myMoveCallback).classesMovedToInner(myTargetClass);
}
myMoveCallback.refactoringCompleted();
}
}
示例3: setData
import com.intellij.refactoring.move.MoveClassesOrPackagesCallback; //导入依赖的package包/类
public void setData(PsiElement[] psiElements,
String targetPackageName,
PsiDirectory initialTargetDirectory,
boolean isTargetDirectoryFixed,
boolean suggestToMoveToAnotherRoot,
boolean searchInComments,
boolean searchForTextOccurences,
String helpID) {
myTargetDirectoryFixed = isTargetDirectoryFixed;
mySuggestToMoveToAnotherRoot = suggestToMoveToAnotherRoot;
if (targetPackageName.length() != 0) {
myWithBrowseButtonReference.prependItem(targetPackageName);
myClassPackageChooser.prependItem(targetPackageName);
}
String nameFromCallback = myMoveCallback instanceof MoveClassesOrPackagesCallback
? ((MoveClassesOrPackagesCallback)myMoveCallback).getElementsToMoveName()
: null;
if (nameFromCallback != null) {
myNameLabel.setText(nameFromCallback);
}
else if (psiElements.length == 1) {
PsiElement firstElement = psiElements[0];
if (firstElement instanceof PsiClass) {
LOG.assertTrue(!MoveClassesOrPackagesImpl.isClassInnerOrLocal((PsiClass)firstElement));
}
else {
PsiElement parent = firstElement.getParent();
LOG.assertTrue(parent != null);
}
myNameLabel.setText(RefactoringBundle.message("move.single.class.or.package.name.label", UsageViewUtil.getType(firstElement),
UsageViewUtil.getLongName(firstElement)));
}
else if (psiElements.length > 1) {
myNameLabel.setText(psiElements[0] instanceof PsiClass
? RefactoringBundle.message("move.specified.classes")
: RefactoringBundle.message("move.specified.packages"));
}
selectInitialCard();
myCbSearchInComments.setSelected(searchInComments);
myCbSearchTextOccurences.setSelected(searchForTextOccurences);
if (initialTargetDirectory != null &&
JavaMoveClassesOrPackagesHandler.packageHasMultipleDirectoriesInModule(myProject, initialTargetDirectory)) {
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
final Set<VirtualFile> initialRoots = new HashSet<VirtualFile>();
collectSourceRoots(psiElements, fileIndex, initialRoots);
if (initialRoots.size() > 1) {
initialTargetDirectory = null;
}
}
((DestinationFolderComboBox)myDestinationFolderCB).setData(myProject, initialTargetDirectory,
new Pass<String>() {
@Override
public void pass(String s) {
setErrorText(s);
}
}, myHavePackages ? myWithBrowseButtonReference.getChildComponent() : myClassPackageChooser.getChildComponent());
UIUtil.setEnabled(myTargetPanel, !getSourceRoots().isEmpty() && isMoveToPackage() && !isTargetDirectoryFixed, true);
validateButtons();
myHelpID = helpID;
}
示例4: setData
import com.intellij.refactoring.move.MoveClassesOrPackagesCallback; //导入依赖的package包/类
public void setData(PsiElement[] psiElements,
String targetPackageName,
PsiDirectory initialTargetDirectory,
boolean isTargetDirectoryFixed,
boolean suggestToMoveToAnotherRoot,
boolean searchInComments,
boolean searchForTextOccurences,
String helpID) {
myTargetDirectoryFixed = isTargetDirectoryFixed;
mySuggestToMoveToAnotherRoot = suggestToMoveToAnotherRoot;
if (targetPackageName.length() != 0) {
myWithBrowseButtonReference.prependItem(targetPackageName);
myClassPackageChooser.prependItem(targetPackageName);
}
String nameFromCallback = myMoveCallback instanceof MoveClassesOrPackagesCallback
? ((MoveClassesOrPackagesCallback)myMoveCallback).getElementsToMoveName()
: null;
if (nameFromCallback != null) {
myNameLabel.setText(nameFromCallback);
}
else if (psiElements.length == 1) {
PsiElement firstElement = psiElements[0];
if (firstElement instanceof PsiClass) {
LOG.assertTrue(!MoveClassesOrPackagesImpl.isClassInnerOrLocal((PsiClass)firstElement));
}
else {
PsiElement parent = firstElement.getParent();
LOG.assertTrue(parent != null);
}
myNameLabel.setText(RefactoringBundle.message("move.single.class.or.package.name.label", UsageViewUtil.getType(firstElement),
UsageViewUtil.getLongName(firstElement)));
}
else if (psiElements.length > 1) {
myNameLabel.setText(psiElements[0] instanceof PsiClass
? RefactoringBundle.message("move.specified.classes")
: RefactoringBundle.message("move.specified.packages"));
}
selectInitialCard();
myCbSearchInComments.setSelected(searchInComments);
myCbSearchTextOccurences.setSelected(searchForTextOccurences);
if (initialTargetDirectory != null &&
JavaMoveClassesOrPackagesHandler.packageHasMultipleDirectoriesInModule(myProject, initialTargetDirectory)) {
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
final Set<VirtualFile> initialRoots = new HashSet<VirtualFile>();
collectSourceRoots(psiElements, fileIndex, initialRoots);
if (initialRoots.size() > 1) {
initialTargetDirectory = null;
}
}
((DestinationFolderComboBox)myDestinationFolderCB).setData(myProject, initialTargetDirectory,
new Pass<String>() {
@Override
public void pass(String s) {
setErrorText(s);
}
}, myHavePackages ? myWithBrowseButtonReference.getChildComponent() : myClassPackageChooser.getChildComponent());
UIUtil.setEnabled(myTargetPanel, getSourceRoots().length > 0 && isMoveToPackage() && !isTargetDirectoryFixed, true);
validateButtons();
myHelpID = helpID;
}
示例5: setData
import com.intellij.refactoring.move.MoveClassesOrPackagesCallback; //导入依赖的package包/类
public void setData(PsiElement[] psiElements,
String targetPackageName,
PsiDirectory initialTargetDirectory,
boolean isTargetDirectoryFixed,
boolean suggestToMoveToAnotherRoot,
boolean searchInComments,
boolean searchForTextOccurences,
String helpID) {
myTargetDirectoryFixed = isTargetDirectoryFixed;
mySuggestToMoveToAnotherRoot = suggestToMoveToAnotherRoot;
if (targetPackageName.length() != 0) {
myWithBrowseButtonReference.prependItem(targetPackageName);
myClassPackageChooser.prependItem(targetPackageName);
}
String nameFromCallback = myMoveCallback instanceof MoveClassesOrPackagesCallback
? ((MoveClassesOrPackagesCallback)myMoveCallback).getElementsToMoveName()
: null;
if (nameFromCallback != null) {
myNameLabel.setText(nameFromCallback);
}
else if (psiElements.length == 1) {
PsiElement firstElement = psiElements[0];
if (firstElement instanceof PsiClass) {
LOG.assertTrue(!MoveClassesOrPackagesImpl.isClassInnerOrLocal((PsiClass)firstElement));
}
else {
PsiElement parent = firstElement.getParent();
LOG.assertTrue(parent != null);
}
myNameLabel.setText(RefactoringBundle.message("move.single.class.or.package.name.label", UsageViewUtil.getType(firstElement),
UsageViewUtil.getLongName(firstElement)));
}
else if (psiElements.length > 1) {
myNameLabel.setText(psiElements[0] instanceof PsiClass
? RefactoringBundle.message("move.specified.classes")
: RefactoringBundle.message("move.specified.packages"));
}
selectInitialCard();
myCbSearchInComments.setSelected(searchInComments);
myCbSearchTextOccurences.setSelected(searchForTextOccurences);
if (initialTargetDirectory != null &&
JavaMoveClassesOrPackagesHandler.packageHasMultipleDirectoriesInModule(myProject, initialTargetDirectory)) {
initialTargetDirectory = null;
}
((DestinationFolderComboBox)myDestinationFolderCB).setData(myProject, initialTargetDirectory,
new Pass<String>() {
@Override
public void pass(String s) {
setErrorText(s);
}
}, myHavePackages ? myWithBrowseButtonReference.getChildComponent() : myClassPackageChooser.getChildComponent());
UIUtil.setEnabled(myTargetPanel, getSourceRoots().length > 0 && isMoveToPackage() && !isTargetDirectoryFixed, true);
validateButtons();
myHelpID = helpID;
}