01: // ========================================================================
02: // $Id: StyleLink.java,v 1.3 2004/05/09 20:31:28 gregwilkins Exp $
03: // Copyright 1999-2004 Mort Bay Consulting Pty. Ltd.
04: // ------------------------------------------------------------------------
05: // Licensed under the Apache License, Version 2.0 (the "License");
06: // you may not use this file except in compliance with the License.
07: // You may obtain a copy of the License at
08: // http://www.apache.org/licenses/LICENSE-2.0
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14: // ========================================================================
15:
16: package org.mortbay.html;
17:
18: /* ------------------------------------------------------------ */
19: /** CSS Style LINK.
20: *
21: * @version $Id: StyleLink.java,v 1.3 2004/05/09 20:31:28 gregwilkins Exp $
22: * @author Greg Wilkins (gregw)
23: */
24: public class StyleLink extends Tag {
25: public final static String REL = "rel", HREF = "href",
26: TYPE = Style.TYPE, MEDIA = Style.MEDIA;
27:
28: /* ------------------------------------------------------------ */
29: /** Constructor.
30: * @param href The URL of the style sheet
31: */
32: public StyleLink(String href) {
33: super ("link");
34: attribute(REL, Style.StyleSheet);
35: attribute(HREF, href);
36: attribute(TYPE, Style.text_css);
37: }
38:
39: /* ------------------------------------------------------------ */
40: /** Full Constructor.
41: * @param rel Style Relationship, default StyleSheet if null.
42: * @param href The URL of the style sheet
43: * @param type The type, default text/css if null
44: * @param media The media, not specified if null
45: */
46: public StyleLink(String rel, String href, String type, String media) {
47: super ("link");
48: attribute(REL, rel == null ? Style.StyleSheet : rel);
49: attribute(HREF, href);
50: attribute(TYPE, type == null ? Style.text_css : type);
51: if (media != null)
52: attribute(MEDIA, media);
53: }
54:
55: };
|