本文整理汇总了Java中com.intellij.refactoring.rename.RenameUtil.addConflictDescriptions方法的典型用法代码示例。如果您正苦于以下问题:Java RenameUtil.addConflictDescriptions方法的具体用法?Java RenameUtil.addConflictDescriptions怎么用?Java RenameUtil.addConflictDescriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.refactoring.rename.RenameUtil
的用法示例。
在下文中一共展示了RenameUtil.addConflictDescriptions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findConflicts
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
public MultiMap<PsiElement, String> findConflicts(Ref<UsageInfo[]> refUsages) {
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
addMethodConflicts(conflictDescriptions);
UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (myChangeInfo.isVisibilityChanged()) {
try {
addInaccessibilityDescriptions(usagesSet, conflictDescriptions);
}
catch (IncorrectOperationException e) {
LOG.error(e);
}
}
return conflictDescriptions;
}
示例2: preprocessUsages
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
for (ChangeSignatureUsageProcessor processor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
if (!processor.setupDefaultValues(myChangeInfo, refUsages, myProject)) return false;
}
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.size() == 0) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
if (myPrepareSuccessfulSwingThreadCallback != null) {
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
if (!dialog.showAndGet()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
}
if (myChangeInfo.isReturnTypeChanged()) {
askToRemoveCovariantOverriders(usagesSet);
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例3: preprocessUsages
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
@Override
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.isEmpty()) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
if (!dialog.showAndGet()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例4: preprocessUsages
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
@Override
protected boolean preprocessUsages(Ref<UsageInfo[]> refUsages) {
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.size() == 0) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
dialog.show();
if (!dialog.isOK()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例5: preprocessUsages
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
protected boolean preprocessUsages(Ref<UsageInfo[]> refUsages) {
for (ChangeSignatureUsageProcessor processor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
if (!processor.setupDefaultValues(myChangeInfo, refUsages, myProject)) return false;
}
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for (ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions()) {
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for (PsiElement key : conflicts.keySet()) {
Collection<String> collection = conflictDescriptions.get(key);
if (collection.size() == 0) collection = new HashSet<String>();
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if (!conflictDescriptions.isEmpty()) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflictDescriptions.values());
}
if (myPrepareSuccessfulSwingThreadCallback != null) {
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
dialog.show();
if (!dialog.isOK()) {
if (dialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
}
if (myChangeInfo.isReturnTypeChanged()) {
askToRemoveCovariantOverriders(usagesSet);
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}
示例6: preprocessUsages
import com.intellij.refactoring.rename.RenameUtil; //导入方法依赖的package包/类
@Override
protected boolean preprocessUsages(Ref<UsageInfo[]> refUsages)
{
for(ChangeSignatureUsageProcessor processor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions())
{
if(processor instanceof ChangeSignatureUsageProcessorEx && ((ChangeSignatureUsageProcessorEx) processor).setupDefaultValues
(myChangeInfo, refUsages, myProject))
{
return false;
}
}
MultiMap<PsiElement, String> conflictDescriptions = new MultiMap<PsiElement, String>();
for(ChangeSignatureUsageProcessor usageProcessor : ChangeSignatureUsageProcessor.EP_NAME.getExtensions())
{
final MultiMap<PsiElement, String> conflicts = usageProcessor.findConflicts(myChangeInfo, refUsages);
for(PsiElement key : conflicts.keySet())
{
Collection<String> collection = conflictDescriptions.get(key);
if(collection.size() == 0)
{
collection = new HashSet<String>();
}
collection.addAll(conflicts.get(key));
conflictDescriptions.put(key, collection);
}
}
final UsageInfo[] usagesIn = refUsages.get();
RenameUtil.addConflictDescriptions(usagesIn, conflictDescriptions);
Set<UsageInfo> usagesSet = new HashSet<UsageInfo>(Arrays.asList(usagesIn));
RenameUtil.removeConflictUsages(usagesSet);
if(!conflictDescriptions.isEmpty())
{
if(ApplicationManager.getApplication().isUnitTestMode())
{
throw new ConflictsInTestsException(conflictDescriptions.values());
}
if(myPrepareSuccessfulSwingThreadCallback != null)
{
ConflictsDialog dialog = prepareConflictsDialog(conflictDescriptions, usagesIn);
dialog.show();
if(!dialog.isOK())
{
if(dialog.isShowConflicts())
{
prepareSuccessful();
}
return false;
}
}
}
if(myChangeInfo.isReturnTypeChanged())
{
askToRemoveCovariantOverriders(usagesSet);
}
refUsages.set(usagesSet.toArray(new UsageInfo[usagesSet.size()]));
prepareSuccessful();
return true;
}