@@ -135,6 +135,8 @@ If you do need the body, consider extracting the data you need and then calling
135
135
*/
136
136
137
137
public class GitCompareMainWindow implements ContenedorHistorico {
138
+
139
+ private final int MAX_FILES_WARNING =40 ;
138
140
139
141
private final static String SUFIX_DEL ="-del" ; //$NON-NLS-1$
140
142
private final static String TEMP_DIR_GITCOMPARE ="/temp/gitCompare-" ; //$NON-NLS-1$
@@ -731,10 +733,13 @@ public int compare(File f1, File f2) {
731
733
732
734
FileVsGit fileVsGit =new FileVsGit (fich ,gitRepo ,fileAbsMapeado ,borrar ,tempDirectoy );
733
735
filesGit .add (fileVsGit );
734
- if (filesGit .size ()==40 ) {
736
+ if (filesGit .size ()==MAX_FILES_WARNING ) {
735
737
int input = JOptionPane .showConfirmDialog (frmGitcompare ,
736
- "There is more than 40 files. Are you sure to continue, or is the 'from Date' wrong? Continue?" , "Lots of files, Continue?" ,
737
- JOptionPane .OK_CANCEL_OPTION , JOptionPane .INFORMATION_MESSAGE );
738
+ "There is more than " +MAX_FILES_WARNING +" files. Are you sure to continue, or is the 'from Date' wrong? Continue?" , "Lots of files, Continue?" ,
739
+ JOptionPane .OK_CANCEL_OPTION , JOptionPane .INFORMATION_MESSAGE );
740
+ if (input ==JOptionPane .CANCEL_OPTION ) {
741
+ throw new Exception ("cancelado por usuario" );
742
+ }
738
743
}
739
744
if (fileAbsMapeado .contains ("codigo.java" )) {
740
745
System .out .println (fileAbsMapeado );
@@ -991,7 +996,7 @@ public static void showMessage(String message) {
991
996
public static void showMessage (String message ,boolean info ) {
992
997
int opc =JOptionPane .OK_OPTION ;
993
998
if (info ) {
994
- opc =JOptionPane .PLAIN_MESSAGE ;
999
+ opc =JOptionPane .INFORMATION_MESSAGE ;
995
1000
}
996
1001
JOptionPane .showMessageDialog (null , message ,"CompareToGit" ,opc );
997
1002
}
0 commit comments