[kune-commits] r1068 - in trunk/src:
main/java/org/ourproject/kune/platf/client/services
main/java/org/ourproject/kune/platf/client/ui/dialogs
main/java/org/ourproject/kune/platf/client/ui/noti
main/java/org/ourproject/kune/platf/client/ui/rte
main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor
main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview
main/java/org/ourproject/kune/workspace/client
main/java/org/ourproject/kune/workspace/client/site
main/java/org/ourproject/kune/workspace/client/site/msg
test/java/org/ourproject/kune/platf/client/state
vjrj
vjrj at ourproject.org
Wed Mar 11 01:16:54 CET 2009
Author: vjrj
Date: 2009-03-11 01:16:51 +0100 (Wed, 11 Mar 2009)
New Revision: 1068
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
Complete - task editHtml dialog (editor/preview) for RTE
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -294,7 +294,7 @@
register(ApplicationComponentGroup.class, new Factory<NotifyUser>(NotifyUser.class) {
@Override
public NotifyUser create() {
- return new NotifyUser($(I18nTranslationService.class));
+ return new NotifyUser($(I18nTranslationService.class), $(Images.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -20,8 +20,10 @@
package org.ourproject.kune.platf.client.ui.dialogs;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.gwtext.client.widgets.Toolbar;
@@ -57,11 +59,11 @@
toolbar.setVisible(false);
}
- public void setErrorMessage(final String message, final Level type) {
+ public void setErrorMessage(final String message, final Level level) {
errorLabel.setText(message);
+ AbstractImagePrototype icon = NotifyUser.getImage(level);
+ icon.applyTo(errorIcon);
errorIcon.setVisible(true);
- // FIXME
- // String iconCls = NotifyUser.getCls(level);
toolbar.setVisible(true);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.client.ui.noti;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
import com.calclab.suco.client.events.Event;
import com.calclab.suco.client.events.Event0;
@@ -27,6 +28,7 @@
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.events.Listener2;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
public class NotifyUser {
@@ -46,6 +48,8 @@
private static I18nTranslationService i18n;
+ private static Images images;
+
public static void askConfirmation(String confirmationTitle, String confirmationText, Listener0 onConfirm,
Listener0 onCancel) {
onConfirmationAsk.fire(new ConfirmationAsk(confirmationTitle, confirmationText, onConfirm, onCancel));
@@ -56,24 +60,33 @@
}
public static String getCls(Level level) {
- String iconCls = "";
switch (level) {
case info:
- iconCls = "k-stm-info-icon";
- break;
+ return "k-stm-info-icon";
case important:
- iconCls = "k-stm-imp-icon";
- break;
+ return "k-stm-imp-icon";
case veryImportant:
- iconCls = "k-stm-verimp-icon";
- break;
+ return "k-stm-verimp-icon";
case error:
- iconCls = "k-stm-error-icon";
- break;
+ default:
+ return "k-stm-error-icon";
}
- return iconCls;
}
+ public static AbstractImagePrototype getImage(Level level) {
+ switch (level) {
+ case info:
+ return images.info();
+ case important:
+ return images.important();
+ case veryImportant:
+ return images.alert();
+ case error:
+ default:
+ return images.error();
+ }
+ }
+
public static void hideProgress() {
onHideProgress.fire();
}
@@ -114,8 +127,9 @@
onNotify.fire(Level.veryImportant, message);
}
- public NotifyUser(I18nTranslationService i18n) {
+ public NotifyUser(I18nTranslationService i18n, Images images) {
NotifyUser.i18n = i18n;
+ NotifyUser.images = images;
onNotify = new Event2<Level, String>("onNotify");
onAlert = new Event2<String, String>("onAlert");
onProgress = new Event<String>("onProgress");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -400,6 +400,7 @@
dialog.setUpdateListener(new Listener<String>() {
public void onEvent(String html) {
view.setHtml(html);
+ fireOnEdit();
}
});
dialog.show();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -15,7 +15,7 @@
super("HTML");
super.setAutoWidth(true);
super.setHideLabels(true);
- super.setHeight(EditHtmlView.HEIGHT - 35);
+ super.setHeight(EditHtmlView.HEIGHT - 20);
editorField = new TextArea();
editorField.setHeight(EditHtmlView.HEIGHT - 70);
editorField.setWidth("98%");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -11,14 +11,16 @@
public EditHtmlPreviewPanel(I18nTranslationService i18n, final EditHtmlPreviewPresenter presenter) {
setTitle(i18n.t("Preview"));
- super.setCls("kune-Content-Main");
- setHeight(EditHtmlView.HEIGHT - 40);
+ setCls("kune-Content-Main");
+ setHeight(EditHtmlView.HEIGHT - 45);
+ setPaddings(5);
setAutoScroll(true);
setAutoWidth(true);
- super.addListener(new PanelListenerAdapter() {
+ addListener(new PanelListenerAdapter() {
@Override
public void onActivate(Panel panel) {
clear();
+ setHeight(EditHtmlView.HEIGHT - 45);
add(new HTML(presenter.getHtml()));
if (isRendered()) {
doLayout();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -152,9 +152,9 @@
import org.ourproject.kune.workspace.client.signin.SignInView;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.site.WorkspaceNotifyUser;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessagePanel;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessagePresenter;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessage;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessagePanel;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessagePresenter;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPresenter;
@@ -283,7 +283,7 @@
@Override
public WorkspaceNotifyUser create() {
return new WorkspaceNotifyUser($(NotifyUser.class), $(I18nUITranslationService.class),
- $(SiteProgress.class), $$(SiteToastMessage.class), $$(WorkspaceSkeleton.class));
+ $(SiteProgress.class), $$(ToastMessage.class), $$(WorkspaceSkeleton.class));
}
});
@@ -298,11 +298,11 @@
}
});
- register(NoDecoration.class, new Factory<SiteToastMessage>(SiteToastMessage.class) {
+ register(NoDecoration.class, new Factory<ToastMessage>(ToastMessage.class) {
@Override
- public SiteToastMessage create() {
- final SiteToastMessagePresenter presenter = new SiteToastMessagePresenter();
- final SiteToastMessagePanel panel = new SiteToastMessagePanel();
+ public ToastMessage create() {
+ final ToastMessagePresenter presenter = new ToastMessagePresenter();
+ final ToastMessagePanel panel = new ToastMessagePanel();
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -4,7 +4,7 @@
import org.ourproject.kune.platf.client.ui.noti.ConfirmationAsk;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessage;
import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -16,7 +16,7 @@
public class WorkspaceNotifyUser {
public WorkspaceNotifyUser(NotifyUser notifyUser, final I18nTranslationService i18n,
- final SiteProgress siteProgress, final Provider<SiteToastMessage> toaster,
+ final SiteProgress siteProgress, final Provider<ToastMessage> toaster,
final Provider<WorkspaceSkeleton> ws) {
notifyUser.addProgressNotifier(new Listener<String>() {
public void onEvent(String message) {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public interface SiteToastMessage {
-
- void showMessage(String title, String message, Level level);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.gwtextux.client.widgets.window.ToastWindow;
-
-public class SiteToastMessagePanel implements SiteToastMessageView {
-
- public SiteToastMessagePanel() {
- }
-
- public void showMessage(String title, String message, Level level) {
- HTML html = new HTML(message);
- html.addStyleName("kune-Margin-Medium-trbl");
- ToastWindow toastWindow = new ToastWindow(title, html.toString());
- String iconCls = NotifyUser.getCls(level);
- toastWindow.setIconCls(iconCls);
- toastWindow.show();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public class SiteToastMessagePresenter implements SiteToastMessage {
-
- private SiteToastMessageView view;
-
- public SiteToastMessagePresenter() {
- }
-
- public View getView() {
- return view;
- }
-
- public void init(SiteToastMessageView view) {
- this.view = view;
- }
-
- public void showMessage(String title, final String message, final Level level) {
- view.showMessage(title, message, level);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public interface SiteToastMessageView extends View {
-
- void showMessage(String title, String message, Level level);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public interface ToastMessage {
+
+ void showMessage(String title, String message, Level level);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java (from rev 1067, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.gwtextux.client.widgets.window.ToastWindow;
+
+public class ToastMessagePanel implements ToastMessageView {
+
+ public ToastMessagePanel() {
+ }
+
+ public void showMessage(String title, String message, Level level) {
+ HTML html = new HTML(message);
+ html.addStyleName("kune-Margin-Medium-trbl");
+ ToastWindow toastWindow = new ToastWindow(title, html.toString());
+ String iconCls = NotifyUser.getCls(level);
+ toastWindow.setIconCls(iconCls);
+ toastWindow.show();
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public class ToastMessagePresenter implements ToastMessage {
+
+ private ToastMessageView view;
+
+ public ToastMessagePresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(ToastMessageView view) {
+ this.view = view;
+ }
+
+ public void showMessage(String title, final String message, final Level level) {
+ view.showMessage(title, message, level);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public interface ToastMessageView extends View {
+
+ void showMessage(String title, String message, Level level);
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -47,7 +47,7 @@
stateManager.onStateChanged(stateChangeListener);
stateManager.onGroupChanged(groupChangeListener);
stateManager.onToolChanged(toolChangeListener);
- new NotifyUser(null);
+ new NotifyUser(null, null);
}
@Test
More information about the kune-commits
mailing list