1 14 package org.wings.externalizer; 15 16 import org.wings.Renderable; 17 import org.wings.io.Device; 18 import org.wings.style.StyleSheet; 19 20 import java.util.Collection ; 21 22 26 public class StyleSheetExternalizer implements Externalizer { 27 28 public static final StyleSheetExternalizer SHARED_INSTANCE = new StyleSheetExternalizer(); 29 30 private static final Class [] SUPPORTED_CLASSES = {StyleSheet.class}; 31 private static final String [] SUPPORTED_MIME_TYPES = {"text/css"}; 32 33 public String getExtension(Object obj) { 34 return "css"; 35 } 36 37 public String getMimeType(Object obj) { 38 return "text/css"; 39 } 40 41 public boolean isFinal(Object obj) { 42 return ((StyleSheet) obj).isFinal(); 43 } 44 45 public int getLength(Object obj) { 46 return -1; 47 } 48 49 public void write(Object obj, Device out) 50 throws java.io.IOException { 51 ((Renderable) obj).write(out); 52 } 53 54 public Class [] getSupportedClasses() { 55 return SUPPORTED_CLASSES; 56 } 57 58 public String [] getSupportedMimeTypes() { 59 return SUPPORTED_MIME_TYPES; 60 } 61 62 public Collection getHeaders(Object obj) { 63 return null; 64 } 65 } 66 67 68 | Popular Tags |