1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.portal.kernel.util.StringPool;
18  import com.liferay.portal.kernel.util.Validator;
19  import com.liferay.taglib.util.IncludeTag;
20  
21  import javax.servlet.http.HttpServletRequest;
22  
23  /**
24   * <a href="FlashTag.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public class FlashTag extends IncludeTag {
29  
30      public void setAlign(String align) {
31          if (Validator.isNotNull(align)) {
32              _align = align;
33          }
34      }
35  
36      public void setAllowScriptAccess(String allowScriptAccess) {
37          if (Validator.isNotNull(allowScriptAccess)) {
38              _allowScriptAccess = allowScriptAccess;
39          }
40      }
41  
42      public void setBase(String base) {
43          if (Validator.isNotNull(base)) {
44              _base = base;
45          }
46      }
47  
48      public void setBgcolor(String bgcolor) {
49          if (Validator.isNotNull(bgcolor)) {
50              _bgcolor = bgcolor;
51          }
52      }
53  
54      public void setDevicefont(String devicefont) {
55          if (Validator.isNotNull(devicefont)) {
56              _devicefont = devicefont;
57          }
58      }
59  
60      public void setFlashvars(String flashvars) {
61          if (Validator.isNotNull(flashvars)) {
62              _flashvars = flashvars;
63          }
64      }
65  
66      public void setHeight(String height) {
67          if (Validator.isNotNull(height)) {
68              _height = height;
69          }
70      }
71  
72      public void setId(String id) {
73          if (Validator.isNotNull(id)) {
74              _id = id;
75          }
76      }
77  
78      public void setLoop(String loop) {
79          if (Validator.isNotNull(loop)) {
80              _loop = loop;
81          }
82      }
83  
84      public void setMenu(String menu) {
85          if (Validator.isNotNull(menu)) {
86              _menu = menu;
87          }
88      }
89  
90      public void setMovie(String movie) {
91          _movie = movie;
92      }
93  
94      public void setPlay(String play) {
95          if (Validator.isNotNull(play)) {
96              _play = play;
97          }
98      }
99  
100     public void setQuality(String quality) {
101         if (Validator.isNotNull(quality)) {
102             _quality = quality;
103         }
104     }
105 
106     public void setSalign(String salign) {
107         if (Validator.isNotNull(salign)) {
108             _salign = salign;
109         }
110     }
111 
112     public void setScale(String scale) {
113         if (Validator.isNotNull(scale)) {
114             _scale = scale;
115         }
116     }
117 
118     public void setSwliveconnect(String swliveconnect) {
119         if (Validator.isNotNull(swliveconnect)) {
120             _swliveconnect = swliveconnect;
121         }
122     }
123 
124     public void setVersion(String version) {
125         if (Validator.isNotNull(version)) {
126             _version = version;
127         }
128     }
129 
130     public void setWidth(String width) {
131         if (Validator.isNotNull(width)) {
132             _width = width;
133         }
134     }
135 
136     public void setWmode(String wmode) {
137         if (Validator.isNotNull(wmode)) {
138             _wmode = wmode;
139         }
140     }
141 
142     protected void cleanUp() {
143         _align = "left";
144         _allowScriptAccess = "sameDomain";
145         _base = StringPool.PERIOD;
146         _bgcolor = "#FFFFFF";
147         _devicefont = Boolean.TRUE.toString();
148         _flashvars = StringPool.BLANK;
149         _height = "500";
150         _id = StringPool.BLANK;
151         _loop = Boolean.TRUE.toString();
152         _menu = Boolean.FALSE.toString();
153         _movie = StringPool.BLANK;
154         _play = Boolean.FALSE.toString();
155         _quality = "best";
156         _salign = StringPool.BLANK;
157         _scale = "showall";
158         _swliveconnect = Boolean.FALSE.toString();
159         _version = "7";
160         _width = "100%";
161         _wmode = "opaque";
162     }
163 
164     protected String getPage() {
165         return _PAGE;
166     }
167 
168     protected void setAttributes(HttpServletRequest request) {
169         request.setAttribute("liferay-ui:flash:align", _align);
170         request.setAttribute(
171             "liferay-ui:flash:allowScriptAccess", _allowScriptAccess);
172         request.setAttribute("liferay-ui:flash:base", _base);
173         request.setAttribute("liferay-ui:flash:bgcolor", _bgcolor);
174         request.setAttribute("liferay-ui:flash:devicefont", _devicefont);
175         request.setAttribute("liferay-ui:flash:flashvars", _flashvars);
176         request.setAttribute("liferay-ui:flash:height", _height);
177         request.setAttribute("liferay-ui:flash:id", _id);
178         request.setAttribute("liferay-ui:flash:loop", _loop);
179         request.setAttribute("liferay-ui:flash:menu", _menu);
180         request.setAttribute("liferay-ui:flash:movie", _movie);
181         request.setAttribute("liferay-ui:flash:play", _play);
182         request.setAttribute("liferay-ui:flash:quality", _quality);
183         request.setAttribute("liferay-ui:flash:salign", _salign);
184         request.setAttribute("liferay-ui:flash:scale", _scale);
185         request.setAttribute("liferay-ui:flash:swliveconnect", _swliveconnect);
186         request.setAttribute("liferay-ui:flash:version", _version);
187         request.setAttribute("liferay-ui:flash:width", _width);
188         request.setAttribute("liferay-ui:flash:wmode", _wmode);
189     }
190 
191     private static final String _PAGE = "/html/taglib/ui/flash/page.jsp";
192 
193     private String _align = "left";
194     private String _allowScriptAccess = "sameDomain";
195     private String _base = StringPool.PERIOD;
196     private String _bgcolor = "#FFFFFF";
197     private String _devicefont = Boolean.TRUE.toString();
198     private String _flashvars = StringPool.BLANK;
199     private String _height = "500";
200     private String _id = StringPool.BLANK;
201     private String _loop = Boolean.TRUE.toString();
202     private String _menu = Boolean.FALSE.toString();
203     private String _movie = StringPool.BLANK;
204     private String _play = Boolean.FALSE.toString();
205     private String _quality = "best";
206     private String _salign = StringPool.BLANK;
207     private String _scale = "showall";
208     private String _swliveconnect = Boolean.FALSE.toString();
209     private String _version = "7";
210     private String _width = "100%";
211     private String _wmode = "opaque";
212 
213 }