[kune-commits] r1381 - in trunk/src/main/java/cc/kune: common/client/notify core/client/init core/client/notify/confirm gspace/client/options msgs/client
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Thu May 12 03:33:24 CEST 2011
Author: vjrj_
Date: 2011-05-12 03:33:23 +0200 (Thu, 12 May 2011)
New Revision: 1381
Added:
trunk/src/main/java/cc/kune/core/client/init/NavigatorSupport.java
Modified:
trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
Log:
Advice to unsupported navs
Modified: trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/common/client/notify/ConfirmAskEvent.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -23,192 +23,212 @@
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
+import com.google.gwt.resources.client.ImageResource;
public class ConfirmAskEvent extends GwtEvent<ConfirmAskEvent.ConfirmAskHandler> {
- public interface ConfirmAskHandler extends EventHandler {
- public void onConfirmAsk(ConfirmAskEvent event);
- }
+ public interface ConfirmAskHandler extends EventHandler {
+ public void onConfirmAsk(ConfirmAskEvent event);
+ }
- public interface HasConfirmAskHandlers extends HasHandlers {
- HandlerRegistration addConfirmAskHandler(ConfirmAskHandler handler);
- }
+ public interface HasConfirmAskHandlers extends HasHandlers {
+ HandlerRegistration addConfirmAskHandler(ConfirmAskHandler handler);
+ }
- private static final Type<ConfirmAskHandler> TYPE = new Type<ConfirmAskHandler>();
+ private static final Type<ConfirmAskHandler> TYPE = new Type<ConfirmAskHandler>();
- public static void fire(final HasHandlers source, final java.lang.String message) {
- source.fireEvent(new ConfirmAskEvent(message));
- }
+ public static void fire(final HasHandlers source, final java.lang.String message) {
+ source.fireEvent(new ConfirmAskEvent(message));
+ }
- public static void fire(final HasHandlers source, final java.lang.String title, final java.lang.String message,
- final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
- final java.lang.String acceptBtnTooltip, final java.lang.String cancelBtnTooltip,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
- source.fireEvent(new ConfirmAskEvent(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnTooltip,
- cancelBtnTooltip, callback));
- }
+ public static void fire(final HasHandlers source, final java.lang.String title,
+ final java.lang.String message, final java.lang.String acceptBtnMsg,
+ final java.lang.String cancelBtnMsg, final java.lang.String acceptBtnTooltip,
+ final java.lang.String cancelBtnTooltip,
+ final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ source.fireEvent(new ConfirmAskEvent(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnTooltip,
+ cancelBtnTooltip, callback));
+ }
- public static Type<ConfirmAskHandler> getType() {
- return TYPE;
- }
+ public static Type<ConfirmAskHandler> getType() {
+ return TYPE;
+ }
- java.lang.String acceptBtnMsg;
- java.lang.String acceptBtnTooltip;
- cc.kune.common.client.utils.SimpleResponseCallback callback;
- java.lang.String cancelBtnMsg;
- java.lang.String cancelBtnTooltip;
- java.lang.String message;
- java.lang.String title;
+ java.lang.String acceptBtnMsg;
+ java.lang.String acceptBtnTooltip;
+ cc.kune.common.client.utils.SimpleResponseCallback callback;
+ java.lang.String cancelBtnMsg;
+ java.lang.String cancelBtnTooltip;
+ ImageResource icon;
+ java.lang.String message;
+ java.lang.String title;
- protected ConfirmAskEvent() {
- // Possibly for serialization.
- }
+ protected ConfirmAskEvent() {
+ // Possibly for serialization.
+ }
- public ConfirmAskEvent(final java.lang.String message) {
- this.message = message;
- }
+ public ConfirmAskEvent(final ImageResource icon, final java.lang.String title,
+ final java.lang.String message, final java.lang.String acceptBtnMsg,
+ final java.lang.String cancelBtnMsg,
+ final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ this(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnMsg, cancelBtnMsg, callback);
+ this.icon = icon;
+ }
- public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
- final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
- this.title = title;
- this.message = message;
- this.acceptBtnMsg = acceptBtnMsg;
- this.cancelBtnMsg = cancelBtnMsg;
- this.callback = callback;
- }
+ public ConfirmAskEvent(final ImageResource icon, final java.lang.String title,
+ final java.lang.String message, final java.lang.String acceptBtnMsg,
+ final java.lang.String cancelBtnMsg, final java.lang.String acceptBtnTooltip,
+ final java.lang.String cancelBtnTooltip,
+ final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ this(title, message, acceptBtnMsg, cancelBtnMsg, acceptBtnTooltip, cancelBtnTooltip, callback);
+ this.icon = icon;
+ }
- public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
- final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
- final java.lang.String acceptBtnTooltip, final java.lang.String cancelBtnTooltip,
- final cc.kune.common.client.utils.SimpleResponseCallback callback) {
- this.title = title;
- this.message = message;
- this.acceptBtnMsg = acceptBtnMsg;
- this.cancelBtnMsg = cancelBtnMsg;
- this.acceptBtnTooltip = acceptBtnTooltip;
- this.cancelBtnTooltip = cancelBtnTooltip;
- this.callback = callback;
- }
+ public ConfirmAskEvent(final java.lang.String message) {
+ this.message = message;
+ }
- @Override
- protected void dispatch(final ConfirmAskHandler handler) {
- handler.onConfirmAsk(this);
- }
+ public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
+ final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
+ final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ this.title = title;
+ this.message = message;
+ this.acceptBtnMsg = acceptBtnMsg;
+ this.cancelBtnMsg = cancelBtnMsg;
+ this.callback = callback;
+ }
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ConfirmAskEvent other = (ConfirmAskEvent) obj;
- if (title == null) {
- if (other.title != null) {
- return false;
- }
- } else if (!title.equals(other.title)) {
- return false;
- }
- if (message == null) {
- if (other.message != null) {
- return false;
- }
- } else if (!message.equals(other.message)) {
- return false;
- }
- if (acceptBtnMsg == null) {
- if (other.acceptBtnMsg != null) {
- return false;
- }
- } else if (!acceptBtnMsg.equals(other.acceptBtnMsg)) {
- return false;
- }
- if (cancelBtnMsg == null) {
- if (other.cancelBtnMsg != null) {
- return false;
- }
- } else if (!cancelBtnMsg.equals(other.cancelBtnMsg)) {
- return false;
- }
- if (acceptBtnTooltip == null) {
- if (other.acceptBtnTooltip != null) {
- return false;
- }
- } else if (!acceptBtnTooltip.equals(other.acceptBtnTooltip)) {
- return false;
- }
- if (cancelBtnTooltip == null) {
- if (other.cancelBtnTooltip != null) {
- return false;
- }
- } else if (!cancelBtnTooltip.equals(other.cancelBtnTooltip)) {
- return false;
- }
- if (callback == null) {
- if (other.callback != null) {
- return false;
- }
- } else if (!callback.equals(other.callback)) {
- return false;
- }
- return true;
- }
+ public ConfirmAskEvent(final java.lang.String title, final java.lang.String message,
+ final java.lang.String acceptBtnMsg, final java.lang.String cancelBtnMsg,
+ final java.lang.String acceptBtnTooltip, final java.lang.String cancelBtnTooltip,
+ final cc.kune.common.client.utils.SimpleResponseCallback callback) {
+ this(title, message, acceptBtnMsg, cancelBtnMsg, callback);
+ this.acceptBtnTooltip = acceptBtnTooltip;
+ this.cancelBtnTooltip = cancelBtnTooltip;
+ }
- public java.lang.String getAcceptBtnMsg() {
- return acceptBtnMsg;
- }
+ @Override
+ protected void dispatch(final ConfirmAskHandler handler) {
+ handler.onConfirmAsk(this);
+ }
- public java.lang.String getAcceptBtnTooltip() {
- return acceptBtnTooltip;
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
}
-
- @Override
- public Type<ConfirmAskHandler> getAssociatedType() {
- return TYPE;
+ if (obj == null) {
+ return false;
}
-
- public cc.kune.common.client.utils.SimpleResponseCallback getCallback() {
- return callback;
+ if (getClass() != obj.getClass()) {
+ return false;
}
-
- public java.lang.String getCancelBtnMsg() {
- return cancelBtnMsg;
+ final ConfirmAskEvent other = (ConfirmAskEvent) obj;
+ if (title == null) {
+ if (other.title != null) {
+ return false;
+ }
+ } else if (!title.equals(other.title)) {
+ return false;
}
-
- public java.lang.String getCancelBtnTooltip() {
- return cancelBtnTooltip;
+ if (message == null) {
+ if (other.message != null) {
+ return false;
+ }
+ } else if (!message.equals(other.message)) {
+ return false;
}
-
- public java.lang.String getMessage() {
- return message;
+ if (acceptBtnMsg == null) {
+ if (other.acceptBtnMsg != null) {
+ return false;
+ }
+ } else if (!acceptBtnMsg.equals(other.acceptBtnMsg)) {
+ return false;
}
-
- public java.lang.String getTitle() {
- return title;
+ if (cancelBtnMsg == null) {
+ if (other.cancelBtnMsg != null) {
+ return false;
+ }
+ } else if (!cancelBtnMsg.equals(other.cancelBtnMsg)) {
+ return false;
}
-
- @Override
- public int hashCode() {
- int hashCode = 23;
- hashCode = (hashCode * 37) + (title == null ? 1 : title.hashCode());
- hashCode = (hashCode * 37) + (message == null ? 1 : message.hashCode());
- hashCode = (hashCode * 37) + (acceptBtnMsg == null ? 1 : acceptBtnMsg.hashCode());
- hashCode = (hashCode * 37) + (cancelBtnMsg == null ? 1 : cancelBtnMsg.hashCode());
- hashCode = (hashCode * 37) + (acceptBtnTooltip == null ? 1 : acceptBtnTooltip.hashCode());
- hashCode = (hashCode * 37) + (cancelBtnTooltip == null ? 1 : cancelBtnTooltip.hashCode());
- hashCode = (hashCode * 37) + (callback == null ? 1 : callback.hashCode());
- return hashCode;
+ if (acceptBtnTooltip == null) {
+ if (other.acceptBtnTooltip != null) {
+ return false;
+ }
+ } else if (!acceptBtnTooltip.equals(other.acceptBtnTooltip)) {
+ return false;
}
+ if (cancelBtnTooltip == null) {
+ if (other.cancelBtnTooltip != null) {
+ return false;
+ }
+ } else if (!cancelBtnTooltip.equals(other.cancelBtnTooltip)) {
+ return false;
+ }
+ if (callback == null) {
+ if (other.callback != null) {
+ return false;
+ }
+ } else if (!callback.equals(other.callback)) {
+ return false;
+ }
+ return true;
+ }
- @Override
- public String toString() {
- return "ConfirmAskEvent[" + title + "," + message + "," + acceptBtnMsg + "," + cancelBtnMsg + ","
- + acceptBtnTooltip + "," + cancelBtnTooltip + "," + callback + "]";
- }
+ public java.lang.String getAcceptBtnMsg() {
+ return acceptBtnMsg;
+ }
+
+ public java.lang.String getAcceptBtnTooltip() {
+ return acceptBtnTooltip;
+ }
+
+ @Override
+ public Type<ConfirmAskHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public cc.kune.common.client.utils.SimpleResponseCallback getCallback() {
+ return callback;
+ }
+
+ public java.lang.String getCancelBtnMsg() {
+ return cancelBtnMsg;
+ }
+
+ public java.lang.String getCancelBtnTooltip() {
+ return cancelBtnTooltip;
+ }
+
+ public ImageResource getIcon() {
+ return icon;
+ }
+
+ public java.lang.String getMessage() {
+ return message;
+ }
+
+ public java.lang.String getTitle() {
+ return title;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + (title == null ? 1 : title.hashCode());
+ hashCode = (hashCode * 37) + (message == null ? 1 : message.hashCode());
+ hashCode = (hashCode * 37) + (acceptBtnMsg == null ? 1 : acceptBtnMsg.hashCode());
+ hashCode = (hashCode * 37) + (cancelBtnMsg == null ? 1 : cancelBtnMsg.hashCode());
+ hashCode = (hashCode * 37) + (acceptBtnTooltip == null ? 1 : acceptBtnTooltip.hashCode());
+ hashCode = (hashCode * 37) + (cancelBtnTooltip == null ? 1 : cancelBtnTooltip.hashCode());
+ hashCode = (hashCode * 37) + (callback == null ? 1 : callback.hashCode());
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "ConfirmAskEvent[" + title + "," + message + "," + acceptBtnMsg + "," + cancelBtnMsg + ","
+ + acceptBtnTooltip + "," + cancelBtnTooltip + "," + callback + "]";
+ }
}
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -26,97 +26,107 @@
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.resources.client.ImageResource;
public class NotifyUser {
- private static EventBus eventBus;
- private static I18nTranslationService i18n;
- private static SimpleResponseCallback onOk;
+ private static EventBus eventBus;
+ private static I18nTranslationService i18n;
+ private static SimpleResponseCallback onOk;
- public static void askConfirmation(final String tittle, final String message, final SimpleResponseCallback callback) {
- eventBus.fireEvent(new ConfirmAskEvent(tittle, message, i18n.t("Yes"), i18n.t("No"), callback));
- }
+ public static void askConfirmation(final ImageResource icon, final String title, final String message,
+ final SimpleResponseCallback callback) {
+ eventBus.fireEvent(new ConfirmAskEvent(icon, title, message, i18n.t("Yes"), i18n.t("No"), callback));
+ }
- public static void error(final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message));
- }
+ public static void askConfirmation(final String title, final String message,
+ final SimpleResponseCallback callback) {
+ askConfirmation(null, title, message, callback);
+ }
- public static void error(final String message, final boolean closeable) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, closeable));
- }
+ public static void error(final String message) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message));
+ }
- public static void error(final String message, final String title, final boolean closeable) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
- }
+ public static void error(final String message, final boolean closeable) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, closeable));
+ }
- public static void error(final String message, final String title, final String id, final boolean closeable) {
- final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.error, message, id, closeable);
- event.setId(id);
- eventBus.fireEvent(event);
- }
+ public static void error(final String message, final String title, final boolean closeable) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
+ }
- public static void hideProgress() {
- eventBus.fireEvent(new ProgressHideEvent());
- }
+ public static void error(final String message, final String title, final String id,
+ final boolean closeable) {
+ final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.error, message, id, closeable);
+ event.setId(id);
+ eventBus.fireEvent(event);
+ }
- public static void important(final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.important, message));
- }
+ public static void hideProgress() {
+ eventBus.fireEvent(new ProgressHideEvent());
+ }
- public static void info(final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message));
- }
+ public static void important(final String message) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.important, message));
+ }
- public static void info(final String message, final boolean closeable) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message, closeable));
- }
+ public static void info(final String message) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message));
+ }
- public static void init(final EventBus eventBus, final I18nTranslationService i18n) {
- NotifyUser.eventBus = eventBus;
- NotifyUser.i18n = i18n;
- onOk = new SimpleResponseCallback() {
+ public static void info(final String message, final boolean closeable) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message, closeable));
+ }
- @Override
- public void onCancel() {
- // Do nothing
- }
+ public static void init(final EventBus eventBus, final I18nTranslationService i18n) {
+ NotifyUser.eventBus = eventBus;
+ NotifyUser.i18n = i18n;
+ onOk = new SimpleResponseCallback() {
- @Override
- public void onSuccess() {
- // Do nothing
- }
- };
+ @Override
+ public void onCancel() {
+ // Do nothing
+ }
- }
+ @Override
+ public void onSuccess() {
+ // Do nothing
+ }
+ };
- public static void logError(final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.log, message));
- }
+ }
- public static void showAlertMessage(final String title, final String message) {
- showAlertMessage(title, message, onOk);
- }
+ public static void logError(final String message) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.log, message));
+ }
- public static void showAlertMessage(final String title, final String message, final SimpleResponseCallback callback) {
- eventBus.fireEvent(new ConfirmAskEvent(title, message, i18n.t("Ok"), "", callback));
- }
+ public static void showAlertMessage(final String title, final String message) {
+ showAlertMessage(title, message, onOk);
+ }
- public static void showProgress() {
- eventBus.fireEvent(new ProgressShowEvent(""));
- }
+ public static void showAlertMessage(final String title, final String message,
+ final SimpleResponseCallback callback) {
+ eventBus.fireEvent(new ConfirmAskEvent(title, message, i18n.t("Ok"), "", callback));
+ }
- public static void showProgress(final String text) {
- eventBus.fireEvent(new ProgressShowEvent(text));
- }
+ public static void showProgress() {
+ eventBus.fireEvent(new ProgressShowEvent(""));
+ }
- public static void showProgressLoading() {
- eventBus.fireEvent(new ProgressShowEvent());
- }
+ public static void showProgress(final String text) {
+ eventBus.fireEvent(new ProgressShowEvent(text));
+ }
- public static void showProgressProcessing() {
- eventBus.fireEvent(new ProgressShowEvent());
- }
+ public static void showProgressLoading() {
+ eventBus.fireEvent(new ProgressShowEvent());
+ }
- public static void veryImportant(final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.veryImportant, message));
- }
+ public static void showProgressProcessing() {
+ eventBus.fireEvent(new ProgressShowEvent());
+ }
+
+ public static void veryImportant(final String message) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.veryImportant, message));
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -21,9 +21,11 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.NotifyLevel;
+import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.core.client.notify.msgs.UserNotifyEvent;
import cc.kune.core.client.notify.spiner.ProgressHideEvent;
+import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.rpcservices.SiteServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.InitDataDTO;
@@ -35,6 +37,7 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.ClosingEvent;
import com.google.gwt.user.client.Window.ClosingHandler;
+import com.google.gwt.user.client.Window.Navigator;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.inject.Inject;
@@ -42,16 +45,18 @@
public class AppStarterDefault implements AppStarter {
private final EventBus eventBus;
private final PrefetchUtilities prefetchUtilities;
+ private final CoreResources res;
private final Session session;
private final SiteServiceAsync siteService;
@Inject
public AppStarterDefault(final Session session, final SiteServiceAsync siteService,
- final EventBus eventBus, final PrefetchUtilities prefetchUtilities) {
+ final EventBus eventBus, final PrefetchUtilities prefetchUtilities, final CoreResources res) {
this.session = session;
this.siteService = siteService;
this.eventBus = eventBus;
this.prefetchUtilities = prefetchUtilities;
+ this.res = res;
Window.addWindowClosingHandler(new ClosingHandler() {
@Override
public void onWindowClosing(final ClosingEvent event) {
@@ -60,14 +65,26 @@
});
}
- private void checkNavigatorCompatibility(final SimpleResponseCallback simpleResponseCallback) {
- // eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, "Navigator: " +
- // Navigator.getUserAgent(),
- // true));
+ private void checkNavigatorCompatibility(final NavigatorSupport navSupport) {
+ if (Navigator.getUserAgent().toLowerCase().contains("msie")) {
+ navSupport.onNotSupported();
+ } else {
+ navSupport.onSupported();
+ }
}
private void getInitData() {
siteService.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
+ private void continueStart(final InitDataDTO initData) {
+ eventBus.fireEvent(new AppStartEvent(initData));
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ // hideInitialPanels();
+ }
+ });
+ }
+
private void hideInitialPanels() {
RootPanel.get("kuneloading").setVisible(false);
}
@@ -85,12 +102,30 @@
public void onSuccess(final InitDataDTO initData) {
session.setInitData(initData);
session.setCurrentUserInfo(initData.getUserInfo());
- eventBus.fireEvent(new AppStartEvent(initData));
- Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ hideInitialPanels();
+ checkNavigatorCompatibility(new NavigatorSupport() {
@Override
- public void execute() {
- hideInitialPanels();
+ public void onNotSupported() {
+ NotifyUser.askConfirmation(
+ res.important32(),
+ "Your browser is currently unsupported",
+ "Please, use a modern navigator like <a class='k-link' href='http://mozilla.org'>Mozilla Firefox</a> instead. Continue anyway?",
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ }
+
+ @Override
+ public void onSuccess() {
+ continueStart(initData);
+ }
+ });
}
+
+ @Override
+ public void onSupported() {
+ continueStart(initData);
+ }
});
}
});
@@ -99,18 +134,6 @@
@Override
public void start() {
prefetchUtilities.preFetchImpImages();
- checkNavigatorCompatibility(new SimpleResponseCallback() {
-
- @Override
- public void onCancel() {
-
- }
-
- @Override
- public void onSuccess() {
-
- }
- });
getInitData();
final Timer prefetchTimer = new Timer() {
@Override
Added: trunk/src/main/java/cc/kune/core/client/init/NavigatorSupport.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/NavigatorSupport.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/init/NavigatorSupport.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -0,0 +1,7 @@
+package cc.kune.core.client.init;
+
+public interface NavigatorSupport {
+ void onNotSupported();
+
+ void onSupported();
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/init/NavigatorSupport.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -27,7 +27,8 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;
@@ -37,7 +38,7 @@
private static final String DIALOG_ID = "k-conf-dial-nok";
private static final String OK_ID = "k-conf-dial-ok";
private HandlerRegistration acceptHandler;
- private final Label askLabel;
+ private final HTML askLabel;
private HandlerRegistration cancelHandler;
private final BasicTopDialog dialog;
@@ -45,7 +46,7 @@
public UserConfirmPanel(final I18nTranslationService i18n) {
dialog = new BasicTopDialog.Builder(DIALOG_ID, false, true).autoscroll(false).width(100).height(100).firstButtonId(
OK_ID).sndButtonId(CANCEL_ID).tabIndexStart(1).build();
- askLabel = new Label();
+ askLabel = new HTML();
askLabel.addStyleName("k-userconfirm-label");
dialog.getInnerPanel().add(askLabel);
}
@@ -63,24 +64,28 @@
dialog.setSecondBtnText(cancelBtnMsg);
dialog.setSecondBtnTitle(ask.getCancelBtnTooltip());
dialog.getTitleText().setText(ask.getTitle());
- askLabel.setText(ask.getMessage());
+ askLabel.setHTML(ask.getMessage());
dialog.showCentered();
resetHandlers();
acceptHandler = dialog.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
+ dialog.hide();
ask.getCallback().onSuccess();
- dialog.hide();
}
});
cancelHandler = dialog.getSecondBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
+ dialog.hide();
ask.getCallback().onCancel();
- dialog.hide();
}
});
dialog.showCentered();
+ final ImageResource icon = ask.getIcon();
+ if (icon != null) {
+ dialog.setTitleIcon(icon);
+ }
}
private void resetHandlers() {
Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -38,25 +38,15 @@
private final I18nTranslationService i18n;
private final CoreResources img;
private ButtonDescriptor prefsItem;
+ private final StateManager stateManager;
private GroupOptionsView view;
@Inject
public GroupOptionsPresenter(final StateManager stateManager, final I18nTranslationService i18n,
final CoreResources img, final GroupOptionsView view) {
+ this.stateManager = stateManager;
this.i18n = i18n;
this.img = img;
- stateManager.onStateChanged(true, new StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- final StateAbstractDTO state = event.getState();
- if (!state.getGroup().isPersonal() && state.getGroupRights().isAdministrable()) {
- prefsItem.setVisible(true);
- } else {
- view.hide();
- prefsItem.setVisible(false);
- }
- }
- });
init(view);
}
@@ -80,5 +70,17 @@
super.init(view);
this.view = view;
createActions();
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ final StateAbstractDTO state = event.getState();
+ if (!state.getGroup().isPersonal() && state.getGroupRights().isAdministrable()) {
+ prefsItem.setVisible(true);
+ } else {
+ view.hide();
+ prefsItem.setVisible(false);
+ }
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-05-12 00:42:14 UTC (rev 1380)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-05-12 01:33:23 UTC (rev 1381)
@@ -32,6 +32,7 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.safehtml.shared.SimpleHtmlSanitizer;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -93,10 +94,9 @@
}
if (TextUtils.notEmpty(message)) {
if (TextUtils.notEmpty(title)) {
- label.setHTML(MSG_WITH_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(title),
- SimpleHtmlSanitizer.sanitizeHtml(message)));
+ label.setHTML(MSG_WITH_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(title), sanitize(message)));
} else {
- label.setHTML(MSG_NO_TITLE.format(SimpleHtmlSanitizer.sanitizeHtml(message)));
+ label.setHTML(MSG_NO_TITLE.format(sanitize(message)));
}
close.setVisible(closeable);
close.setTitle(closeTitle);
@@ -153,6 +153,10 @@
close();
}
+ private SafeHtml sanitize(final String message) {
+ return SafeHtmlUtils.fromTrustedString(message);
+ }
+
@Override
public void setText(final String text) {
label.setText(text);
More information about the kune-commits
mailing list