forked from phoedos/pmd
added some error checking
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1250 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -62,6 +62,10 @@ public class PMDJEditPlugin extends EditPlugin {
|
||||
public void instanceCheckDirectory(View view) {
|
||||
if (jEdit.getBooleanProperty(PMDJEditPlugin.OPTION_UI_DIRECTORY_POPUP)) {
|
||||
final String dir = JOptionPane.showInputDialog(jEdit.getFirstView(), "Please type in a directory to scan", NAME, JOptionPane.QUESTION_MESSAGE);
|
||||
if (dir == null || !(new File(dir)).exists() || !(new File(dir)).isDirectory() ) {
|
||||
JOptionPane.showMessageDialog(jEdit.getFirstView(), dir + " is not a valid directory name", NAME, JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
process(findFilesInDirectory(dir));
|
||||
} else {
|
||||
final VFSBrowser browser = (VFSBrowser)view.getDockableWindowManager().getDockable("vfs.browser");
|
||||
@ -81,6 +85,10 @@ public class PMDJEditPlugin extends EditPlugin {
|
||||
public void instanceCheckDirectoryRecursively(View view) {
|
||||
if (jEdit.getBooleanProperty(PMDJEditPlugin.OPTION_UI_DIRECTORY_POPUP)) {
|
||||
final String dir = JOptionPane.showInputDialog(jEdit.getFirstView(), "Please type in a directory to scan recursively", NAME, JOptionPane.QUESTION_MESSAGE);
|
||||
if (dir == null || !(new File(dir)).exists() || !(new File(dir)).isDirectory() ) {
|
||||
JOptionPane.showMessageDialog(jEdit.getFirstView(), dir + " is not a valid directory name", NAME, JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
process(findFilesRecursively(dir));
|
||||
} else {
|
||||
final VFSBrowser browser = (VFSBrowser)view.getDockableWindowManager().getDockable("vfs.browser");
|
||||
|
Reference in New Issue
Block a user