private Class<? extends Paintable>[] classes = new Class[1024];
+ private String windowId;
+
private static ArrayList<ApplicationConnection> unstartedApplications = new ArrayList<ApplicationConnection>();
private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<ApplicationConnection>();
public void addComponentMappings(ValueMap valueMap, WidgetSet widgetSet) {
JsArrayString keyArray = valueMap.getKeyArray();
for (int i = 0; i < keyArray.length(); i++) {
- String key = keyArray.get(i);
+ String key = keyArray.get(i).intern();
int value = valueMap.getInt(key);
classes[value] = widgetSet.getImplementationByClassName(key);
if (classes[value] == VUnknownComponent.class) {
unknownComponents = new HashMap<String, String>();
}
unknownComponents.put("" + value, key);
+ } else if (key == "com.vaadin.ui.Window") {
+ windowId = "" + value;
}
}
}
+ /**
+ * @return the integer value that is used to code top level windows
+ * "com.vaadin.ui.Window"
+ */
+ String getEncodedWindowTag() {
+ return windowId;
+ }
+
String getUnknownServerClassNameByEncodedTagName(String tag) {
if (unknownComponents != null) {
return unknownComponents.get(tag);
updatedWidgets.add(idToPaintableDetail.get(uidl.getId())
.getComponent());
} else {
- if (!uidl.getTag().equals("0")) {
+ if (!uidl.getTag().equals(
+ configuration.getEncodedWindowTag())) {
ClientExceptionHandler
.displayError("Received update for "
+ uidl.getTag()
}
}
- private static HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
- private static int nextTypeKey = 0;
-
- static String getTagForType(Class<? extends Paintable> class1) {
- synchronized (typeToKey) {
- Integer object = typeToKey.get(class1);
- if (object == null) {
- object = nextTypeKey++;
- typeToKey.put(class1, object);
- }
- return object.toString();
+ private HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
+ private int nextTypeKey = 0;
+
+ String getTagForType(Class<? extends Paintable> class1) {
+ Integer object = typeToKey.get(class1);
+ if (object == null) {
+ object = nextTypeKey++;
+ typeToKey.put(class1, object);
}
+ return object.toString();
}
/**