View Javadoc

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