@@ -155,22 +155,21 @@ public void run() {
155155 @ Override
156156 public boolean showConfirmation (@ NotNull String message , @ NotNull String title , @ NotNull String [] options ,
157157 String defaultOption ) {
158- return getValueFromDispatchThread (() -> Messages .showDialog (message ,
158+ return runFromDispatchThread (() -> 0 == Messages .showDialog (message ,
159159 title ,
160160 options ,
161161 ArrayUtils .indexOf (options , defaultOption ),
162- null ) == 0 );
162+ null ));
163163 }
164164
165165 @ Override
166166 public boolean showConfirmation (@ NotNull Component node , @ NotNull String message , @ NotNull String title , @ NotNull String [] options , String defaultOption ) {
167- return getValueFromDispatchThread (() -> Messages .showDialog (node ,
167+ return runFromDispatchThread (() -> 0 == Messages .showDialog (node ,
168168 message ,
169169 title ,
170170 options ,
171171 ArrayUtils .indexOf (options , defaultOption ),
172- null )
173- == 0 );
172+ null ));
174173 }
175174
176175 @ Override
@@ -738,26 +737,26 @@ public void showMessageDialog(Component component, String message, String title,
738737 @ Override
739738 public int showConfirmDialog (Component component , String message , String title , String [] options ,
740739 String defaultOption , Icon icon ) {
741- return getValueFromDispatchThread (() -> Messages .showDialog (component ,
742- message ,
743- title ,
744- options ,
745- ArrayUtils .indexOf (options , defaultOption ),
746- icon ));
740+ return runFromDispatchThread (() -> Messages .showDialog (component ,
741+ message ,
742+ title ,
743+ options ,
744+ ArrayUtils .indexOf (options , defaultOption ),
745+ icon ));
747746 }
748747
749748 @ Override
750749 public boolean showYesNoDialog (Component component , String message , String title , Icon icon ) {
751- return getValueFromDispatchThread (() -> Messages .showYesNoDialog (component , message , title , icon )
750+ return runFromDispatchThread (() -> Messages .showYesNoDialog (component , message , title , icon )
752751 == Messages .YES );
753752 }
754753
755754 @ Override
756755 public String showInputDialog (Component component , String message , String title , Icon icon ) {
757- return getValueFromDispatchThread (() -> Messages .showInputDialog (component , message , title , icon ));
756+ return runFromDispatchThread (() -> Messages .showInputDialog (component , message , title , icon ));
758757 }
759758
760- private static <T > T getValueFromDispatchThread (Supplier <T > supplier ) {
759+ private static <T > T runFromDispatchThread (Supplier <T > supplier ) {
761760 if (ApplicationManager .getApplication ().isDispatchThread ()) {
762761 return supplier .get ();
763762 }
0 commit comments