Coverage Report - org.homeunix.thecave.buddi.plugin.api.BuddiTransactionCellRendererPlugin
 
Classes in this File Line Coverage Branch Coverage Complexity
BuddiTransactionCellRendererPlugin
38%
5/13
75%
3/4
1.222
 
 1  
 /*
 2  
  * Created on Nov 5, 2007 by wyatt
 3  
  */
 4  
 package org.homeunix.thecave.buddi.plugin.api;
 5  
 
 6  
 import javax.swing.DefaultListCellRenderer;
 7  
 
 8  
 import org.homeunix.thecave.buddi.model.Account;
 9  
 
 10  
 import ca.digitalcave.moss.application.plugin.MossPlugin;
 11  
 import ca.digitalcave.moss.common.Version;
 12  
 
 13  
 /**
 14  
  * Create a plugin of this type to allow custom cell renderers for the transaction
 15  
  * window.  If there are no custom renderers defined, we use the default renderer;
 16  
  * if there is exactly one custom renderer, we use it; if there are more than one
 17  
  * custom renderers, we use the first one which is loaded (most likely the one
 18  
  * which is first in alphabetical order, but this may differ by platform).
 19  
  *  
 20  
  * @author wyatt
 21  
  *
 22  
  */
 23  3475
 public abstract class BuddiTransactionCellRendererPlugin extends DefaultListCellRenderer implements MossPlugin {
 24  
         private static final long serialVersionUID = 0L;
 25  
         private Account account;
 26  
         
 27  
         public String getDescription() {
 28  0
                 return null;
 29  
         }
 30  
         
 31  
         public Account getAccount() {
 32  0
                 return account;
 33  
         }
 34  
 
 35  
         public void setAccount(Account account) {
 36  0
                 this.account = account;
 37  0
         }
 38  
         
 39  
         public Version getMaximumVersion() {
 40  0
                 return null;
 41  
         }
 42  
         
 43  
         public Version getMinimumVersion() {
 44  
                 //This plugin type was not implemented until 2.9.15.0
 45  0
                 return new Version("2.9.15.0");
 46  
         }
 47  
         
 48  
         public boolean isPluginActive() {
 49  0
                 return true;
 50  
         }
 51  
         
 52  
         @Override
 53  
         public String getName() {
 54  0
                 return "Change Me";
 55  
         }
 56  
         
 57  
         @Override
 58  
         public int hashCode() {
 59  2798
                 return getName().hashCode();
 60  
         }
 61  
         
 62  
         @Override
 63  
         public boolean equals(Object obj) {
 64  4179
                 if (obj instanceof BuddiTransactionCellRendererPlugin)
 65  1399
                         return obj.hashCode() == this.hashCode();
 66  2780
                 return false;
 67  
         }
 68  
 }