Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 40 |  | Methods: | 2
| NCLOC: | 28 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
AttributesSubMenu.java | 0% | 0% | 0% | 0% |

1 |  | package net.sourceforge.pmd.util.viewer.gui.menu;
2 |  |
3 |  | import net.sourceforge.pmd.ast.SimpleNode;
4 |  | import net.sourceforge.pmd.jaxen.Attribute;
5 |  | import net.sourceforge.pmd.jaxen.AttributeAxisIterator;
6 |  | import net.sourceforge.pmd.util.viewer.model.AttributeToolkit;
7 |  | import net.sourceforge.pmd.util.viewer.model.ViewerModel;
8 |  | import net.sourceforge.pmd.util.viewer.util.NLS;
9 |  |
10 |  | import javax.swing.*;
11 |  | import java.text.MessageFormat;
12 |  |
13 |  |
14 |  | /**
15 |  | * contains menu items for the predicate creation
16 |  | *
17 |  | * @author Boris Gruschko ( boris at gruschko.org )
18 |  | * @version $Id: AttributesSubMenu.java,v 1.10 2006/02/10 14:15:31 tomcopeland Exp $
19 |  | */
20 |  | public class AttributesSubMenu
21 |  | extends JMenu {
22 |  | private ViewerModel model;
23 |  | private SimpleNode node;
24 |  |
25 | 0 | public AttributesSubMenu(ViewerModel model, SimpleNode node) {
26 | 0 | super(MessageFormat.format(NLS.nls("AST.MENU.ATTRIBUTES"), new Object[]{node.toString()}));
27 | 0 | this.model = model;
28 | 0 | this.node = node;
29 | 0 | init();
30 |  | }
31 |  |
32 | 0 | private void init() {
33 | 0 | AttributeAxisIterator i = new AttributeAxisIterator(node);
34 | 0 | while (i.hasNext()) {
35 | 0 | Attribute attribute = (Attribute) i.next();
36 | 0 | add(new XPathFragmentAddingItem(attribute.getName() + " = " + attribute.getValue(), model,
37 |  | AttributeToolkit.constructPredicate(attribute)));
38 |  | }
39 |  | }
40 |  | }