01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.jsp.tag.presentation;
16:
17: import java.io.Writer;
18: import org.araneaframework.jsp.tag.basic.AttributedTagInterface;
19: import org.araneaframework.jsp.util.JspUtil;
20:
21: /**
22: * Standard button tag.
23: *
24: * @author Oleg Mürk
25: *
26: * @jsp.tag
27: * name = "basicLinkButton"
28: * body-content = "JSP"
29: * description = "Represents a HTML link with an onClick JavaScript action."
30: */
31: public class LinkButtonHtmlTag extends BaseButtonTag {
32: {
33: baseStyleClass = "aranea-link-button";
34: }
35:
36: protected int doStartTag(Writer out) throws Exception {
37: super .doStartTag(out);
38:
39: addContextEntry(AttributedTagInterface.HTML_ELEMENT_KEY, id);
40:
41: JspUtil.writeOpenStartTag(out, "a");
42: JspUtil.writeAttribute(out, "id", id);
43: JspUtil.writeAttribute(out, "class", getStyleClass());
44: JspUtil.writeAttribute(out, "style", getStyle());
45: JspUtil.writeAttribute(out, "href", "javascript:");
46: JspUtil.writeAttribute(out, "onclick", onclick);
47: JspUtil.writeAttribute(out, "tabindex", tabindex);
48: JspUtil.writeCloseStartTag_SS(out);
49:
50: return EVAL_BODY_INCLUDE;
51: }
52:
53: protected int doEndTag(Writer out) throws Exception {
54: if (labelId != null)
55: JspUtil.writeEscaped(out, JspUtil.getResourceString(
56: pageContext, labelId));
57: JspUtil.writeEndTag(out, "a");
58:
59: super.doEndTag(out);
60: return EVAL_PAGE;
61: }
62: }
|