Release 4.2.5.2.0
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6993 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -3,18 +3,18 @@
|
||||
<property name="config" value="config/"/>
|
||||
<property name="src" value="src/"/>
|
||||
<property name="etc" value="etc/"/>
|
||||
<property name="pmdjar" value="pmd-4.2.4.jar"/>
|
||||
<property name="pmdjar" value="pmd-4.2.5.jar"/>
|
||||
<!-- first to third number for the pmd plugin -->
|
||||
<!-- fourth number JDeveloper Version 1:9.0.5-10.1.2, 2:10.1.3, 3:11.1.1 -->
|
||||
<!-- fifth number minor version number for the JDeveloper Plugin -->
|
||||
<property name="pluginversion" value="4.2.4.2.0"/>
|
||||
<property name="pluginversion" value="4.2.5.2.0"/>
|
||||
<property name="mainclass" value="net.sourceforge.pmd.jdeveloper"/>
|
||||
<property name="jdeveloper.dir" value="C:/Oracle/10gJD10134"/>
|
||||
<property name="jdeveloper.dir" value="C:/Oracle/10gJD10135"/>
|
||||
<property name="jdeveloper.ext.subdir" value="jdev/extensions"/>
|
||||
<property name="release.dir"
|
||||
value="C:/Documents and Settings/Torsten/My Documents/Eigene Programme/Java/PMD/releases"/>
|
||||
<property name="uploadbundle.scp.user" value=""/>
|
||||
<property name="uploadbundle.scp.pwd" value=""/>
|
||||
<property name="uploadbundle.scp.user" value="***"/>
|
||||
<property name="uploadbundle.scp.pwd" value="***"/>
|
||||
<property name="upload.ftp.pwd" value=""/>
|
||||
<!-- builded properties -->
|
||||
<property name="release.dirname" value="${mainclass}.${pluginversion}"/>
|
||||
@ -68,6 +68,10 @@
|
||||
todir="${jdeveloper.install.dir}/${mainclass}.${pluginversion}/lib"/>
|
||||
<copy file="lib/asm-3.1.jar"
|
||||
todir="${jdeveloper.install.dir}/${mainclass}.${pluginversion}/lib"/>
|
||||
<copy file="conf/pmd.plugin.properties"
|
||||
todir="${jdeveloper.install.dir}/${mainclass}.${pluginversion}/conf"/>
|
||||
<copy file="conf/pmd.rule.properties"
|
||||
todir="${jdeveloper.install.dir}/${mainclass}.${pluginversion}/conf"/>
|
||||
</target>
|
||||
<target name="release" depends="clean,jar">
|
||||
<mkdir dir="tmp/${release.dirname}/lib"/>
|
||||
@ -75,6 +79,8 @@
|
||||
<copy file="lib/${pmdjar}" todir="tmp/${release.dirname}/lib"/>
|
||||
<copy file="lib/jaxen-1.1.1.jar" todir="tmp/${release.dirname}/lib"/>
|
||||
<copy file="lib/asm-3.1.jar" todir="tmp/${release.dirname}/lib"/>
|
||||
<copy file="conf/pmd.plugin.properties" todir="tmp/${release.dirname}/conf"/>
|
||||
<copy file="conf/pmd.rule.properties" todir="tmp/${release.dirname}/conf"/>
|
||||
<zip destfile="${release.zipname}" basedir="tmp/"/>
|
||||
<move file="${release.zipname}" todir="${release.dir}"/>
|
||||
<delete dir="tmp"/>
|
||||
@ -102,6 +108,10 @@
|
||||
todir="update-center-bundle/${mainclass}.${pluginversion}/lib/"/>
|
||||
<copy file="lib/asm-3.1.jar"
|
||||
todir="update-center-bundle/${mainclass}.${pluginversion}/lib/"/>
|
||||
<copy file="conf/pmd.plugin.properties"
|
||||
todir="update-center-bundle/${mainclass}.${pluginversion}/conf"/>
|
||||
<copy file="conf/pmd.rule.properties"
|
||||
todir="update-center-bundle/${mainclass}.${pluginversion}/conf"/>
|
||||
<zip destfile="update-center-bundle/${bundle.filename}"
|
||||
basedir="update-center-bundle">
|
||||
<exclude name="center.xml"/>
|
||||
@ -124,7 +134,7 @@
|
||||
<target name="uploadbundle" depends="bundle">
|
||||
<echo message="Uploading center.xml file"></echo>
|
||||
<scp file="${release.dir}/update-center-bundle/center.xml"
|
||||
todir="${uploadbundle.scp.user}@pmd.sourceforge.net:/home/groups/p/pm/pmd/htdocs/"
|
||||
todir="${uploadbundle.scp.user},pmd@frs.sourceforge.net:/home/groups/p/pm/pmd/htdocs/"
|
||||
password="${uploadbundle.scp.pwd}" trust="true"></scp>
|
||||
</target>
|
||||
</project>
|
||||
|
@ -2,10 +2,10 @@
|
||||
<update-bundle version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle">
|
||||
<update id="net.sourceforge.pmd.jdeveloper" xmlns="http://xmlns.oracle.com/jdeveloper/update">
|
||||
<name>PMD JDeveloper Extension</name>
|
||||
<version>4.2.4.2.0</version>
|
||||
<version>4.2.5.2.0</version>
|
||||
<author>Torsten Kleiber</author>
|
||||
<author-url>http://pmd.sourceforge.net/</author-url>
|
||||
<description>Provides integrated support for PMD 4.2.4 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<description>Provides integrated support for PMD 4.2.5 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<requirements>
|
||||
<requires-extension id="oracle.jdeveloper" minVersion="10.1.3.00"
|
||||
maxVersion="11.1.1.0.20.45"/>
|
||||
|
@ -2,24 +2,24 @@
|
||||
<updates version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatecenter">
|
||||
<update id="net.sourceforge.pmd.jdeveloper" xmlns="http://xmlns.oracle.com/jdeveloper/update">
|
||||
<name>PMD JDeveloper Extension</name>
|
||||
<version>4.2.4.2.0</version>
|
||||
<version>4.2.5.2.0</version>
|
||||
<author>Torsten Kleiber</author>
|
||||
<author-url>http://pmd.sourceforge.net</author-url>
|
||||
<description>Provides integrated support for PMD 4.2.4 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<bundle-url>http://downloads.sourceforge.net/pmd/pmd-jdeveloper1013-bundle-4.2.4.2.0.zip</bundle-url>
|
||||
<description>Provides integrated support for PMD 4.2.5 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<bundle-url>http://downloads.sourceforge.net/pmd/pmd-jdeveloper1013-bundle-4.2.5.2.0.zip</bundle-url>
|
||||
<requirements>
|
||||
<requires-extension id="oracle.jdeveloper" minVersion="10.1.3.00" maxVersion="11.1.1.0.20.45" />
|
||||
</requirements>
|
||||
</update>
|
||||
<update id="net.sourceforge.pmd.jdeveloper" xmlns="http://xmlns.oracle.com/jdeveloper/update">
|
||||
<name>PMD JDeveloper Extension</name>
|
||||
<version>4.2.4.3.0</version>
|
||||
<version>4.2.5.3.0</version>
|
||||
<author>Torsten Kleiber</author>
|
||||
<author-url>http://pmd.sourceforge.net</author-url>
|
||||
<description>Provides integrated support for PMD 4.2.4 in JDeveloper 11g.</description>
|
||||
<bundle-url>http://downloads.sourceforge.net/pmd/pmd-jdeveloper1111-bundle-4.2.4.3.0.zip</bundle-url>
|
||||
<description>Provides integrated support for PMD 4.2.5 in JDeveloper 11g.</description>
|
||||
<bundle-url>http://downloads.sourceforge.net/pmd/pmd-jdeveloper1111-bundle-4.2.5.3.0.zip</bundle-url>
|
||||
<requirements>
|
||||
<requires-extension id="oracle.jdeveloper" minVersion="11.1.1.0.31.51.56" maxVersion="11.1.1.0.31.51.56" />
|
||||
<requires-extension id="oracle.jdeveloper" minVersion="11.1.1.0.31.51.56" maxVersion="11.1.1.99" />
|
||||
</requirements>
|
||||
</update>
|
||||
</updates>
|
@ -1,3 +1,7 @@
|
||||
October 14, 2009 - 4.2.5:
|
||||
Updated PMD version to 4.2.5 for 10.1.3 to 11.1.1
|
||||
Fixed bug 2543957
|
||||
|
||||
October 21, 2008 - 4.2.4:
|
||||
Updated PMD version to 4.2.4 for 9.0.5 to 11.1.1
|
||||
|
||||
|
@ -20,7 +20,7 @@ TESTS:
|
||||
|
||||
src release:
|
||||
// TODO automation by ant, if subversion tasks are available
|
||||
checkin
|
||||
checkin
|
||||
// TODO automation by ant, if subversion tasks are available
|
||||
copy to tags/pmd-jdeveloper/pmd_jdeveloperXXX_release_X_X_X_X_X
|
||||
ant releasesrc
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||
<extension xmlns="http://jcp.org/jsr/198/extension-manifest"
|
||||
id="net.sourceforge.pmd.jdeveloper" version="4.2.4.2.0"
|
||||
id="net.sourceforge.pmd.jdeveloper" version="4.2.5.2.0"
|
||||
esdk-version="1.0">
|
||||
<name>PMD JDeveloper Extension</name>
|
||||
<owner>Torsten Kleiber</owner>
|
||||
@ -8,9 +8,9 @@
|
||||
<import>oracle.jdeveloper</import>
|
||||
</dependencies>
|
||||
<classpaths>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.4.2.0/lib/pmd-4.2.4.jar</classpath>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.4.2.0/lib/jaxen-1.1.1.jar</classpath>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.4.2.0/lib/asm-3.1.jar</classpath>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.5.2.0/lib/pmd-4.2.5.jar</classpath>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.5.2.0/lib/jaxen-1.1.1.jar</classpath>
|
||||
<classpath>net.sourceforge.pmd.jdeveloper.4.2.5.2.0/lib/asm-3.1.jar</classpath>
|
||||
</classpaths>
|
||||
<hooks>
|
||||
<jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
|
||||
@ -19,7 +19,7 @@
|
||||
</addins>
|
||||
</jdeveloper-hook>
|
||||
<feature-hook>
|
||||
<description>Provides integrated support for PMD 4.2 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<description>Provides integrated support for PMD 4.2.5 in JDeveloper 10.1.3 - 11g Technology Preview 1.</description>
|
||||
<optional>false</optional>
|
||||
</feature-hook>
|
||||
</hooks>
|
||||
|
Binary file not shown.
@ -1,25 +1,25 @@
|
||||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||
<jpr:project xmlns:jpr="http://xmlns.oracle.com/ide/project">
|
||||
<hash n="component-versions">
|
||||
<value n="oracle.adf.dt.migration.ProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adfdt.controller.jsf.addin.JSFProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adfdt.controller.struts.addin.db.ADFStrutsProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adfdt.controller.struts.addin.StrutsProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adfdtinternal.model.portlet.migration.WebCenterProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adfdtinternal.view.faces.addin.ADFFacesLibraryMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.bm.commonIde.ProjectUpgrader" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.ide.model.Project" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.ide.model.ResourcePathsMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jbo.dt.jclient.migrator.JCProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jbo.dt.jdevx.ui.appnav.APProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdeveloper.dbmodeler.migration.ProjectMigratorHelper" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdeveloper.ejb.EjbMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdeveloper.offlinedb.migration.OfflineDBProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdevimpl.jsp.JsfLibraryMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.adf.dt.migration.ProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.adfdt.controller.jsf.addin.JSFProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.adfdt.controller.struts.addin.db.ADFStrutsProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.adfdt.controller.struts.addin.StrutsProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.adfdtinternal.model.portlet.migration.WebCenterProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.adfdtinternal.view.faces.addin.ADFFacesLibraryMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.bm.commonIde.ProjectUpgrader" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.ide.model.Project" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.ide.model.ResourcePathsMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jbo.dt.jclient.migrator.JCProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jbo.dt.jdevx.ui.appnav.APProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdeveloper.dbmodeler.migration.ProjectMigratorHelper" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdeveloper.ejb.EjbMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdeveloper.offlinedb.migration.OfflineDBProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdevimpl.jsp.JsfLibraryMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdevimpl.jsp.JspMigrator" v="10.1.3.1.0"/>
|
||||
<value n="oracle.jdevimpl.runner.RunConfigurationsMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdevimpl.webservices.WebServicesMigratorHelper" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.tip.tools.ide.pm.addin.PMProjectMigrator" v="10.1.3.3.0;10.1.3.4.0"/>
|
||||
<value n="oracle.jdevimpl.runner.RunConfigurationsMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.jdevimpl.webservices.WebServicesMigratorHelper" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.tip.tools.ide.pm.addin.PMProjectMigrator" v="10.1.3.3.0;10.1.3.4.0;10.1.3.5.0"/>
|
||||
<value n="oracle.toplink.addin.migration.TopLinkProjectMigrator" v="10.1.3.1.0"/>
|
||||
</hash>
|
||||
<list n="contentSets">
|
||||
@ -125,7 +125,7 @@
|
||||
<hash n="oracle.jdevimpl.config.JProjectLibraries">
|
||||
<list n="exportedReferences">
|
||||
<hash>
|
||||
<url n="id" path="../../../../../../../Oracle/10gJD10133/jdev/system/oracle.jdeveloper.10.1.3.41.57/PMD 4.2.4.library"/>
|
||||
<url n="id" path="../../../../../../../Oracle/10gJD10133/jdev/system/oracle.jdeveloper.10.1.3.41.57/PMD 4.2.5.library"/>
|
||||
<value n="isJDK" v="false"/>
|
||||
</hash>
|
||||
<hash>
|
||||
@ -140,7 +140,7 @@
|
||||
<hash n="internalDefinitions"/>
|
||||
<list n="libraryReferences">
|
||||
<hash>
|
||||
<url n="id" path="../../../../../../../Oracle/10gJD10133/jdev/system/oracle.jdeveloper.10.1.3.41.57/PMD 4.2.4.library"/>
|
||||
<url n="id" path="../../../../../../../Oracle/10gJD10133/jdev/system/oracle.jdeveloper.10.1.3.41.57/PMD 4.2.5.library"/>
|
||||
<value n="isJDK" v="false"/>
|
||||
</hash>
|
||||
<hash>
|
||||
|
@ -38,7 +38,7 @@ public class FileStorage implements SettingsStorage {
|
||||
|
||||
final FileOutputStream fos = new FileOutputStream(file);
|
||||
savedProperties.store(fos,
|
||||
"PMD-JDeveloper rule selections " + new Date());
|
||||
"PMD generated file " + new Date());
|
||||
fos.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
Util.logMessage(e.getStackTrace());
|
||||
|
@ -10,22 +10,26 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.ListCellRenderer;
|
||||
import javax.swing.ListModel;
|
||||
import javax.swing.ListSelectionModel;
|
||||
@ -39,15 +43,24 @@ import net.sourceforge.pmd.RuleSetNotFoundException;
|
||||
import net.sourceforge.pmd.RuleSets;
|
||||
import net.sourceforge.pmd.RuleSetWriter;
|
||||
|
||||
import oracle.ide.Ide;
|
||||
import oracle.ide.panels.DefaultTraversablePanel;
|
||||
import oracle.ide.panels.TraversableContext;
|
||||
|
||||
|
||||
public class SettingsPanel extends DefaultTraversablePanel {
|
||||
|
||||
private static final String PLUGIN_HOME =
|
||||
"/extensions/net.sourceforge.pmd.jdeveloper." + Version.version() +
|
||||
"/conf/";
|
||||
private static final String PLUGIN_PROPS =
|
||||
PLUGIN_HOME + "pmd.plugin.properties";
|
||||
private static final String RULE_PROPS =
|
||||
PLUGIN_HOME + "pmd.rule.properties";
|
||||
|
||||
private class ImportListener implements ActionListener {
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
final FileDialog fdlg =
|
||||
final FileDialog fdlg =
|
||||
new FileDialog(new Frame(), "Import", FileDialog.LOAD);
|
||||
fdlg.setVisible(true);
|
||||
if (fdlg.getFile() == null) {
|
||||
@ -60,7 +73,7 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
|
||||
private class ExportListener implements ActionListener {
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
final FileDialog fdlg =
|
||||
final FileDialog fdlg =
|
||||
new FileDialog(new Frame(), "Export", FileDialog.SAVE);
|
||||
fdlg.setVisible(true);
|
||||
if (fdlg.getFile() == null) {
|
||||
@ -71,6 +84,20 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
}
|
||||
}
|
||||
|
||||
private class FindListener implements ActionListener {
|
||||
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
FileDialog fdlg =
|
||||
new FileDialog(new Frame(), "Find", FileDialog.LOAD);
|
||||
fdlg.setVisible(true);
|
||||
String selected = fdlg.getDirectory() + fdlg.getFile();
|
||||
if (fdlg.getFile() == null) {
|
||||
return;
|
||||
}
|
||||
selectedRulesSeparateFileNameField.setText(selected);
|
||||
}
|
||||
}
|
||||
|
||||
private class CheckboxList extends JList {
|
||||
|
||||
private class MyMouseAdapter extends MouseAdapter {
|
||||
@ -81,7 +108,8 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
public void mousePressed(final MouseEvent evt) {
|
||||
final int index = locationToIndex(evt.getPoint());
|
||||
if (index != -1) {
|
||||
final JCheckBox box = (JCheckBox)getModel().getElementAt(index);
|
||||
final JCheckBox box =
|
||||
(JCheckBox)getModel().getElementAt(index);
|
||||
box.setSelected(!box.isSelected());
|
||||
repaint();
|
||||
}
|
||||
@ -97,7 +125,8 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
public void mouseMoved(final MouseEvent evt) {
|
||||
final int index = locationToIndex(evt.getPoint());
|
||||
if (index != -1) {
|
||||
final JCheckBox box = (JCheckBox)getModel().getElementAt(index);
|
||||
final JCheckBox box =
|
||||
(JCheckBox)getModel().getElementAt(index);
|
||||
final List examples = rules.getRule(box).getExamples();
|
||||
final StringBuffer examplesBuffer = new StringBuffer();
|
||||
if (!examples.isEmpty()) {
|
||||
@ -107,9 +136,9 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
}
|
||||
String example = examplesBuffer.toString();
|
||||
|
||||
while (example.charAt(0) == '\r' ||
|
||||
example.charAt(0) == '\n' ||
|
||||
example.charAt(0) == '\t' ||
|
||||
while (example.charAt(0) == '\r' ||
|
||||
example.charAt(0) == '\n' ||
|
||||
example.charAt(0) == '\t' ||
|
||||
example.charAt(0) == ' ') {
|
||||
example = example.substring(1);
|
||||
}
|
||||
@ -120,18 +149,18 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
}
|
||||
|
||||
private class CheckboxListCellRenderer implements ListCellRenderer {
|
||||
public Component getListCellRendererComponent(final JList list,
|
||||
final Object value,
|
||||
final int index,
|
||||
final boolean isSelected,
|
||||
public Component getListCellRendererComponent(final JList list,
|
||||
final Object value,
|
||||
final int index,
|
||||
final boolean isSelected,
|
||||
final boolean cellHasFocus) {
|
||||
final JCheckBox box = (JCheckBox)value;
|
||||
box.setEnabled(isEnabled());
|
||||
box.setFont(getFont());
|
||||
box.setFocusPainted(false);
|
||||
box.setBorderPainted(true);
|
||||
box.setBorder(isSelected ?
|
||||
UIManager.getBorder("List.focusCellHighlightBorder") :
|
||||
box.setBorder(isSelected ?
|
||||
UIManager.getBorder("List.focusCellHighlightBorder") :
|
||||
new EmptyBorder(1, 1, 1, 1));
|
||||
return box;
|
||||
}
|
||||
@ -145,19 +174,30 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
}
|
||||
}
|
||||
|
||||
public static final String STORED_SEPARATELY =
|
||||
"pmd.settings.separate";
|
||||
public static final String SEL_FILENAME =
|
||||
"pmd.settings.separate.name";
|
||||
public static final String STORED_SEPARATELY = "pmd.settings.separate";
|
||||
public static final String SEL_FILENAME = "pmd.settings.separate.name";
|
||||
|
||||
private final transient JTextArea exampleTextArea = new JTextArea(10, 50);
|
||||
private JCheckBox selectedRulesStoredSeparatelyBox;
|
||||
private JTextField selectedRulesSeparateFileNameField = new JTextField(30);
|
||||
private transient SelectedRules rules;
|
||||
private transient JList rulesList;
|
||||
private static FileStorage pluginProps =
|
||||
new FileStorage(new File(Version.getJdevHome() + PLUGIN_PROPS));
|
||||
|
||||
public static SettingsStorage createSettingsStorage() {
|
||||
return new IDEStorage();
|
||||
try {
|
||||
if (Boolean.valueOf(pluginProps.load(STORED_SEPARATELY)).booleanValue()) {
|
||||
return new FileStorage(new File(pluginProps.load(SEL_FILENAME)));
|
||||
}
|
||||
} catch (SettingsException se) {
|
||||
Util.logMessage(se.getStackTrace());
|
||||
Util.showError(se, Plugin.PMD_TITLE);
|
||||
}
|
||||
return new FileStorage(new File(Version.getJdevHome() + RULE_PROPS));
|
||||
}
|
||||
|
||||
|
||||
public void onEntry(final TraversableContext tcon) {
|
||||
removeAll();
|
||||
try {
|
||||
@ -167,7 +207,15 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
Util.showError(rsne, Plugin.PMD_TITLE);
|
||||
}
|
||||
|
||||
try {
|
||||
selectedRulesStoredSeparatelyBox =
|
||||
new JCheckBox("", Boolean.valueOf(pluginProps.load(STORED_SEPARATELY)).booleanValue());
|
||||
} catch (SettingsException se) {
|
||||
Util.logMessage(se.getStackTrace());
|
||||
Util.showError(se, Plugin.PMD_TITLE);
|
||||
}
|
||||
final JPanel mainPanel = new JPanel(new BorderLayout());
|
||||
mainPanel.add(createTopPanel(), BorderLayout.NORTH);
|
||||
mainPanel.add(createRulesSelectionPanel(), BorderLayout.SOUTH);
|
||||
add(mainPanel);
|
||||
}
|
||||
@ -177,22 +225,23 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
checkBoxesPanel.setBorder(BorderFactory.createTitledBorder("Rules"));
|
||||
rulesList = new CheckboxList(rules.getAllBoxes());
|
||||
rulesList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
rulesList.setVisibleRowCount(5);
|
||||
checkBoxesPanel.add(new JScrollPane(rulesList), BorderLayout.NORTH);
|
||||
final JPanel buttonsPanel = new JPanel();
|
||||
buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.Y_AXIS));
|
||||
final JButton selectAll = new JButton("Select all");
|
||||
selectAll.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
setSelected(true);
|
||||
}
|
||||
});
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
setSelected(true);
|
||||
}
|
||||
});
|
||||
buttonsPanel.add(selectAll);
|
||||
final JButton selectNone = new JButton("Deselect all");
|
||||
selectNone.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
setSelected(false);
|
||||
}
|
||||
});
|
||||
public void actionPerformed(final ActionEvent evt) {
|
||||
setSelected(false);
|
||||
}
|
||||
});
|
||||
buttonsPanel.add(selectNone);
|
||||
final JButton importButton = new JButton("Import rules file");
|
||||
importButton.addActionListener(new ImportListener());
|
||||
@ -211,6 +260,54 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
return rulesSelPanel;
|
||||
}
|
||||
|
||||
private JPanel createTopPanel() {
|
||||
|
||||
try {
|
||||
selectedRulesSeparateFileNameField.setText(pluginProps.load(SEL_FILENAME));
|
||||
selectedRulesStoredSeparatelyBox.setSelected(Boolean.valueOf(pluginProps.load(STORED_SEPARATELY)).booleanValue());
|
||||
} catch (SettingsException se) {
|
||||
Util.logMessage(se.getStackTrace());
|
||||
Util.showError(se, Plugin.PMD_TITLE);
|
||||
}
|
||||
JPanel topPanel = new JPanel(new BorderLayout());
|
||||
JPanel customStoragePanel = new JPanel(new BorderLayout());
|
||||
customStoragePanel.setBorder(BorderFactory.createTitledBorder("Settings storage"));
|
||||
|
||||
JPanel customStorageCheckBoxPanel = new JPanel();
|
||||
customStorageCheckBoxPanel.add(new JLabel("Use centrally managed rule settings?"));
|
||||
customStorageCheckBoxPanel.add(selectedRulesStoredSeparatelyBox);
|
||||
customStoragePanel.add(customStorageCheckBoxPanel, BorderLayout.NORTH);
|
||||
|
||||
JPanel customStorageTextFieldPanel = new JPanel();
|
||||
customStorageTextFieldPanel.add(new JLabel("File:"));
|
||||
customStorageTextFieldPanel.add(selectedRulesSeparateFileNameField);
|
||||
JButton findButton = new JButton("Find file");
|
||||
findButton.addActionListener(new FindListener());
|
||||
customStorageTextFieldPanel.add(findButton);
|
||||
|
||||
customStoragePanel.add(customStorageTextFieldPanel,
|
||||
BorderLayout.SOUTH);
|
||||
topPanel.add(customStoragePanel, BorderLayout.CENTER);
|
||||
return topPanel;
|
||||
}
|
||||
|
||||
public void onExit(final TraversableContext tcon) {
|
||||
final Properties properties = new Properties();
|
||||
properties.setProperty(STORED_SEPARATELY,
|
||||
String.valueOf(selectedRulesStoredSeparatelyBox.isSelected()));
|
||||
properties.setProperty(SEL_FILENAME,
|
||||
selectedRulesSeparateFileNameField.getText());
|
||||
try {
|
||||
pluginProps.save(properties);
|
||||
rules.save(createSettingsStorage());
|
||||
} catch (SettingsException se) {
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Can't save settings :" + se.getMessage(),
|
||||
"Can't save settings",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setSelected(final Boolean selected) {
|
||||
final ListModel model = rulesList.getModel();
|
||||
for (int i = 0; i < model.getSize(); i++) {
|
||||
@ -220,18 +317,6 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
rulesList.repaint();
|
||||
}
|
||||
|
||||
public void onExit(final TraversableContext tcon) {
|
||||
try {
|
||||
rules.save(createSettingsStorage());
|
||||
} catch (SettingsException se) {
|
||||
JOptionPane.showMessageDialog(null,
|
||||
"Can't save selected rules to the file :" +
|
||||
se.getMessage(),
|
||||
"Can't save settings",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
private void importFile(final String fileLocation) {
|
||||
final RuleSetFactory factory = new RuleSetFactory();
|
||||
RuleSets ruleSets = null;
|
||||
@ -255,9 +340,10 @@ public class SettingsPanel extends DefaultTraversablePanel {
|
||||
rulesList.repaint();
|
||||
}
|
||||
|
||||
private Boolean isRuleAvailabel(final Set<Rule> allRules, final Rule requestedRule) {
|
||||
private Boolean isRuleAvailabel(final Set<Rule> allRules,
|
||||
final Rule requestedRule) {
|
||||
Boolean returnValue = Boolean.FALSE;
|
||||
for (Rule rule: allRules) {
|
||||
for (Rule rule : allRules) {
|
||||
if (rule.getName().equals(requestedRule.getName())) {
|
||||
returnValue = Boolean.TRUE;
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import net.sourceforge.pmd.SourceType;
|
||||
|
||||
import oracle.ide.Context;
|
||||
|
||||
import oracle.ide.Ide;
|
||||
|
||||
import oracle.jdeveloper.compiler.OjcConfiguration;
|
||||
|
||||
final class Version {
|
||||
@ -27,7 +29,10 @@ final class Version {
|
||||
}
|
||||
|
||||
public static String version() {
|
||||
return "4.2.4.2.0";
|
||||
return "4.2.5.2.0";
|
||||
}
|
||||
|
||||
static String getJdevHome() {
|
||||
return Ide.getHomeDirectory();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user