| PngImageTag.java |
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.taglib.util.IncludeTag;
18
19 import javax.servlet.http.HttpServletRequest;
20
21 /**
22 * <a href="PngImageTag.java.html"><b><i>View Source</i></b></a>
23 *
24 * @author Brian Wing Shun Chan
25 */
26 public class PngImageTag extends IncludeTag {
27
28 public void setHeight(String height) {
29 _height = height;
30 }
31
32 public void setImage(String image) {
33 _image = image;
34 }
35
36 public void setWidth(String width) {
37 _width = width;
38 }
39
40 protected void cleanUp() {
41 _height = null;
42 _image = null;
43 _width = null;
44 }
45
46 protected String getPage() {
47 return _PAGE;
48 }
49
50 protected void setAttributes(HttpServletRequest request) {
51 request.setAttribute("liferay-ui:png_image:height", _height);
52 request.setAttribute("liferay-ui:png_image:image", _image);
53 request.setAttribute("liferay-ui:png_image:width", _width);
54 }
55
56 private static final String _PAGE = "/html/taglib/ui/png_image/page.jsp";
57
58 private String _height;
59 private String _image;
60 private String _width;
61
62 }