01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.externalizer;
14:
15: import org.wings.Renderable;
16: import org.wings.resource.HttpHeader;
17: import org.wings.io.Device;
18: import org.wings.style.StyleSheet;
19:
20: import java.util.Collection;
21:
22: /**
23: * @author <a href="mailto:engels@mercatis.de">Holger Engels</a>
24: */
25: public class StyleSheetExternalizer implements Externalizer<StyleSheet> {
26:
27: public static final StyleSheetExternalizer SHARED_INSTANCE = new StyleSheetExternalizer();
28:
29: private static final Class[] SUPPORTED_CLASSES = { StyleSheet.class };
30: private static final String[] SUPPORTED_MIME_TYPES = { "text/css" };
31:
32: public String getId(StyleSheet obj) {
33: return null;
34: }
35:
36: public String getExtension(StyleSheet obj) {
37: return "css";
38: }
39:
40: public String getMimeType(StyleSheet obj) {
41: return "text/css";
42: }
43:
44: public boolean isFinal(StyleSheet obj) {
45: return ((StyleSheet) obj).isFinal();
46: }
47:
48: public int getLength(StyleSheet obj) {
49: return -1;
50: }
51:
52: public void write(Object obj, Device out)
53: throws java.io.IOException {
54: ((Renderable) obj).write(out);
55: }
56:
57: public Class[] getSupportedClasses() {
58: return SUPPORTED_CLASSES;
59: }
60:
61: public String[] getSupportedMimeTypes() {
62: return SUPPORTED_MIME_TYPES;
63: }
64:
65: public Collection<HttpHeader> getHeaders(StyleSheet obj) {
66: return null;
67: }
68: }
|