本文整理汇总了Java中com.intellij.refactoring.ui.ConflictsDialog.isOK方法的典型用法代码示例。如果您正苦于以下问题:Java ConflictsDialog.isOK方法的具体用法?Java ConflictsDialog.isOK怎么用?Java ConflictsDialog.isOK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.refactoring.ui.ConflictsDialog
的用法示例。
在下文中一共展示了ConflictsDialog.isOK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doOKAction
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected void doOKAction() {
MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (myCreateInnerClassRb.isSelected()) {
final PsiClass innerClass = myTargetClass.findInnerClassByName(myInnerClassName.getText(), false);
if (innerClass != null) {
conflicts.putValue(innerClass, "Inner class " + myInnerClassName.getText() + " already defined in class " + myTargetClass.getName());
}
}
if (conflicts.size() > 0) {
final ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
if (!conflictsDialog.isOK()){
if (conflictsDialog.isShowConflicts()) close(CANCEL_EXIT_CODE);
return;
}
}
final JCheckBox makeVarargsCb = myCreateInnerClassRb.isSelected() ? myCbMakeVarargs : myCbMakeVarargsAnonymous;
if (makeVarargsCb != null && makeVarargsCb.isSelected()) {
final VariableData data = myInputVariables[myInputVariables.length - 1];
if (data.type instanceof PsiArrayType) {
data.type = new PsiEllipsisType(((PsiArrayType)data.type).getComponentType());
}
}
super.doOKAction();
}
示例2: doOKAction
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected void doOKAction() {
MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
checkMethodConflicts(conflicts);
if (!conflicts.isEmpty()) {
final ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
if (!conflictsDialog.isOK()){
if (conflictsDialog.isShowConflicts()) close(CANCEL_EXIT_CODE);
return;
}
}
if (myMakeVarargs != null && myMakeVarargs.isSelected()) {
final VariableData data = myInputVariables[myInputVariables.length - 1];
if (data.type instanceof PsiArrayType) {
data.type = new PsiEllipsisType(((PsiArrayType)data.type).getComponentType());
}
}
super.doOKAction();
}
示例3: preprocessUsages
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected final boolean preprocessUsages(final Ref<UsageInfo[]> refUsages) {
UsageInfo[] usagesIn = refUsages.get();
if (myPrepareSuccessfulSwingThreadCallback != null) {
MultiMap<PsiElement, String> conflicts = getConflictDescriptions(usagesIn);
if (conflicts.size() > 0) {
ConflictsDialog conflictsDialog = prepareConflictsDialog(conflicts, refUsages.get());
conflictsDialog.show();
if (!conflictsDialog.isOK()) {
if (conflictsDialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
if(!mySettings.isChangeSignature()) {
refUsages.set(filterInternalUsages(usagesIn));
}
}
refUsages.set(filterOverriding(usagesIn));
prepareSuccessful();
return true;
}
示例4: checkConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
public boolean checkConflicts(final PullUpDialog dialog) {
final MemberInfo[] infos = dialog.getSelectedMemberInfos();
final PsiClass superClass = dialog.getSuperClass();
if (!checkWritable(superClass, infos)) return false;
final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
final PsiDirectory targetDirectory = superClass.getContainingFile().getContainingDirectory();
final PsiPackage targetPackage = targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null;
conflicts
.putAllValues(PullUpConflictsUtil.checkConflicts(infos, mySubclass, superClass, targetPackage, targetDirectory, dialog.getContainmentVerifier()));
}
}, RefactoringBundle.message("detecting.possible.conflicts"), true, myProject)) return false;
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例5: showConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected boolean showConflicts(final MultiMap<PsiElement, String> conflicts, @Nullable final UsageInfo[] usages) {
if (!conflicts.isEmpty() && ApplicationManager.getApplication().isUnitTestMode()) {
throw new ConflictsInTestsException(conflicts.values());
}
if (myPrepareSuccessfulSwingThreadCallback != null && !conflicts.isEmpty()) {
final ConflictsDialog conflictsDialog = prepareConflictsDialog(conflicts, usages);
conflictsDialog.show();
if (!conflictsDialog.isOK()) {
if (conflictsDialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
prepareSuccessful();
return true;
}
示例6: showConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
public static boolean showConflicts(DialogWrapper dialog, MultiMap<PsiElement, String> conflicts, final Project project) {
if (!conflicts.isEmpty()) {
fireConflictsEvent(conflicts, project);
ConflictsDialog conflictsDialog = new ConflictsDialog(project, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例7: reportConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected boolean reportConflicts(final MultiMap<PsiElement,String> conflicts, final Project project, IntroduceVariableSettings dialog) {
ConflictsDialog conflictsDialog = new ConflictsDialog(project, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) {
if (dialog instanceof DialogWrapper) ((DialogWrapper)dialog).close(DialogWrapper.CANCEL_EXIT_CODE);
}
return ok;
}
示例8: checkConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
@Override
public boolean checkConflicts(final PullUpDialog dialog) {
final List<MemberInfo> infos = dialog.getSelectedMemberInfos();
final MemberInfo[] memberInfos = infos.toArray(new MemberInfo[infos.size()]);
final PsiClass superClass = dialog.getSuperClass();
if (!checkWritable(superClass, memberInfos)) return false;
final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
final PsiDirectory targetDirectory = superClass.getContainingFile().getContainingDirectory();
final PsiPackage targetPackage = targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null;
conflicts
.putAllValues(PullUpConflictsUtil.checkConflicts(memberInfos, mySubclass, superClass, targetPackage, targetDirectory, dialog.getContainmentVerifier()));
}
});
}
}, RefactoringBundle.message("detecting.possible.conflicts"), true, myProject)) return false;
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例9: checkConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
@Override
public boolean checkConflicts(final GrPullUpDialog dialog) {
/* todo */
List<GrMemberInfo> _infos = dialog.getSelectedMemberInfos();
final GrMemberInfo[] infos = _infos.toArray(new GrMemberInfo[_infos.size()]);
final PsiClass superClass = dialog.getSuperClass();
if (!checkWritable(superClass, infos)) return false;
final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
final PsiDirectory targetDirectory = superClass.getContainingFile().getContainingDirectory();
final PsiPackage targetPackage =
targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null;
conflicts.putAllValues(GrPullUpConflictsUtil.checkConflicts(infos, mySubclass, superClass, targetPackage, targetDirectory,
dialog.getContainmentVerifier()));
}
});
}
}, RefactoringBundle.message("detecting.possible.conflicts"), true, myProject)) {
return false;
}
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例10: showConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
public static boolean showConflicts(DialogWrapper dialog, MultiMap<PsiElement, String> conflicts, final Project project) {
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = new ConflictsDialog(project, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例11: preprocessUsages
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
protected boolean preprocessUsages(Ref<UsageInfo[]> refUsages) {
final UsageInfo[] usagesIn = refUsages.get();
ArrayList<UsageInfo> oldUsages = new ArrayList<UsageInfo>();
addAll(oldUsages, usagesIn);
final ObjectUpcastedUsageInfo[] objectUpcastedUsageInfos = objectUpcastedUsages(usagesIn);
if (myPrepareSuccessfulSwingThreadCallback != null) {
MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (objectUpcastedUsageInfos.length > 0) {
final String message = RefactoringBundle.message("instances.of.0.upcasted.to.1.were.found",
RefactoringUIUtil.getDescription(myClass, true), CommonRefactoringUtil.htmlEmphasize(
CommonClassNames.JAVA_LANG_OBJECT));
conflicts.putValue(myClass, message);
}
analyzeConflicts(usagesIn, conflicts);
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = prepareConflictsDialog(conflicts, usagesIn);
conflictsDialog.show();
if (!conflictsDialog.isOK()){
if (conflictsDialog.isShowConflicts()) prepareSuccessful();
return false;
}
}
if (objectUpcastedUsageInfos.length > 0) {
showObjectUpcastedUsageView(objectUpcastedUsageInfos);
setPreviewUsages(true);
}
}
ArrayList<UsageInfo> filteredUsages = filterUsages(oldUsages);
refUsages.set(filteredUsages.toArray(new UsageInfo[filteredUsages.size()]));
prepareSuccessful();
return true;
}
示例12: preprocessUsages
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的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;
}
示例13: processIntention
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
@Override
protected final void processIntention(@NotNull PsiElement element) throws IncorrectOperationException {
final PsiMember member = (PsiMember)element.getParent();
final PsiModifierList modifierList = member.getModifierList();
if (modifierList == null) {
return;
}
final MultiMap<PsiElement, String> conflicts = checkForConflicts(member);
final boolean conflictsDialogOK;
if (conflicts.isEmpty()) {
conflictsDialogOK = true;
} else {
final ConflictsDialog conflictsDialog = new ConflictsDialog(member.getProject(), conflicts, new Runnable() {
@Override
public void run() {
final AccessToken token = WriteAction.start();
try {
modifierList.setModifierProperty(getModifier(), true);
}
finally {
token.finish();
}
}
});
conflictsDialog.show();
conflictsDialogOK = conflictsDialog.isOK();
}
if (conflictsDialogOK) {
modifierList.setModifierProperty(getModifier(), true);
}
}
示例14: checkConflicts
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
@Override
public boolean checkConflicts(final HaxePullUpDialog dialog) {
final List<MemberInfo> infos = dialog.getSelectedMemberInfos();
final MemberInfo[] memberInfos = infos.toArray(new MemberInfo[infos.size()]);
final PsiClass superClass = dialog.getSuperClass();
if (!checkWritable(superClass, memberInfos)) return false;
final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
//final PsiDirectory targetDirectory = superClass.getContainingFile().getContainingDirectory();
//final PsiPackage targetPackage = targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null;
//conflicts
// .putAllValues(PullUpConflictsUtil.checkConflicts(memberInfos, mySubclass, superClass, targetPackage, targetDirectory,
// dialog.getContainmentVerifier()));
}
});
}
}, RefactoringBundle.message("detecting.possible.conflicts"), true, myProject)) return false;
if (!conflicts.isEmpty()) {
ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
conflictsDialog.show();
final boolean ok = conflictsDialog.isOK();
if (!ok && conflictsDialog.isShowConflicts()) dialog.close(DialogWrapper.CANCEL_EXIT_CODE);
return ok;
}
return true;
}
示例15: showConflictsDialog
import com.intellij.refactoring.ui.ConflictsDialog; //导入方法依赖的package包/类
private boolean showConflictsDialog(final JSNamedElement existing, final String name)
{
final String message = existing instanceof JSFunction ? JavaScriptBundle.message("javascript.introduce.variable.function.already.exists",
CommonRefactoringUtil.htmlEmphasize(name)) : JavaScriptBundle.message("javascript.introduce.variable.variable.already.exists",
CommonRefactoringUtil.htmlEmphasize(name));
final ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, message);
conflictsDialog.show();
return conflictsDialog.isOK();
}