KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > ui > web > admin > approval > TextComparisonView


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13
14 package org.ejbca.ui.web.admin.approval;
15
16 import java.io.Serializable JavaDoc;
17
18 /**
19  * Class used to present comparable data with red text for rows that doesn't match.
20  *
21  * @author Philip Vendil
22  * @version $Id: TextComparisonView.java,v 1.2 2006/09/05 09:23:28 anatom Exp $
23  */

24 public class TextComparisonView implements Serializable JavaDoc {
25     
26     private String JavaDoc orgvalue;
27     private String JavaDoc newvalue;
28     
29     public TextComparisonView(String JavaDoc orgvalue, String JavaDoc newvalue){
30         this.orgvalue = orgvalue;
31         this.newvalue = newvalue;
32     }
33     
34     
35     public String JavaDoc getTextComparisonColor(){
36       if(orgvalue != null && !orgvalue.equals(newvalue)) {
37         return "alert";
38       }
39         
40       
41       return "";
42     }
43
44     public String JavaDoc getNewvalue() {
45         return newvalue;
46     }
47     public String JavaDoc getOrgvalue() {
48         return orgvalue;
49     }
50 }
51
Popular Tags