1 16 package org.mortbay.html; 17 18 19 20 22 public class Style extends Block 23 { 24 public static final String  25 STYLE = "style", 26 TYPE = "type", 27 MEDIA = "media"; 28 29 public final static String  30 StyleSheet="stylesheet", 31 AlternateStyleSheet="alternate stylesheet", 32 text_css="text/css", 33 screen = "screen"; 34 35 36 37 39 public Style(String style, String type) 40 { 41 super(STYLE); 42 if (type!=null) 43 attribute(TYPE,type); 44 add(style); 45 } 46 47 48 49 public Style(String style) 50 { 51 this(style, text_css); 52 } 53 54 55 56 public Style() 57 { 58 super(STYLE); 59 attribute(TYPE,text_css); 60 } 61 62 63 65 public Style media(String m) 66 { 67 attribute(MEDIA,m); 68 return this; 69 } 70 71 72 74 public Style comment() 75 { 76 nest(new Comment()); 77 return this; 78 } 79 80 81 82 86 public Style importStyle(String url) 87 { 88 add("@import url("+url+");\n"); 89 return this; 90 } 91 }; 92 93 94 95 96 | Popular Tags |