Compare commits
249
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
495294d09e | ||
|
|
0d3cba2a2e | ||
|
|
2b7463ac4d | ||
|
|
0ac6f23098 | ||
|
|
c6cc722fc1 | ||
|
|
af3d0be27e | ||
|
|
d7ac591da0 | ||
|
|
32fb4784d6 | ||
|
|
a585e1d1bb | ||
|
|
83a811f2f8 | ||
|
|
f58ecd51dc | ||
|
|
307040f53f | ||
|
|
4cb3e53d4b | ||
|
|
314151c761 | ||
|
|
cca1aac4d9 | ||
|
|
2654bbff4d | ||
|
|
8bbca10f73 | ||
|
|
3dea951e0c | ||
|
|
3cd12def47 | ||
|
|
ad3086eb2b | ||
|
|
f2ac93a42d | ||
|
|
14cc641316 | ||
|
|
b60d442777 | ||
|
|
a050468aea | ||
|
|
85914a9a2c | ||
|
|
232eeb24f0 | ||
|
|
8cebc5dc84 | ||
|
|
0496cc8fc5 | ||
|
|
66ef2399e3 | ||
|
|
ee246222ae | ||
|
|
791ddbef0b | ||
|
|
d0f2ec451a | ||
|
|
9487afa38f | ||
|
|
ba1404de3f | ||
|
|
c8da4a1c83 | ||
|
|
5155cdd50d | ||
|
|
d0af1fc350 | ||
|
|
94b5c9f797 | ||
|
|
fb32b871d8 | ||
|
|
1668a79f03 | ||
|
|
340e0f2583 | ||
|
|
4155d94028 | ||
|
|
d79bc38bd1 | ||
|
|
3efe93295c | ||
|
|
ad7c32bcff | ||
|
|
6112861894 | ||
|
|
ec289775c3 | ||
|
|
d10160ae45 | ||
|
|
bbd2b945cf | ||
|
|
866eb78393 | ||
|
|
ba6485bdc7 | ||
|
|
a40c07aeb2 | ||
|
|
a37296d7b9 | ||
|
|
260e0730b7 | ||
|
|
384cfa8bcd | ||
|
|
3f39a04a58 | ||
|
|
a3393f4b13 | ||
|
|
17442f2028 | ||
|
|
c7933c9700 | ||
|
|
779e304d18 | ||
|
|
61498acc39 | ||
|
|
12faf9023b | ||
|
|
46671ba8b8 | ||
|
|
d1c1863f07 | ||
|
|
75201a5a60 | ||
|
|
0b23f48cf4 | ||
|
|
73a989fc97 | ||
|
|
779526036a | ||
|
|
19da0dfc1a | ||
|
|
ffc48e9835 | ||
|
|
fdb5dcc628 | ||
|
|
043e5d02f3 | ||
|
|
7a083a30e9 | ||
|
|
c831d82bf0 | ||
|
|
2130c12ba3 | ||
|
|
79ef486724 | ||
|
|
b937b65558 | ||
|
|
38044fb7f5 | ||
|
|
cc3f172ef2 | ||
|
|
8fe5a0d780 | ||
|
|
f67056e7d7 | ||
|
|
59eaa27c59 | ||
|
|
d836721675 | ||
|
|
aaeaefad1a | ||
|
|
6f857aa813 | ||
|
|
1d7d5e6474 | ||
|
|
a73b7f1fb1 | ||
|
|
64d3bc28cb | ||
|
|
8b4ade3016 | ||
|
|
60c0bcb858 | ||
|
|
0b60a2d6ff | ||
|
|
73ebf2603a | ||
|
|
6f427f9fa5 | ||
|
|
d6b326838f | ||
|
|
0e3a92c291 | ||
|
|
bbc1d2a02f | ||
|
|
0e1bf46e07 | ||
|
|
6243e25400 | ||
|
|
ae499b9132 | ||
|
|
c168ecc6e5 | ||
|
|
ac439685fc | ||
|
|
2321376151 | ||
|
|
f7cefa4a7d | ||
|
|
eeb8b10892 | ||
|
|
2577acd87e | ||
|
|
e3ad18317a | ||
|
|
6bc10af45e | ||
|
|
5a1a457eae | ||
|
|
59a60be0d2 | ||
|
|
f7aa88db54 | ||
|
|
eb371c24a1 | ||
|
|
a846ccb014 | ||
|
|
a31f7f3578 | ||
|
|
ecb51fbac5 | ||
|
|
3ab42655dc | ||
|
|
c44b0c2c87 | ||
|
|
2817991f7d | ||
|
|
ce0fd33919 | ||
|
|
316ef30f5b | ||
|
|
7a7381829a | ||
|
|
9e0de88bc2 | ||
|
|
13f6224635 | ||
|
|
a4e7012c63 | ||
|
|
de924b50cf | ||
|
|
605de6f7bf | ||
|
|
751ed84e0d | ||
|
|
b5a90924a7 | ||
|
|
ca664ea719 | ||
|
|
d740f68a94 | ||
|
|
d20f8f2291 | ||
|
|
72cc961ca8 | ||
|
|
e26de08062 | ||
|
|
9b4b50560d | ||
|
|
240e548c36 | ||
|
|
9172c26905 | ||
|
|
1b2063cf94 | ||
|
|
8c64498325 | ||
|
|
ffb1131fe0 | ||
|
|
3f719b9b0f | ||
|
|
aea7c89175 | ||
|
|
0fb697a50b | ||
|
|
e300a2630b | ||
|
|
59646f99d2 | ||
|
|
743d2da79a | ||
|
|
4e8664c244 | ||
|
|
5948b700b3 | ||
|
|
2a8cf167b9 | ||
|
|
d4aad400d5 | ||
|
|
f7f2532566 | ||
|
|
8cdc5bd985 | ||
|
|
0252a9c905 | ||
|
|
8f8afde50b | ||
|
|
6836ae8bcd | ||
|
|
51ca03348c | ||
|
|
41d0550d99 | ||
|
|
06bb1a6f27 | ||
|
|
fc173e08c8 | ||
|
|
14461efefd | ||
|
|
68c1d53a59 | ||
|
|
80a7ece0bc | ||
|
|
10f5aa8d69 | ||
|
|
9893f33977 | ||
|
|
2e0bffe7a3 | ||
|
|
718ef77283 | ||
|
|
4ac13741ab | ||
|
|
f3c1227dcc | ||
|
|
7cd887ba8c | ||
|
|
c07f274b4e | ||
|
|
037cf154f7 | ||
|
|
69ff09410a | ||
|
|
39e59dd02f | ||
|
|
7ed88ed4cf | ||
|
|
ef13f147ce | ||
|
|
e0dbf498e2 | ||
|
|
c777f4d548 | ||
|
|
b3d2a856a8 | ||
|
|
59a61fb58c | ||
|
|
7e018ac3bd | ||
|
|
d4e6c1872d | ||
|
|
767cea113d | ||
|
|
5f2d71cdde | ||
|
|
263b91d556 | ||
|
|
94cfdb93fd | ||
|
|
91ad44ba0a | ||
|
|
2141dba366 | ||
|
|
d700a3ea11 | ||
|
|
7a6f82b222 | ||
|
|
1da7b889b7 | ||
|
|
8b9942436d | ||
|
|
3d0d4436de | ||
|
|
5620b24c8f | ||
|
|
8a0052dee9 | ||
|
|
80e5944dcd | ||
|
|
169ab5d225 | ||
|
|
d1e9279f3a | ||
|
|
244c79ecb0 | ||
|
|
10bc1bab17 | ||
|
|
1b59db43f3 | ||
|
|
18e444b448 | ||
|
|
be028ccaef | ||
|
|
4583fde181 | ||
|
|
a0b8ff4c4a | ||
|
|
9ce5a5be43 | ||
|
|
d951795634 | ||
|
|
f663b9773a | ||
|
|
79a84939c5 | ||
|
|
b287a5a73c | ||
|
|
d9c6cb8b31 | ||
|
|
791e3f10e4 | ||
|
|
8534a438a6 | ||
|
|
185958c419 | ||
|
|
123fc5f64f | ||
|
|
eed1a59034 | ||
|
|
2ab3bd3ac6 | ||
|
|
bf5c221439 | ||
|
|
f84db1bffc | ||
|
|
0043392460 | ||
|
|
99a31e423a | ||
|
|
823d3447c8 | ||
|
|
68ff19de08 | ||
|
|
55218c6196 | ||
|
|
ab934c2a9b | ||
|
|
cd2745d5fe | ||
|
|
f9590d218a | ||
|
|
cfde99a990 | ||
|
|
d2429a95cc | ||
|
|
713dc2a9a5 | ||
|
|
411cf2826f | ||
|
|
99348a8582 | ||
|
|
33bcfed90f | ||
|
|
cdb5525716 | ||
|
|
d157b08bee | ||
|
|
dc353cb718 | ||
|
|
adfd316184 | ||
|
|
2f4cdbd6c3 | ||
|
|
bbad2dfbc2 | ||
|
|
ce49bdd986 | ||
|
|
d61aa6189f | ||
|
|
1593b8037d | ||
|
|
e659268f29 | ||
|
|
e4fa5f88fe | ||
|
|
84cad6c1c4 | ||
|
|
7a3d8ceb9a | ||
|
|
159cbfa9e9 | ||
|
|
89b1d699bf | ||
|
|
76a293d720 | ||
|
|
4378fd6bdf | ||
|
|
4d127404d3 | ||
|
|
e84d41bebb |
No files matched your search
-12
@@ -1,12 +0,0 @@
|
||||
target/
|
||||
bin/
|
||||
.project
|
||||
.classpath
|
||||
.checkstyle
|
||||
.pmd
|
||||
.ruleset
|
||||
.settings/
|
||||
*.iml
|
||||
.idea
|
||||
*.patch
|
||||
*/src/site/site.xml
|
||||
@@ -1,12 +0,0 @@
|
||||
PMD
|
||||
|
||||
This product is licensed under a BSD-style license;
|
||||
for more info see http://pmd.sourceforge.net/license.html or LICENSE
|
||||
|
||||
Part of this product (mostly the package net.sourceforge.pmd.lang.vm)
|
||||
is licensed under the Apache License, Version 2.0;
|
||||
for more info see http://www.apache.org/licenses/LICENSE-2.0 or LICENSE
|
||||
|
||||
Part of this product (part of pmd-scala)
|
||||
is licensed under the GNU Lesser General Public License, Version 3 or later
|
||||
for more info see http://www.gnu.org/licenses/lgpl.txt or LICENSE
|
||||
@@ -1,27 +0,0 @@
|
||||
[![PMD - Don't shoot the messenger][PMDLogo]][website]
|
||||
|
||||
PMD
|
||||
===
|
||||
|
||||
About
|
||||
-----
|
||||
PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks,
|
||||
unnecessary object creation, and so forth. It supports Java, JavaScript, XML, XSL.
|
||||
Additionally it includes CPD, the copy-paste-detector. CPD finds duplicated code in
|
||||
Java, C, C++, C#, PHP, Ruby, Fortran, JavaScript.
|
||||
|
||||
Source
|
||||
------
|
||||
Our latest source of PMD can be found on [GitHub]. Fork us!
|
||||
The current status of this repo can be seen at [BuildHive].
|
||||
|
||||
News and Website
|
||||
----------------
|
||||
More information can be found on our [Website] and on [SourceForge].
|
||||
|
||||
|
||||
[PMDLogo]: http://pmd.sourceforge.net/pmd_logo.png
|
||||
[GitHub]: https://github.com/pmd/pmd
|
||||
[BuildHive]: https://buildhive.cloudbees.com/job/pmd/
|
||||
[Website]: http://pmd.sourceforge.net
|
||||
[SourceForge]: https://sourceforge.net/projects/pmd/
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.sourceforge.pmd.util.viewer;
|
||||
|
||||
import net.sourceforge.pmd.util.viewer.gui.MainFrame;
|
||||
|
||||
|
||||
/**
|
||||
* viewer's starter
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class Viewer {
|
||||
/**
|
||||
* starts the viewer
|
||||
*
|
||||
* @param args arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
new MainFrame();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:41 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,147 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.ast.Node;
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.util.viewer.gui.menu.ASTNodePopupMenu;
|
||||
import net.sourceforge.pmd.util.viewer.model.ASTModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.TreeSelectionEvent;
|
||||
import javax.swing.event.TreeSelectionListener;
|
||||
import javax.swing.tree.TreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
||||
/**
|
||||
* tree panel GUI
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ASTPanel
|
||||
extends JPanel
|
||||
implements ViewerModelListener, TreeSelectionListener {
|
||||
private ViewerModel model;
|
||||
private JTree tree;
|
||||
|
||||
/**
|
||||
* constructs the panel
|
||||
*
|
||||
* @param model model to attach the panel to
|
||||
*/
|
||||
public ASTPanel(ViewerModel model) {
|
||||
this.model = model;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
model.addViewerModelListener(this);
|
||||
|
||||
setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("AST.PANEL.TITLE")));
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
tree = new JTree((TreeNode) null);
|
||||
|
||||
tree.addTreeSelectionListener(this);
|
||||
|
||||
tree.addMouseListener(new MouseAdapter() {
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
if (e.isPopupTrigger()) {
|
||||
TreePath path =
|
||||
tree.getClosestPathForLocation(e.getX(), e.getY());
|
||||
tree.setSelectionPath(path);
|
||||
|
||||
JPopupMenu menu =
|
||||
new ASTNodePopupMenu(model, (SimpleNode) path.getLastPathComponent());
|
||||
|
||||
menu.show(tree, e.getX(), e.getY());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add(new JScrollPane(tree), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ViewerModelListener#viewerModelChanged(ViewerModelEvent)
|
||||
*/
|
||||
public void viewerModelChanged(ViewerModelEvent e) {
|
||||
switch (e.getReason()) {
|
||||
case ViewerModelEvent.CODE_RECOMPILED:
|
||||
tree.setModel(new ASTModel(model.getRootNode()));
|
||||
|
||||
break;
|
||||
|
||||
case ViewerModelEvent.NODE_SELECTED:
|
||||
|
||||
if (e.getSource() != this) {
|
||||
LinkedList list = new LinkedList();
|
||||
|
||||
for (
|
||||
Node node = (Node) e.getParameter(); node != null;
|
||||
node = node.jjtGetParent())
|
||||
list.addFirst(node);
|
||||
|
||||
TreePath path = new TreePath(list.toArray());
|
||||
|
||||
tree.setSelectionPath(path);
|
||||
|
||||
tree.scrollPathToVisible(path);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
|
||||
*/
|
||||
public void valueChanged(TreeSelectionEvent e) {
|
||||
model.selectNode((SimpleNode) e.getNewLeadSelectionPath().getLastPathComponent(), this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2005/02/16 15:46:05 mikkey
|
||||
* javadoc fixes
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.3 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.2 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
/**
|
||||
* contains action command constants
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public interface ActionCommands {
|
||||
String COMPILE_ACTION = "Compile";
|
||||
String EVALUATE_ACTION = "Evaluate";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.3 2004/12/22 20:52:12 tomcopeland
|
||||
* Fixing some stuff PMD found
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,105 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.BorderLayout;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
/**
|
||||
* A panel showing XPath expression evaluation results
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EvaluationResultsPanel
|
||||
extends JPanel
|
||||
implements ViewerModelListener {
|
||||
private ViewerModel model;
|
||||
private JList list;
|
||||
|
||||
/**
|
||||
* constructs the panel
|
||||
*
|
||||
* @param model model to refer to
|
||||
*/
|
||||
public EvaluationResultsPanel(ViewerModel model) {
|
||||
super(new BorderLayout());
|
||||
|
||||
this.model = model;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
model.addViewerModelListener(this);
|
||||
|
||||
list = new JList();
|
||||
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
|
||||
list.addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
if (list.getSelectedValue() != null) {
|
||||
model.selectNode((SimpleNode) list.getSelectedValue(), EvaluationResultsPanel.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add(new JScrollPane(list), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ViewerModelListener#viewerModelChanged(ViewerModelEvent)
|
||||
*/
|
||||
public void viewerModelChanged(ViewerModelEvent e) {
|
||||
switch (e.getReason()) {
|
||||
case ViewerModelEvent.PATH_EXPRESSION_EVALUATED:
|
||||
|
||||
if (e.getSource() != this) {
|
||||
list.setListData(new Vector(model.getLastEvaluationResults()));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ViewerModelEvent.CODE_RECOMPILED:
|
||||
list.setListData(new Vector(0));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2005/02/16 15:46:34 mikkey
|
||||
* javadoc fixes
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,172 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.ast.ParseException;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
|
||||
/**
|
||||
* viewer's main frame
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MainFrame
|
||||
extends JFrame
|
||||
implements ActionListener, ActionCommands, ViewerModelListener {
|
||||
private ViewerModel model;
|
||||
private SourceCodePanel sourcePanel;
|
||||
private ASTPanel astPanel;
|
||||
private XPathPanel xPathPanel;
|
||||
private JButton compileBtn;
|
||||
private JButton evalBtn;
|
||||
private JLabel statusLbl;
|
||||
|
||||
/**
|
||||
* constructs and shows the frame
|
||||
*/
|
||||
public MainFrame() {
|
||||
super(NLS.nls("MAIN.FRAME.TITLE"));
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
model = new ViewerModel();
|
||||
|
||||
model.addViewerModelListener(this);
|
||||
|
||||
sourcePanel = new SourceCodePanel(model);
|
||||
astPanel = new ASTPanel(model);
|
||||
xPathPanel = new XPathPanel(model);
|
||||
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
|
||||
JSplitPane editingPane =
|
||||
new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sourcePanel, astPanel);
|
||||
editingPane.setResizeWeight(0.5d);
|
||||
|
||||
JPanel interactionsPane = new JPanel(new BorderLayout());
|
||||
|
||||
interactionsPane.add(xPathPanel, BorderLayout.SOUTH);
|
||||
interactionsPane.add(editingPane, BorderLayout.CENTER);
|
||||
|
||||
getContentPane().add(interactionsPane, BorderLayout.CENTER);
|
||||
|
||||
compileBtn = new JButton(NLS.nls("MAIN.FRAME.COMPILE_BUTTON.TITLE"));
|
||||
compileBtn.setActionCommand(COMPILE_ACTION);
|
||||
compileBtn.addActionListener(this);
|
||||
|
||||
evalBtn = new JButton(NLS.nls("MAIN.FRAME.EVALUATE_BUTTON.TITLE"));
|
||||
evalBtn.setActionCommand(EVALUATE_ACTION);
|
||||
evalBtn.addActionListener(this);
|
||||
evalBtn.setEnabled(false);
|
||||
|
||||
statusLbl = new JLabel();
|
||||
statusLbl.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||
|
||||
JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||
|
||||
btnPane.add(compileBtn);
|
||||
btnPane.add(evalBtn);
|
||||
btnPane.add(statusLbl);
|
||||
|
||||
getContentPane().add(btnPane, BorderLayout.SOUTH);
|
||||
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
|
||||
pack();
|
||||
setSize(800, 600);
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||
*/
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String command = e.getActionCommand();
|
||||
long t0, t1;
|
||||
if (command.equals(COMPILE_ACTION)) {
|
||||
try {
|
||||
t0 = System.currentTimeMillis();
|
||||
model.commitSource(sourcePanel.getSourceCode());
|
||||
t1 = System.currentTimeMillis();
|
||||
setStatus(NLS.nls("MAIN.FRAME.COMPILATION.TOOK")+ " "+(t1-t0)+" ms");
|
||||
} catch (ParseException exc) {
|
||||
setStatus(NLS.nls("MAIN.FRAME.COMPILATION.PROBLEM")+ " "+exc.toString());
|
||||
new ParseExceptionHandler(this, exc);
|
||||
}
|
||||
} else if (command.equals(EVALUATE_ACTION)) {
|
||||
try {
|
||||
t0 = System.currentTimeMillis();
|
||||
model.evaluateXPathExpression(xPathPanel.getXPathExpression(), this);
|
||||
t1 = System.currentTimeMillis();
|
||||
setStatus(NLS.nls("MAIN.FRAME.EVALUATION.TOOK")+ " "+(t1-t0)+" ms");
|
||||
} catch (Exception exc) {
|
||||
setStatus(NLS.nls("MAIN.FRAME.EVALUATION.PROBLEM")+ " "+exc.toString());
|
||||
new ParseExceptionHandler(this, exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status bar message
|
||||
* @param string the new status, the empty string will be set if the value is <code>null</code>
|
||||
*/
|
||||
private void setStatus(String string) {
|
||||
if (string == null)
|
||||
string = "";
|
||||
statusLbl.setText(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ViewerModelListener#viewerModelChanged(ViewerModelEvent)
|
||||
*/
|
||||
public void viewerModelChanged(ViewerModelEvent e) {
|
||||
evalBtn.setEnabled(model.hasCompiledTree());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.6 2005/02/16 15:47:01 mikkey
|
||||
* javadoc fixes
|
||||
*
|
||||
* Revision 1.5 2004/12/13 14:46:11 tomcopeland
|
||||
* Applied, thanks Miguel!
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.2 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,112 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
|
||||
/**
|
||||
* handles parsing exceptions
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ParseExceptionHandler
|
||||
extends JDialog
|
||||
implements ActionListener {
|
||||
private Exception exc;
|
||||
private JTextArea errorArea;
|
||||
private JButton okBtn;
|
||||
|
||||
/**
|
||||
* creates the dialog
|
||||
*
|
||||
* @param parent dialog's parent
|
||||
* @param exc exception to be handled
|
||||
*/
|
||||
public ParseExceptionHandler(JFrame parent, Exception exc) {
|
||||
super(parent, NLS.nls("COMPILE_ERROR.DIALOG.TITLE"), true);
|
||||
|
||||
this.exc = exc;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
errorArea = new JTextArea();
|
||||
errorArea.setEditable(false);
|
||||
errorArea.setText(exc.getMessage() + "\n");
|
||||
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
|
||||
JPanel messagePanel = new JPanel(new BorderLayout());
|
||||
|
||||
messagePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),
|
||||
BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
|
||||
NLS.nls("COMPILE_ERROR.PANEL.TITLE"))));
|
||||
|
||||
messagePanel.add(new JScrollPane(errorArea), BorderLayout.CENTER);
|
||||
|
||||
getContentPane().add(messagePanel, BorderLayout.CENTER);
|
||||
|
||||
JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.RIGHT));
|
||||
|
||||
okBtn = new JButton(NLS.nls("COMPILE_ERROR.OK_BUTTON.CAPTION"));
|
||||
|
||||
okBtn.addActionListener(this);
|
||||
|
||||
btnPane.add(okBtn);
|
||||
|
||||
getRootPane().setDefaultButton(okBtn);
|
||||
|
||||
getContentPane().add(btnPane, BorderLayout.SOUTH);
|
||||
|
||||
pack();
|
||||
|
||||
setLocationRelativeTo(getParent());
|
||||
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||
*/
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (e.getSource() == okBtn) {
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.2 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,119 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.DefaultHighlighter;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
|
||||
|
||||
/**
|
||||
* source code panel
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SourceCodePanel
|
||||
extends JPanel
|
||||
implements ViewerModelListener {
|
||||
private ViewerModel model;
|
||||
private JTextArea sourceCodeArea;
|
||||
|
||||
public SourceCodePanel(ViewerModel model) {
|
||||
this.model = model;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
model.addViewerModelListener(this);
|
||||
|
||||
setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("SOURCE.PANEL.TITLE")));
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
sourceCodeArea = new JTextArea();
|
||||
|
||||
add(new JScrollPane(sourceCodeArea), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the string representation of the source code
|
||||
*
|
||||
* @return source code's string representation
|
||||
*/
|
||||
public String getSourceCode() {
|
||||
return sourceCodeArea.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ViewerModelListener#viewerModelChanged(ViewerModelEvent)
|
||||
*/
|
||||
public void viewerModelChanged(ViewerModelEvent e) {
|
||||
if (e.getReason() == ViewerModelEvent.NODE_SELECTED) {
|
||||
final SimpleNode node = (SimpleNode) e.getParameter();
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
sourceCodeArea.getHighlighter().removeAllHighlights();
|
||||
|
||||
if (node == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int startOffset =
|
||||
(sourceCodeArea.getLineStartOffset(node.getBeginLine() - 1) +
|
||||
node.getBeginColumn()) - 1;
|
||||
|
||||
int end =
|
||||
(sourceCodeArea.getLineStartOffset(node.getEndLine() - 1) +
|
||||
node.getEndColumn());
|
||||
|
||||
sourceCodeArea.getHighlighter().addHighlight(startOffset, end,
|
||||
new DefaultHighlighter.DefaultHighlightPainter(new Color(79, 237, 111)));
|
||||
|
||||
sourceCodeArea.moveCaretPosition(startOffset);
|
||||
} catch (BadLocationException exc) {
|
||||
throw new IllegalStateException(exc.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2005/02/16 15:47:27 mikkey
|
||||
* javadoc fixes
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,115 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui;
|
||||
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.Dimension;
|
||||
|
||||
|
||||
/**
|
||||
* Panel for the XPath entry and editing
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class XPathPanel
|
||||
extends JTabbedPane
|
||||
implements ViewerModelListener {
|
||||
private ViewerModel model;
|
||||
private JTextArea xPathArea;
|
||||
|
||||
/**
|
||||
* Constructs the panel
|
||||
*
|
||||
* @param model model to refer to
|
||||
*/
|
||||
public XPathPanel(ViewerModel model) {
|
||||
super(JTabbedPane.BOTTOM);
|
||||
|
||||
this.model = model;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
model.addViewerModelListener(this);
|
||||
|
||||
xPathArea = new JTextArea();
|
||||
|
||||
setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("XPATH.PANEL.TITLE")));
|
||||
|
||||
add(new JScrollPane(xPathArea), NLS.nls("XPATH.PANEL.EXPRESSION"));
|
||||
add(new EvaluationResultsPanel(model), NLS.nls("XPATH.PANEL.RESULTS"));
|
||||
|
||||
setPreferredSize(new Dimension(-1, 200));
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the XPath expression typed into the text area
|
||||
*
|
||||
* @return XPath expression
|
||||
*/
|
||||
public String getXPathExpression() {
|
||||
return xPathArea.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ViewerModelListener#viewerModelChanged(ViewerModelEvent)
|
||||
*/
|
||||
public void viewerModelChanged(ViewerModelEvent e) {
|
||||
switch (e.getReason()) {
|
||||
case ViewerModelEvent.PATH_EXPRESSION_APPENDED:
|
||||
|
||||
if (e.getSource() != this) {
|
||||
xPathArea.append((String) e.getParameter());
|
||||
}
|
||||
|
||||
setSelectedIndex(0);
|
||||
|
||||
break;
|
||||
|
||||
case ViewerModelEvent.CODE_RECOMPILED:
|
||||
setSelectedIndex(0);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2005/02/16 15:47:48 mikkey
|
||||
* javadoc fixes
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.3 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.2 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui.menu;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
|
||||
/**
|
||||
* context sensetive menu for the AST Panel
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ASTNodePopupMenu
|
||||
extends JPopupMenu {
|
||||
private ViewerModel model;
|
||||
private SimpleNode node;
|
||||
|
||||
public ASTNodePopupMenu(ViewerModel model, SimpleNode node) {
|
||||
this.model = model;
|
||||
this.node = node;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
add(new SimpleNodeSubMenu(model, node));
|
||||
|
||||
addSeparator();
|
||||
|
||||
add(new AttributesSubMenu(model, node));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:43 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.4 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.3 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:34:33 tomcopeland
|
||||
* Fixed some stuff PMD found
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,73 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui.menu;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.jaxen.Attribute;
|
||||
import net.sourceforge.pmd.jaxen.AttributeAxisIterator;
|
||||
import net.sourceforge.pmd.util.viewer.model.AttributeToolkit;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
|
||||
/**
|
||||
* contains menu items for the predicate creation
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AttributesSubMenu
|
||||
extends JMenu {
|
||||
private ViewerModel model;
|
||||
private SimpleNode node;
|
||||
|
||||
public AttributesSubMenu(ViewerModel model, SimpleNode node) {
|
||||
super(MessageFormat.format(NLS.nls("AST.MENU.ATTRIBUTES"), new Object[]{node.toString()}));
|
||||
|
||||
this.model = model;
|
||||
this.node = node;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
AttributeAxisIterator i = new AttributeAxisIterator(node);
|
||||
|
||||
while (i.hasNext()) {
|
||||
Attribute attribute = (Attribute) i.next();
|
||||
|
||||
add(new XPathFragmentAddingItem(attribute.getName() + " = " + attribute.getValue(), model,
|
||||
AttributeToolkit.constructPredicate(attribute)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:43 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.4 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.3 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:34:34 tomcopeland
|
||||
* Fixed some stuff PMD found
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,76 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui.menu;
|
||||
|
||||
import net.sourceforge.pmd.ast.Node;
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
import net.sourceforge.pmd.util.viewer.util.NLS;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
|
||||
/**
|
||||
* submenu for the simple node itself
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SimpleNodeSubMenu
|
||||
extends JMenu {
|
||||
private ViewerModel model;
|
||||
private SimpleNode node;
|
||||
|
||||
/**
|
||||
* constructs the submenu
|
||||
*
|
||||
* @param model model to which the actions will be forwarded
|
||||
* @param node menu's owner
|
||||
*/
|
||||
public SimpleNodeSubMenu(ViewerModel model, SimpleNode node) {
|
||||
super(MessageFormat.format(NLS.nls("AST.MENU.NODE.TITLE"), new Object[]{node.toString()}));
|
||||
|
||||
this.model = model;
|
||||
this.node = node;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
StringBuffer buf = new StringBuffer(200);
|
||||
|
||||
for (Node temp = node; temp != null; temp = temp.jjtGetParent()) {
|
||||
buf.insert(0, "/" + temp.toString());
|
||||
}
|
||||
|
||||
add(new XPathFragmentAddingItem(NLS.nls("AST.MENU.NODE.ADD_ABSOLUTE_PATH"), model, buf.toString()));
|
||||
|
||||
add(new XPathFragmentAddingItem(NLS.nls("AST.MENU.NODE.ADD_ALLDESCENDANTS"), model,
|
||||
"//" + node.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:43 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,70 @@
|
||||
package net.sourceforge.pmd.util.viewer.gui.menu;
|
||||
|
||||
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
|
||||
/**
|
||||
* adds the given path fragment to the XPath expression upon action
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class XPathFragmentAddingItem
|
||||
extends JMenuItem
|
||||
implements ActionListener {
|
||||
private ViewerModel model;
|
||||
private String fragment;
|
||||
|
||||
/**
|
||||
* constructs the item
|
||||
*
|
||||
* @param caption menu item's caption
|
||||
* @param model model to refer to
|
||||
* @param fragment XPath expression fragment to be added upon action
|
||||
*/
|
||||
public XPathFragmentAddingItem(String caption, ViewerModel model, String fragment) {
|
||||
super(caption);
|
||||
|
||||
this.model = model;
|
||||
this.fragment = fragment;
|
||||
|
||||
addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||
*/
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
model.appendToXPathExpression(fragment, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.4 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.3 2004/04/15 18:21:58 tomcopeland
|
||||
* Cleaned up imports with new version of IDEA; fixed some deprecated Ant junx
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,125 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
|
||||
import javax.swing.event.TreeModelEvent;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
import javax.swing.tree.TreeModel;
|
||||
import javax.swing.tree.TreePath;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
/**
|
||||
* Model for the AST Panel Tree component
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ASTModel
|
||||
implements TreeModel {
|
||||
private SimpleNode root;
|
||||
private Vector listeners = new Vector(1);
|
||||
|
||||
/**
|
||||
* creates the tree model
|
||||
*
|
||||
* @param root tree's root
|
||||
*/
|
||||
public ASTModel(SimpleNode root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
|
||||
*/
|
||||
public Object getChild(Object parent, int index) {
|
||||
return ((SimpleNode) parent).jjtGetChild(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
|
||||
*/
|
||||
public int getChildCount(Object parent) {
|
||||
return ((SimpleNode) parent).jjtGetNumChildren();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object,
|
||||
* java.lang.Object)
|
||||
*/
|
||||
public int getIndexOfChild(Object parent, Object child) {
|
||||
SimpleNode node = ((SimpleNode) parent);
|
||||
|
||||
for (int i = 0; i < node.jjtGetNumChildren(); i++)
|
||||
if (node.jjtGetChild(i).equals(child)) {
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
|
||||
*/
|
||||
public boolean isLeaf(Object node) {
|
||||
return ((SimpleNode) node).jjtGetNumChildren() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#getRoot()
|
||||
*/
|
||||
public Object getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath,
|
||||
* java.lang.Object)
|
||||
*/
|
||||
public void valueForPathChanged(TreePath path, Object newValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
|
||||
*/
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
|
||||
*/
|
||||
public void removeTreeModelListener(TreeModelListener l) {
|
||||
listeners.remove(l);
|
||||
}
|
||||
|
||||
protected void fireTreeModelEvent(TreeModelEvent e) {
|
||||
for (int i = 0; i < listeners.size(); i++) {
|
||||
((TreeModelListener) listeners.elementAt(i)).treeNodesChanged(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.3 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
import net.sourceforge.pmd.jaxen.Attribute;
|
||||
|
||||
|
||||
/**
|
||||
* A toolkit for vaious attribute translations
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AttributeToolkit {
|
||||
/**
|
||||
* formats a value for it's usage in XPath expressions
|
||||
*
|
||||
* @param attribute atribute which value should be formatted
|
||||
* @return formmated value
|
||||
*/
|
||||
public static String formatValueForXPath(Attribute attribute) {
|
||||
return "'" + attribute.getValue() + "'";
|
||||
}
|
||||
|
||||
/**
|
||||
* constructs a predicate from the given attribute
|
||||
*
|
||||
* @param attribute attribute to be formatted as predicate
|
||||
* @return predicate
|
||||
*/
|
||||
public static String constructPredicate(Attribute attribute) {
|
||||
return "[@" + attribute.getName() + "=" +
|
||||
formatValueForXPath(attribute) + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,142 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
|
||||
import javax.swing.tree.TreeNode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* provides the adapter for the tree model
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SimpleNodeTreeNodeAdapter
|
||||
implements TreeNode {
|
||||
private SimpleNode node;
|
||||
private List children;
|
||||
private SimpleNodeTreeNodeAdapter parent;
|
||||
|
||||
/**
|
||||
* constructs the node
|
||||
*
|
||||
* @param node underlying AST's node
|
||||
*/
|
||||
public SimpleNodeTreeNodeAdapter(SimpleNodeTreeNodeAdapter parent, SimpleNode node) {
|
||||
this.parent = parent;
|
||||
this.node = node;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the underlying node
|
||||
*
|
||||
* @return AST node
|
||||
*/
|
||||
public SimpleNode getSimpleNode() {
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#getChildAt(int)
|
||||
*/
|
||||
public TreeNode getChildAt(int childIndex) {
|
||||
checkChildren();
|
||||
|
||||
return (TreeNode) children.get(childIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#getChildCount()
|
||||
*/
|
||||
public int getChildCount() {
|
||||
checkChildren();
|
||||
|
||||
return children.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#getParent()
|
||||
*/
|
||||
public TreeNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#getIndex(javax.swing.tree.TreeNode)
|
||||
*/
|
||||
public int getIndex(TreeNode node) {
|
||||
checkChildren();
|
||||
|
||||
return children.indexOf(node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#getAllowsChildren()
|
||||
*/
|
||||
public boolean getAllowsChildren() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#isLeaf()
|
||||
*/
|
||||
public boolean isLeaf() {
|
||||
checkChildren();
|
||||
|
||||
return children.size() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.swing.tree.TreeNode#children()
|
||||
*/
|
||||
public Enumeration children() {
|
||||
return Collections.enumeration(children);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks the children and creates them if neccessary
|
||||
*/
|
||||
private void checkChildren() {
|
||||
if (children == null) {
|
||||
children = new ArrayList(node.jjtGetNumChildren());
|
||||
|
||||
for (int i = 0; i < node.jjtGetNumChildren(); i++) {
|
||||
children.add(new SimpleNodeTreeNodeAdapter(this, (SimpleNode) node.jjtGetChild(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return node.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:41 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.3 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,180 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
import net.sourceforge.pmd.TargetJDK1_4;
|
||||
import net.sourceforge.pmd.ast.ASTCompilationUnit;
|
||||
import net.sourceforge.pmd.ast.ParseException;
|
||||
import net.sourceforge.pmd.ast.SimpleNode;
|
||||
import net.sourceforge.pmd.jaxen.DocumentNavigator;
|
||||
import org.jaxen.BaseXPath;
|
||||
import org.jaxen.JaxenException;
|
||||
import org.jaxen.XPath;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
/**
|
||||
* The model for the viewer gui
|
||||
* <p/>
|
||||
* <p/>
|
||||
* This is the model part of MVC
|
||||
* </p>
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ViewerModel {
|
||||
private Vector listeners;
|
||||
private SimpleNode rootNode;
|
||||
private List evaluationResults;
|
||||
|
||||
/**
|
||||
* constructs the model
|
||||
*/
|
||||
public ViewerModel() {
|
||||
listeners = new Vector(5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves AST's root node
|
||||
*
|
||||
* @return AST's root node
|
||||
*/
|
||||
public SimpleNode getRootNode() {
|
||||
return rootNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* commits source code to the model.
|
||||
* <p/>
|
||||
* <p/>
|
||||
* all existing source will be replaced
|
||||
* </p>
|
||||
*
|
||||
* @param source source to be commited
|
||||
*/
|
||||
public void commitSource(String source) {
|
||||
ASTCompilationUnit compilationUnit = new TargetJDK1_4().createParser(new StringReader(source)).CompilationUnit();
|
||||
rootNode = compilationUnit;
|
||||
fireViewerModelEvent(new ViewerModelEvent(this, ViewerModelEvent.CODE_RECOMPILED));
|
||||
}
|
||||
|
||||
/**
|
||||
* determines wheteher the model has a compiled tree at it's disposal
|
||||
*
|
||||
* @return true if there is an AST, false otherwise
|
||||
*/
|
||||
public boolean hasCompiledTree() {
|
||||
return rootNode != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* evaluates the given XPath expression against the current tree
|
||||
*
|
||||
* @param xPath XPath expression to be evaluated
|
||||
* @param evaluator object which requests the evaluation
|
||||
*/
|
||||
public void evaluateXPathExpression(String xPath, Object evaluator)
|
||||
throws ParseException, JaxenException {
|
||||
XPath xpath = new BaseXPath(xPath, new DocumentNavigator());
|
||||
|
||||
evaluationResults = xpath.selectNodes(rootNode);
|
||||
|
||||
fireViewerModelEvent(new ViewerModelEvent(evaluator, ViewerModelEvent.PATH_EXPRESSION_EVALUATED));
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the results of last evaluation
|
||||
*
|
||||
* @return a list containing the nodes selected by the last XPath expression
|
||||
* evaluation
|
||||
*/
|
||||
public List getLastEvaluationResults() {
|
||||
return evaluationResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* selects the given node in the AST
|
||||
*
|
||||
* @param node node to be selected
|
||||
* @param selector object which requests the selection
|
||||
*/
|
||||
public void selectNode(SimpleNode node, Object selector) {
|
||||
fireViewerModelEvent(new ViewerModelEvent(selector, ViewerModelEvent.NODE_SELECTED, node));
|
||||
}
|
||||
|
||||
/**
|
||||
* appends the given fragment to the XPath expression
|
||||
*
|
||||
* @param pathFragment fragment to be added
|
||||
* @param appender object that is trying to append the fragment
|
||||
*/
|
||||
public void appendToXPathExpression(String pathFragment, Object appender) {
|
||||
fireViewerModelEvent(new ViewerModelEvent(appender, ViewerModelEvent.PATH_EXPRESSION_APPENDED, pathFragment));
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a listener to the model
|
||||
*
|
||||
* @param l listener to be added
|
||||
*/
|
||||
public void addViewerModelListener(ViewerModelListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* removes the lisetener from the model
|
||||
*
|
||||
* @param l listener to be removed
|
||||
*/
|
||||
public void removeViewerModelListener(ViewerModelListener l) {
|
||||
listeners.remove(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* notifes all listener of a change in the model
|
||||
*
|
||||
* @param e change's reason
|
||||
*/
|
||||
protected void fireViewerModelEvent(ViewerModelEvent e) {
|
||||
for (int i = 0; i < listeners.size(); i++) {
|
||||
((ViewerModelListener) listeners.elementAt(i)).viewerModelChanged(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.5 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.4 2004/04/12 17:35:09 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.3 2004/04/12 17:23:29 tomcopeland
|
||||
* Moving all explicit JavaParser creations over to a factory-ish sort of thing. This makes the version of the parser explicit rather than assumed.
|
||||
*
|
||||
* Revision 1.2 2003/09/23 20:51:06 tomcopeland
|
||||
* Cleaned up imports
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.3 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.2 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,112 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
/**
|
||||
* The event which will be sent every time the model changes
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Note: the instances will be immutable
|
||||
* </p>
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ViewerModelEvent {
|
||||
/**
|
||||
* reason in the case of code recompilation
|
||||
*/
|
||||
public static final int CODE_RECOMPILED = 1;
|
||||
|
||||
/**
|
||||
* reason in the case of node selection
|
||||
*/
|
||||
public static final int NODE_SELECTED = 2;
|
||||
|
||||
/**
|
||||
* reason in the case of path extension
|
||||
*/
|
||||
public static final int PATH_EXPRESSION_APPENDED = 3;
|
||||
|
||||
/**
|
||||
* reason in the case of path expression evaluation
|
||||
*/
|
||||
public static final int PATH_EXPRESSION_EVALUATED = 4;
|
||||
private Object source;
|
||||
private int reason;
|
||||
private Object parameter;
|
||||
|
||||
/**
|
||||
* Creates an event
|
||||
*
|
||||
* @param source event's source
|
||||
* @param reason event's reason
|
||||
*/
|
||||
public ViewerModelEvent(Object source, int reason) {
|
||||
this(source, reason, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an event
|
||||
*
|
||||
* @param source event's source
|
||||
* @param reason event's reason
|
||||
* @param parameter parameter object
|
||||
*/
|
||||
public ViewerModelEvent(Object source, int reason, Object parameter) {
|
||||
this.source = source;
|
||||
this.reason = reason;
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the reason for event's occurance
|
||||
*
|
||||
* @return event's reason
|
||||
*/
|
||||
public int getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves the object which caused the event
|
||||
*
|
||||
* @return object that casused the event
|
||||
*/
|
||||
public Object getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieves event's parameter
|
||||
*
|
||||
* @return event's parameter
|
||||
*/
|
||||
public Object getParameter() {
|
||||
return parameter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.3 2003/09/24 00:40:35 bgr
|
||||
* evaluation results browsing added
|
||||
*
|
||||
* Revision 1.2 2003/09/23 07:52:16 bgr
|
||||
* menus added
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.sourceforge.pmd.util.viewer.model;
|
||||
|
||||
/**
|
||||
* identiefie a listener of the ViewerModel
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public interface ViewerModelListener {
|
||||
/**
|
||||
* DOCUMENT ME!
|
||||
*
|
||||
* @param e DOCUMENT ME!
|
||||
*/
|
||||
void viewerModelChanged(ViewerModelEvent e);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.3 2004/12/22 20:52:12 tomcopeland
|
||||
* Fixing some stuff PMD found
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,34 @@
|
||||
##########################################################################
|
||||
# english string translations for the viewer
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
# Main Frame
|
||||
MAIN.FRAME.TITLE = AST Viewer
|
||||
MAIN.FRAME.COMPILE_BUTTON.TITLE = Compile
|
||||
MAIN.FRAME.EVALUATE_BUTTON.TITLE = Evaluate XPath Expression
|
||||
MAIN.FRAME.COMPILATION.TOOK = Compilation took
|
||||
MAIN.FRAME.COMPILATION.PROBLEM = Compilation problem:
|
||||
MAIN.FRAME.EVALUATION.TOOK = Evaluation took
|
||||
MAIN.FRAME.EVALUATION.PROBLEM = Evaluation problem:
|
||||
|
||||
|
||||
# Source Panel
|
||||
SOURCE.PANEL.TITLE = Source code
|
||||
|
||||
# Tree Panel
|
||||
AST.PANEL.TITLE = Abstract Syntax Tree
|
||||
AST.MENU.ATTRIBUTES = Add predicate from {0}'a attributes
|
||||
AST.MENU.NODE.TITLE = Add {0} to the XPath expression
|
||||
AST.MENU.NODE.ADD_ABSOLUTE_PATH = Add with absolute path
|
||||
AST.MENU.NODE.ADD_ALLDESCENDANTS = Add all descentands of this type
|
||||
|
||||
# XPath Panel
|
||||
XPATH.PANEL.TITLE = XPath
|
||||
XPATH.PANEL.EXPRESSION = Expression
|
||||
XPATH.PANEL.RESULTS = Results
|
||||
|
||||
# Compile Error dialog
|
||||
COMPILE_ERROR.DIALOG.TITLE = Compilation error
|
||||
COMPILE_ERROR.PANEL.TITLE = Error message
|
||||
COMPILE_ERROR.OK_BUTTON.CAPTION = Ok
|
||||
@@ -0,0 +1,49 @@
|
||||
package net.sourceforge.pmd.util.viewer.util;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
|
||||
/**
|
||||
* helps with internationalization
|
||||
*
|
||||
* @author Boris Gruschko ( boris at gruschko.org )
|
||||
* @version $Id$
|
||||
*/
|
||||
public class NLS {
|
||||
private final static ResourceBundle bundle;
|
||||
|
||||
static {
|
||||
bundle =
|
||||
ResourceBundle.getBundle("net.sourceforge.pmd.util.viewer.resources.viewer_strings");
|
||||
}
|
||||
|
||||
/**
|
||||
* translates the given key to the message
|
||||
*
|
||||
* @param key key to be translated
|
||||
* @return translated string
|
||||
*/
|
||||
public static String nls(String key) {
|
||||
return bundle.getString(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.1 2005/08/15 19:51:42 tomcopeland
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.2 2004/09/27 19:42:52 tomcopeland
|
||||
* A ridiculously large checkin, but it's all just code reformatting. Nothing to see here...
|
||||
*
|
||||
* Revision 1.1 2003/09/23 20:32:42 tomcopeland
|
||||
* Added Boris Gruschko's new AST/XPath viewer
|
||||
*
|
||||
* Revision 1.1 2003/09/24 01:33:03 bgr
|
||||
* moved to a new package
|
||||
*
|
||||
* Revision 1.1 2003/09/22 05:21:54 bgr
|
||||
* initial commit
|
||||
*
|
||||
*/
|
||||
@@ -1,36 +0,0 @@
|
||||
<project name="generate-jdk4-pom"
|
||||
default="generate-xdocs">
|
||||
|
||||
<target name="generate-xdocs">
|
||||
<path id="tools.classpath">
|
||||
<fileset dir="${lib}">
|
||||
<include name="pmd-build-*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<taskdef name="pmd-build"
|
||||
classname="net.sourceforge.pmd.ant.PmdBuildTask">
|
||||
<classpath refid="tools.classpath"/>
|
||||
</taskdef>
|
||||
<echo>Generating documentation into ${target}, into ${rules.src}</echo>
|
||||
<mkdir dir="${target}"/>
|
||||
<pmd-build siteXml="${siteXml}"
|
||||
rulesDirectory="${rules.src}"
|
||||
target="${target}"/>
|
||||
</target>
|
||||
|
||||
<!--
|
||||
Unit test of this task
|
||||
|
||||
Should be run from tools/ant directory
|
||||
-->
|
||||
<target name="test">
|
||||
|
||||
<antcall target="generate-xdocs">
|
||||
<param name="target" value="target-test"/>
|
||||
<param name="lib" value="../lib"/>
|
||||
<param name="rules.src" value="../../src/site/xdocs"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -1,17 +0,0 @@
|
||||
<project name="pmd" default="ruleset-docs" basedir="../">
|
||||
|
||||
<!--
|
||||
Properties required to call this script:
|
||||
target.docs, directory where to store the rules directory
|
||||
|
||||
-->
|
||||
|
||||
<property name="rule-format" value="build/xslt/rule-format.xsl"/>
|
||||
<property name="rules-index" value="build/xslt/rules-index.xsl"/>
|
||||
|
||||
<target name="ruleset-docs">
|
||||
<mkdir dir="${target.docs}/rules" />
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -1,270 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
These are default Java conventions from Eclipse 3.3.2 with the following changes:
|
||||
1) Line lengths to 120
|
||||
2) Disable all Comment formatting options
|
||||
3) Enum constants always wrap to new line
|
||||
-->
|
||||
<profiles version="11">
|
||||
<profile kind="CodeFormatterProfile" name="PMD" version="11">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="mixed"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -1,73 +0,0 @@
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
||||
http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
|
||||
<activeProfiles>
|
||||
<activeProfile>gpg-settings</activeProfile>
|
||||
</activeProfiles>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>gpg-settings</id>
|
||||
<properties>
|
||||
<!-- this key will be used by the maven gpg plugin during release -->
|
||||
<gpg.keyname>your-gpg-key</gpg.keyname>
|
||||
<gpg.passphrase>your-passphrase</gpg.passphrase>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<servers>
|
||||
<!-- to upload to sonatype maven central.
|
||||
See https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide -->
|
||||
<server>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<username>your-sonatype-jira-login</username>
|
||||
<password>your-sonatype-jira-password</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>sonatype-nexus-staging</id>
|
||||
<username>your-sonatype-jira-login</username>
|
||||
<password>your-sonatype-jira-password</password>
|
||||
</server>
|
||||
|
||||
<server>
|
||||
<id>pmd-repo</id>
|
||||
<username>your-sf-login</username>
|
||||
<password>your-sf-pwd</password>
|
||||
<!-- or use instead of the password your private key with optional passphrase
|
||||
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
|
||||
<passphrase>some_passphrase</passphrase>
|
||||
-->
|
||||
</server>
|
||||
<server>
|
||||
<id>pmd-site</id>
|
||||
<username>your-sf-login</username>
|
||||
<password>your-sf-pwd</password>
|
||||
<!-- or use instead of the password your private key with optional passphrase
|
||||
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
|
||||
<passphrase>some_passphrase</passphrase>
|
||||
-->
|
||||
</server>
|
||||
<server>
|
||||
<id>pmd-snapshot-repo</id>
|
||||
<username>your-sf-login</username>
|
||||
<password>your-sf-pwd</password>
|
||||
<!-- or use instead of the password your private key with optional passphrase
|
||||
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
|
||||
<passphrase>some_passphrase</passphrase>
|
||||
-->
|
||||
</server>
|
||||
<server>
|
||||
<id>pmd-snapshot-site</id>
|
||||
<username>your-sf-login</username>
|
||||
<password>your-sf-pwd</password>
|
||||
<!-- or use instead of the password your private key with optional passphrase
|
||||
<privateKey>${user.home}/.ssh/id_dsa</privateKey>
|
||||
<passphrase>some_passphrase</passphrase>
|
||||
-->
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
</settings>
|
||||
@@ -1,191 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>7</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>net.sourceforge.pmd</groupId>
|
||||
<artifactId>pmd-build</artifactId>
|
||||
<name>PMD Build Plugin</name>
|
||||
<version>0.9</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<description>
|
||||
<![CDATA[
|
||||
This small subproject regroup most of the stuff needed to build pmd.
|
||||
As some java code has been produced to reduce the use of scripts when
|
||||
generating the website, the build also requires a small jar, which is
|
||||
generated by this pom.
|
||||
|
||||
IMPORTANT NOTE: the pmd-build.jar does not need to be recompile if you
|
||||
modify any ant or xslt files. You can alter the files that are in the
|
||||
xslt directory and directly uses the appropriate ant or java task.
|
||||
pmd-build should be recompiled and package (and its version incrememented)
|
||||
only if you modify the java code.
|
||||
]]>
|
||||
</description>
|
||||
<url>http://pmd.sourceforge.net/</url>
|
||||
<inceptionYear>2008</inceptionYear>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>BSD-style</name>
|
||||
<url>http://pmd.sourceforge.net/license.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git://github.com/pmd/pmd.git</connection>
|
||||
<developerConnection>scm:git:ssh://git@github.com/pmd/pmd.git</developerConnection>
|
||||
<url>https://github.com/pmd/pmd</url>
|
||||
<tag>pmd-build/0.9</tag>
|
||||
</scm>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>rpelisse</id>
|
||||
<name>Romain Pelisse</name>
|
||||
<email>rpelisse@users.sourceforge.net</email>
|
||||
<roles>
|
||||
<role>Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>adangel</id>
|
||||
<name>Andreas Dangel</name>
|
||||
<email>adangel@users.sourceforge.net</email>
|
||||
<roles>
|
||||
<role>Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<tagNameFormat>@{project.artifactId}/@{project.version}</tagNameFormat>
|
||||
<pushChanges>false</pushChanges>
|
||||
<localCheckout>true</localCheckout>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<mavenVersion>3.0.3</mavenVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.8.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>3.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-testing</groupId>
|
||||
<artifactId>maven-plugin-testing-harness</artifactId>
|
||||
<version>2.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
<minimumTokens>100</minimumTokens>
|
||||
<rulesets>
|
||||
<ruleset>${basedir}/../pmd-core/src/main/resources/rulesets/internal/dogfood.xml</ruleset>
|
||||
</rulesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>2.13</version>
|
||||
<configuration>
|
||||
<configLocation>${basedir}/../pmd-core/etc/checkstyle-config.xml</configLocation>
|
||||
<suppressionsFile>${basedir}/../pmd-core/etc/checkstyle-suppressions.xml</suppressionsFile>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
Release Howto for pmd-build:
|
||||
============================
|
||||
|
||||
Prerequisites:
|
||||
--------------
|
||||
* You need to have a Jira account at Sonatype: https://issues.sonatype.org/
|
||||
* You need to have upload permissions to the staging repository for PMD at sonatype: https://issues.sonatype.org/browse/OSSRH-2295
|
||||
* For more infos: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
|
||||
* You need a GPG key for signing the artifacts. Use "gpg --list-keys" to see your available keys. Note: Your key must be
|
||||
available through various keyservers.
|
||||
* You need to have your settings.xml filled:
|
||||
-> configure the property gpg.keyname and any other property for the maven-gpg-plugin (e.g. via a profile)
|
||||
-> configure the server section (you need to configure your sonatype jira account for server id "sonatype-nexus-staging").
|
||||
* You'll need at least maven 3.0.4, see http://jira.codehaus.org/browse/MRELEASE-756
|
||||
|
||||
Step by step:
|
||||
-------------
|
||||
1. Checkout master branch:
|
||||
|
||||
git clone https://github.com/pmd/pmd.git
|
||||
cd pmd/maven-plugin-pmd-build
|
||||
|
||||
2. Prepare the release (creates a new release tag).
|
||||
This will be done for you: http://maven.apache.org/plugins/maven-release-plugin/examples/prepare-release.html
|
||||
Maven will ask you about the release version, the tag name and the new version. You can simply hit enter,
|
||||
to use the default values.
|
||||
|
||||
mvn release:clean
|
||||
mvn release:prepare
|
||||
|
||||
3. Perform the release (builds from the tag and deploys the artifact).
|
||||
|
||||
mvn release:perform
|
||||
|
||||
4. Release it via Sonatype Nexus
|
||||
* Login to https://oss.sonatype.org/
|
||||
* Go to Staging Repositories page
|
||||
* Select a staging repository
|
||||
* Click the close button
|
||||
* Now you can download the artifacts again and verify they are working.
|
||||
* Once you are sure they are working, click "Release" and the artifacts are eventually available through maven central.
|
||||
|
||||
5. Push your local changes if everything is fine
|
||||
|
||||
git push origin master
|
||||
git push origin tag pmd-build/<version>
|
||||
|
||||
Loaded 30 of 3720 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user