Skip to content

Commit b4e394f

Browse files
committed
compare Messages.showYesNoDialog with correct values: Messages.YES/Messages.NO
1 parent a51190d commit b4e394f

File tree

124 files changed

+294
-279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+294
-279
lines changed

java/compiler/impl/src/com/intellij/compiler/actions/BuildArtifactAction.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -201,7 +201,7 @@ public void run() {
201201
info + "Do you want to continue and clear these directories?";
202202
}
203203
final int answer = Messages.showYesNoDialog(myProject, message, "Clean Artifacts", null);
204-
if (answer != 0) {
204+
if (answer != Messages.YES) {
205205
return;
206206
}
207207
}

java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -443,7 +443,7 @@ public void run() {
443443
DebuggerPanelsManager.getInstance(getProject()).toFront(mySession);
444444
final String displayName = requestor instanceof Breakpoint? ((Breakpoint)requestor).getDisplayName() : requestor.getClass().getSimpleName();
445445
final String message = DebuggerBundle.message("error.evaluating.breakpoint.condition.or.action", displayName, ex.getMessage());
446-
considerRequestHit[0] = Messages.showYesNoDialog(getProject(), message, ex.getTitle(), Messages.getQuestionIcon()) == 0;
446+
considerRequestHit[0] = Messages.showYesNoDialog(getProject(), message, ex.getTitle(), Messages.getQuestionIcon()) == Messages.YES;
447447
}
448448
}, ModalityState.NON_MODAL);
449449
requestHit = considerRequestHit[0];

java/debugger/impl/src/com/intellij/debugger/ui/ExportDialog.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -124,7 +124,7 @@ else if (file.exists()) {
124124
DebuggerBundle.message("threads.export.dialog.title"),
125125
Messages.getQuestionIcon()
126126
);
127-
if (answer == 0) {
127+
if (answer == Messages.YES) {
128128
super.doOKAction();
129129
}
130130
}

java/idea-ui/src/com/intellij/framework/addSupport/impl/AddSupportForSingleFrameworkDialog.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2011 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -109,7 +109,7 @@ protected void run(final Result result) {
109109
int answer = Messages.showYesNoDialog(getRootPane(),
110110
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
111111
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
112-
if (answer != 0) {
112+
if (answer != Messages.YES) {
113113
return;
114114
}
115115
}

java/idea-ui/src/com/intellij/ide/projectWizard/ProjectSettingsStep.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ private boolean validateModulePaths() throws ConfigurationException {
398398
int answer = Messages.showYesNoDialog(IdeBundle.message("prompt.overwrite.project.file", moduleFile.getAbsolutePath(),
399399
IdeBundle.message("project.new.wizard.module.identification")),
400400
IdeBundle.message("title.file.already.exists"), Messages.getQuestionIcon());
401-
if (answer != 0) {
401+
if (answer != Messages.YES) {
402402
return false;
403403
}
404404
}

java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public void onWizardFinished() throws CommitStepException {
332332
int answer = Messages.showYesNoDialog(getComponent(),
333333
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
334334
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
335-
if (answer != 0) {
335+
if (answer != Messages.YES) {
336336
throw new CommitStepException(null);
337337
}
338338
}

java/idea-ui/src/com/intellij/ide/util/frameworkSupport/AddFrameworkSupportDialog.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11

2+
/*
3+
* Copyright 2000-2013 JetBrains s.r.o.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
217
package com.intellij.ide.util.frameworkSupport;
318

419
import com.intellij.CommonBundle;
@@ -76,7 +91,7 @@ protected void doOKAction() {
7691
int answer = Messages.showYesNoDialog(myAddSupportPanel.getMainPanel(),
7792
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
7893
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
79-
if (answer != 0) {
94+
if (answer != Messages.YES) {
8095
return;
8196
}
8297
}

java/idea-ui/src/com/intellij/ide/util/newProjectWizard/ProjectNameWithTypeStep.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -444,7 +444,7 @@ private boolean validateModulePaths() throws ConfigurationException {
444444
int answer = Messages.showYesNoDialog(IdeBundle.message("prompt.overwrite.project.file", moduleFile.getAbsolutePath(),
445445
IdeBundle.message("project.new.wizard.module.identification")),
446446
IdeBundle.message("title.file.already.exists"), Messages.getQuestionIcon());
447-
if (answer != 0) {
447+
if (answer != Messages.YES) {
448448
return true;
449449
}
450450
}

java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SelectTemplateStep.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2012 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -476,7 +476,7 @@ private boolean validateModulePaths() throws ConfigurationException {
476476
int answer = Messages.showYesNoDialog(IdeBundle.message("prompt.overwrite.project.file", moduleFile.getAbsolutePath(),
477477
IdeBundle.message("project.new.wizard.module.identification")),
478478
IdeBundle.message("title.file.already.exists"), Messages.getQuestionIcon());
479-
if (answer != 0) {
479+
if (answer != Messages.YES) {
480480
return false;
481481
}
482482
}

java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SupportForFrameworksStep.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11

2+
/*
3+
* Copyright 2000-2013 JetBrains s.r.o.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
217
package com.intellij.ide.util.newProjectWizard;
318

419
import com.intellij.CommonBundle;
@@ -76,7 +91,7 @@ public void _commit(final boolean finishChosen) throws CommitStepException {
7691
int answer = Messages.showYesNoDialog(getComponent(),
7792
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
7893
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
79-
if (answer != 0) {
94+
if (answer != Messages.YES) {
8095
throw new CommitStepException(null);
8196
}
8297
}

java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -178,7 +178,7 @@ public boolean validateNameAndPath(WizardContext context, boolean defaultFormat)
178178
int answer = Messages.showYesNoDialog(
179179
IdeBundle.message("prompt.overwrite.project.file", projectFile.getAbsolutePath(), context.getPresentationName()),
180180
IdeBundle.message("title.file.already.exists"), Messages.getQuestionIcon());
181-
shouldContinue = (answer == 0);
181+
shouldContinue = (answer == Messages.YES);
182182
}
183183

184184
return shouldContinue;

java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2012 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -130,7 +130,7 @@ public boolean validate() throws ConfigurationException {
130130
: IdeBundle.message("prompt.overwrite.project.file",
131131
projectFile.getAbsolutePath(), myWizardContext.getPresentationName());
132132
int answer = Messages.showYesNoDialog(message, title, Messages.getQuestionIcon());
133-
shouldContinue = answer == 0;
133+
shouldContinue = answer == Messages.YES;
134134
}
135135

136136
return shouldContinue;

java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleJdkConfigurable.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2011 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
2828
import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
2929
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
3030
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement;
31-
import com.intellij.openapi.ui.DialogWrapper;
3231
import com.intellij.openapi.ui.Messages;
3332
import com.intellij.openapi.util.Computable;
3433
import com.intellij.openapi.util.Condition;
@@ -137,7 +136,7 @@ public boolean value(Sdk jdk) {
137136
ProjectBundle.message("project.roots.no.jdk.on.project.message"),
138137
ProjectBundle.message("project.roots.no.jdk.on.project.title"),
139138
Messages.getInformationIcon());
140-
if (res == DialogWrapper.OK_EXIT_CODE) {
139+
if (res == Messages.YES) {
141140
myJdksModel.setProjectSdk(jdk);
142141
return true;
143142
}

java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModulesConfigurator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2012 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -472,7 +472,7 @@ private boolean doRemoveModule(@NotNull ModuleEditor selectedEditor) {
472472
}
473473
int result =
474474
Messages.showYesNoDialog(myProject, question, ProjectBundle.message("module.remove.confirmation.title"), Messages.getQuestionIcon());
475-
if (result != 0) {
475+
if (result != Messages.YES) {
476476
return false;
477477
}
478478
// do remove

java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/LayoutTreeComponent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -282,7 +282,7 @@ public boolean checkCanRemove(final List<? extends PackagingElementNode<?>> node
282282
message = "The selected node belongs to " + nodes.size() + " elements. Do you want to remove all these elements from the artifact?";
283283
}
284284
final int answer = Messages.showYesNoDialog(myArtifactsEditor.getMainComponent(), message, "Remove Elements", null);
285-
if (answer != 0) return false;
285+
if (answer != Messages.YES) return false;
286286
}
287287
return true;
288288
}

java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public void addLibraryOrderEntry(final Module module, final Library library) {
530530
if (Messages.showYesNoDialog(parent,
531531
ProjectBundle.message("project.roots.replace.library.entry.message", entry.getPresentableName()),
532532
ProjectBundle.message("project.roots.replace.library.entry.title"),
533-
Messages.getInformationIcon()) == DialogWrapper.OK_EXIT_CODE) {
533+
Messages.getInformationIcon()) == Messages.YES) {
534534
modelProxy.removeOrderEntry(entry);
535535
break;
536536
}

java/idea-ui/src/com/intellij/openapi/vcs/checkout/NewProjectCheckoutListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public boolean processCheckedOutDirectory(Project project, File directory, VcsKe
4444
ProjectCheckoutListener.getProductNameWithArticle(),
4545
directory.getAbsolutePath()),
4646
VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
47-
if (rc == 0) {
47+
if (rc == Messages.YES) {
4848
final ProjectManager pm = ProjectManager.getInstance();
4949
final Project[] projects = pm.getOpenProjects();
5050
final Set<VirtualFile> files = projectsLocationSet(projects);

java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectCheckoutListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public boolean processCheckedOutDirectory(Project project, File directory) {
3939
int rc = Messages
4040
.showYesNoDialog(project, VcsBundle.message("checkout.open.project.prompt", getProductNameWithArticle(), files[0].getPath()),
4141
VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
42-
if (rc == 0) {
42+
if (rc == Messages.YES) {
4343
ProjectUtil.openProject(files[0].getPath(), project, false);
4444
}
4545
return true;

java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectDirCheckoutListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2012 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public boolean processCheckedOutDirectory(Project project, File directory) {
3333
String message = VcsBundle.message("checkout.open.project.dir.prompt",
3434
ProjectCheckoutListener.getProductNameWithArticle(), directory.getPath());
3535
int rc = Messages.showYesNoDialog(project, message, VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
36-
if (rc == 0) {
36+
if (rc == Messages.YES) {
3737
ProjectUtil.openProject(directory.getPath(), project, false);
3838
}
3939
return true;

java/idea-ui/src/com/intellij/openapi/vcs/checkout/ProjectImporterCheckoutListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2011 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public boolean processCheckedOutDirectory(Project project, File directory) {
3939
int rc = Messages
4040
.showYesNoDialog(project, VcsBundle.message("checkout.open.project.prompt", ProjectCheckoutListener.getProductNameWithArticle(), file.getPath()),
4141
VcsBundle.message("checkout.title"), Messages.getQuestionIcon());
42-
if (rc == 0) {
42+
if (rc == Messages.YES) {
4343
openProcessor.doOpenProject(virtualFile, project, false);
4444
}
4545
return true;

java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ModifierFix.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@
2323
import com.intellij.openapi.diagnostic.Logger;
2424
import com.intellij.openapi.editor.Editor;
2525
import com.intellij.openapi.project.Project;
26-
import com.intellij.openapi.ui.DialogWrapper;
2726
import com.intellij.openapi.ui.Messages;
2827
import com.intellij.psi.*;
2928
import com.intellij.psi.search.PsiElementProcessor;
@@ -185,7 +184,7 @@ public boolean execute(@NotNull PsiMethod inheritor) {
185184
if (Messages.showYesNoDialog(project,
186185
QuickFixBundle.message("change.inheritors.visibility.warning.text"),
187186
QuickFixBundle.message("change.inheritors.visibility.warning.title"),
188-
Messages.getQuestionIcon()) == DialogWrapper.OK_EXIT_CODE) {
187+
Messages.getQuestionIcon()) == Messages.YES) {
189188
ApplicationManager.getApplication().runWriteAction(new Runnable() {
190189
@Override
191190
public void run() {

java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHandler.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2000-2009 JetBrains s.r.o.
2+
* Copyright 2000-2013 JetBrains s.r.o.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@
2323
import com.intellij.openapi.diagnostic.Logger;
2424
import com.intellij.openapi.editor.Editor;
2525
import com.intellij.openapi.project.Project;
26-
import com.intellij.openapi.ui.DialogWrapper;
2726
import com.intellij.openapi.ui.Messages;
2827
import com.intellij.openapi.util.Computable;
2928
import com.intellij.psi.*;
@@ -67,7 +66,7 @@ protected ClassMember[] chooseOriginalMembers(PsiClass aClass, Project project,
6766

6867
if (Messages.showYesNoDialog(project, text,
6968
CodeInsightBundle.message("generate.equals.and.hashcode.already.defined.title"),
70-
Messages.getQuestionIcon()) == DialogWrapper.OK_EXIT_CODE) {
69+
Messages.getQuestionIcon()) == Messages.YES) {
7170
if (!ApplicationManager.getApplication().runWriteAction(new Computable<Boolean>() {
7271
@Override
7372
public Boolean compute() {

0 commit comments

Comments
 (0)