*/
public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh";
- private final boolean debugLogging = false;
+ private final boolean debugLogging = true || false;
// will hold the UIDL security key (for XSS protection) once received
private String uidlSecurityKey = "init";
final boolean synchronous) {
if (!synchronous) {
RequestCallback requestCallback = new RequestCallback() {
+ @Override
public void onError(Request request, Throwable exception) {
showCommunicationError(exception.getMessage(), -1);
endRequest();
}
+ @Override
public void onResponseReceived(Request request,
Response response) {
VConsole.log("Server visit took "
}
// deferring to avoid flickering
Scheduler.get().scheduleDeferred(new Command() {
+ @Override
public void execute() {
if (!hasActiveRequest()) {
hideLoadingIndicator();
}
Command c = new Command() {
+ @Override
public void execute() {
handleUIDLDuration.logDuration(" * Loading widgets completed",
10);
private void loadStyleDependencies(JsArrayString dependencies) {
// Assuming no reason to interpret in a defined order
ResourceLoadListener resourceLoadListener = new ResourceLoadListener() {
+ @Override
public void onLoad(ResourceLoadEvent event) {
ApplicationConfiguration.endDependencyLoading();
}
+ @Override
public void onError(ResourceLoadEvent event) {
VConsole.error(event.getResourceUrl()
+ " could not be loaded, or the load detection failed because the stylesheet is empty.");
// Listener that loads the next when one is completed
ResourceLoadListener resourceLoadListener = new ResourceLoadListener() {
+ @Override
public void onLoad(ResourceLoadEvent event) {
if (dependencies.length() != 0) {
String url = translateVaadinUri(dependencies.shift());
ApplicationConfiguration.endDependencyLoading();
}
+ @Override
public void onError(ResourceLoadEvent event) {
VConsole.error(event.getResourceUrl() + " could not be loaded.");
// The show must go on
}
private final ScheduledCommand sendPendingCommand = new ScheduledCommand() {
+ @Override
public void execute() {
deferedSendPending = false;
doSendPendingVariableChanges();
this.url = url;
}
+ @Override
public void notificationHidden(HideEvent event) {
redirect(url);
}
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector;
Set<String> keySet = u.getKeySet();
for (String key : keySet) {
if (key.equals("state")) {
- // TODO print updated shared states
+
+ ValueMap stateJson = u.getValueMap(key);
+
+ for (String stateKey : stateJson.getKeySet()) {
+ ValueMap valuesJson = stateJson.getValueMap(stateKey);
+
+ SimpleTree values = new SimpleTree("state pid=" + stateKey);
+ for (String valueKey : valuesJson.getKeySet()) {
+ values.add(new HTML(valueKey + "="
+ + valuesJson.getAsString(valueKey)));
+ }
+ add(values);
+ }
+
} else if (key.equals("changes")) {
- JsArray<UIDL> jsValueMapArray = u.getJSValueMapArray("changes")
+ JsArray<UIDL> jsValueMapArray = u.getJSValueMapArray(key)
.cast();
for (int i = 0; i < jsValueMapArray.length(); i++) {
UIDL uidl = jsValueMapArray.get(i);
}
addDomHandler(new MouseOutHandler() {
+ @Override
public void onMouseOut(MouseOutEvent event) {
deHiglight();
}
if (highlightedPid != null && highlightedPid.equals(uidl.getId())) {
getElement().getStyle().setBackgroundColor("#fdd");
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ @Override
public void execute() {
getElement().scrollIntoView();
}