From 72f5bc5a241b4e8a2759592475d6c6eaed14cb35 Mon Sep 17 00:00:00 2001 From: Jiger Patel Date: Tue, 22 Apr 2003 12:30:10 +0000 Subject: [PATCH] Added Custom RuleSet adding capabilities git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1844 51baf565-9d33-0410-a72c-fc3788e3496d --- .../net/sourceforge/pmd/jedit/PMDOptionPane.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDOptionPane.java b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDOptionPane.java index 0aa0fde9a2..62ea6a882a 100644 --- a/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDOptionPane.java +++ b/pmd-jedit/src/net/sourceforge/pmd/jedit/PMDOptionPane.java @@ -65,6 +65,8 @@ public class PMDOptionPane extends AbstractOptionPane implements OptionPane { private JTextArea exampleTextArea= new JTextArea(10, 50); private JCheckBox directoryPopupBox; JTextField txtMinTileSize; + JTextField txtCustomRules; + public PMDOptionPane() { super(PMDJEditPlugin.NAME); @@ -80,11 +82,17 @@ public class PMDOptionPane extends AbstractOptionPane implements OptionPane { addComponent(new JLabel("Please see http://pmd.sf.net/ for more information")); - JPanel rulesPanel = new JPanel(); + JPanel rulesPanel = new JPanel(new BorderLayout()); rulesPanel.setBorder(BorderFactory.createTitledBorder("Rules")); JList list = new CheckboxList(rules.getAllBoxes()); list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); rulesPanel.add(new JScrollPane(list), BorderLayout.NORTH); + //Custom Rule Panel Defination. + JPanel pnlCustomRules = new JPanel(new FlowLayout(FlowLayout.LEFT)); + pnlCustomRules.add(new JLabel("Path to custom rules.xml files(seperated by comma)")); + pnlCustomRules.add((txtCustomRules = new JTextField(jEdit.getProperty("pmd.customRulesPath",""),30))); + + rulesPanel.add(pnlCustomRules, BorderLayout.CENTER); JPanel textPanel = new JPanel(); textPanel.setBorder(BorderFactory.createTitledBorder("Example")); @@ -114,7 +122,6 @@ public class PMDOptionPane extends AbstractOptionPane implements OptionPane { pnlSouth.add(directoryPopupBox); pnlSouth.add(pnlTileSize); mainPanel.add(pnlSouth, BorderLayout.SOUTH); - addComponent(mainPanel); } @@ -125,5 +132,10 @@ public class PMDOptionPane extends AbstractOptionPane implements OptionPane { } jEdit.setIntegerProperty("pmd.cpd.defMinTileSize",(txtMinTileSize.getText().length() == 0)?100:Integer.parseInt(txtMinTileSize.getText())); + + if(txtCustomRules != null) + { + jEdit.setProperty("pmd.customRulesPath",txtCustomRules.getText()); + } } }