Updated to jEdit 4.2 API changes

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2192 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Jiger Patel
2003-08-14 09:28:16 +00:00
parent 4aecb56dbd
commit f73ad90644
4 changed files with 20 additions and 11 deletions

View File

@ -6,23 +6,26 @@ plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.author=Jiger Patel, Tom Copeland
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.version=2.2
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.docs=jedit.html
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.0=jdk 1.3
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.1=jedit 04.00.99.00
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.1=jedit 04.02.01.00
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.depend.2=plugin errorlist.ErrorListPlugin 1.2
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.jars=pmd-1.2.1.jar jaxen-core-1.0-fcs.jar saxpath-1.0-fcs.jar pmd-swingui-0.1.jar
#
# Menu properties
#
pmd-menu=pmd-check-current-buffer pmd-check-all-open-buffers pmd-check-current-directory pmd-check-current-directory-recursively pmd-clear-errorlist %pmd-cpd
pmd-cpd=cpd-currentfile cpd-dir cpd-dir-recursively
pmd-menu.label=$PMD
#New jEdit 4.2 properties
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.activate=defer
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.menu.label=$PMD
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.menu=pmd-check-current-buffer pmd-check-all-open-buffers pmd-check-current-directory pmd-check-current-directory-recursively pmd-clear-errorlist %pmd-cpd pmd-cpd=cpd-currentfile cpd-dir cpd-dir-recursively
pmd-check-current-buffer.label=Check current buffer
pmd-check-all-open-buffers.label=Check all open buffers
pmd-check-current-directory.label=Check all files in current directory
pmd-check-current-directory-recursively.label=Check directory recursively
pmd-clear-errorlist.label=Clear ErrorList
pmd-cpd.label=Detect Duplicate Code
cpd-currentfile.label=In Current File
cpd-dir.label=In Directory
@ -30,8 +33,10 @@ cpd-dir-recursively.label=In Directory Recursively
#
# Option pane properties
#
options.PMD.title=PMD
options.PMD.label=PMD
plugin.net.sourceforge.pmd.jedit.PMDJEditPlugin.option-pane=pmd
options.pmd.label=PMD
options.pmd.code=new net.sourceforge.pmd.jedit.PMDOptionPane()
#Dockables properties.
cpd-viewer.title=Copy/Paste Detector

View File

@ -1,5 +1,6 @@
<project name="PMDJEditPlugin" default="jar" basedir="../">
<property file="etc/build.properties"></property>
<property name="config" value="config/"/>
<property name="src" value="src/"/>
<property name="lib" value="lib/"/>

View File

@ -69,13 +69,13 @@ public class PMDJEditPlugin extends EditPlugin {
ErrorSource.registerErrorSource(errorSource);
}
public void createMenuItems(Vector menuItems) {
/* public void createMenuItems(Vector menuItems) {
menuItems.addElement(GUIUtilities.loadMenu("pmd-menu"));
}
public void createOptionPanes(OptionsDialog optionsDialog) {
optionsDialog.addOptionPane(new PMDOptionPane());
}
} */
// boilerplate JEdit code
public static void checkDirectory(View view) {
@ -141,16 +141,17 @@ public class PMDJEditPlugin extends EditPlugin {
}
public void instanceCheckDirectoryRecursively(View view) {
if (jEdit.getBooleanProperty(PMDJEditPlugin.OPTION_UI_DIRECTORY_POPUP))
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)
if (dir != null && dir.trim() != null)
{
if (!(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(findFiles(dir, true));
}
}
else

View File

@ -58,6 +58,8 @@ public class SelectedRules
//Load custom RuleSets if any.
String customRuleSetPath = jEdit.getProperty("pmd.customRulesPath");
System.out.println("See custom rules path " + customRuleSetPath);
if(!(customRuleSetPath == null))
{
StringTokenizer strtok = new StringTokenizer(customRuleSetPath, ",");