View Javadoc

1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kns.web.ui;
17  
18  import java.io.Serializable;
19  
20  import org.apache.commons.lang.StringUtils;
21  import org.kuali.rice.kns.service.KNSServiceLocator;
22  import org.kuali.rice.kns.util.KNSConstants;
23  
24  /**
25   * Represents an extra button that may appear on the lookups or bottom of a
26   * document page.
27   */
28  public class ExtraButton implements Serializable {
29  	private String extraButtonSource = "";
30  
31  	private String extraButtonAltText = "";
32  
33  	private String extraButtonParams = "";
34  
35  	private String extraButtonProperty = "";
36  
37  	private String extraButtonOnclick = "";
38  	 
39  	public String getExtraButtonAltText() {
40  		return extraButtonAltText;
41  	}
42  
43  	public void setExtraButtonAltText(String extraButtonAltText) {
44  		this.extraButtonAltText = extraButtonAltText;
45  	}
46  
47  	public String getExtraButtonParams() {
48  		return extraButtonParams;
49  	}
50  
51  	public void setExtraButtonParams(String extraButtonParams) {
52  		this.extraButtonParams = extraButtonParams;
53  	}
54  
55  	public String getExtraButtonProperty() {
56  		return extraButtonProperty;
57  	}
58  
59  	public void setExtraButtonProperty(String extraButtonProperty) {
60  		this.extraButtonProperty = extraButtonProperty;
61  	}
62  
63  	public String getExtraButtonSource() {
64  		return extraButtonSource;
65  	}
66  	    
67  	public String getExtraButtonOnclick() {
68  	    return this.extraButtonOnclick;
69  	}
70  	 
71  	public void setExtraButtonOnclick(String extraButtonOnclick) {
72  	    this.extraButtonOnclick = extraButtonOnclick;
73  	}
74  
75  	public void setExtraButtonSource(String extraButtonSource) {
76  		if (StringUtils.isNotBlank(extraButtonSource)) {
77  			this.extraButtonSource = extraButtonSource
78  					.replace(
79  							"${kr.externalizable.images.url}",
80  							KNSServiceLocator
81  									.getKualiConfigurationService()
82  									.getPropertyString(
83  											KNSConstants.EXTERNALIZABLE_IMAGES_URL_KEY))
84  					.replace(
85  							"${externalizable.images.url}",
86  							KNSServiceLocator
87  									.getKualiConfigurationService()
88  									.getPropertyString(
89  											KNSConstants.APPLICATION_EXTERNALIZABLE_IMAGES_URL_KEY));
90  		}
91  	}
92  
93  }