public class AjaxApplicationManager implements Paintable.RepaintRequestListener,
Application.WindowAttachListener, Application.WindowDetachListener {
- private static String GET_PARAM_VARIABLE_CHANGES = "changeVariables";
-
private static String GET_PARAM_REPAINT_ALL = "repaintAll";
- private static String GET_PARAM_UI_CHANGES_FORMAT = "format";
-
private static int DEFAULT_BUFFER_SIZE = 32 * 1024;
private static int MAX_BUFFER_SIZE = 64 * 1024;
/* Document type declarations */
private final static String UIDL_XML_DECL = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- private final static String UIDL_DOCTYPE_DECL = "<!DOCTYPE uidl PUBLIC \"-//MILLSTONE//DTD UIDL//EN\" \"http://millstone.org/xml/3.0/UIDL.dtd\">";
-
- /* commonly used tags and argument names */
- private final static String UIDL_TAG_VARIABLE = "var";
-
private final static String UIDL_ARG_NAME = "name";
private final static String UIDL_ARG_VALUE = "value";
private final static String UIDL_ARG_ID = "id";
- private final static String UIDL_ARG_TYPE = "type";
-
private Stack mOpenTags;
private boolean mTagArgumentListOpen;
private boolean closed = false;
- private OutputStream output;
-
private AjaxApplicationManager manager;
-
- private String paintableId;
private boolean trackPaints = false;
// Set the variable map
this.variableMap = variableMap;
- // Set the output stream
- this.output = output;
-
// Set the target for UIDL writing
try {
this.uidlBuffer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(output,"UTF-8")));
public void put(Object key, Object value) {
data.put(
key,
- new SoftReference(new CacheItem(value, key.toString())));
+ new SoftReference(new CacheItem(value)));
}
public Object get(Object key) {
private class CacheItem {
private Object data;
- private String name;
- public CacheItem(Object data, String name) {
- this.name = name;
+ public CacheItem(Object data) {
this.data = data;
}
public void finalize() throws Throwable {
this.data = null;
- this.name = null;
super.finalize();
}
private Cache resourceCache = new Cache();
/** Collection of subdirectory entries */
- private Collection subdirs = new LinkedList();
private URL descFile;
/** Creates a new instance of ThemeRepository by reading the themes
public void put(Object key, Object value) {
data.put(
key,
- new SoftReference(new CacheItem(value, key.toString())));
+ new SoftReference(new CacheItem(value)));
}
public Object get(Object key) {
private class CacheItem {
private Object data;
- private String name;
- public CacheItem(Object data, String name) {
- this.name = name;
+ public CacheItem(Object data) {
this.data = data;
}
public void finalize() throws Throwable {
this.data = null;
- this.name = null;
super.finalize();
}
/** Name of the theme. */
private String name;
- /** Description file. */
- private java.io.File file;
/** Version of the theme. */
private String version;
* @throws FileNotFoundException Thrown if the given file is not found.
*/
public Theme(java.io.File descriptionFile) throws FileNotFoundException {
- this.file = descriptionFile;
parse(new InputSource(new FileInputStream(descriptionFile)));
}
this.files.add(file);
}
- /** Remove a file from fileset. */
- private void removeFile(File file) {
- this.files.add(file);
- }
-
/** Get requirements in this fileset. */
private RequirementCollection getRequirements() {
return this.requirements;
return version;
}
+ /** Get theme description */
+ public String getDescription() {
+ return description;
+ }
+
}
// Create new list, if not found
if (list == null) {
- list = new TransformerList(type);
+ list = new TransformerList();
this.transformerSpool.put(type, list);
if (webAdapterServlet.isDebugMode()) {
Log.info("Created new type: " + type);
private class TransformerList {
- private UIDLTransformerType type = null;
private LinkedList list = new LinkedList();
private long lastUsed = 0;
- public TransformerList(UIDLTransformerType type) {
- this.type = type;
- }
-
public void add(UIDLTransformer transformer) {
list.add(transformer);
}
/* Document type declarations */
private final static String UIDL_XML_DECL =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- private final static String UIDL_DOCTYPE_DECL =
- "<!DOCTYPE uidl PUBLIC \"-//MILLSTONE//DTD UIDL//EN\" \"http://millstone.org/xml/3.0/UIDL.dtd\">";
/* commonly used tags and argument names */
- private final static String UIDL_TAG_VARIABLE = "var";
private final static String UIDL_ARG_NAME = "name";
private final static String UIDL_ARG_VALUE = "value";
private final static String UIDL_ARG_ID = "id";
- private final static String UIDL_ARG_TYPE = "type";
private Stack mOpenTags;
private boolean mTagArgumentListOpen;
private StringBuffer uidlBuffer;