View Javadoc

1   package de.matthias_burbach.deputy.swing;
2   
3   import de.matthias_burbach.deputy.core.rule.DeprecationRule;
4   import de.matthias_burbach.deputy.core.rule.Rule;
5   
6   /***
7    * Displays a deprecation rule.
8    *
9    * @author Matthias Burbach
10   */
11  public class DeprecationRuleTreeNode extends RuleTreeNode {
12      /***
13       * The rule to display.
14       */
15      private DeprecationRule rule;
16  
17      /***
18       * @param rule The rule to display.
19       */
20      public DeprecationRuleTreeNode(
21              final DeprecationRule rule) {
22          this.rule = rule;
23      }
24  
25      /*(non-Javadoc)
26       * @see java.lang.Object#toString()
27       */
28      /***
29       * {@inheritDoc}
30       */
31      public String toString() {
32          return "Deprecate " + rule.getArtifactId() + "-" + rule.getVersion();
33      }
34  
35      /*(non-Javadoc)
36       * @see javax.swing.tree.TreeNode#isLeaf()
37       */
38      /***
39       * {@inheritDoc}
40       */
41      public boolean isLeaf() {
42          return true;
43      }
44  
45      /*(non-Javadoc)
46       * @see de.matthias_burbach.deputy.swing.RuleTreeNode#getRule()
47       */
48      /***
49       * {@inheritDoc}
50       */
51      public Rule getRule() {
52          return rule;
53      }
54  }