kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
Author: vjrj
Date: 2009-03-05 14:57:02 +0100 (Thu, 05 Mar 2009)
New Revision: 1059
Added:
trunk/img/icons/ooffice-human/README
Modified:
trunk/COPYRIGHT
trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.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/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/COPYRIGHT
===================================================================
--- trunk/COPYRIGHT 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/COPYRIGHT 2009-03-05 13:57:02 UTC (rev 1059)
@@ -72,6 +72,12 @@
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
+and others icons from openoffice.org-style-human debian package
+ Copyright 2002-2007 Sun Microsystems, Inc.
+ This product is made available subject to the terms of GNU Lesser General
+ Public License Version 2.1. A copy of the LGPL license can be found
+ http://www.openoffice.org/project/www/license.html
+
others
--------------------------------------------------------------------------------
suco
Added: trunk/img/icons/ooffice-human/README
===================================================================
--- trunk/img/icons/ooffice-human/README 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/img/icons/ooffice-human/README 2009-03-05 13:57:02 UTC (rev 1059)
@@ -0,0 +1 @@
+from openoffice.org-style-human debian package and res/commandimagelist directory
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-05 13:57:02 UTC (rev 1059)
@@ -13,4 +13,4 @@
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.4.1
-*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment{border:1px dashed silver;font-size:85%;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
+*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment span{border:1px dashed silver;font-size:85%;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
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-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-05 13:57:02 UTC (rev 1059)
@@ -267,9 +267,5 @@
$(ToolGroup.class).createAll();
$(Application.class).start();
// $(HelloWorld.class);
-
- // $(TestRTEDialog.class);
- // $(TestRTEDialog.class);
- // $(TestRTEDialog.class);
}
}
\ No newline at end of file
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-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-05 13:57:02 UTC (rev 1059)
@@ -37,6 +37,7 @@
private static final String EDIT_MENU = "Edit";
private static final String INSERT_MENU = "Insert";
+ private static final String FORMAT_MENU = "Format";
private RTEditorView view;
private boolean extended;
private final AccessRolDTO accessRol;
@@ -52,8 +53,6 @@
private ActionToolbarPushButtonDescriptor<Object> underline;
private ActionToolbarPushButtonDescriptor<Object> strikethrough;
private final Event0 onEdit;
- private ActionToolbarPushButtonDescriptor<Object> subscript;
- private ActionToolbarPushButtonDescriptor<Object> superscript;
private final TextEditorInsertElement insertElement;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
@@ -146,8 +145,6 @@
sndBar.setPushButtonPressed(bold, view.isBold());
sndBar.setPushButtonPressed(italic, view.isItalic());
sndBar.setPushButtonPressed(underline, view.isUnderlined());
- sndBar.setPushButtonPressed(subscript, view.isSubscript());
- sndBar.setPushButtonPressed(superscript, view.isSuperscript());
}
if (isExtended()) {
sndBar.setPushButtonPressed(strikethrough, view.isStrikethrough());
@@ -183,7 +180,7 @@
}
});
bold.setIconCls(getCssName(imgResources.bold()));
- bold.setToolTip(i18n.t("Toggle Bold"));
+ bold.setToolTip(i18n.t("Bold"));
bold.setShortcut(new ActionShortcut(true, 'B'));
bold.setAddCondition(canBeBasic);
@@ -194,7 +191,7 @@
}
});
italic.setIconCls(getCssName(imgResources.italic()));
- italic.setToolTip(i18n.t("Toggle Italic"));
+ italic.setToolTip(i18n.t("Italic"));
italic.setShortcut(new ActionShortcut(true, 'I'));
italic.setAddCondition(canBeBasic);
italic.setAddCondition(canBeBasic);
@@ -206,30 +203,31 @@
}
});
underline.setIconCls(getCssName(imgResources.underline()));
- underline.setToolTip(i18n.t("Toggle Underline"));
+ underline.setToolTip(i18n.t("Underline"));
underline.setShortcut(new ActionShortcut(true, 'U'));
underline.setAddCondition(canBeBasic);
- subscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
view.toggleSubscript();
}
});
- subscript.setIconCls(getCssName(imgResources.superscript()));
- subscript.setToolTip(i18n.t("Toggle Subscript"));
+ subscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
+ subscript.setTextDescription(i18n.t("Subscript"));
+ subscript.setIconCls(getCssName(imgResources.subscript()));
subscript.setShortcut(new ActionShortcut(true, ','));
subscript.setAddCondition(canBeBasic);
- superscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
- new Listener0() {
+ ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
view.toggleSuperscript();
}
});
+ superscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
+ superscript.setTextDescription(i18n.t("Superscript"));
superscript.setIconCls(getCssName(imgResources.superscript()));
- superscript.setToolTip(i18n.t("Toggle Superscript"));
- superscript.setRightSeparator(ActionToolbarButtonSeparator.spacer);
superscript.setShortcut(new ActionShortcut(true, '.'));
superscript.setAddCondition(canBeBasic);
@@ -378,7 +376,7 @@
}
});
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
- strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
+ strikethrough.setToolTip(i18n.t("Strikethrough"));
strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
strikethrough.setAddCondition(canBeExtended);
@@ -479,8 +477,6 @@
sndActions.add(withNoItem(italic));
sndActions.add(withNoItem(underline));
sndActions.add(withNoItem(strikethrough));
- sndActions.add(withNoItem(subscript));
- sndActions.add(withNoItem(superscript));
sndActions.add(withNoItem(justifyLeft));
sndActions.add(withNoItem(justifyCentre));
sndActions.add(withNoItem(justifyRight));
@@ -492,6 +488,8 @@
topActions.add(withNoItem(paste));
topActions.add(withNoItem(editHtml));
topActions.add(withNoItem(hr));
+ topActions.add(withNoItem(subscript));
+ topActions.add(withNoItem(superscript));
sndActions.add(withNoItem(hrButton));
sndActions.add(withNoItem(decreaseIndent));
sndActions.add(withNoItem(increaseIndent));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-05 13:57:02 UTC (rev 1059)
@@ -10,8 +10,12 @@
public class TestRTEDialog {
+ private final RTEditor editor;
+ private final BasicDialog dialog;
+
public TestRTEDialog(RTEditor editor) {
- BasicDialog dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
+ this.editor = editor;
+ dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
final VerticalPanel vp = new VerticalPanel();
vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
@@ -19,7 +23,6 @@
final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
vp.add(editorPanel.getRTE());
editor.setExtended(true);
- editor.attach();
vp.setWidth("100%");
dialog.add(vp);
dialog.addListener(new WindowListenerAdapter() {
@@ -30,6 +33,14 @@
vp.setCellHeight(editorPanel.getRTE(), "" + newHeight);
}
});
+ }
+
+ public void setExtended(boolean extended) {
+ editor.setExtended(extended);
+ }
+
+ public void show() {
+ editor.attach();
dialog.show();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-03-05 13:57:02 UTC (rev 1059)
@@ -1,91 +1,91 @@
-@sprite .x-btn-icon .k-rte-underline {
+@sprite div .k-rte-underline {
gwt-image: 'underline';
}
-@sprite .x-btn-icon .k-rte-superscript {
+@sprite div .k-rte-superscript {
gwt-image: 'superscript';
}
-@sprite .x-btn-icon .k-rte-subscript {
+@sprite div .k-rte-subscript {
gwt-image: 'subscript';
}
-@sprite .x-btn-icon .k-rte-strikeout {
+@sprite div .k-rte-strikeout {
gwt-image: 'strikeout';
}
-@sprite .x-btn-icon .k-rte-removeFormat {
+@sprite div .k-rte-removeFormat {
gwt-image: 'removeFormat';
}
-@sprite .x-btn-icon .k-rte-link {
+@sprite div .k-rte-link {
gwt-image: 'link';
}
-@sprite .x-btn-icon .k-rte-linkbreak {
+@sprite div .k-rte-linkbreak {
gwt-image: 'linkbreak';
}
-@sprite .x-btn-icon .k-rte-italic {
+@sprite div .k-rte-italic {
gwt-image: 'italic';
}
-@sprite .x-btn-icon .k-rte-incrementindent {
+@sprite div .k-rte-incrementindent {
gwt-image: 'incrementindent';
}
-@sprite .x-btn-icon .k-rte-images {
+@sprite div .k-rte-images {
gwt-image: 'images';
}
-@sprite .x-btn-icon .k-rte-hfixedline {
+@sprite div .k-rte-hfixedline {
gwt-image: 'hfixedline';
}
-@sprite .x-btn-icon .k-rte-fontheight {
+@sprite div .k-rte-fontheight {
gwt-image: 'fontheight';
}
-@sprite .x-btn-icon .k-rte-fontcolor {
+@sprite div .k-rte-fontcolor {
gwt-image: 'fontcolor';
}
-@sprite .x-btn-icon .k-rte-edithtml {
+@sprite div .k-rte-edithtml {
gwt-image: 'edithtml';
}
-@sprite .x-btn-icon .k-rte-defaultnumbering {
+@sprite div .k-rte-defaultnumbering {
gwt-image: 'defaultnumbering';
}
-@sprite .x-btn-icon .k-rte-defaultbullet {
+@sprite div .k-rte-defaultbullet {
gwt-image: 'defaultbullet';
}
-@sprite .x-btn-icon .k-rte-decrementindent {
+@sprite div .k-rte-decrementindent {
gwt-image: 'decrementindent';
}
-@sprite .x-btn-icon .k-rte-charfontname {
+@sprite div .k-rte-charfontname {
gwt-image: 'charfontname';
}
-@sprite .x-btn-icon .k-rte-centerpara {
+@sprite div .k-rte-centerpara {
gwt-image: 'centerpara';
}
-@sprite .x-btn-icon .k-rte-bold {
+@sprite div .k-rte-bold {
gwt-image: 'bold';
}
-@sprite .x-btn-icon .k-rte-backcolor {
+@sprite div .k-rte-backcolor {
gwt-image: 'backcolor';
}
-@sprite .x-btn-icon .k-rte-alignright {
+@sprite div .k-rte-alignright {
gwt-image: 'alignright';
}
-@sprite .x-btn-icon .k-rte-alignleft {
+@sprite div .k-rte-alignleft {
gwt-image: 'alignleft';
}
\ No newline at end of file
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-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-05 13:57:02 UTC (rev 1059)
@@ -49,6 +49,7 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
+import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
@@ -359,7 +360,7 @@
public SiteOptions create() {
final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nUITranslationService.class), $$(I18nTranslator.class));
+ $(I18nUITranslationService.class), $$(I18nTranslator.class), $$(TestRTEDialog.class));
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-03-05 13:57:02 UTC (rev 1059)
@@ -20,6 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.siteoptions;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -37,7 +38,8 @@
public class SiteOptionsPanel implements SiteOptionsView {
public SiteOptionsPanel(final SiteOptionsPresenter presenter, final WorkspaceSkeleton ws,
- final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider) {
+ final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider,
+ final Provider<TestRTEDialog> editor) {
final PushButton optionsButton = new PushButton("");
// optionsButton.setText(i18n.t("Options"));
optionsButton.setHTML(i18n.t("Options")
@@ -53,6 +55,22 @@
optionsMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
}
});
+
+ final Item testRTE = new Item(i18n.t("Test new RTE"), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ editor.get().show();
+ }
+ }, "");
+
+ final Item testRTEbasic = new Item(i18n.t("Test new RTE (basic mode)"), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ editor.get().setExtended(false);
+ editor.get().show();
+ }
+ }, "");
+
final Item linkHelpInTrans = new Item(i18n.t("Help with the translation"), new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem item, EventObject e) {
@@ -68,8 +86,9 @@
Window.open("http://ourproject.org/tracker/?group_id=407", "_blank", null);
}
}, "images/kuneicon16.gif");
+ optionsMenu.addItem(testRTE);
+ optionsMenu.addItem(testRTEbasic);
optionsMenu.addItem(linkHelpInTrans);
optionsMenu.addItem(linkKuneBugs);
-
}
}
1
0
04 Mar '09
Author: vjrj
Date: 2009-03-04 01:11:14 +0100 (Wed, 04 Mar 2009)
New Revision: 1058
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.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/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java 2009-03-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -70,10 +70,10 @@
final DateTimeFormat fmt;
if (dateFormat == null) {
- fmt = shortFormat ? DateTimeFormat.getFormat("M/d/yyyy") : DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+ fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
} else {
if (shortFormat) {
- fmt = DateTimeFormat.getFormat(dateFormat);
+ fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
} else {
String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -10,12 +10,14 @@
public interface RTEditor {
- void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position);
+ void addAction(ActionDescriptor<Object> action, ActionPosition position);
- void addActions(ActionCollection<Object> actions, boolean basic, ActionPosition position);
+ void addActions(ActionCollection<Object> actions, ActionPosition position);
void addOnEditListener(Listener0 listener);
+ void attach();
+
void editContent(String content);
View getEditorArea();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -40,12 +40,14 @@
extended = rta.getExtendedFormatter();
shortcuts = new HashMap<ActionShortcut, ActionItem<Object>>();
createListeners();
+ rta.setWidth("96%");
+ rta.setHeight("100%");
}
public void addActions(ActionItemCollection<Object> actionItems) {
for (ActionItem<Object> actionItem : actionItems) {
ActionDescriptor<Object> action = actionItem.getAction();
- if (action.hasShortcut()) {
+ if (action.hasShortcut() && action.mustBeAdded(null)) {
ActionShortcut shortcut = action.getShortcut();
shortcuts.put(shortcut, actionItem);
}
@@ -60,6 +62,10 @@
insertHtml(span.getString());
}
+ public void adjustSize(int height) {
+ rta.setHeight("" + height);
+ }
+
public boolean canBeBasic() {
return basic != null;
}
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-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -1,6 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ActionAddCondition;
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
@@ -41,10 +42,8 @@
private final AccessRolDTO accessRol;
private final I18nTranslationService i18n;
private final Session session;
- private final ActionItemCollection<Object> basicTopActions;
- private final ActionItemCollection<Object> basicSndActions;
- private final ActionItemCollection<Object> extendedTopActions;
- private final ActionItemCollection<Object> extendedSndActions;
+ private final ActionItemCollection<Object> topActions;
+ private final ActionItemCollection<Object> sndActions;
private final RTEImgResources imgResources;
private final RTEActionTopToolbar topBar;
private final RTEActionSndToolbar sndBar;
@@ -70,47 +69,29 @@
this.imgResources = imgResources;
extended = true;
accessRol = AccessRolDTO.Editor;
- basicTopActions = new ActionItemCollection<Object>();
- basicSndActions = new ActionItemCollection<Object>();
- extendedTopActions = new ActionItemCollection<Object>();
- extendedSndActions = new ActionItemCollection<Object>();
+ topActions = new ActionItemCollection<Object>();
+ sndActions = new ActionItemCollection<Object>();
this.onEdit = new Event0("onRTEEdit");
}
- public void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position) {
+ public void addAction(ActionDescriptor<Object> action, ActionPosition position) {
switch (position) {
case top:
- if (basic) {
- basicTopActions.add(withNoItem(action));
- } else {
- extendedTopActions.add(withNoItem(action));
- }
+ topActions.add(withNoItem(action));
break;
case snd:
- if (basic) {
- basicSndActions.add(withNoItem(action));
- } else {
- extendedSndActions.add(withNoItem(action));
- }
+ sndActions.add(withNoItem(action));
break;
}
}
- public void addActions(ActionCollection<Object> actions, boolean basic, ActionPosition position) {
+ public void addActions(ActionCollection<Object> actions, ActionPosition position) {
switch (position) {
case top:
- if (basic) {
- basicTopActions.addAll(withNoItem(actions));
- } else {
- extendedTopActions.addAll(withNoItem(actions));
- }
+ topActions.addAll(withNoItem(actions));
break;
case snd:
- if (basic) {
- basicSndActions.addAll(withNoItem(actions));
- } else {
- extendedSndActions.addAll(withNoItem(actions));
- }
+ sndActions.addAll(withNoItem(actions));
break;
}
}
@@ -119,6 +100,19 @@
onEdit.add(listener);
}
+ public void adjustSize(final int height) {
+ view.adjustSize(height);
+ }
+
+ public void attach() {
+ topBar.clear();
+ sndBar.clear();
+ view.addActions(topActions);
+ view.addActions(sndActions);
+ topBar.addActions(topActions);
+ sndBar.addActions(sndActions);
+ }
+
public void editContent(String content) {
}
@@ -141,18 +135,6 @@
public void init(RTEditorView view) {
this.view = view;
createBasicActions();
- if (view.canBeBasic()) {
- view.addActions(basicTopActions);
- view.addActions(basicSndActions);
- topBar.addActions(basicTopActions);
- sndBar.addActions(basicSndActions);
- }
- if (isExtended()) {
- view.addActions(extendedTopActions);
- view.addActions(extendedSndActions);
- topBar.addActions(extendedTopActions);
- sndBar.addActions(extendedSndActions);
- }
}
public void setExtended(boolean extended) {
@@ -173,6 +155,17 @@
}
private void createBasicActions() {
+ ActionAddCondition<Object> canBeBasic = new ActionAddCondition<Object>() {
+ public boolean mustBeAdded(Object param) {
+ return view.canBeBasic();
+ }
+ };
+ ActionAddCondition<Object> canBeExtended = new ActionAddCondition<Object>() {
+ public boolean mustBeAdded(Object param) {
+ return isExtended();
+ }
+ };
+
ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -182,6 +175,7 @@
selectAll.setShortcut(new ActionShortcut(true, 'A'));
selectAll.setTextDescription(i18n.t("Select all"));
selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
+ selectAll.setAddCondition(canBeBasic);
bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -191,6 +185,7 @@
bold.setIconCls(getCssName(imgResources.bold()));
bold.setToolTip(i18n.t("Toggle Bold"));
bold.setShortcut(new ActionShortcut(true, 'B'));
+ bold.setAddCondition(canBeBasic);
italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
@@ -201,6 +196,8 @@
italic.setIconCls(getCssName(imgResources.italic()));
italic.setToolTip(i18n.t("Toggle Italic"));
italic.setShortcut(new ActionShortcut(true, 'I'));
+ italic.setAddCondition(canBeBasic);
+ italic.setAddCondition(canBeBasic);
underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
@@ -211,6 +208,7 @@
underline.setIconCls(getCssName(imgResources.underline()));
underline.setToolTip(i18n.t("Toggle Underline"));
underline.setShortcut(new ActionShortcut(true, 'U'));
+ underline.setAddCondition(canBeBasic);
subscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
@@ -221,6 +219,7 @@
subscript.setIconCls(getCssName(imgResources.superscript()));
subscript.setToolTip(i18n.t("Toggle Subscript"));
subscript.setShortcut(new ActionShortcut(true, ','));
+ subscript.setAddCondition(canBeBasic);
superscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
@@ -232,6 +231,7 @@
superscript.setToolTip(i18n.t("Toggle Superscript"));
superscript.setRightSeparator(ActionToolbarButtonSeparator.spacer);
superscript.setShortcut(new ActionShortcut(true, '.'));
+ superscript.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -242,6 +242,7 @@
justifyLeft.setIconCls(getCssName(imgResources.alignleft()));
justifyLeft.setToolTip(i18n.t("Left Justify"));
justifyLeft.setShortcut(new ActionShortcut(true, 'L'));
+ justifyLeft.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyCentre = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -252,6 +253,7 @@
justifyCentre.setIconCls(getCssName(imgResources.centerpara()));
justifyCentre.setToolTip(i18n.t("Centre Justify"));
justifyCentre.setShortcut(new ActionShortcut(true, 'E'));
+ justifyCentre.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyRight = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -263,6 +265,7 @@
justifyRight.setToolTip(i18n.t("Right Justify"));
justifyRight.setShortcut(new ActionShortcut(true, 'R'));
justifyRight.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ justifyRight.setAddCondition(canBeBasic);
ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -273,6 +276,7 @@
undo.setShortcut(new ActionShortcut(true, 'Z'));
undo.setTextDescription(i18n.t("Undo"));
undo.setParentMenuTitle(i18n.t(EDIT_MENU));
+ undo.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -283,6 +287,7 @@
redo.setShortcut(new ActionShortcut(true, 'Y'));
redo.setTextDescription(i18n.t("Redo"));
redo.setParentMenuTitle(i18n.t(EDIT_MENU));
+ redo.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -293,6 +298,7 @@
copy.setShortcut(new ActionShortcut(true, 'C'));
copy.setTextDescription(i18n.t("Copy"));
copy.setParentMenuTitle(i18n.t(EDIT_MENU));
+ copy.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -303,6 +309,7 @@
cut.setShortcut(new ActionShortcut(true, 'X'));
cut.setTextDescription(i18n.t("Cut"));
cut.setParentMenuTitle(i18n.t(EDIT_MENU));
+ cut.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -313,6 +320,7 @@
paste.setShortcut(new ActionShortcut(true, 'V'));
paste.setTextDescription(i18n.t("Paste"));
paste.setParentMenuTitle(i18n.t(EDIT_MENU));
+ paste.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -322,6 +330,7 @@
});
editHtml.setTextDescription(i18n.t("Edit HTML"));
editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
+ editHtml.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -338,6 +347,7 @@
comment.setTextDescription(i18n.t("Comment..."));
comment.setParentMenuTitle(i18n.t(INSERT_MENU));
comment.setEnableCondition(isInsertHtmlSupported());
+ comment.setAddCondition(canBeExtended);
ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -348,6 +358,7 @@
hr.setTextDescription(i18n.t("Horizontal line"));
hr.setIconCls(getCssName(imgResources.hfixedline()));
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
+ hr.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -358,6 +369,7 @@
hrButton.setIconCls(getCssName(imgResources.hfixedline()));
hrButton.setToolTip(i18n.t("Horizontal line"));
hrButton.setShortcut(new ActionShortcut(true, true, ' ', "Space"));
+ hrButton.setAddCondition(canBeExtended);
strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
@@ -367,7 +379,8 @@
});
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
- strikethrough.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ strikethrough.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> decreaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -377,6 +390,7 @@
});
decreaseIndent.setIconCls(getCssName(imgResources.decrementindent()));
decreaseIndent.setToolTip(i18n.t("Decrease Indent"));
+ decreaseIndent.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> increaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -387,6 +401,7 @@
increaseIndent.setIconCls(getCssName(imgResources.incrementindent()));
increaseIndent.setToolTip(i18n.t("Increase Indent"));
increaseIndent.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ increaseIndent.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -397,6 +412,7 @@
ol.setIconCls(getCssName(imgResources.defaultnumbering()));
ol.setToolTip(i18n.t("Numbered List"));
ol.setShortcut(new ActionShortcut(true, '7'));
+ ol.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -408,6 +424,7 @@
ul.setToolTip(i18n.t("Bullet List"));
ul.setShortcut(new ActionShortcut(true, '8'));
ul.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ ul.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -417,6 +434,7 @@
});
img.setIconCls(getCssName(imgResources.images()));
img.setToolTip(i18n.t("Insert Image"));
+ img.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -427,6 +445,7 @@
createLink.setIconCls(getCssName(imgResources.link()));
createLink.setToolTip(i18n.t("Create Link"));
createLink.setShortcut(new ActionShortcut(true, 'K'));
+ createLink.setAddCondition(canBeExtended);
insertElement.addOnCreateLink(new Listener2<String, String>() {
public void onEvent(String name, String url) {
view.createLink(url);
@@ -442,6 +461,7 @@
removeLink.setIconCls(getCssName(imgResources.linkbreak()));
removeLink.setToolTip(i18n.t("Remove Link"));
removeLink.setShortcut(new ActionShortcut(true, true, 'K'));
+ removeLink.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> removeFormat = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -452,35 +472,36 @@
removeFormat.setIconCls(getCssName(imgResources.removeFormat()));
removeFormat.setToolTip(i18n.t("Clear Formatting"));
removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
+ removeFormat.setAddCondition(canBeExtended);
- basicTopActions.add(withNoItem(selectAll));
- basicSndActions.add(withNoItem(bold));
- basicSndActions.add(withNoItem(italic));
- basicSndActions.add(withNoItem(underline));
- extendedSndActions.add(withNoItem(strikethrough));
- basicSndActions.add(withNoItem(subscript));
- basicSndActions.add(withNoItem(superscript));
- basicSndActions.add(withNoItem(justifyLeft));
- basicSndActions.add(withNoItem(justifyCentre));
- basicSndActions.add(withNoItem(justifyRight));
+ topActions.add(withNoItem(selectAll));
+ sndActions.add(withNoItem(bold));
+ sndActions.add(withNoItem(italic));
+ sndActions.add(withNoItem(underline));
+ sndActions.add(withNoItem(strikethrough));
+ sndActions.add(withNoItem(subscript));
+ sndActions.add(withNoItem(superscript));
+ sndActions.add(withNoItem(justifyLeft));
+ sndActions.add(withNoItem(justifyCentre));
+ sndActions.add(withNoItem(justifyRight));
- extendedTopActions.add(withNoItem(undo));
- extendedTopActions.add(withNoItem(redo));
- extendedTopActions.add(withNoItem(copy));
- extendedTopActions.add(withNoItem(cut));
- extendedTopActions.add(withNoItem(paste));
- extendedTopActions.add(withNoItem(editHtml));
- extendedTopActions.add(withNoItem(hr));
- extendedSndActions.add(withNoItem(hrButton));
- extendedSndActions.add(withNoItem(decreaseIndent));
- extendedSndActions.add(withNoItem(increaseIndent));
- extendedSndActions.add(withNoItem(ol));
- extendedSndActions.add(withNoItem(ul));
- extendedSndActions.add(withNoItem(img));
- extendedSndActions.add(withNoItem(createLink));
- extendedSndActions.add(withNoItem(removeLink));
- extendedSndActions.add(withNoItem(removeFormat));
- extendedTopActions.add(withNoItem(comment));
+ topActions.add(withNoItem(undo));
+ topActions.add(withNoItem(redo));
+ topActions.add(withNoItem(copy));
+ topActions.add(withNoItem(cut));
+ topActions.add(withNoItem(paste));
+ topActions.add(withNoItem(editHtml));
+ topActions.add(withNoItem(hr));
+ sndActions.add(withNoItem(hrButton));
+ sndActions.add(withNoItem(decreaseIndent));
+ sndActions.add(withNoItem(increaseIndent));
+ sndActions.add(withNoItem(ol));
+ sndActions.add(withNoItem(ul));
+ sndActions.add(withNoItem(img));
+ sndActions.add(withNoItem(createLink));
+ sndActions.add(withNoItem(removeLink));
+ sndActions.add(withNoItem(removeFormat));
+ topActions.add(withNoItem(comment));
}
private String getCssName(ImageResource imageResource) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -9,6 +9,8 @@
void addComment(String userName);
+ void adjustSize(int height);
+
boolean canBeBasic();
boolean canBeExtended();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-03 19:31:56 UTC (rev 1057)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-04 00:11:14 UTC (rev 1058)
@@ -5,17 +5,31 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import com.google.gwt.user.client.ui.VerticalPanel;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
public class TestRTEDialog {
public TestRTEDialog(RTEditor editor) {
BasicDialog dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
- VerticalPanel vp = new VerticalPanel();
+ final VerticalPanel vp = new VerticalPanel();
vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
vp.add(((ActionToolbarPanel<Object>) editor.getSndBar().getView()).getToolbar(ActionToolbarPosition.topbar));
- vp.add(((RTEditorPanel) editor.getEditorArea()).getRTE());
+ final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
+ vp.add(editorPanel.getRTE());
+ editor.setExtended(true);
+ editor.attach();
+ vp.setWidth("100%");
dialog.add(vp);
+ dialog.addListener(new WindowListenerAdapter() {
+ @Override
+ public void onResize(Window source, int width, int height) {
+ int newHeight = height - 26 * 2 - 40;
+ editorPanel.adjustSize(newHeight);
+ vp.setCellHeight(editorPanel.getRTE(), "" + newHeight);
+ }
+ });
dialog.show();
}
}
1
0
Author: vjrj
Date: 2009-03-03 20:31:56 +0100 (Tue, 03 Mar 2009)
New Revision: 1057
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.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/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -10,32 +10,46 @@
return ((modifiers & modifier) == modifier);
}
- final boolean alt;
- final boolean ctrl;
- final boolean shift;
+ private final boolean alt;
+ private final boolean ctrl;
+ private final boolean shift;
+ private final char key;
+ private final String keyName;
- final char key;
-
- public ActionShortcut(boolean alt, boolean ctrl, boolean shift, char key) {
+ public ActionShortcut(boolean alt, boolean ctrl, boolean shift, char key, String keyName) {
this.alt = alt;
this.ctrl = ctrl;
this.shift = shift;
this.key = key;
+ this.keyName = keyName;
}
public ActionShortcut(boolean ctrl, boolean shift, char key) {
- this(false, ctrl, shift, key);
+ this(false, ctrl, shift, key, null);
}
+ public ActionShortcut(boolean ctrl, boolean shift, char key, String keyName) {
+ this(false, ctrl, shift, key, keyName);
+ }
+
public ActionShortcut(boolean ctrl, char key) {
- this(false, ctrl, false, key);
+ this(false, ctrl, false, key, null);
}
+ public ActionShortcut(boolean ctrl, char key, String keyName) {
+ this(false, ctrl, false, key, keyName);
+ }
+
public ActionShortcut(char key, int modifiers) {
this(has(modifiers, KeyboardListener.MODIFIER_ALT), has(modifiers, KeyboardListener.MODIFIER_CTRL), has(
- modifiers, KeyboardListener.MODIFIER_SHIFT), key);
+ modifiers, KeyboardListener.MODIFIER_SHIFT), key, null);
}
+ public ActionShortcut(char key, int modifiers, String keyName) {
+ this(has(modifiers, KeyboardListener.MODIFIER_ALT), has(modifiers, KeyboardListener.MODIFIER_CTRL), has(
+ modifiers, KeyboardListener.MODIFIER_SHIFT), key, keyName);
+ }
+
@Override
public boolean equals(Object obj) {
if (this == obj) {
@@ -89,12 +103,16 @@
s += sKey(alt, "Alt", i18n);
s += sKey(ctrl, "Ctrl", i18n);
s += sKey(shift, "Shift", i18n);
- s += String.valueOf(key).toUpperCase() + ")";
+ s += keyName != null ? translateKey(keyName, i18n) + ")" : String.valueOf(key).toUpperCase() + ")";
return s;
}
- private String sKey(boolean key, String keyName, I18nTranslationService i18n) {
- return key ? i18n.tWithNT(keyName, "The '" + keyName + "' keyboard key") + "+" : "";
+ private String sKey(boolean key, String specialKeyName, I18nTranslationService i18n) {
+ return key ? translateKey(specialKeyName, i18n) + "+" : "";
}
+ private String translateKey(String keyNameToTranslate, I18nTranslationService i18n) {
+ return i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -29,6 +29,7 @@
private String parentMenuTitle;
private String parentMenuIconUrl;
+ private String parentMenuIconCls;
private String parentSubMenuTitle;
public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
@@ -65,6 +66,10 @@
super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
}
+ public String getParentMenuIconCls() {
+ return parentMenuIconCls;
+ }
+
public String getParentMenuIconUrl() {
return parentMenuIconUrl;
}
@@ -77,6 +82,10 @@
return parentSubMenuTitle;
}
+ public void setParentMenuIconCls(String parentMenuIconCls) {
+ this.parentMenuIconCls = parentMenuIconCls;
+ }
+
public void setParentMenuIconUrl(final String parentMenuIconUrl) {
this.parentMenuIconUrl = parentMenuIconUrl;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -207,19 +207,20 @@
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
final Item item;
if (action instanceof ActionToolbarMenuRadioDescriptor) {
- CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS(i18n));
+ CheckItem checkItem = new CheckItem();
ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
checkItem.setGroup(radioDescriptor.getGroup());
checkItem.setChecked(radioDescriptor.mustBeChecked());
item = checkItem;
} else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
- CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS(i18n));
+ CheckItem checkItem = new CheckItem();
ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
item = checkItem;
} else {
- item = new Item(action.getText() + action.getShortcutToS(i18n));
+ item = new Item();
}
+ item.setText(genMenuItemText(action));
BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
@Override
public void onClick(BaseItem item, EventObject e) {
@@ -227,11 +228,13 @@
}
};
item.addListener(clickListener);
- if (action.getIconCls() != null) {
- item.setIconCls(action.getIconCls());
+ String iconCls = action.getIconCls();
+ String iconUrl = action.getIconUrl();
+ if (iconCls != null) {
+ item.setIconCls(iconCls);
}
- if (action.getIconUrl() != null) {
- item.setIcon(action.getIconUrl());
+ if (iconUrl != null) {
+ item.setIcon(iconUrl);
}
// ToolTip tip = new ToolTip();
// tip.setHtml(action.getToolTip());
@@ -250,7 +253,8 @@
subMenu = new Menu();
final MenuItem subMenuItem = new MenuItem(menuSubTitle, subMenu);
if (menu == null) {
- menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
+ menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
+ menuTitle, menuKey);
}
menu.addItem(subMenuItem);
toolbarMenus.put(subMenuKey, subMenu);
@@ -260,14 +264,14 @@
} else {
// Menu action without submenu
if (menu == null) {
- menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
+ menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), null, menuTitle, menuKey);
}
menu.addItem(item);
}
return item;
}
- private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl,
+ private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl, final String iconCls,
final String menuTitle, final String menuKey) {
final Menu menu = new Menu();
final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
@@ -275,6 +279,9 @@
if (iconUrl != null) {
toolbarMenu.setIcon(iconUrl);
}
+ if (iconCls != null) {
+ toolbarMenu.setIconCls(iconCls);
+ }
toolbarMenus.put(menuKey, menu);
add(barPosition, toolbarMenu);
return menu;
@@ -300,6 +307,16 @@
return id;
}
+ private String genMenuItemText(final ActionToolbarMenuDescriptor<T> action) {
+ // HorizontalPanel hp = new HorizontalPanel();
+ // Label title = new Label(action.getText());
+ // hp.add(title);
+ // hp.setCellWidth(title, "100%");
+ // hp.add(new Label(action.getShortcutToS(i18n)));
+ // return hp.getElement().getInnerHTML();
+ return action.getText() + action.getShortcutToS(i18n);
+ }
+
private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
final String actionText) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -62,15 +62,24 @@
}
public String formatDateWithLocale(final Date date) {
- String dateFormat = currentLang.getDateFormat();
+ return formatDateWithLocale(date, false);
+ }
+
+ public String formatDateWithLocale(final Date date, boolean shortFormat) {
+ String dateFormat = shortFormat ? currentLang.getDateFormatShort() : currentLang.getDateFormat();
+
final DateTimeFormat fmt;
if (dateFormat == null) {
- fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+ fmt = shortFormat ? DateTimeFormat.getFormat("M/d/yyyy") : DateTimeFormat.getFormat("M/d/yyyy h:mm a");
} else {
- String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
- String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
- dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
- fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+ if (shortFormat) {
+ fmt = DateTimeFormat.getFormat(dateFormat);
+ } else {
+ String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
+ String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
+ dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
+ fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+ }
}
String dateFormated = fmt.format(date);
return dateFormated;
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-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -57,6 +57,7 @@
import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.NoDecoration;
@@ -232,7 +233,7 @@
RTEActionTopToolbar topBar = $(RTEActionTopToolbar.class);
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
- $(Session.class), topBar, sndBar, $(RTEImgResources.class));
+ $(Session.class), topBar, sndBar, $(RTEImgResources.class), $(TextEditorInsertElement.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class));
presenter.init(panel);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -4,25 +4,26 @@
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPresenter.ActionPosition;
+import com.calclab.suco.client.events.Listener0;
+
public interface RTEditor {
void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position);
void addActions(ActionCollection<Object> actions, boolean basic, ActionPosition position);
+ void addOnEditListener(Listener0 listener);
+
void editContent(String content);
+ View getEditorArea();
+
ActionToolbar<Object> getSndBar();
ActionToolbar<Object> getTopBar();
- View getView();
-
- void setAccessRol(AccessRolDTO accessRol);
-
void setExtended(boolean extended);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -53,7 +53,7 @@
}
public void addComment(String userName) {
- String time = i18n.formatDateWithLocale(new Date());
+ String time = i18n.formatDateWithLocale(new Date(), true);
Element span = DOM.createSpan();
span.setInnerText(i18n.t("type here") + " -" + userName + " " + time);
DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
@@ -92,10 +92,6 @@
extended.insertHorizontalRule();
}
- public void insertHR() {
- extended.insertHorizontalRule();
- }
-
public void insertHtml(String html) {
extended.insertHtml(html);
}
@@ -112,8 +108,11 @@
extended.insertUnorderedList();
}
+ public boolean isAttached() {
+ return rta.isAttached();
+ }
+
public boolean isBold() {
- Log.debug("Is bold: " + basic.isBold());
return basic.isBold();
}
@@ -239,16 +238,18 @@
extended.removeLink();
}
+ protected void fireEdit() {
+ presenter.fireOnEdit();
+ }
+
private void createListeners() {
rta.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (sender == rta) {
// We use the RichTextArea's onKeyUp event to update the
- // toolbar status.
- // This will catch any cases where the user moves the cursur
- // using the
- // keyboard, or uses one of the browser's built-in keyboard
- // shortcuts.
+ // toolbar status. This will catch any cases where the user
+ // moves the cursor using the keyboard, or uses one of the
+ // browser's built-in keyboard shortcuts.
updateStatus();
}
}
@@ -270,7 +271,7 @@
// keyboard shortcuts.
updateStatus();
- // fireEdit();
+ fireEdit();
if (modifiers != 0) {
ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
if (actionItem != null) {
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-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -7,17 +7,25 @@
import org.ourproject.kune.platf.client.actions.ActionItem;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionShortcut;
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
+import com.calclab.suco.client.events.Event0;
import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.events.Listener2;
import com.google.gwt.libideas.resources.client.ImageResource;
public class RTEditorPresenter implements RTEditor {
@@ -30,7 +38,7 @@
private static final String INSERT_MENU = "Insert";
private RTEditorView view;
private boolean extended;
- private AccessRolDTO accessRol;
+ private final AccessRolDTO accessRol;
private final I18nTranslationService i18n;
private final Session session;
private final ActionItemCollection<Object> basicTopActions;
@@ -44,13 +52,20 @@
private ActionToolbarPushButtonDescriptor<Object> italic;
private ActionToolbarPushButtonDescriptor<Object> underline;
private ActionToolbarPushButtonDescriptor<Object> strikethrough;
+ private final Event0 onEdit;
+ private ActionToolbarPushButtonDescriptor<Object> subscript;
+ private ActionToolbarPushButtonDescriptor<Object> superscript;
+ private final TextEditorInsertElement insertElement;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
- RTEActionSndToolbar sndBar, RTEImgResources imgResources) {
+ RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
this.sndBar = sndBar;
+ this.insertElement = textEditorInsertElement;
+ styleToolbar(topBar);
+ styleToolbar(sndBar);
sndBar.attach();
this.imgResources = imgResources;
extended = true;
@@ -59,6 +74,7 @@
basicSndActions = new ActionItemCollection<Object>();
extendedTopActions = new ActionItemCollection<Object>();
extendedSndActions = new ActionItemCollection<Object>();
+ this.onEdit = new Event0("onRTEEdit");
}
public void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position) {
@@ -99,9 +115,21 @@
}
}
+ public void addOnEditListener(final Listener0 listener) {
+ onEdit.add(listener);
+ }
+
public void editContent(String content) {
}
+ public void fireOnEdit() {
+ onEdit.fire();
+ }
+
+ public View getEditorArea() {
+ return view;
+ }
+
public ActionToolbar<Object> getSndBar() {
return sndBar;
}
@@ -110,13 +138,9 @@
return topBar;
}
- public View getView() {
- return view;
- }
-
public void init(RTEditorView view) {
this.view = view;
- createDefBasicActions();
+ createBasicActions();
if (view.canBeBasic()) {
view.addActions(basicTopActions);
view.addActions(basicSndActions);
@@ -124,7 +148,6 @@
sndBar.addActions(basicSndActions);
}
if (isExtended()) {
- createDefExtendedActions();
view.addActions(extendedTopActions);
view.addActions(extendedSndActions);
topBar.addActions(extendedTopActions);
@@ -132,10 +155,6 @@
}
}
- public void setAccessRol(AccessRolDTO accessRol) {
- this.accessRol = accessRol;
- }
-
public void setExtended(boolean extended) {
this.extended = extended;
}
@@ -145,13 +164,15 @@
sndBar.setPushButtonPressed(bold, view.isBold());
sndBar.setPushButtonPressed(italic, view.isItalic());
sndBar.setPushButtonPressed(underline, view.isUnderlined());
+ sndBar.setPushButtonPressed(subscript, view.isSubscript());
+ sndBar.setPushButtonPressed(superscript, view.isSuperscript());
}
if (isExtended()) {
sndBar.setPushButtonPressed(strikethrough, view.isStrikethrough());
}
}
- private void createDefBasicActions() {
+ private void createBasicActions() {
ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -189,14 +210,60 @@
});
underline.setIconCls(getCssName(imgResources.underline()));
underline.setToolTip(i18n.t("Toggle Underline"));
+ underline.setShortcut(new ActionShortcut(true, 'U'));
- basicTopActions.add(withNoItem(selectAll));
- basicSndActions.add(withNoItem(bold));
- basicSndActions.add(withNoItem(italic));
- basicSndActions.add(withNoItem(underline));
- }
+ subscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
+ new Listener0() {
+ public void onEvent() {
+ view.toggleSubscript();
+ }
+ });
+ subscript.setIconCls(getCssName(imgResources.superscript()));
+ subscript.setToolTip(i18n.t("Toggle Subscript"));
+ subscript.setShortcut(new ActionShortcut(true, ','));
- private void createDefExtendedActions() {
+ superscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
+ new Listener0() {
+ public void onEvent() {
+ view.toggleSuperscript();
+ }
+ });
+ superscript.setIconCls(getCssName(imgResources.superscript()));
+ superscript.setToolTip(i18n.t("Toggle Superscript"));
+ superscript.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ superscript.setShortcut(new ActionShortcut(true, '.'));
+
+ ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.justifyLeft();
+ }
+ });
+ justifyLeft.setIconCls(getCssName(imgResources.alignleft()));
+ justifyLeft.setToolTip(i18n.t("Left Justify"));
+ justifyLeft.setShortcut(new ActionShortcut(true, 'L'));
+
+ ActionToolbarButtonDescriptor<Object> justifyCentre = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.justifyCenter();
+ }
+ });
+ justifyCentre.setIconCls(getCssName(imgResources.centerpara()));
+ justifyCentre.setToolTip(i18n.t("Centre Justify"));
+ justifyCentre.setShortcut(new ActionShortcut(true, 'E'));
+
+ ActionToolbarButtonDescriptor<Object> justifyRight = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.justifyRight();
+ }
+ });
+ justifyRight.setIconCls(getCssName(imgResources.alignright()));
+ justifyRight.setToolTip(i18n.t("Right Justify"));
+ justifyRight.setShortcut(new ActionShortcut(true, 'R'));
+ justifyRight.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+
ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -279,8 +346,19 @@
}
});
hr.setTextDescription(i18n.t("Horizontal line"));
+ hr.setIconCls(getCssName(imgResources.hfixedline()));
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
+ ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.insertHorizontalRule();
+ }
+ });
+ hrButton.setIconCls(getCssName(imgResources.hfixedline()));
+ hrButton.setToolTip(i18n.t("Horizontal line"));
+ hrButton.setShortcut(new ActionShortcut(true, true, ' ', "Space"));
+
strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
new Listener0() {
public void onEvent() {
@@ -289,7 +367,103 @@
});
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
+ strikethrough.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ ActionToolbarButtonDescriptor<Object> decreaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.leftIndent();
+ }
+ });
+ decreaseIndent.setIconCls(getCssName(imgResources.decrementindent()));
+ decreaseIndent.setToolTip(i18n.t("Decrease Indent"));
+
+ ActionToolbarButtonDescriptor<Object> increaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.rightIndent();
+ }
+ });
+ increaseIndent.setIconCls(getCssName(imgResources.incrementindent()));
+ increaseIndent.setToolTip(i18n.t("Increase Indent"));
+ increaseIndent.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+
+ ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.insertOrderedList();
+ }
+ });
+ ol.setIconCls(getCssName(imgResources.defaultnumbering()));
+ ol.setToolTip(i18n.t("Numbered List"));
+ ol.setShortcut(new ActionShortcut(true, '7'));
+
+ ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.insertUnorderedList();
+ }
+ });
+ ul.setIconCls(getCssName(imgResources.defaultbullet()));
+ ul.setToolTip(i18n.t("Bullet List"));
+ ul.setShortcut(new ActionShortcut(true, '8'));
+ ul.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+
+ ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ NotifyUser.info(TextUtils.IN_DEVELOPMENT);
+ }
+ });
+ img.setIconCls(getCssName(imgResources.images()));
+ img.setToolTip(i18n.t("Insert Image"));
+
+ ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ insertElement.show();
+ }
+ });
+ createLink.setIconCls(getCssName(imgResources.link()));
+ createLink.setToolTip(i18n.t("Create Link"));
+ createLink.setShortcut(new ActionShortcut(true, 'K'));
+ insertElement.addOnCreateLink(new Listener2<String, String>() {
+ public void onEvent(String name, String url) {
+ view.createLink(url);
+ }
+ });
+
+ ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.unlink();
+ }
+ });
+ removeLink.setIconCls(getCssName(imgResources.linkbreak()));
+ removeLink.setToolTip(i18n.t("Remove Link"));
+ removeLink.setShortcut(new ActionShortcut(true, true, 'K'));
+
+ ActionToolbarButtonDescriptor<Object> removeFormat = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.removeFormat();
+ }
+ });
+ removeFormat.setIconCls(getCssName(imgResources.removeFormat()));
+ removeFormat.setToolTip(i18n.t("Clear Formatting"));
+ removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
+
+ basicTopActions.add(withNoItem(selectAll));
+ basicSndActions.add(withNoItem(bold));
+ basicSndActions.add(withNoItem(italic));
+ basicSndActions.add(withNoItem(underline));
+ extendedSndActions.add(withNoItem(strikethrough));
+ basicSndActions.add(withNoItem(subscript));
+ basicSndActions.add(withNoItem(superscript));
+ basicSndActions.add(withNoItem(justifyLeft));
+ basicSndActions.add(withNoItem(justifyCentre));
+ basicSndActions.add(withNoItem(justifyRight));
+
extendedTopActions.add(withNoItem(undo));
extendedTopActions.add(withNoItem(redo));
extendedTopActions.add(withNoItem(copy));
@@ -297,8 +471,16 @@
extendedTopActions.add(withNoItem(paste));
extendedTopActions.add(withNoItem(editHtml));
extendedTopActions.add(withNoItem(hr));
+ extendedSndActions.add(withNoItem(hrButton));
+ extendedSndActions.add(withNoItem(decreaseIndent));
+ extendedSndActions.add(withNoItem(increaseIndent));
+ extendedSndActions.add(withNoItem(ol));
+ extendedSndActions.add(withNoItem(ul));
+ extendedSndActions.add(withNoItem(img));
+ extendedSndActions.add(withNoItem(createLink));
+ extendedSndActions.add(withNoItem(removeLink));
+ extendedSndActions.add(withNoItem(removeFormat));
extendedTopActions.add(withNoItem(comment));
- extendedSndActions.add(withNoItem(strikethrough));
}
private String getCssName(ImageResource imageResource) {
@@ -317,6 +499,13 @@
};
}
+ private void styleToolbar(ActionToolbar<Object> topBar) {
+ SimpleToolbar toolbar = ((ActionToolbarPanel<Object>) topBar.getView()).getToolbar(ActionToolbarPosition.topbar);
+ toolbar.setStyleName("x-toolbar");
+ toolbar.addStyleName("x-panel");
+ toolbar.addStyleName("k-toolbar-bottom-line");
+ }
+
private ActionItemCollection<Object> withNoItem(ActionCollection<Object> actions) {
ActionItemCollection<Object> collection = new ActionItemCollection<Object>();
for (ActionDescriptor<Object> action : actions) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -31,6 +31,8 @@
void insertUnorderedList();
+ boolean isAttached();
+
boolean isBold();
boolean isItalic();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -9,12 +9,12 @@
public class TestRTEDialog {
public TestRTEDialog(RTEditor editor) {
- BasicDialog dialog = new BasicDialog("Testing RTE", false);
+ BasicDialog dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
VerticalPanel vp = new VerticalPanel();
vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
vp.add(((ActionToolbarPanel<Object>) editor.getSndBar().getView()).getToolbar(ActionToolbarPosition.topbar));
- vp.add(((RTEditorPanel) editor.getView()).getRTE());
+ vp.add(((RTEditorPanel) editor.getEditorArea()).getRTE());
dialog.add(vp);
dialog.show();
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-03 15:10:55 UTC (rev 1056)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-03 19:31:56 UTC (rev 1057)
@@ -15,7 +15,7 @@
@Test
public void altS() {
- ActionShortcut shortcut = new ActionShortcut(true, false, false, 'S');
+ ActionShortcut shortcut = new ActionShortcut(true, false, false, 'S', null);
assertEquals(" (Alt+S)", shortcut.toString(i18n));
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_CTRL));
@@ -47,7 +47,7 @@
@Test
public void ctrlShiftS() {
- ActionShortcut shortcut = new ActionShortcut(false, true, true, 'S');
+ ActionShortcut shortcut = new ActionShortcut(false, true, true, 'S', null);
assertEquals(" (Ctrl+Shift+S)", shortcut.toString(i18n));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_SHIFT | KeyboardListener.MODIFIER_CTRL));
1
0
03 Mar '09
Author: vjrj
Date: 2009-03-03 16:10:55 +0100 (Tue, 03 Mar 2009)
New Revision: 1056
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/linkbreak.png
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.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/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-03 15:10:55 UTC (rev 1056)
@@ -13,4 +13,4 @@
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.4.1
-*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}
\ No newline at end of file
+*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment{border:1px dashed silver;font-size:85%;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-03 15:10:55 UTC (rev 1056)
@@ -1,4 +1,12 @@
body {
font-family: arial, sans;
margin: 5px;
+}
+
+.k-rte-comment span {
+ border:1px dashed #C0C0C0;
+ font-size:85%;
+ line-height:1.4;
+ padding:1px;
+ background-color:#D7FFD7;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -19,10 +19,13 @@
\*/
package org.ourproject.kune.platf.client.actions.toolbar;
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
public interface ActionToolbar<T> {
+ void addActions(ActionItemCollection<T> actionItemCollection);
+
void attach();
void clear();
@@ -33,6 +36,8 @@
ActionToolbarView<T> getView();
- void addActions(ActionItemCollection<T> actionItemCollection);
+ void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -41,6 +41,7 @@
import com.calclab.suco.client.ioc.Provider;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Ext;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
@@ -75,20 +76,18 @@
}
public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
+ final ToolbarButton button = new ToolbarButton();
final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
T item = actionItem.getItem();
final ActionToolbarPosition pos = action.getActionPosition();
- final ToolbarButton button = new ToolbarButton();
final String text = action.getText();
- final String id = action.getId();
final String iconUrl = action.getIconUrl();
final String iconCls = action.getIconCls();
if (text != null) {
button.setText(text);
}
- if (id != null) {
- button.setId(id);
- }
+ String id = generateIdIfEmpty(action);
+ button.setId(id);
if (action instanceof ActionToolbarPushButtonDescriptor) {
button.setEnableToggle(true);
ActionPressedCondition<T> mustInitialyPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
@@ -119,7 +118,7 @@
if (action.hasRightSeparator()) {
add(toolbar, action.getRightSeparator());
}
- toolbarButtons.put(genButtonKey(pos, text), button);
+ toolbarButtons.put(genButtonKey(pos, id), button);
}
public void addMenuAction(final ActionItem<T> actionItem, final boolean enable) {
@@ -130,7 +129,7 @@
final String itemKey = genMenuKey(pos, menuTitle, menuSubTitle, action.getText());
Item item = menuItems.get(itemKey);
if (item == null) {
- item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem, action.getId());
+ item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem, generateIdIfEmpty(action));
menuItems.put(itemKey, item);
}
setEnableMenuItem(item, enable);
@@ -169,8 +168,7 @@
}
public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
- final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
- final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getText()));
+ final ToolbarButton button = findButton(action);
if (button != null) {
setEnableButton(button, enable);
} else {
@@ -178,6 +176,16 @@
}
}
+ public void setPushButtonPressed(final ActionDescriptor<T> action, final boolean pressed) {
+ final ToolbarButton button = findButton(action);
+ if (button != null && button.isEnableToggle()) {
+ // Log.debug("Setting button pressed: " + pressed);
+ button.toggle(pressed);
+ } else {
+ Log.error("Tryng to set pressed a non existent toolbar push button");
+ }
+ }
+
private void add(final ActionToolbarPosition toolbar, final Widget widget) {
getToolbar(toolbar).add(widget);
}
@@ -272,11 +280,26 @@
return menu;
}
- private String genButtonKey(final ActionToolbarPosition pos, final String actionText) {
- final String basePart = "km-act-btn-" + pos.toString().substring(0, 2) + "-" + actionText;
+ private ToolbarButton findButton(final ActionDescriptor<T> action) {
+ final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
+ final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getId()));
+ return button;
+ }
+
+ private String genButtonKey(final ActionToolbarPosition pos, final String id) {
+ final String basePart = "km-act-btn-" + pos.toString().substring(0, 2) + "-" + id;
return basePart;
}
+ private String generateIdIfEmpty(final ActionDescriptor<T> action) {
+ String id = action.getId();
+ if (id == null) {
+ id = Ext.generateId();
+ action.setId(id);
+ }
+ return id;
+ }
+
private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
final String actionText) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -36,6 +36,24 @@
this.view = toolbar;
}
+ public void addActions(final ActionItemCollection<T> actions) {
+ for (final ActionItem<T> actionItem : actions) {
+ final ActionDescriptor<T> action = actionItem.getAction();
+ if (actionItem.mustBeAdded()) {
+ if (isToolbarMenu(action)) {
+ view.addMenuAction(actionItem, actionItem.mustBeEnabled());
+ } else {
+ if (isToolbarButton(action)) {
+ view.addButtonAction(actionItem, actionItem.mustBeEnabled());
+ } else {
+ Log.error("Code error: Not an ActionMenuDescriptor or ActionButtonDescriptor: "
+ + action.getText());
+ }
+ }
+ }
+ }
+ }
+
public void attach() {
view.attach();
}
@@ -56,24 +74,14 @@
return view;
}
- public void addActions(final ActionItemCollection<T> actions) {
- for (final ActionItem<T> actionItem : actions) {
- final ActionDescriptor<T> action = actionItem.getAction();
- if (actionItem.mustBeAdded()) {
- if (isToolbarMenu(action)) {
- view.addMenuAction(actionItem, actionItem.mustBeEnabled());
- } else {
- if (isToolbarButton(action)) {
- view.addButtonAction(actionItem, actionItem.mustBeEnabled());
- } else {
- Log.error("Code error: Not an ActionMenuDescriptor or ActionButtonDescriptor: "
- + action.getText());
- }
- }
- }
- }
+ public void setButtonEnable(ActionDescriptor<T> action, boolean enable) {
+ view.setButtonEnable(action, enable);
}
+ public void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed) {
+ view.setPushButtonPressed(action, pressed);
+ }
+
private boolean isToolbarButton(final ActionDescriptor<T> action) {
return action instanceof ActionToolbarButtonDescriptor
|| action instanceof ActionToolbarButtonAndItemDescriptor;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -39,4 +39,6 @@
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
+
}
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-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -64,6 +64,7 @@
import com.calclab.suco.client.ioc.module.AbstractModule;
import com.calclab.suco.client.ioc.module.Factory;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.libideas.client.StyleInjector;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
@@ -231,7 +232,7 @@
RTEActionTopToolbar topBar = $(RTEActionTopToolbar.class);
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
- $(Session.class), topBar, sndBar, RTEImgResources.INSTANCE);
+ $(Session.class), topBar, sndBar, $(RTEImgResources.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class));
presenter.init(panel);
@@ -252,6 +253,15 @@
}
});
+ register(Singleton.class, new Factory<RTEImgResources>(RTEImgResources.class) {
+ @Override
+ public RTEImgResources create() {
+ RTEImgResources instance = GWT.create(RTEImgResources.class);
+ StyleInjector.injectStylesheet(instance.css().getText());
+ return instance;
+ }
+ });
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
@@ -260,6 +270,5 @@
// $(TestRTEDialog.class);
// $(TestRTEDialog.class);
// $(TestRTEDialog.class);
-
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -9,16 +9,15 @@
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.BasicFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.ExtendedFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.Justification;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.libideas.client.StyleInjector;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.KeyboardListener;
import com.google.gwt.user.client.ui.Widget;
@@ -30,14 +29,15 @@
private final ExtendedFormatter extended;
private final HashMap<ActionShortcut, ActionItem<Object>> shortcuts;
private final ActionManager actionManager;
+ private final RTEditorPresenter presenter;
public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n, ActionManager actionManager) {
+ this.presenter = presenter;
this.i18n = i18n;
this.actionManager = actionManager;
rta = new RichTextArea();
basic = rta.getBasicFormatter();
extended = rta.getExtendedFormatter();
- StyleInjector.injectStylesheet(RTEImgResources.INSTANCE.css().getText());
shortcuts = new HashMap<ActionShortcut, ActionItem<Object>>();
createListeners();
}
@@ -56,11 +56,14 @@
String time = i18n.formatDateWithLocale(new Date());
Element span = DOM.createSpan();
span.setInnerText(i18n.t("type here") + " -" + userName + " " + time);
- DOM.setElementAttribute((com.google.gwt.user.client.Element) span, "backgroundColor", "rgb(255,255,215");
- // FIXME: addCustomStyle
+ DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
insertHtml(span.getString());
}
+ public boolean canBeBasic() {
+ return basic != null;
+ }
+
public boolean canBeExtended() {
return extended != null;
}
@@ -110,27 +113,28 @@
}
public boolean isBold() {
- return rta.isAttached() && basic.isBold();
+ Log.debug("Is bold: " + basic.isBold());
+ return basic.isBold();
}
public boolean isItalic() {
- return rta.isAttached() && basic.isItalic();
+ return basic.isItalic();
}
public boolean isStrikethrough() {
- return rta.isAttached() && extended.isStrikethrough();
+ return extended.isStrikethrough();
}
public boolean isSubscript() {
- return rta.isAttached() && basic.isSubscript();
+ return basic.isSubscript();
}
public boolean isSuperscript() {
- return rta.isAttached() && basic.isSuperscript();
+ return basic.isSuperscript();
}
public boolean isUnderlined() {
- return rta.isAttached() && basic.isUnderlined();
+ return basic.isUnderlined();
}
public void justifyCenter() {
@@ -236,7 +240,21 @@
}
private void createListeners() {
+ rta.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ if (sender == rta) {
+ // We use the RichTextArea's onKeyUp event to update the
+ // toolbar status.
+ // This will catch any cases where the user moves the cursur
+ // using the
+ // keyboard, or uses one of the browser's built-in keyboard
+ // shortcuts.
+ updateStatus();
+ }
+ }
+ });
rta.addKeyboardListener(new KeyboardListener() {
+
public void onKeyDown(final Widget sender, final char keyCode, final int modifiers) {
}
@@ -251,12 +269,12 @@
// using the keyboard, or uses one of the browser's built-in
// keyboard shortcuts.
- // updateStatus();
+ updateStatus();
// fireEdit();
if (modifiers != 0) {
ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
if (actionItem != null) {
- NotifyUser.info("Shortcut");
+ Log.debug("RTE shortcut pressed (" + modifiers + ", " + keyCode + ")");
actionManager.doAction(actionItem);
}
}
@@ -264,4 +282,11 @@
}
});
}
+
+ /**
+ * Updates the status of all the stateful buttons.
+ */
+ private void updateStatus() {
+ presenter.updateStatus();
+ }
}
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-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -6,7 +6,6 @@
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
import org.ourproject.kune.platf.client.actions.ActionItem;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
-import org.ourproject.kune.platf.client.actions.ActionPressedCondition;
import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
@@ -41,6 +40,10 @@
private final RTEImgResources imgResources;
private final RTEActionTopToolbar topBar;
private final RTEActionSndToolbar sndBar;
+ private ActionToolbarPushButtonDescriptor<Object> bold;
+ private ActionToolbarPushButtonDescriptor<Object> italic;
+ private ActionToolbarPushButtonDescriptor<Object> underline;
+ private ActionToolbarPushButtonDescriptor<Object> strikethrough;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
RTEActionSndToolbar sndBar, RTEImgResources imgResources) {
@@ -114,10 +117,12 @@
public void init(RTEditorView view) {
this.view = view;
createDefBasicActions();
- topBar.addActions(basicTopActions);
- sndBar.addActions(basicSndActions);
- view.addActions(basicTopActions);
- view.addActions(basicSndActions);
+ if (view.canBeBasic()) {
+ view.addActions(basicTopActions);
+ view.addActions(basicSndActions);
+ topBar.addActions(basicTopActions);
+ sndBar.addActions(basicSndActions);
+ }
if (isExtended()) {
createDefExtendedActions();
view.addActions(extendedTopActions);
@@ -135,6 +140,17 @@
this.extended = extended;
}
+ public void updateStatus() {
+ if (view.canBeBasic()) {
+ sndBar.setPushButtonPressed(bold, view.isBold());
+ sndBar.setPushButtonPressed(italic, view.isItalic());
+ sndBar.setPushButtonPressed(underline, view.isUnderlined());
+ }
+ if (isExtended()) {
+ sndBar.setPushButtonPressed(strikethrough, view.isStrikethrough());
+ }
+ }
+
private void createDefBasicActions() {
ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -146,49 +162,33 @@
selectAll.setTextDescription(i18n.t("Select all"));
selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
- ActionToolbarPushButtonDescriptor<Object> bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
- public void onEvent() {
- view.toggleBold();
- }
- });
- bold.setIconCls(getCssName(imgResources.bold()));
- bold.setToolTip(i18n.t("Toggle Bold"));
- bold.setMustInitialyPressed(new ActionPressedCondition<Object>() {
- public boolean mustBePressed(Object param) {
- return view.isBold();
+ bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.toggleBold();
}
});
+ bold.setIconCls(getCssName(imgResources.bold()));
+ bold.setToolTip(i18n.t("Toggle Bold"));
bold.setShortcut(new ActionShortcut(true, 'B'));
- ActionToolbarPushButtonDescriptor<Object> italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
+ new Listener0() {
public void onEvent() {
view.toggleItalic();
}
});
italic.setIconCls(getCssName(imgResources.italic()));
italic.setToolTip(i18n.t("Toggle Italic"));
- italic.setMustInitialyPressed(new ActionPressedCondition<Object>() {
- public boolean mustBePressed(Object param) {
- return view.isItalic();
- }
- });
italic.setShortcut(new ActionShortcut(true, 'I'));
- ActionToolbarPushButtonDescriptor<Object> underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
+ new Listener0() {
public void onEvent() {
view.toggleUnderline();
}
});
- underline.setIconCls(imgResources.underline().getName());
+ underline.setIconCls(getCssName(imgResources.underline()));
underline.setToolTip(i18n.t("Toggle Underline"));
- underline.setMustInitialyPressed(new ActionPressedCondition<Object>() {
- public boolean mustBePressed(Object param) {
- return view.isUnderlined();
- }
- });
basicTopActions.add(withNoItem(selectAll));
basicSndActions.add(withNoItem(bold));
@@ -281,19 +281,14 @@
hr.setTextDescription(i18n.t("Horizontal line"));
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
- ActionToolbarPushButtonDescriptor<Object> strikethrough = new ActionToolbarPushButtonDescriptor<Object>(
- accessRol, ActionToolbarPosition.topbar, new Listener0() {
+ strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
+ new Listener0() {
public void onEvent() {
view.toggleStrikethrough();
}
});
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
- strikethrough.setMustInitialyPressed(new ActionPressedCondition<Object>() {
- public boolean mustBePressed(Object param) {
- return view.isStrikethrough();
- }
- });
extendedTopActions.add(withNoItem(undo));
extendedTopActions.add(withNoItem(redo));
@@ -307,7 +302,7 @@
}
private String getCssName(ImageResource imageResource) {
- return ".k-rte-" + imageResource.getName();
+ return "k-rte-" + imageResource.getName();
}
private boolean isExtended() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -9,6 +9,8 @@
void addComment(String userName);
+ boolean canBeBasic();
+
boolean canBeExtended();
void copy();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -1,84 +1,81 @@
package org.ourproject.kune.platf.client.ui.rte.img;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.libideas.resources.client.CssResource;
import com.google.gwt.libideas.resources.client.ImageResource;
import com.google.gwt.libideas.resources.client.ImmutableResourceBundle;
public interface RTEImgResources extends ImmutableResourceBundle {
- public static final RTEImgResources INSTANCE = GWT.create(RTEImgResources.class);
-
@Resource("alignleft.png")
- ImageResource alignleft();
+ public ImageResource alignleft();
@Resource("alignright.png")
- ImageResource alignright();
+ public ImageResource alignright();
@Resource("backcolor.png")
- ImageResource backcolor();
+ public ImageResource backcolor();
@Resource("bold.png")
- ImageResource bold();
+ public ImageResource bold();
@Resource("centerpara.png")
- ImageResource centerpara();
+ public ImageResource centerpara();
@Resource("charfontname.png")
- ImageResource charfontname();
+ public ImageResource charfontname();
@Resource("rteimg.css")
- CssResource css();
+ public CssResource css();
@Resource("decrementindent.png")
- ImageResource decrementindent();
+ public ImageResource decrementindent();
@Resource("defaultbullet.png")
- ImageResource defaultbullet();
+ public ImageResource defaultbullet();
@Resource("defaultnumbering.png")
- ImageResource defaultnumbering();
+ public ImageResource defaultnumbering();
@Resource("edithtml.png")
- ImageResource edithtml();
+ public ImageResource edithtml();
@Resource("fontcolor.png")
- ImageResource fontcolor();
+ public ImageResource fontcolor();
@Resource("fontheight.png")
- ImageResource fontheight();
+ public ImageResource fontheight();
@Resource("hfixedline.png")
- ImageResource hfixedline();
+ public ImageResource hfixedline();
@Resource("images.png")
- ImageResource images();
+ public ImageResource images();
@Resource("incrementindent.png")
- ImageResource incrementindent();
+ public ImageResource incrementindent();
@Resource("italic.png")
- ImageResource italic();
+ public ImageResource italic();
@Resource("link.png")
- ImageResource link();
+ public ImageResource link();
- @Resource("link_break.png")
- ImageResource link_break();
+ @Resource("linkbreak.png")
+ public ImageResource linkbreak();
@Resource("removeFormat.png")
- ImageResource removeFormat();
+ public ImageResource removeFormat();
@Resource("strikeout.png")
- ImageResource strikeout();
+ public ImageResource strikeout();
@Resource("subscript.png")
- ImageResource subscript();
+ public ImageResource subscript();
@Resource("superscript.png")
- ImageResource superscript();
+ public ImageResource superscript();
@Resource("underline.png")
- ImageResource underline();
+ public ImageResource underline();
}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png
===================================================================
(Binary files differ)
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/linkbreak.png (from rev 1054, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/linkbreak.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-03-03 15:10:55 UTC (rev 1056)
@@ -1,91 +1,91 @@
-@stripe .k-rte-underline {
+@sprite .x-btn-icon .k-rte-underline {
gwt-image: 'underline';
}
-@stripe .k-rte-superscript {
+@sprite .x-btn-icon .k-rte-superscript {
gwt-image: 'superscript';
}
-@stripe .k-rte-subscript {
+@sprite .x-btn-icon .k-rte-subscript {
gwt-image: 'subscript';
}
-@stripe .k-rte-strikeout {
+@sprite .x-btn-icon .k-rte-strikeout {
gwt-image: 'strikeout';
}
-@stripe .k-rte-removeFormat {
+@sprite .x-btn-icon .k-rte-removeFormat {
gwt-image: 'removeFormat';
}
-@stripe .k-rte-link {
+@sprite .x-btn-icon .k-rte-link {
gwt-image: 'link';
}
-@stripe .k-rte-link_break {
- gwt-image: 'link_break';
+@sprite .x-btn-icon .k-rte-linkbreak {
+ gwt-image: 'linkbreak';
}
-@stripe .k-rte-italic {
+@sprite .x-btn-icon .k-rte-italic {
gwt-image: 'italic';
}
-@stripe .k-rte-incrementindent {
+@sprite .x-btn-icon .k-rte-incrementindent {
gwt-image: 'incrementindent';
}
-@stripe .k-rte-images {
+@sprite .x-btn-icon .k-rte-images {
gwt-image: 'images';
}
-@stripe .k-rte-hfixedline {
+@sprite .x-btn-icon .k-rte-hfixedline {
gwt-image: 'hfixedline';
}
-@stripe .k-rte-fontheight {
+@sprite .x-btn-icon .k-rte-fontheight {
gwt-image: 'fontheight';
}
-@stripe .k-rte-fontcolor {
+@sprite .x-btn-icon .k-rte-fontcolor {
gwt-image: 'fontcolor';
}
-@stripe .k-rte-edithtml {
+@sprite .x-btn-icon .k-rte-edithtml {
gwt-image: 'edithtml';
}
-@stripe .k-rte-defaultnumbering {
+@sprite .x-btn-icon .k-rte-defaultnumbering {
gwt-image: 'defaultnumbering';
}
-@stripe .k-rte-defaultbullet {
+@sprite .x-btn-icon .k-rte-defaultbullet {
gwt-image: 'defaultbullet';
}
-@stripe .k-rte-decrementindent {
+@sprite .x-btn-icon .k-rte-decrementindent {
gwt-image: 'decrementindent';
}
-@stripe .k-rte-charfontname {
+@sprite .x-btn-icon .k-rte-charfontname {
gwt-image: 'charfontname';
}
-@stripe .k-rte-centerpara {
+@sprite .x-btn-icon .k-rte-centerpara {
gwt-image: 'centerpara';
}
-@stripe .k-rte-bold {
+@sprite .x-btn-icon .k-rte-bold {
gwt-image: 'bold';
}
-@stripe .k-rte-backcolor {
+@sprite .x-btn-icon .k-rte-backcolor {
gwt-image: 'backcolor';
}
-@stripe .k-rte-alignright {
+@sprite .x-btn-icon .k-rte-alignright {
gwt-image: 'alignright';
}
-@stripe .k-rte-alignleft {
+@sprite .x-btn-icon .k-rte-alignleft {
gwt-image: 'alignleft';
}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -1,30 +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 MessagePresenter {
-
- void resetMessage();
-
- void setMessage(final String message, final Level level);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java 2009-03-03 15:10:55 UTC (rev 1056)
@@ -1,95 +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.services.Images;
-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.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class SimpleMessagePanel extends HorizontalPanel {
- HTML message = null;
- Image messageIcon = null;
- private final Images images;
-
- public SimpleMessagePanel(Images images) {
- this.images = images;
- message = new HTML();
- messageIcon = new Image();
- add(messageIcon);
- add(message);
- setCellVerticalAlignment(messageIcon, VerticalPanel.ALIGN_MIDDLE);
- setVisible(false);
- setStyleName("kune-SiteMessagePanel");
- addStyleDependentName("info");
- images.info().applyTo(messageIcon);
- messageIcon.addStyleName("gwt-Image");
- message.setWidth("100%");
- this.setCellWidth(message, "100%");
- }
-
- public void adjustWidth(final int windowWidth) {
- final int messageWidth = windowWidth * 60 / 100 - 3;
- this.setWidth("" + messageWidth);
- }
-
- public void hide() {
- message.setText("");
- this.setVisible(false);
- }
-
- public void reset() {
- message.setText("");
- }
-
- public void setMessage(final String text) {
- this.message.setHTML(text);
- }
-
- public void setMessage(final String text, final Level lastMessageType, final Level type) {
- AbstractImagePrototype imagePrototype = null;
- switch (type) {
- case error:
- imagePrototype = images.error();
- break;
- case veryImportant:
- imagePrototype = images.important();
- break;
- case important:
- imagePrototype = images.emblemImportant();
- break;
- case info:
- imagePrototype = images.info();
- break;
- }
- imagePrototype.applyTo(messageIcon);
- removeStyleDependentName(lastMessageType.toString());
- addStyleDependentName(type.toString());
- setMessage(text);
- }
-
- public void show() {
- this.setVisible(true);
- }
-}
1
0
Author: vjrj
Date: 2009-03-03 02:35:36 +0100 (Tue, 03 Mar 2009)
New Revision: 1055
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentIconsRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserActionRegistry.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationToolbar.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentEditorActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/CustomPushButton.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedBorderDecorator.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/TitledPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/UIConstants.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/
Modified:
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/registry/ContentCapabilitiesRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.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/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -25,8 +25,6 @@
import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_UPLOADEDFILE;
import org.ourproject.kune.blogs.client.cnt.BlogViewer;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -36,7 +34,9 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -29,9 +29,6 @@
import org.ourproject.kune.blogs.client.cnt.BlogViewerView;
import org.ourproject.kune.blogs.client.ctx.BlogContext;
import org.ourproject.kune.blogs.client.ctx.BlogContextPresenter;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -43,7 +40,10 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,13 +21,13 @@
import org.ourproject.kune.blogs.client.BlogClientTool;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,13 +20,13 @@
package org.ourproject.kune.blogs.client.cnt;
import org.ourproject.kune.blogs.client.BlogClientTool;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -27,14 +27,14 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.wiki.client.WikiClientTool;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -27,9 +27,6 @@
import org.ourproject.kune.chat.client.ctx.room.AddRoom;
import org.ourproject.kune.chat.client.ctx.room.AddRoomPanel;
import org.ourproject.kune.chat.client.ctx.room.AddRoomPresenter;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
@@ -39,7 +36,10 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,7 +21,6 @@
import org.ourproject.kune.chat.client.ChatClientTool;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -29,6 +28,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -25,8 +25,6 @@
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
import org.ourproject.kune.docs.client.cnt.DocumentViewer;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -36,7 +34,9 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -29,9 +29,6 @@
import org.ourproject.kune.docs.client.cnt.DocumentViewerView;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -43,7 +40,10 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,12 +21,12 @@
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,13 +20,13 @@
package org.ourproject.kune.docs.client.cnt;
import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -24,8 +24,6 @@
import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_UPLOADEDFILE;
import org.ourproject.kune.gallery.client.cnt.GalleryViewer;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -35,7 +33,9 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -29,9 +29,6 @@
import org.ourproject.kune.gallery.client.cnt.GalleryViewerView;
import org.ourproject.kune.gallery.client.ctx.GalleryContext;
import org.ourproject.kune.gallery.client.ctx.GalleryContextPresenter;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -43,7 +40,10 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,7 +21,6 @@
import org.ourproject.kune.gallery.client.GalleryClientTool;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
@@ -31,6 +30,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,13 +20,13 @@
package org.ourproject.kune.gallery.client.cnt;
import org.ourproject.kune.gallery.client.GalleryClientTool;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.client.actions;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.ImageDescriptor;
import com.calclab.suco.client.events.Listener;
@@ -222,8 +223,8 @@
return shortcut;
}
- public String getShortcutToS() {
- return shortcut == null ? "" : shortcut.toString();
+ public String getShortcutToS(I18nTranslationService i18n) {
+ return shortcut == null ? "" : shortcut.toString(i18n);
}
/**
@@ -244,6 +245,10 @@
return toolTip;
}
+ public boolean hasShortcut() {
+ return shortcut != null;
+ }
+
/**
* Checks if is must be confirmed.
*
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -6,9 +6,14 @@
public class ActionShortcut {
+ private static boolean has(int modifiers, int modifier) {
+ return ((modifiers & modifier) == modifier);
+ }
+
final boolean alt;
final boolean ctrl;
final boolean shift;
+
final char key;
public ActionShortcut(boolean alt, boolean ctrl, boolean shift, char key) {
@@ -26,6 +31,49 @@
this(false, ctrl, false, key);
}
+ public ActionShortcut(char key, int modifiers) {
+ this(has(modifiers, KeyboardListener.MODIFIER_ALT), has(modifiers, KeyboardListener.MODIFIER_CTRL), has(
+ modifiers, KeyboardListener.MODIFIER_SHIFT), key);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ActionShortcut other = (ActionShortcut) obj;
+ if (alt != other.alt) {
+ return false;
+ }
+ if (ctrl != other.ctrl) {
+ return false;
+ }
+ if (key != other.key) {
+ return false;
+ }
+ if (shift != other.shift) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (alt ? 1231 : 1237);
+ result = prime * result + (ctrl ? 1231 : 1237);
+ result = prime * result + key;
+ result = prime * result + (shift ? 1231 : 1237);
+ return result;
+ }
+
public boolean is(char keyCode, int modifiers) {
return (keyCode == keyCode && same(modifiers, KeyboardListener.MODIFIER_ALT, alt)
&& same(modifiers, KeyboardListener.MODIFIER_CTRL, ctrl) && same(modifiers,
@@ -33,7 +81,7 @@
}
public boolean same(int modifiers, int modifier, boolean keyValue) {
- return (((modifiers & modifier) == modifier) == keyValue);
+ return (has(modifiers, modifier) == keyValue);
}
public String toString(I18nTranslationService i18n) {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,25 +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.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ContentActionRegistry extends ActionRegistry<StateToken> {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentEditorActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentEditorActionRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentEditorActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,6 +0,0 @@
-package org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ContentEditorActionRegistry extends ActionRegistry<StateToken> {
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,78 +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.platf.client.actions;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-
-public class ContentIconsRegistry {
- private final HashMap<String, String> contentTypesIcons;
-
- public ContentIconsRegistry() {
- contentTypesIcons = new HashMap<String, String>();
- }
-
- public String getContentTypeIcon(final String typeId) {
- final String icon = contentTypesIcons.get(typeId);
- return icon == null ? "" : icon;
- }
-
- /**
- * If there is a specific icon for a type/subtype pair or a generic type
- * icon in defect
- *
- * @param typeId
- * the kune typeId (see *ClientTool)
- * @param mimeType
- * @return
- */
- public String getContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType) {
- String icon = getContentTypeIcon(concatenate(typeId, mimeType));
- if (icon.equals("")) {
- if (mimeType == null) {
- return getContentTypeIcon(typeId);
- }
- } else {
- return icon;
- }
- final String subtype = mimeType.getSubtype();
- if (subtype != null && subtype.length() > 0) {
- icon = getContentTypeIcon(typeId, new BasicMimeTypeDTO(mimeType.getType()));
- }
- return icon.equals("") ? getContentTypeIcon(typeId) : icon;
- }
-
- public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
- registerContentTypeIcon(concatenate(typeId, mimeType), iconUrl);
- }
-
- public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
- contentTypesIcons.put(contentTypeId, iconUrl);
- }
-
- private String concatenate(final String typeId, final BasicMimeTypeDTO mimeType) {
- if (mimeType != null) {
- return typeId + "|" + mimeType;
- } else {
- return typeId;
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,25 +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.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ContextActionRegistry extends ActionRegistry<StateToken> {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -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.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-/**
- * The Class GroupActionRegistry stores actions over groups (mainly used in SN)
- */
-public class GroupActionRegistry extends ActionRegistry<StateToken> {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,31 +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.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-
-/**
- * The Class UserActionRegistry.
- *
- * List of actions over a user (initially used for buddies actions)
- *
- */
-public class UserActionRegistry extends ActionRegistry<UserSimpleDTO> {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,26 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-
-public interface ActionBuddiesSummaryToolbar extends ActionToolbar<UserSimpleDTO> {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,31 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-
-public class ActionBuddiesSummaryToolbarPresenter extends ActionToolbarPresenter<UserSimpleDTO> implements
- ActionBuddiesSummaryToolbar {
-
- public ActionBuddiesSummaryToolbarPresenter(ActionToolbarView<UserSimpleDTO> toolbar) {
- super(toolbar);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,26 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface ActionContentToolbar extends ActionToolbar<StateToken> {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,30 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ActionContentToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContentToolbar {
-
- public ActionContentToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
- super(toolbar);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,26 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface ActionContextToolbar extends ActionToolbar<StateToken> {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,30 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ActionContextToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContextToolbar {
-
- public ActionContextToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
- super(toolbar);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,26 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface ActionGroupSummaryToolbar extends ActionToolbar<StateToken> {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,30 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ActionGroupSummaryToolbarPresenter extends ActionToolbarPresenter<StateToken> implements
- ActionGroupSummaryToolbar {
-
- public ActionGroupSummaryToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
- super(toolbar);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,31 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public class ActionParticipationSummaryToolbarPresenter extends ActionToolbarPresenter<StateToken> implements
- ActionParticipationToolbar {
-
- public ActionParticipationSummaryToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
- super(toolbar);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,26 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface ActionParticipationToolbar extends ActionToolbar<StateToken> {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -33,6 +33,6 @@
ActionToolbarView<T> getView();
- void setActions(ActionItemCollection<T> actionItemCollection);
+ void addActions(ActionItemCollection<T> actionItemCollection);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -24,6 +24,8 @@
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItem;
import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.ActionPressedCondition;
+import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
@@ -32,6 +34,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import com.allen_sauer.gwt.log.client.Log;
@@ -56,8 +59,10 @@
private final Provider<ActionManager> actionManagerProvider;
protected final SimpleToolbar topbar;
protected final SimpleToolbar bottombar;
+ private final I18nTranslationService i18n;
- public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider) {
+ public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, I18nTranslationService i18n) {
+ this.i18n = i18n;
topbar = new SimpleToolbar();
bottombar = new SimpleToolbar();
topbar.setWidth("100%");
@@ -86,8 +91,8 @@
}
if (action instanceof ActionToolbarPushButtonDescriptor) {
button.setEnableToggle(true);
- button.setPressed(((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed().mustBePressed(
- item));
+ ActionPressedCondition<T> mustInitialyPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
+ button.setPressed(mustInitialyPressed != null && mustInitialyPressed.mustBePressed(item));
}
button.addListener(new ButtonListenerAdapter() {
@Override
@@ -101,7 +106,9 @@
if (iconCls != null) {
button.setIconCls(iconCls);
}
- button.setTooltip(action.getToolTip());
+ String toolTip = action.getToolTip();
+ ActionShortcut shortcut = action.getShortcut();
+ button.setTooltip((toolTip == null ? "" : toolTip) + (shortcut != null ? shortcut.toString(i18n) : ""));
setEnableButton(button, enable);
final SimpleToolbar toolbar = getToolbar(pos);
@@ -192,18 +199,18 @@
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
final Item item;
if (action instanceof ActionToolbarMenuRadioDescriptor) {
- CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS());
+ CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS(i18n));
ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
checkItem.setGroup(radioDescriptor.getGroup());
checkItem.setChecked(radioDescriptor.mustBeChecked());
item = checkItem;
} else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
- CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS());
+ CheckItem checkItem = new CheckItem(action.getText() + action.getShortcutToS(i18n));
ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
item = checkItem;
} else {
- item = new Item(action.getText() + action.getShortcutToS());
+ item = new Item(action.getText() + action.getShortcutToS(i18n));
}
BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -56,7 +56,7 @@
return view;
}
- public void setActions(final ActionItemCollection<T> actions) {
+ public void addActions(final ActionItemCollection<T> actions) {
for (final ActionItem<T> actionItem : actions) {
final ActionDescriptor<T> action = actionItem.getAction();
if (actionItem.mustBeAdded()) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/registry/ContentCapabilitiesRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/registry/ContentCapabilitiesRegistry.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/registry/ContentCapabilitiesRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.platf.client.registry;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
public class ContentCapabilitiesRegistry {
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-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -19,7 +19,8 @@
\*/
package org.ourproject.kune.platf.client.services;
-import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
+import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
@@ -46,13 +47,19 @@
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePanel;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePresenter;
+import org.ourproject.kune.platf.client.ui.rte.RTEActionSndToolbar;
+import org.ourproject.kune.platf.client.ui.rte.RTEActionSndToolbarPresenter;
+import org.ourproject.kune.platf.client.ui.rte.RTEActionTopToolbar;
+import org.ourproject.kune.platf.client.ui.rte.RTEActionTopToolbarPresenter;
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPanel;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPresenter;
+import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.ioc.decorator.NoDecoration;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
import com.calclab.suco.client.ioc.module.Factory;
@@ -202,19 +209,42 @@
}
});
- register(Singleton.class, new Factory<RTEditor>(RTEditor.class) {
+ register(NoDecoration.class, new Factory<RTEActionTopToolbar>(RTEActionTopToolbar.class) {
@Override
+ public RTEActionTopToolbar create() {
+ final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class), i18n);
+ final RTEActionTopToolbarPresenter toolbar = new RTEActionTopToolbarPresenter(panel);
+ return toolbar;
+ }
+ }, new Factory<RTEActionSndToolbar>(RTEActionSndToolbar.class) {
+ @Override
+ public RTEActionSndToolbar create() {
+ final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class), i18n);
+ final RTEActionSndToolbarPresenter toolbar = new RTEActionSndToolbarPresenter(panel);
+ return toolbar;
+ }
+ });
+
+ register(NoDecoration.class, new Factory<RTEditor>(RTEditor.class) {
+ @Override
public RTEditor create() {
- final RTEditorPresenter presenter = new RTEditorPresenter($(ContentEditorActionRegistry.class),
- $(I18nTranslationService.class), $(Session.class), RTEImgResources.INSTANCE);
- final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class));
+ RTEActionTopToolbar topBar = $(RTEActionTopToolbar.class);
+ RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
+ final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
+ $(Session.class), topBar, sndBar, RTEImgResources.INSTANCE);
+ final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
+ $(ActionManager.class));
presenter.init(panel);
return presenter;
}
});
+ register(NoDecoration.class, new Factory<TestRTEDialog>(TestRTEDialog.class) {
+ @Override
+ public TestRTEDialog create() {
+ return new TestRTEDialog($(RTEditor.class));
+ }
+ });
- // ew TestRTEDialog($(RTEditor.class));
-
register(ApplicationComponentGroup.class, new Factory<NotifyUser>(NotifyUser.class) {
@Override
public NotifyUser create() {
@@ -227,5 +257,9 @@
$(Application.class).start();
// $(HelloWorld.class);
+ // $(TestRTEDialog.class);
+ // $(TestRTEDialog.class);
+ // $(TestRTEDialog.class);
+
}
}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/CustomPushButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/CustomPushButton.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/CustomPushButton.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,52 +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.platf.client.ui;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.PushButton;
-
-public class CustomPushButton extends Composite {
-
- private final PushButton button;
-
- public CustomPushButton(final String text, final ClickListener listener) {
- button = new PushButton(text, listener);
- RoundedBorderDecorator roundedButton = new RoundedBorderDecorator(button, RoundedBorderDecorator.ALL,
- RoundedBorderDecorator.SIMPLE);
- initWidget(roundedButton);
- roundedButton.setColor("#AAA");
- button.setStyleName("kune-CustomPushButton");
- this.addStyleName("kune-CustomPushButton-space");
- }
-
- public boolean isEnabled() {
- return button.isEnabled();
- }
-
- public void setEnabled(final boolean enabled) {
- button.setEnabled(enabled);
- }
-
- public void setText(final String text) {
- button.setText(text);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedBorderDecorator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedBorderDecorator.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedBorderDecorator.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,284 +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.platf.client.ui;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.ComplexPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <p>
- * A Panel to create rounded corners similar to other known Google(tm)
- * applications. Basically the html of the rounded corners looks as follows
- * (with some extra styling to make it really work):
- * </p>
- *
- * <pre>
- * <div&gt
- * <div style="margin:0 2px"></div>
- * <div style="margin:0 1px"></div>
- * <div>your widget</div>
- * <div style="margin:0 1px">&lt/div>
- * <div style="margin:0 2px">&lt/div>
- * </div>
- * </pre>
- *
- * <p>
- * Use the class as follows:
- * </p>
- * <p>
- * Create panel with all corners rounded:
- * </p>
- *
- * <pre>
- * // all 4 corners are rounded.
- * RoundedPanel rp = new RoundedPanel();
- * </pre>
- *
- * <p>
- * or with custom set corners, like only on the left
- * </p>
- *
- * <pre>
- * // custom set corners
- * RoundedPanel rp = new RoundedPanel(corners);
- * </pre>
- *
- * <p>
- * By default the classname assigned to the rounded corners is "rp". You need
- * this to set the color of the rounded corners to match the rest of you widget.
- * e.g. <code>.rp { background-color:#c3d9ff; }</code> If you want another class
- * name, use the method <code>setLineStyleName</code>.
- * </p>
- *
- * @author Hilbrand Bouwkamp(hs(a)bouwkamp.com)
- * @version 1.2
- *
- * adapted by Vicente J. Ruiz Jurado and danigb for kune
- */
-
-public class RoundedBorderDecorator extends ComplexPanel implements HasColor {
- /**
- * <code>TOPLEFT</code> top left rounded corner
- */
- public final static int TOPLEFT = 1;
- /**
- * <code>TOPRIGHT</code> top right rounded corner
- */
- public final static int TOPRIGHT = 2;
- /**
- * <code>BOTTOMLEFT</code> bottom left rounded corner
- */
- public final static int BOTTOMLEFT = 4;
- /**
- * <code>BOTTOMRIGHT</code> bottom right rounded corner
- */
- public final static int BOTTOMRIGHT = 8;
- /**
- * <code>BOTTOM</code> rounded corners at the top
- */
- public final static int TOP = TOPLEFT | TOPRIGHT;
- /**
- * <code>TOP</code> rounded corners at the bottom
- */
- public final static int BOTTOM = BOTTOMLEFT | BOTTOMRIGHT;
- /**
- * <code>LEFT</code> rounded corners on the left side
- */
- public final static int LEFT = TOPLEFT | BOTTOMLEFT;
- /**
- * <code>RIGHT</code> rounded corners on the right side
- */
- public final static int RIGHT = TOPRIGHT | BOTTOMRIGHT;
- /**
- * <code>ALL</code> rounded corners on all sides
- */
- public final static int ALL = TOP | BOTTOM;
-
- /**
- * <code>ALL</code> rounded corners of size 1px
- */
- public final static int SIMPLE = 1;
-
- /**
- * <code>DOUBLE</code> rounded corners of size 2px
- */
- public final static int DOUBLE = 2;
-
- // private Element variables
- private final Element body; // body of widget
- private Element div2t; // margin 2 top line
- private Element div1t; // margin 1 top line
- private final Element divElement; // div element containing widget
- private Element div1b; // margin 1 bottom line
- private Element div2b; // margin 2 bottom line
- private String color;
-
- /**
- * <p>
- * Creates a new <code>RoundedPanel</code> with custom rounded corners on
- * the given widget <code>w</code>. Every combination of corners can be set
- * via the <code>corners</code> argument. Use the static constants to set
- * the corners. For example if you want to create a panel with only rounded
- * corners at the left, use:<br>
- * <code>new RoundedPanel(yourWidget, RoundedPanel.LEFT);</code>
- * </p>
- *
- * @param corners
- * set custom rounded corners.
- * @param decorated
- * widget to add corners to.
- *
- * @param size
- * size of the corners: DOUBLE (2px) or SIMPLE (1px)
- */
- public RoundedBorderDecorator(final Widget decorated, final int corners, final int size) {
- body = DOM.createDiv();
- if (is(corners, TOP)) {
- if (is(size, DOUBLE)) {
- div2t = createLine(corners & TOP, '2');
- DOM.appendChild(body, div2t);
- }
- div1t = createLine(corners & TOP, '1');
- DOM.appendChild(body, div1t);
- }
- divElement = DOM.createDiv();
- DOM.appendChild(body, divElement);
- if (is(corners, BOTTOM)) {
- div1b = createLine(corners & BOTTOM, '1');
- DOM.appendChild(body, div1b);
- if (is(size, DOUBLE)) {
- div2b = createLine(corners & BOTTOM, '2');
- DOM.appendChild(body, div2b);
- }
- }
- setElement(body);
- add(decorated, divElement);
- setColor("CCC");
- }
-
- public RoundedBorderDecorator(final Widget decorated, final int corners) {
- this(decorated, corners, DOUBLE);
- }
-
- /**
- * <p>
- * Creates div element representing part of the rounded corner.
- * </p>
- *
- * @param corner
- * corner mask to set rounded corner.
- * @param width
- * margin width for line.
- */
- private Element createLine(final int corner, final char width) {
- // margin 2 fields : top/bottom right/left => "0 <width>px"
- // margin 4 fields : top right bottom left => "0 <width>px 0
- // <width>px"
- final String margin = corner == TOP || corner == BOTTOM ? "0 " + width + "px" : is(corner, LEFT) ? "0 0 0 "
- + width + "px" : "0 " + width + "px 0 0";
- final Element div = DOM.createDiv();
- DOM.setStyleAttribute(div, "fontSize", "0px");
- DOM.setStyleAttribute(div, "height", "1px");
- DOM.setStyleAttribute(div, "lineHeight", "1px");
- DOM.setStyleAttribute(div, "margin", margin);
- DOM.setInnerHTML(div, " ");
- return div;
- }
-
- // convience method for mask test
- private boolean is(final int input, final int mask) {
- return (input & mask) > 0;
- }
-
- /**
- * <p>
- * Set the style of the RoundedPanel. In most cases this is not necessary
- * and setting the style on the widget to which the
- * <code>RoundedPanel</code> is applied should be set, as is done when not
- * using the RoundedPanel</code>
- * </p>
- *
- * @param style
- * css style name
- */
- public void setStyleName(final String style) {
- DOM.setElementProperty(body, "className", style);
- }
-
- /**
- * <p>
- * Set the css style name of the rounded corners div's. Default the css
- * stylename is <code>rp</code>. Use it to set the colors of the corner. For
- * example: <code>.rp { background-color:#c3d9ff; }</code>.
- * </p>
- * <p>
- * A custom style might be needed when the corners are visible only when a
- * panel is selected. Use this method to set the custom style name and add
- * something like the following to the stylesheet:<br>
- * .selected .rp { background-color:#c3d9ff; }
- * </p>
- *
- * @param style
- * css style name.
- */
- public void setCornerStyleName(final String style) {
- if (null != div2t) {
- DOM.setElementProperty(div2t, "className", style);
- }
- if (null != div1t) {
- DOM.setElementProperty(div1t, "className", style);
- }
- if (null != div1b) {
- DOM.setElementProperty(div1b, "className", style);
- }
- if (null != div2b) {
- DOM.setElementProperty(div2b, "className", style);
- }
- if (null != divElement) {
- DOM.setElementProperty(divElement, "className", style);
- }
- }
-
- public void setColor(final String color) {
- this.color = color;
- if (null != div2t) {
- DOM.setStyleAttribute(div2t, "backgroundColor", color);
- }
- if (null != div1t) {
- DOM.setStyleAttribute(div1t, "backgroundColor", color);
- }
- if (null != div1b) {
- DOM.setStyleAttribute(div1b, "backgroundColor", color);
- }
- if (null != div2b) {
- DOM.setStyleAttribute(div2b, "backgroundColor", color);
- }
- if (null != divElement) {
- DOM.setStyleAttribute(divElement, "backgroundColor", color);
- }
- }
-
- public String getColor() {
- return color;
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/TitledPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/TitledPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/TitledPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,122 +0,0 @@
-
-/*
- * Copyright 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A panel that wraps its contents in a border with a title that appears in the
- * upper left corner of the border. This is an implementation of the fieldset
- * HTML element.
- */
-public class TitledPanel extends SimplePanel {
- /**
- * Implementation class for TitledPanel.
- */
- public static class TitledPanelImpl {
- /**
- * Set the title of a fieldset element.
- */
- public void setTitle(final Element fieldset, final Element legend, final String title) {
- if (title != "" && title != null) {
- DOM.setInnerHTML(legend, title);
- DOM.insertChild(fieldset, legend, 0);
- } else if (DOM.getParent(legend) != null) {
- DOM.removeChild(fieldset, legend);
- }
- }
- }
-
- /**
- * Implementation class for TitledPanel that handles Mozilla rendering
- * issues.
- */
- public static class TitledPanelImplMozilla extends TitledPanelImpl {
- public void setTitle(final Element fieldset, final Element legend, final String title) {
- DOM.setStyleAttribute(fieldset, "display", "none");
- super.setTitle(fieldset, legend, title);
- DOM.setStyleAttribute(fieldset, "display", "");
- }
- }
-
- /**
- * The implementation instance.
- */
- private static TitledPanelImpl impl = (TitledPanelImpl) GWT.create(TitledPanelImpl.class);
-
- /**
- * The legend used as the title.
- */
- private final Element legend;
-
- /**
- * The title.
- */
- private String title;
-
- /**
- * Constructor.
- *
- * @param title
- * the title to display
- */
- public TitledPanel(final String title) {
- super(DOM.createElement("fieldset"));
- legend = DOM.createElement("legend");
- DOM.appendChild(getElement(), legend);
- setTitle(title);
- }
-
- /**
- * Constructor.
- *
- * @param title
- * the title to display
- * @param w
- * the widget to add to the panel
- */
- public TitledPanel(final String title, final Widget w) {
- this(title);
- setWidget(w);
- }
-
- /**
- * Get the current title.
- *
- * @return the title of the panel
- */
- public String getTitle() {
- return this.title;
- }
-
- /**
- * Set the title in the border. Pass in null or an empty string to remove
- * the title completely, leaving just a box.
- *
- * @param title
- * the new title
- */
- public void setTitle(final String title) {
- this.title = title;
- impl.setTitle(getElement(), legend, title);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/UIConstants.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/UIConstants.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/UIConstants.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,27 +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.platf.client.ui;
-
-public interface UIConstants {
-
- String ICON_HORIZ_ALIGN_RIGHT = "right";
- String ICON_HORIZ_ALIGN_LEFT = "left";
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,38 +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.platf.client.ui;
-
-import org.ourproject.kune.platf.client.View;
-
-import com.google.gwt.user.client.ui.Label;
-
-public class UnknowComponent extends Label implements View {
-
- public static final UnknowComponent instance = new UnknowComponent();
-
- public UnknowComponent() {
- super("programming error: unknown component!! please contact kune-devel(a)lists-ourproject.org");
- }
-
- public View getView() {
- return this;
- }
-
-}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+
+public interface RTEActionSndToolbar extends ActionToolbar<Object> {
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionSndToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,12 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+
+public class RTEActionSndToolbarPresenter extends ActionToolbarPresenter<Object> implements RTEActionSndToolbar {
+
+ public RTEActionSndToolbarPresenter(ActionToolbarView<Object> toolbar) {
+ super(toolbar);
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+
+public interface RTEActionTopToolbar extends ActionToolbar<Object> {
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbarPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEActionTopToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,12 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+
+public class RTEActionTopToolbarPresenter extends ActionToolbarPresenter<Object> implements RTEActionTopToolbar {
+
+ public RTEActionTopToolbarPresenter(ActionToolbarView<Object> toolbar) {
+ super(toolbar);
+ }
+
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -3,19 +3,21 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+import org.ourproject.kune.platf.client.ui.rte.RTEditorPresenter.ActionPosition;
public interface RTEditor {
- void addBasicAction(ActionDescriptor<Object> action);
+ void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position);
- void addBasicActions(ActionCollection<Object> actions);
+ void addActions(ActionCollection<Object> actions, boolean basic, ActionPosition position);
- void addExtendedAction(ActionDescriptor<Object> action);
+ void editContent(String content);
- void addExtendedActions(ActionCollection<Object> actions);
+ ActionToolbar<Object> getSndBar();
- void editContent(String content);
+ ActionToolbar<Object> getTopBar();
View getView();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,9 +1,15 @@
package org.ourproject.kune.platf.client.ui.rte;
import java.util.Date;
+import java.util.HashMap;
-import org.ourproject.kune.platf.client.actions.ActionCollection;
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionItemCollection;
+import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.BasicFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.ExtendedFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
@@ -13,6 +19,7 @@
import com.google.gwt.dom.client.Element;
import com.google.gwt.libideas.client.StyleInjector;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.KeyboardListener;
import com.google.gwt.user.client.ui.Widget;
public class RTEditorPanel implements RTEditorView {
@@ -21,19 +28,34 @@
private final RichTextArea rta;
private final BasicFormatter basic;
private final ExtendedFormatter extended;
+ private final HashMap<ActionShortcut, ActionItem<Object>> shortcuts;
+ private final ActionManager actionManager;
- public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n) {
+ public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n, ActionManager actionManager) {
this.i18n = i18n;
+ this.actionManager = actionManager;
rta = new RichTextArea();
basic = rta.getBasicFormatter();
extended = rta.getExtendedFormatter();
StyleInjector.injectStylesheet(RTEImgResources.INSTANCE.css().getText());
+ shortcuts = new HashMap<ActionShortcut, ActionItem<Object>>();
+ createListeners();
}
+ public void addActions(ActionItemCollection<Object> actionItems) {
+ for (ActionItem<Object> actionItem : actionItems) {
+ ActionDescriptor<Object> action = actionItem.getAction();
+ if (action.hasShortcut()) {
+ ActionShortcut shortcut = action.getShortcut();
+ shortcuts.put(shortcut, actionItem);
+ }
+ }
+ }
+
public void addComment(String userName) {
String time = i18n.formatDateWithLocale(new Date());
Element span = DOM.createSpan();
- span.setInnerText(i18n.t("type here") + " -" + userName + time);
+ span.setInnerText(i18n.t("type here") + " -" + userName + " " + time);
DOM.setElementAttribute((com.google.gwt.user.client.Element) span, "backgroundColor", "rgb(255,255,215");
// FIXME: addCustomStyle
insertHtml(span.getString());
@@ -88,27 +110,27 @@
}
public boolean isBold() {
- return basic.isBold();
+ return rta.isAttached() && basic.isBold();
}
public boolean isItalic() {
- return basic.isItalic();
+ return rta.isAttached() && basic.isItalic();
}
public boolean isStrikethrough() {
- return extended.isStrikethrough();
+ return rta.isAttached() && extended.isStrikethrough();
}
public boolean isSubscript() {
- return basic.isSubscript();
+ return rta.isAttached() && basic.isSubscript();
}
public boolean isSuperscript() {
- return basic.isSuperscript();
+ return rta.isAttached() && basic.isSuperscript();
}
public boolean isUnderlined() {
- return basic.isUnderlined();
+ return rta.isAttached() && basic.isUnderlined();
}
public void justifyCenter() {
@@ -147,10 +169,6 @@
basic.selectAll();
}
- public void setActions(ActionCollection<Object> actions) {
- // TODO Auto-generated method stub
- }
-
public void setFontName(String name) {
basic.setFontName(name);
}
@@ -216,4 +234,34 @@
public void unlink() {
extended.removeLink();
}
+
+ private void createListeners() {
+ rta.addKeyboardListener(new KeyboardListener() {
+ public void onKeyDown(final Widget sender, final char keyCode, final int modifiers) {
+ }
+
+ public void onKeyPress(final Widget sender, final char keyCode, final int modifiers) {
+ }
+
+ public void onKeyUp(final Widget sender, final char keyCode, final int modifiers) {
+ if (sender == rta) {
+ // We use the RichTextArea's onKeyUp event to update the
+ // toolbar status.
+ // This will catch any cases where the user moves the cursor
+ // using the keyboard, or uses one of the browser's built-in
+ // keyboard shortcuts.
+
+ // updateStatus();
+ // fireEdit();
+ if (modifiers != 0) {
+ ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
+ if (actionItem != null) {
+ NotifyUser.info("Shortcut");
+ actionManager.doAction(actionItem);
+ }
+ }
+ }
+ }
+ });
+ }
}
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-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -4,12 +4,14 @@
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionPressedCondition;
import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
@@ -17,9 +19,14 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.libideas.resources.client.ImageResource;
public class RTEditorPresenter implements RTEditor {
+ public enum ActionPosition {
+ top, snd
+ };
+
private static final String EDIT_MENU = "Edit";
private static final String INSERT_MENU = "Insert";
private RTEditorView view;
@@ -27,39 +34,77 @@
private AccessRolDTO accessRol;
private final I18nTranslationService i18n;
private final Session session;
- private final ActionCollection<Object> extendedActions;
- private final ActionCollection<Object> basicActions;
+ private final ActionItemCollection<Object> basicTopActions;
+ private final ActionItemCollection<Object> basicSndActions;
+ private final ActionItemCollection<Object> extendedTopActions;
+ private final ActionItemCollection<Object> extendedSndActions;
private final RTEImgResources imgResources;
+ private final RTEActionTopToolbar topBar;
+ private final RTEActionSndToolbar sndBar;
- public RTEditorPresenter(ContentEditorActionRegistry contentEditorActionRegistry, I18nTranslationService i18n,
- Session session, RTEImgResources imgResources) {
+ public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
+ RTEActionSndToolbar sndBar, RTEImgResources imgResources) {
this.i18n = i18n;
this.session = session;
+ this.topBar = topBar;
+ this.sndBar = sndBar;
+ sndBar.attach();
this.imgResources = imgResources;
extended = true;
accessRol = AccessRolDTO.Editor;
- extendedActions = createDefExtendedActions();
- basicActions = createDefBasicActions();
+ basicTopActions = new ActionItemCollection<Object>();
+ basicSndActions = new ActionItemCollection<Object>();
+ extendedTopActions = new ActionItemCollection<Object>();
+ extendedSndActions = new ActionItemCollection<Object>();
}
- public void addBasicAction(ActionDescriptor<Object> action) {
- basicActions.add(action);
+ public void addAction(ActionDescriptor<Object> action, boolean basic, ActionPosition position) {
+ switch (position) {
+ case top:
+ if (basic) {
+ basicTopActions.add(withNoItem(action));
+ } else {
+ extendedTopActions.add(withNoItem(action));
+ }
+ break;
+ case snd:
+ if (basic) {
+ basicSndActions.add(withNoItem(action));
+ } else {
+ extendedSndActions.add(withNoItem(action));
+ }
+ break;
+ }
}
- public void addBasicActions(ActionCollection<Object> actions) {
- basicActions.addAll(actions);
+ public void addActions(ActionCollection<Object> actions, boolean basic, ActionPosition position) {
+ switch (position) {
+ case top:
+ if (basic) {
+ basicTopActions.addAll(withNoItem(actions));
+ } else {
+ extendedTopActions.addAll(withNoItem(actions));
+ }
+ break;
+ case snd:
+ if (basic) {
+ basicSndActions.addAll(withNoItem(actions));
+ } else {
+ extendedSndActions.addAll(withNoItem(actions));
+ }
+ break;
+ }
}
- public void addExtendedAction(ActionDescriptor<Object> action) {
- extendedActions.add(action);
+ public void editContent(String content) {
}
- public void addExtendedActions(ActionCollection<Object> actions) {
- extendedActions.addAll(actions);
+ public ActionToolbar<Object> getSndBar() {
+ return sndBar;
}
- public void editContent(String content) {
- view.setActions(extendedActions);
+ public ActionToolbar<Object> getTopBar() {
+ return topBar;
}
public View getView() {
@@ -68,6 +113,18 @@
public void init(RTEditorView view) {
this.view = view;
+ createDefBasicActions();
+ topBar.addActions(basicTopActions);
+ sndBar.addActions(basicSndActions);
+ view.addActions(basicTopActions);
+ view.addActions(basicSndActions);
+ if (isExtended()) {
+ createDefExtendedActions();
+ view.addActions(extendedTopActions);
+ view.addActions(extendedSndActions);
+ topBar.addActions(extendedTopActions);
+ sndBar.addActions(extendedSndActions);
+ }
}
public void setAccessRol(AccessRolDTO accessRol) {
@@ -78,9 +135,7 @@
this.extended = extended;
}
- private ActionCollection<Object> createDefBasicActions() {
- ActionCollection<Object> actions = new ActionCollection<Object>();
-
+ private void createDefBasicActions() {
ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -97,13 +152,14 @@
view.toggleBold();
}
});
- bold.setIconCls(imgResources.bold().getName());
+ bold.setIconCls(getCssName(imgResources.bold()));
bold.setToolTip(i18n.t("Toggle Bold"));
bold.setMustInitialyPressed(new ActionPressedCondition<Object>() {
public boolean mustBePressed(Object param) {
return view.isBold();
}
});
+ bold.setShortcut(new ActionShortcut(true, 'B'));
ActionToolbarPushButtonDescriptor<Object> italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -111,13 +167,14 @@
view.toggleItalic();
}
});
- italic.setIconCls(imgResources.italic().getName());
+ italic.setIconCls(getCssName(imgResources.italic()));
italic.setToolTip(i18n.t("Toggle Italic"));
italic.setMustInitialyPressed(new ActionPressedCondition<Object>() {
public boolean mustBePressed(Object param) {
return view.isItalic();
}
});
+ italic.setShortcut(new ActionShortcut(true, 'I'));
ActionToolbarPushButtonDescriptor<Object> underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -133,17 +190,13 @@
}
});
- actions.add(bold);
- actions.add(italic);
- actions.add(underline);
- actions.add(selectAll);
-
- return actions;
+ basicTopActions.add(withNoItem(selectAll));
+ basicSndActions.add(withNoItem(bold));
+ basicSndActions.add(withNoItem(italic));
+ basicSndActions.add(withNoItem(underline));
}
- private ActionCollection<Object> createDefExtendedActions() {
- ActionCollection<Object> actions = new ActionCollection<Object>();
-
+ private void createDefExtendedActions() {
ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -209,6 +262,11 @@
view.addComment(session.getCurrentUser().getShortName());
}
});
+ comment.setEnableCondition(new ActionEnableCondition<Object>() {
+ public boolean mustBeEnabled(Object param) {
+ return session.isLogged();
+ }
+ });
comment.setShortcut(new ActionShortcut(true, 'M'));
comment.setTextDescription(i18n.t("Comment..."));
comment.setParentMenuTitle(i18n.t(INSERT_MENU));
@@ -220,10 +278,8 @@
view.insertHorizontalRule();
}
});
- hr.setShortcut(new ActionShortcut(true, 'M'));
hr.setTextDescription(i18n.t("Horizontal line"));
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
- hr.setEnableCondition(isExtended());
ActionToolbarPushButtonDescriptor<Object> strikethrough = new ActionToolbarPushButtonDescriptor<Object>(
accessRol, ActionToolbarPosition.topbar, new Listener0() {
@@ -231,7 +287,7 @@
view.toggleStrikethrough();
}
});
- strikethrough.setIconCls(imgResources.strikeout().getName());
+ strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
strikethrough.setMustInitialyPressed(new ActionPressedCondition<Object>() {
public boolean mustBePressed(Object param) {
@@ -239,25 +295,23 @@
}
});
- actions.add(undo);
- actions.add(redo);
- actions.add(copy);
- actions.add(cut);
- actions.add(paste);
- actions.add(editHtml);
- actions.add(comment);
- actions.add(hr);
- actions.add(strikethrough);
+ extendedTopActions.add(withNoItem(undo));
+ extendedTopActions.add(withNoItem(redo));
+ extendedTopActions.add(withNoItem(copy));
+ extendedTopActions.add(withNoItem(cut));
+ extendedTopActions.add(withNoItem(paste));
+ extendedTopActions.add(withNoItem(editHtml));
+ extendedTopActions.add(withNoItem(hr));
+ extendedTopActions.add(withNoItem(comment));
+ extendedSndActions.add(withNoItem(strikethrough));
+ }
- return actions;
+ private String getCssName(ImageResource imageResource) {
+ return ".k-rte-" + imageResource.getName();
}
- private ActionEnableCondition<Object> isExtended() {
- return new ActionEnableCondition<Object>() {
- public boolean mustBeEnabled(Object param) {
- return extended && view.canBeExtended();
- }
- };
+ private boolean isExtended() {
+ return extended && view.canBeExtended();
}
private ActionEnableCondition<Object> isInsertHtmlSupported() {
@@ -267,4 +321,17 @@
}
};
}
+
+ private ActionItemCollection<Object> withNoItem(ActionCollection<Object> actions) {
+ ActionItemCollection<Object> collection = new ActionItemCollection<Object>();
+ for (ActionDescriptor<Object> action : actions) {
+ // this action don't have a associated item
+ collection.add(withNoItem(action));
+ }
+ return collection;
+ }
+
+ private ActionItem<Object> withNoItem(ActionDescriptor<Object> action) {
+ return new ActionItem<Object>(action, null);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,10 +1,12 @@
package org.ourproject.kune.platf.client.ui.rte;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ActionCollection;
+import org.ourproject.kune.platf.client.actions.ActionItemCollection;
public interface RTEditorView extends View {
+ void addActions(ActionItemCollection<Object> extendedTopActions);
+
void addComment(String userName);
boolean canBeExtended();
@@ -57,8 +59,6 @@
void selectAll();
- void setActions(ActionCollection<Object> actions);
-
void setFontName(String name);
void setFontSize(int size);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -1,12 +1,21 @@
package org.ourproject.kune.platf.client.ui.rte;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
public class TestRTEDialog {
public TestRTEDialog(RTEditor editor) {
BasicDialog dialog = new BasicDialog("Testing RTE", false);
- dialog.add(((RTEditorPanel) editor.getView()).getRTE());
+ VerticalPanel vp = new VerticalPanel();
+
+ vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
+ vp.add(((ActionToolbarPanel<Object>) editor.getSndBar().getView()).getToolbar(ActionToolbarPosition.topbar));
+ vp.add(((RTEditorPanel) editor.getView()).getRTE());
+ dialog.add(vp);
dialog.show();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -24,8 +24,6 @@
import static org.ourproject.kune.wiki.client.WikiClientTool.TYPE_UPLOADEDFILE;
import static org.ourproject.kune.wiki.client.WikiClientTool.TYPE_WIKIPAGE;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -36,7 +34,9 @@
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.wiki.client.cnt.WikiViewer;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -19,9 +19,6 @@
\*/
package org.ourproject.kune.wiki.client;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
@@ -43,7 +40,10 @@
import org.ourproject.kune.wiki.client.cnt.WikiViewerView;
import org.ourproject.kune.wiki.client.ctx.WikiContext;
import org.ourproject.kune.wiki.client.ctx.WikiContextPresenter;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,7 +20,6 @@
package org.ourproject.kune.wiki.client.cnt;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -29,6 +28,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.wiki.client.WikiClientTool;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -19,14 +19,14 @@
*/
package org.ourproject.kune.wiki.client.cnt;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.wiki.client.WikiClientTool;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -30,8 +30,6 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
@@ -54,8 +52,10 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cnt.FoldableContent;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -19,12 +19,6 @@
*/
package org.ourproject.kune.workspace.client;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.registry.AclEditableRegistry;
import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
import org.ourproject.kune.platf.client.registry.CanBeHomepageRegistry;
@@ -42,6 +36,11 @@
import org.ourproject.kune.platf.client.registry.VersionableRegistry;
import org.ourproject.kune.platf.client.registry.XmppComentableRegistry;
import org.ourproject.kune.platf.client.registry.XmppNotifyCapableRegistry;
+import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
+import org.ourproject.kune.workspace.client.socialnet.GroupActionRegistry;
+import org.ourproject.kune.workspace.client.socialnet.UserActionRegistry;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
@@ -189,13 +188,6 @@
}
});
- register(Singleton.class, new Factory<ContentEditorActionRegistry>(ContentEditorActionRegistry.class) {
- @Override
- public ContentEditorActionRegistry create() {
- return new ContentEditorActionRegistry();
- }
- });
-
register(Singleton.class, new Factory<ContentActionRegistry>(ContentActionRegistry.class) {
@Override
public ContentActionRegistry create() {
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-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,20 +21,6 @@
import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
@@ -64,9 +50,15 @@
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
+import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPresenter;
+import org.ourproject.kune.workspace.client.cxt.ActionContextToolbar;
+import org.ourproject.kune.workspace.client.cxt.ActionContextToolbarPresenter;
+import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPanel;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPresenter;
@@ -195,6 +187,7 @@
import org.ourproject.kune.workspace.client.socialnet.BuddiesSummary;
import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupActionRegistry;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
@@ -203,9 +196,16 @@
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.UserActionRegistry;
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddie;
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePanel;
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePresenter;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionBuddiesSummaryToolbar;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionBuddiesSummaryToolbarPresenter;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionGroupSummaryToolbar;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionGroupSummaryToolbarPresenter;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionParticipationSummaryToolbarPresenter;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionParticipationToolbar;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
@@ -480,14 +480,16 @@
register(Singleton.class, new Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
@Override
public ActionGroupSummaryToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>($$(ActionManager.class));
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
+ $$(ActionManager.class), $(I18nTranslationService.class));
final ActionGroupSummaryToolbarPresenter toolbar = new ActionGroupSummaryToolbarPresenter(panel);
return toolbar;
}
}, new Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class) {
@Override
public ActionParticipationToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>($$(ActionManager.class));
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
+ $$(ActionManager.class), $(I18nTranslationService.class));
final ActionParticipationSummaryToolbarPresenter toolbar = new ActionParticipationSummaryToolbarPresenter(
panel);
return toolbar;
@@ -496,7 +498,7 @@
@Override
public ActionBuddiesSummaryToolbar create() {
final ActionToolbarPanel<UserSimpleDTO> panel = new ActionToolbarPanel<UserSimpleDTO>(
- $$(ActionManager.class));
+ $$(ActionManager.class), $(I18nTranslationService.class));
final ActionBuddiesSummaryToolbarPresenter toolbar = new ActionBuddiesSummaryToolbarPresenter(panel);
return toolbar;
}
@@ -867,7 +869,8 @@
@Override
public TextEditor create() {
final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
contentNavigatorToolbar);
@@ -921,7 +924,8 @@
@Override
public ActionContentToolbar create() {
final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(contentNavigatorToolbar);
return toolbar;
}
@@ -931,7 +935,8 @@
@Override
public ActionContextToolbar create() {
final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ ActionCntCtxToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
final ActionContextToolbar toolbar = new ActionContextToolbarPresenter(contentNavigatorToolbar);
return toolbar;
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbar.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.cnt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionContentToolbar extends ActionToolbar<StateToken> {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbarPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ActionContentToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.cnt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionContentToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContentToolbar {
+
+ public ActionContentToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentActionRegistry.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentActionRegistry.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.cnt;
+
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ContentActionRegistry extends ActionRegistry<StateToken> {
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentIconsRegistry.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistry.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/ContentIconsRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,78 @@
+/*
+ *
+ * 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.cnt;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+
+public class ContentIconsRegistry {
+ private final HashMap<String, String> contentTypesIcons;
+
+ public ContentIconsRegistry() {
+ contentTypesIcons = new HashMap<String, String>();
+ }
+
+ public String getContentTypeIcon(final String typeId) {
+ final String icon = contentTypesIcons.get(typeId);
+ return icon == null ? "" : icon;
+ }
+
+ /**
+ * If there is a specific icon for a type/subtype pair or a generic type
+ * icon in defect
+ *
+ * @param typeId
+ * the kune typeId (see *ClientTool)
+ * @param mimeType
+ * @return
+ */
+ public String getContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType) {
+ String icon = getContentTypeIcon(concatenate(typeId, mimeType));
+ if (icon.equals("")) {
+ if (mimeType == null) {
+ return getContentTypeIcon(typeId);
+ }
+ } else {
+ return icon;
+ }
+ final String subtype = mimeType.getSubtype();
+ if (subtype != null && subtype.length() > 0) {
+ icon = getContentTypeIcon(typeId, new BasicMimeTypeDTO(mimeType.getType()));
+ }
+ return icon.equals("") ? getContentTypeIcon(typeId) : icon;
+ }
+
+ public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
+ registerContentTypeIcon(concatenate(typeId, mimeType), iconUrl);
+ }
+
+ public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
+ contentTypesIcons.put(contentTypeId, iconUrl);
+ }
+
+ private String concatenate(final String typeId, final BasicMimeTypeDTO mimeType) {
+ if (mimeType != null) {
+ return typeId + "|" + mimeType;
+ } else {
+ return typeId;
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
@@ -139,7 +138,7 @@
private void setToolbar(ActionItemCollection<StateToken> collection) {
toolbar.disableMenusAndClearButtons();
- toolbar.setActions(collection);
+ toolbar.addActions(collection);
toolbar.attach();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -25,7 +25,6 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
@@ -45,6 +44,7 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
import org.ourproject.kune.workspace.client.title.RenameAction;
import org.ourproject.kune.workspace.client.upload.FileUploader;
@@ -140,7 +140,7 @@
public void selectItem(final StateToken stateToken) {
view.selectItem(genId(stateToken));
toolbar.disableMenusAndClearButtons();
- toolbar.setActions(actionsByItem.get(stateToken));
+ toolbar.addActions(actionsByItem.get(stateToken));
}
public void setEditOnNextStateChange(final boolean edit) {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.cxt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionContextToolbar extends ActionToolbar<StateToken> {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.cxt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionContextToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContextToolbar {
+
+ public ActionContextToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextActionRegistry.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ContextActionRegistry.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.cxt;
+
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ContextActionRegistry extends ActionRegistry<StateToken> {
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -200,7 +200,7 @@
final ActionItemCollection<StateToken> collection = new ActionItemCollection<StateToken>();
collection.add(new ActionItem<StateToken>(save, null));
collection.add(new ActionItem<StateToken>(close, null));
- toolbar.setActions(collection);
+ toolbar.addActions(collection);
}
private void reset() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -22,13 +22,13 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.i18n.I18nTranslationServiceMocked;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.socialnet.UserActionRegistry;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Listener;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.calclab.suco.client.ioc.Provider;
@@ -34,8 +35,8 @@
private final WorkspaceSkeleton ws;
public ActionCntCtxToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
- final WorkspaceSkeleton ws) {
- super(actionManagerProvider);
+ final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(actionManagerProvider, i18n);
this.position = position;
this.ws = ws;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -28,10 +28,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkDataDTO;
@@ -48,6 +45,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionBuddiesSummaryToolbar;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -135,7 +133,7 @@
}
}
toolbar.disableMenusAndClearButtons();
- toolbar.setActions(actionRegistry.getCurrentActions(session.getCurrentUser(), session.isLogged(),
+ toolbar.addActions(actionRegistry.getCurrentActions(session.getCurrentUser(), session.isLogged(),
state.getGroupRights(), true));
toolbar.attach();
view.show();
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupActionRegistry.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -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.socialnet;
+
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+/**
+ * The Class GroupActionRegistry stores actions over groups (mainly used in SN)
+ */
+public class GroupActionRegistry extends ActionRegistry<StateToken> {
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -25,9 +25,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
@@ -53,6 +51,7 @@
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionGroupSummaryToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -97,7 +96,7 @@
public void onEvent(StateAbstractDTO state) {
setState(state);
toolbar.disableMenusAndClearButtons();
- toolbar.setActions(groupActionRegistry.getCurrentActions(state.getGroup().getStateToken(),
+ toolbar.addActions(groupActionRegistry.getCurrentActions(state.getGroup().getStateToken(),
session.isLogged(), state.getGroupRights(), true));
toolbar.attach();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -21,8 +21,6 @@
import java.util.List;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
@@ -34,6 +32,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
+import org.ourproject.kune.workspace.client.socialnet.toolbar.ActionParticipationToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -23,7 +23,6 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserActionRegistry.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/UserActionRegistry.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserActionRegistry.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.socialnet;
+
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+
+/**
+ * The Class UserActionRegistry.
+ *
+ * List of actions over a user (initially used for buddies actions)
+ *
+ */
+public class UserActionRegistry extends ActionRegistry<UserSimpleDTO> {
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbar.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+
+public interface ActionBuddiesSummaryToolbar extends ActionToolbar<UserSimpleDTO> {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbarPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionBuddiesSummaryToolbarPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionBuddiesSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+
+public class ActionBuddiesSummaryToolbarPresenter extends ActionToolbarPresenter<UserSimpleDTO> implements
+ ActionBuddiesSummaryToolbar {
+
+ public ActionBuddiesSummaryToolbarPresenter(ActionToolbarView<UserSimpleDTO> toolbar) {
+ super(toolbar);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbar.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionGroupSummaryToolbar extends ActionToolbar<StateToken> {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbarPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionGroupSummaryToolbarPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionGroupSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionGroupSummaryToolbarPresenter extends ActionToolbarPresenter<StateToken> implements
+ ActionGroupSummaryToolbar {
+
+ public ActionGroupSummaryToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationSummaryToolbarPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationSummaryToolbarPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationSummaryToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionParticipationSummaryToolbarPresenter extends ActionToolbarPresenter<StateToken> implements
+ ActionParticipationToolbar {
+
+ public ActionParticipationSummaryToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationToolbar.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionParticipationToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/toolbar/ActionParticipationToolbar.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.socialnet.toolbar;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionParticipationToolbar extends ActionToolbar<StateToken> {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -20,7 +20,6 @@
package org.ourproject.kune.workspace.client.title;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -28,6 +27,7 @@
import org.ourproject.kune.platf.client.registry.RenamableRegistry;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener2;
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ContentIconsRegistryTest.java 2009-03-03 01:35:36 UTC (rev 1055)
@@ -5,6 +5,7 @@
import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
public class ContentIconsRegistryTest {
1
0
Author: vjrj
Date: 2009-03-02 20:32:02 +0100 (Mon, 02 Mar 2009)
New Revision: 1054
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListenerCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationServiceMocked.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/ConfirmationAsk.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/AbstractUploader.java
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploader.java
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderView.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
Modified:
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/gallery/server/GalleryServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.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/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/i18n/I18nTranslationServiceDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoDownloadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileJsonUploadManagerAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManagerAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/wiki/server/WikiServerTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/AccessListsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFlags.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardTrdForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/I18nManagerTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Log:
code reorganization
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -27,14 +27,13 @@
import org.ourproject.kune.blogs.client.cnt.BlogViewer;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -42,6 +41,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -33,16 +33,15 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.blogs.client;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.blogs.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.blogs.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.errors.ContainerNotPermittedException;
import org.ourproject.kune.platf.client.errors.ContentNotPermittedException;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Container;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -32,7 +32,7 @@
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.wiki.client.WikiClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -32,10 +32,10 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.chat.client;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,7 +26,7 @@
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.TextUtils;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.ctx.room;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
import com.calclab.emiteuimodule.client.dialog.BasicDialogExtended;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -27,14 +27,13 @@
import org.ourproject.kune.docs.client.cnt.DocumentViewer;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -42,6 +41,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -33,16 +33,15 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.docs.client;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.docs.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.actions.ActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.docs.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.errors.ContainerNotPermittedException;
import org.ourproject.kune.platf.client.errors.ContentNotPermittedException;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Container;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,14 +26,13 @@
import org.ourproject.kune.gallery.client.cnt.GalleryViewer;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -41,6 +40,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -33,16 +33,15 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.gallery.client;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.gallery.client.cnt;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.BasicThumb;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,7 +26,7 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.gallery.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/server/GalleryServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/server/GalleryServerTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/gallery/server/GalleryServerTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.errors.ContainerNotPermittedException;
import org.ourproject.kune.platf.client.errors.ContentNotPermittedException;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,23 +19,20 @@
\*/
package org.ourproject.kune.platf.client.actions;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener0;
public class ActionManager {
- private final WorkspaceSkeleton ws;
-
- public ActionManager(final WorkspaceSkeleton ws) {
- this.ws = ws;
+ public ActionManager() {
}
public void doAction(final ActionItem<?> actionItem) {
final ActionDescriptor<?> action = actionItem.getAction();
final Object item = actionItem.getItem();
if (action.isMustBeConfirmed()) {
- ws.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() {
+ NotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() {
public void onEvent() {
fire(action, item);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,6 +1,6 @@
package org.ourproject.kune.platf.client.actions;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.google.gwt.user.client.ui.KeyboardListener;
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,72 +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.platf.client.actions.toolbar;
-
-import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class ActionCntCtxToolbarPanel<T> extends ActionToolbarPanel<T> {
-
- public enum Position {
- content, context
- }
-
- private final Position position;
-
- public ActionCntCtxToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
- final WorkspaceSkeleton ws) {
- super(actionManagerProvider, ws);
- this.position = position;
- }
-
- public void attach() {
- if (!topbar.isAttached()) {
- switch (position) {
- case content:
- ws.getEntityWorkspace().getContentTopBar().removeAll();
- ws.getEntityWorkspace().getContentTopBar().add(topbar);
- ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
- break;
- case context:
- default:
- ws.getEntityWorkspace().getContextTopBar().removeAll();
- ws.getEntityWorkspace().getContextTopBar().add(topbar);
- ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
- }
- }
- }
-
- public void detach() {
- if (topbar.isAttached()) {
- switch (position) {
- case content:
- ws.getEntityWorkspace().getContentTopBar().remove(topbar);
- ws.getEntityWorkspace().getContentBottomBar().remove(bottombar);
- break;
- case context:
- default:
- ws.getEntityWorkspace().getContextTopBar().remove(topbar);
- ws.getEntityWorkspace().getContextBottomBar().remove(bottombar);
- }
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -32,8 +32,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.ioc.Provider;
@@ -57,10 +56,8 @@
private final Provider<ActionManager> actionManagerProvider;
protected final SimpleToolbar topbar;
protected final SimpleToolbar bottombar;
- protected final WorkspaceSkeleton ws;
- public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, final WorkspaceSkeleton ws) {
- this.ws = ws;
+ public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider) {
topbar = new SimpleToolbar();
bottombar = new SimpleToolbar();
topbar.setWidth("100%");
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,46 +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.platf.client.app;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class TextEditorInsertElementGroup extends ProviderCollection {
-
- public TextEditorInsertElementGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((TextEditorInsertAbstract) p.get()).reset();
- }
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListener.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListener.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.platf.client.i18n;
+
+import com.google.gwt.user.client.EventListener;
+
+public interface I18nChangeListener extends EventListener {
+
+ void onI18nLanguageChange();
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListenerCollection.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nChangeListenerCollection.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.platf.client.i18n;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * A helper class for implementers of the SourcesI18nChangeEvents interface.
+ * This subclass of {@link ArrayList} assumes that all objects added to it will
+ * be of type {@link org.ourproject.kune.platf.client.i18n.I18nChangeListener}.
+ */
+public class I18nChangeListenerCollection extends ArrayList<I18nChangeListener> {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Fires a locale change event to all listeners.
+ *
+ */
+ public void fireI18nLanguageChange() {
+ for (Iterator<I18nChangeListener> it = iterator(); it.hasNext();) {
+ I18nChangeListener listener = it.next();
+ listener.onI18nLanguageChange();
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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.platf.client.i18n;
+
+import java.util.Date;
+
+public abstract class I18nTranslationService {
+ protected static final String TRANSLATION_NOTE_REGEXP = " (\\[)%NT (.*)(\\])$";
+ protected static final String NOTE_FOR_TRANSLATOR_TAG_BEGIN = " [%NT ";
+ protected static final String NOTE_FOR_TRANSLATOR_TAG_END = "]";
+ // Also in I18nTranslation
+ protected static final String UNTRANSLATED_VALUE = null;
+
+ public String decodeHtml(final String textToDecode) {
+ String text = textToDecode;
+ // text = text.replaceAll("©", "©");
+ return text;
+ }
+
+ public String formatDate(final String format, final Date date) {
+ // TODO: 18n dates
+ return null;
+ // cc = c.sub(/^%[EO]?(.)$/o, '%\\1')
+ // case cc
+ // when '%A'; o << "#{::Date::DAYNAMES[wday]}
+ // [weekday]".t(::Date::DAYNAMES[wday])
+ // when '%a'; o << "#{::Date::ABBR_DAYNAMES[wday]} [abbreviated
+ // weekday]".t(::Date::ABBR_DAYNAMES[wday])
+ // when '%B'; o << "#{::Date::MONTHNAMES[mon]}
+ // [month]".t(::Date::MONTHNAMES[mon])
+ // when '%b'; o << "#{::Date::ABBR_MONTHNAMES[mon]} [abbreviated
+ // month]".t(::Date::ABBR_MONTHNAMES[mon])
+ // when '%c'; o << ((Locale.active? && !Locale.active.date_format.nil?)
+ // ?
+ // localize(Locale.active.date_format) : strftime('%Y-%m-%d'))
+ // when '%p'; o << if hour < 12 then 'AM [Ante Meridiem]'.t("am") else
+ // 'PM [Post
+ // Meridiem]'.t("am") end
+ // when '%P'; o << if hour < 12 then 'AM [Ante Meridiem]'.t("AM") else
+ // 'PM [Post
+ // Meridiem]'.t("PM") end
+ // else; o << c
+ }
+
+ public String removeNT(final String string) {
+ return string.replaceAll(TRANSLATION_NOTE_REGEXP, "");
+ }
+
+ /**
+ * In production, this method uses a hashmap. In development, if the text is
+ * not in the hashmap, it makes a server petition (that stores the text
+ * pending for translation in db).
+ *
+ * Warning: text is escaped as html before insert in the db. Don't use html
+ * here (o user this method with params).
+ *
+ * @param text
+ * @return text translated in the current language
+ */
+ public String t(final String text) {
+ return null;
+ }
+
+ /**
+ * Use [%d] to reference the Integer parameters
+ *
+ */
+ public String t(final String text, final Integer... args) {
+ String translation = t(text);
+ for (Integer arg : args) {
+ translation = translation.replaceFirst("\\[%d\\]", arg.toString());
+ }
+ return decodeHtml(translation);
+ }
+
+ /**
+ * Use [%d] to reference the Long parameter
+ *
+ */
+ public String t(final String text, final Long... args) {
+ String translation = t(text);
+ for (Long arg : args) {
+ translation = translation.replaceFirst("\\[%d\\]", arg.toString());
+ }
+ return decodeHtml(translation);
+ }
+
+ /**
+ * Use [%s] to reference the string parameter
+ *
+ */
+ public String t(final String text, final String... args) {
+ String translation = t(text);
+ for (String arg : args) {
+ translation = translation.replaceFirst("\\[%s\\]", arg);
+ }
+ return decodeHtml(translation);
+ }
+
+ /**
+ * Adds [%NT noteForTranslators] at the end of text. This tag is later
+ * renderer in the translator panel to inform translator how to do this
+ * translation
+ *
+ */
+ public String tWithNT(final String text, final String noteForTranslators) {
+ return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END);
+ }
+
+ /**
+ * Use [%d] to reference the Integer parameter.
+ *
+ * Also adds [%NT noteForTranslators] at the end of text. This tag is later
+ * renderer in the translator panel to inform translator how to do this
+ * translation
+ *
+ */
+ public String tWithNT(final String text, final String noteForTranslators, final Integer... args) {
+ return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
+ }
+
+ /**
+ * Use [%d] to reference the Long parameter.
+ *
+ * Also adds [%NT noteForTranslators] at the end of text. This tag is later
+ * renderer in the translator panel to inform translator how to do this
+ * translation
+ *
+ */
+ public String tWithNT(final String text, final String noteForTranslators, final Long... args) {
+ return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
+ }
+
+ /**
+ * Use [%s] to reference the String parameter.
+ *
+ * Also adds [%NT noteForTranslators] at the end of text. This tag is later
+ * renderer in the translator panel to inform translator how to do this
+ * translation
+ *
+ */
+ public String tWithNT(final String text, final String noteForTranslators, final String... args) {
+ return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationServiceMocked.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationServiceMocked.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.platf.client.i18n;
+
+import org.ourproject.kune.platf.client.ui.TextUtils;
+
+public class I18nTranslationServiceMocked extends I18nTranslationService {
+ public String t(final String text) {
+ String encodeText = TextUtils.escapeHtmlLight(text);
+ String translation = removeNT(encodeText);
+ return decodeHtml(translation);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nUITranslationService.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,226 @@
+/*
+ *
+ * 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.platf.client.i18n;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.Location;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class I18nUITranslationService extends I18nTranslationService {
+ private HashMap<String, String> lexicon;
+ private String currentLanguageCode;
+ private I18nChangeListenerCollection i18nChangeListeners;
+ private I18nLanguageDTO currentLang;
+ private I18nServiceAsync i18nService;
+ private Session session;
+
+ /*
+ * If a UI element need to be fired when (for instance) the language changes
+ * use this. Useful if you widget have to take in account text language
+ * direction, for instance.
+ */
+ public void addI18nChangeListener(final I18nChangeListener listener) {
+ if (i18nChangeListeners == null) {
+ i18nChangeListeners = new I18nChangeListenerCollection();
+ }
+ i18nChangeListeners.add(listener);
+ }
+
+ public void changeCurrentLanguage(final String newLanguage) {
+ if (!newLanguage.equals(this.currentLanguageCode)) {
+ setCurrentLanguage(newLanguage);
+ changeLocale(newLanguage);
+ }
+ }
+
+ public String formatDateWithLocale(final Date date) {
+ String dateFormat = currentLang.getDateFormat();
+ final DateTimeFormat fmt;
+ if (dateFormat == null) {
+ fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+ } else {
+ String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
+ String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
+ dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
+ fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+ }
+ String dateFormated = fmt.format(date);
+ return dateFormated;
+ }
+
+ public String getCurrentLanguage() {
+ return currentLanguageCode;
+ }
+
+ public HashMap<String, String> getLexicon() {
+ return lexicon;
+ }
+
+ public void init(final I18nServiceAsync i18nService, final Session session, final Listener0 onReady) {
+ this.i18nService = i18nService;
+ this.session = session;
+ final Location loc = WindowUtils.getLocation();
+ final String locale = loc.getParameter("locale");
+ i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final I18nLanguageDTO result) {
+ currentLang = result;
+ currentLanguageCode = currentLang.getCode();
+ session.setCurrentLanguage(currentLang);
+ i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final HashMap<String, String> result) {
+ lexicon = result;
+ onReady.onEvent();
+ }
+ });
+ }
+ });
+ }
+
+ public void removeI18nChangeListener(final I18nChangeListener listener) {
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.remove(listener);
+ }
+ }
+
+ public void setCurrentLanguage(final String newLanguage) {
+ this.currentLanguageCode = newLanguage;
+ }
+
+ public void setLexicon(final HashMap<String, String> lexicon) {
+ this.lexicon = lexicon;
+ fireI18nLanguageChange();
+ }
+
+ public void setTranslationAfterSave(final String text, final String translation) {
+ lexicon.put(text, translation);
+ fireI18nLanguageChange();
+ }
+
+ /**
+ * In production, this method uses a hashmap. In development, if the text is
+ * not in the hashmap, it makes a server petition (that stores the text
+ * pending for translation in db).
+ *
+ * Warning: text is escaped as html before insert in the db. Don't use html
+ * here (o user this method with params).
+ *
+ * @param text
+ * @return text translated in the current language
+ */
+ @Override
+ public String t(final String text) {
+ final String encodeText = TextUtils.escapeHtmlLight(text);
+ String translation = lexicon.get(encodeText);
+ if (lexicon.containsKey(encodeText)) {
+ if (translation == UNTRANSLATED_VALUE) {
+ // Not translated but in db, return text
+ translation = removeNT(encodeText);
+ }
+ } else {
+ // Not translated and not in db, make a petition for translation
+ if (session.isLogged()) {
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+ new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ }
+
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
+ translation = removeNT(encodeText);
+ }
+ return decodeHtml(translation);
+ }
+
+ /**
+ *
+ * See in:
+ * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread
+ * /5e4e25050d3be984/7035ec39354d06aa?lnk=gst&q=get+locale&rnum=23
+ *
+ * JSNI method to change the locale of the application - it effectively
+ * parses the existing URL and creates a new one for the chosen locale.
+ *
+ * It additionally launches any JavaScript debugger that might be attached
+ * to the system (Windows only). To disable this functionality just remove
+ * the "debugger" line.
+ *
+ * @param newLocale
+ * String value of the new locale to go to.
+ */
+ private native void changeLocale(String newLocale)
+ /*-{
+ // Uncomment the "debugger;" line to see how to set debug statements in JSNI code
+ // When in web mode, if your browser has a JavaScript debugger attached, it will
+ // launch at this point in the code (when the user changes locale through the menu system).
+ // debugger;
+
+ // Get the current location
+ var currLocation = $wnd.location.toString();
+ // Get rid of any GWT History tokens that might be present
+ var noHistoryCurrLocArray = currLocation.split("#");
+ var noHistoryCurrLoc = noHistoryCurrLocArray[0];
+ var currHistory = noHistoryCurrLocArray[1];
+ // Get rid of any locale string
+ var locArray = noHistoryCurrLoc.split("?");
+ // Build the new href location and then send the browser there.
+ // $wnd.location.href = locArray[0]+"?locale="+newLocale+"#"+currHistory;
+ $wnd.location.href = locArray[0]+"?locale="+newLocale
+
+ // extjs part:
+ // commented because the error: "Ext is not defined"
+ // we have to try other way
+ // var head = document.getElementsByTagName("head")[0];
+ // var script = document.createElement('script');
+ // script.id = 'localScript';
+ // script.type = 'text/javascript';
+ // script.src = "js/ext/locale/ext-lang-"+newLocale+".js";
+ // head.appendChild(script);
+ }-*/;
+
+ private void fireI18nLanguageChange() {
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.fireI18nLanguageChange();
+ }
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,27 +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.platf.client.services;
-
-import com.google.gwt.user.client.EventListener;
-
-public interface I18nChangeListener extends EventListener {
-
- void onI18nLanguageChange();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,44 +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.platf.client.services;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * A helper class for implementers of the SourcesI18nChangeEvents interface.
- * This subclass of {@link ArrayList} assumes that all objects added to it will
- * be of type {@link org.ourproject.kune.platf.client.services.I18nChangeListener}.
- */
-public class I18nChangeListenerCollection extends ArrayList<I18nChangeListener> {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Fires a locale change event to all listeners.
- *
- */
- public void fireI18nLanguageChange() {
- for (Iterator<I18nChangeListener> it = iterator(); it.hasNext();) {
- I18nChangeListener listener = it.next();
- listener.onI18nLanguageChange();
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationService.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,162 +1,6 @@
-/*
- *
- * 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.platf.client.services;
-import java.util.Date;
+@Deprecated
+public class I18nTranslationService extends org.ourproject.kune.platf.client.i18n.I18nTranslationService {
-public abstract class I18nTranslationService {
- protected static final String TRANSLATION_NOTE_REGEXP = " (\\[)%NT (.*)(\\])$";
- protected static final String NOTE_FOR_TRANSLATOR_TAG_BEGIN = " [%NT ";
- protected static final String NOTE_FOR_TRANSLATOR_TAG_END = "]";
- // Also in I18nTranslation
- protected static final String UNTRANSLATED_VALUE = null;
-
- public String decodeHtml(final String textToDecode) {
- String text = textToDecode;
- // text = text.replaceAll("©", "©");
- return text;
- }
-
- public String formatDate(final String format, final Date date) {
- // TODO: 18n dates
- return null;
- // cc = c.sub(/^%[EO]?(.)$/o, '%\\1')
- // case cc
- // when '%A'; o << "#{::Date::DAYNAMES[wday]}
- // [weekday]".t(::Date::DAYNAMES[wday])
- // when '%a'; o << "#{::Date::ABBR_DAYNAMES[wday]} [abbreviated
- // weekday]".t(::Date::ABBR_DAYNAMES[wday])
- // when '%B'; o << "#{::Date::MONTHNAMES[mon]}
- // [month]".t(::Date::MONTHNAMES[mon])
- // when '%b'; o << "#{::Date::ABBR_MONTHNAMES[mon]} [abbreviated
- // month]".t(::Date::ABBR_MONTHNAMES[mon])
- // when '%c'; o << ((Locale.active? && !Locale.active.date_format.nil?)
- // ?
- // localize(Locale.active.date_format) : strftime('%Y-%m-%d'))
- // when '%p'; o << if hour < 12 then 'AM [Ante Meridiem]'.t("am") else
- // 'PM [Post
- // Meridiem]'.t("am") end
- // when '%P'; o << if hour < 12 then 'AM [Ante Meridiem]'.t("AM") else
- // 'PM [Post
- // Meridiem]'.t("PM") end
- // else; o << c
- }
-
- public String removeNT(final String string) {
- return string.replaceAll(TRANSLATION_NOTE_REGEXP, "");
- }
-
- /**
- * In production, this method uses a hashmap. In development, if the text is
- * not in the hashmap, it makes a server petition (that stores the text
- * pending for translation in db).
- *
- * Warning: text is escaped as html before insert in the db. Don't use html
- * here (o user this method with params).
- *
- * @param text
- * @return text translated in the current language
- */
- public String t(final String text) {
- return null;
- }
-
- /**
- * Use [%d] to reference the Integer parameters
- *
- */
- public String t(final String text, final Integer... args) {
- String translation = t(text);
- for (Integer arg : args) {
- translation = translation.replaceFirst("\\[%d\\]", arg.toString());
- }
- return decodeHtml(translation);
- }
-
- /**
- * Use [%d] to reference the Long parameter
- *
- */
- public String t(final String text, final Long... args) {
- String translation = t(text);
- for (Long arg : args) {
- translation = translation.replaceFirst("\\[%d\\]", arg.toString());
- }
- return decodeHtml(translation);
- }
-
- /**
- * Use [%s] to reference the string parameter
- *
- */
- public String t(final String text, final String... args) {
- String translation = t(text);
- for (String arg : args) {
- translation = translation.replaceFirst("\\[%s\\]", arg);
- }
- return decodeHtml(translation);
- }
-
- /**
- * Adds [%NT noteForTranslators] at the end of text. This tag is later
- * renderer in the translator panel to inform translator how to do this
- * translation
- *
- */
- public String tWithNT(final String text, final String noteForTranslators) {
- return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END);
- }
-
- /**
- * Use [%d] to reference the Integer parameter.
- *
- * Also adds [%NT noteForTranslators] at the end of text. This tag is later
- * renderer in the translator panel to inform translator how to do this
- * translation
- *
- */
- public String tWithNT(final String text, final String noteForTranslators, final Integer... args) {
- return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
- }
-
- /**
- * Use [%d] to reference the Long parameter.
- *
- * Also adds [%NT noteForTranslators] at the end of text. This tag is later
- * renderer in the translator panel to inform translator how to do this
- * translation
- *
- */
- public String tWithNT(final String text, final String noteForTranslators, final Long... args) {
- return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
- }
-
- /**
- * Use [%s] to reference the String parameter.
- *
- * Also adds [%NT noteForTranslators] at the end of text. This tag is later
- * renderer in the translator panel to inform translator how to do this
- * translation
- *
- */
- public String tWithNT(final String text, final String noteForTranslators, final String... args) {
- return t(text + NOTE_FOR_TRANSLATOR_TAG_BEGIN + noteForTranslators + NOTE_FOR_TRANSLATOR_TAG_END, args);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nTranslationServiceMocked.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,26 +1,8 @@
-/*
- *
- * 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.platf.client.services;
import org.ourproject.kune.platf.client.ui.TextUtils;
+@Deprecated
public class I18nTranslationServiceMocked extends I18nTranslationService {
public String t(final String text) {
String encodeText = TextUtils.escapeHtmlLight(text);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,226 +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.platf.client.services;
-
-import java.util.Date;
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.Location;
-import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener0;
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class I18nUITranslationService extends I18nTranslationService {
- private HashMap<String, String> lexicon;
- private String currentLanguageCode;
- private I18nChangeListenerCollection i18nChangeListeners;
- private I18nLanguageDTO currentLang;
- private I18nServiceAsync i18nService;
- private Session session;
-
- /*
- * If a UI element need to be fired when (for instance) the language changes
- * use this. Useful if you widget have to take in account text language
- * direction, for instance.
- */
- public void addI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners == null) {
- i18nChangeListeners = new I18nChangeListenerCollection();
- }
- i18nChangeListeners.add(listener);
- }
-
- public void changeCurrentLanguage(final String newLanguage) {
- if (!newLanguage.equals(this.currentLanguageCode)) {
- setCurrentLanguage(newLanguage);
- changeLocale(newLanguage);
- }
- }
-
- public String formatDateWithLocale(final Date date) {
- String dateFormat = currentLang.getDateFormat();
- final DateTimeFormat fmt;
- if (dateFormat == null) {
- fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
- } else {
- String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
- String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
- dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
- fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
- }
- String dateFormated = fmt.format(date);
- return dateFormated;
- }
-
- public String getCurrentLanguage() {
- return currentLanguageCode;
- }
-
- public HashMap<String, String> getLexicon() {
- return lexicon;
- }
-
- public void init(final I18nServiceAsync i18nService, final Session session, final Listener0 onReady) {
- this.i18nService = i18nService;
- this.session = session;
- final Location loc = WindowUtils.getLocation();
- final String locale = loc.getParameter("locale");
- i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
- public void onFailure(final Throwable caught) {
- Log.error("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final I18nLanguageDTO result) {
- currentLang = result;
- currentLanguageCode = currentLang.getCode();
- session.setCurrentLanguage(currentLang);
- i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
- public void onFailure(final Throwable caught) {
- Log.error("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final HashMap<String, String> result) {
- lexicon = result;
- onReady.onEvent();
- }
- });
- }
- });
- }
-
- public void removeI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.remove(listener);
- }
- }
-
- public void setCurrentLanguage(final String newLanguage) {
- this.currentLanguageCode = newLanguage;
- }
-
- public void setLexicon(final HashMap<String, String> lexicon) {
- this.lexicon = lexicon;
- fireI18nLanguageChange();
- }
-
- public void setTranslationAfterSave(final String text, final String translation) {
- lexicon.put(text, translation);
- fireI18nLanguageChange();
- }
-
- /**
- * In production, this method uses a hashmap. In development, if the text is
- * not in the hashmap, it makes a server petition (that stores the text
- * pending for translation in db).
- *
- * Warning: text is escaped as html before insert in the db. Don't use html
- * here (o user this method with params).
- *
- * @param text
- * @return text translated in the current language
- */
- @Override
- public String t(final String text) {
- final String encodeText = TextUtils.escapeHtmlLight(text);
- String translation = lexicon.get(encodeText);
- if (lexicon.containsKey(encodeText)) {
- if (translation == UNTRANSLATED_VALUE) {
- // Not translated but in db, return text
- translation = removeNT(encodeText);
- }
- } else {
- // Not translated and not in db, make a petition for translation
- if (session.isLogged()) {
- i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
- new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- }
-
- public void onSuccess(final String result) {
- }
- });
- Log.debug("Registering in db '" + text + "' as pending translation");
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
- }
- translation = removeNT(encodeText);
- }
- return decodeHtml(translation);
- }
-
- /**
- *
- * See in:
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread
- * /5e4e25050d3be984/7035ec39354d06aa?lnk=gst&q=get+locale&rnum=23
- *
- * JSNI method to change the locale of the application - it effectively
- * parses the existing URL and creates a new one for the chosen locale.
- *
- * It additionally launches any JavaScript debugger that might be attached
- * to the system (Windows only). To disable this functionality just remove
- * the "debugger" line.
- *
- * @param newLocale
- * String value of the new locale to go to.
- */
- private native void changeLocale(String newLocale)
- /*-{
- // Uncomment the "debugger;" line to see how to set debug statements in JSNI code
- // When in web mode, if your browser has a JavaScript debugger attached, it will
- // launch at this point in the code (when the user changes locale through the menu system).
- // debugger;
-
- // Get the current location
- var currLocation = $wnd.location.toString();
- // Get rid of any GWT History tokens that might be present
- var noHistoryCurrLocArray = currLocation.split("#");
- var noHistoryCurrLoc = noHistoryCurrLocArray[0];
- var currHistory = noHistoryCurrLocArray[1];
- // Get rid of any locale string
- var locArray = noHistoryCurrLoc.split("?");
- // Build the new href location and then send the browser there.
- // $wnd.location.href = locArray[0]+"?locale="+newLocale+"#"+currHistory;
- $wnd.location.href = locArray[0]+"?locale="+newLocale
-
- // extjs part:
- // commented because the error: "Ext is not defined"
- // we have to try other way
- // var head = document.getElementsByTagName("head")[0];
- // var script = document.createElement('script');
- // script.id = 'localScript';
- // script.type = 'text/javascript';
- // script.src = "js/ext/locale/ext-lang-"+newLocale+".js";
- // head.appendChild(script);
- }-*/;
-
- private void fireI18nLanguageChange() {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.fireI18nLanguageChange();
- }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
-import org.ourproject.kune.platf.client.app.TextEditorInsertElementGroup;
import org.ourproject.kune.platf.client.app.ToolGroup;
import com.calclab.suco.client.ioc.module.AbstractModule;
@@ -33,6 +32,5 @@
registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup(container));
registerDecorator(ToolGroup.class, new ToolGroup(container));
registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
- registerDecorator(TextEditorInsertElementGroup.class, new TextEditorInsertElementGroup(container));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.errors.LastAdminInGroupException;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,6 +26,8 @@
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.I18nService;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.platf.client.ui;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.gwtext.client.core.Connection;
import com.gwtext.client.core.UrlParam;
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,97 @@
+/*
+ *
+ * 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.platf.client.ui;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
+
+public class SimpleToolbar extends Composite {
+
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
+
+ public SimpleToolbar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
+ public void add(final Widget widget, VerticalAlignmentConstant valign) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, valign);
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
+ }
+
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public void remove(final Widget widget) {
+ childPanel.remove(widget);
+ }
+
+ public void removeAll() {
+ childPanel.clear();
+ }
+
+ public void setCellWidth(Widget widget, String width) {
+ childPanel.setCellWidth(widget, width);
+ }
+
+ public void setCleanStyle() {
+ setStyleName("x-toolbar");
+ addStyleName("x-panel");
+ addStyleName("k-blank-toolbar");
+ }
+
+ @Override
+ public void setHeight(String height) {
+ mainPanel.setHeight(height);
+ mainPanel.setCellHeight(childPanel, height);
+ }
+}
\ No newline at end of file
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.platf.client.ui.dialogs;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
@@ -57,7 +57,7 @@
toolbar.setVisible(false);
}
- public void setErrorMessage(final String message, final SiteErrorType type) {
+ public void setErrorMessage(final String message, final Level type) {
errorLabel.setText(message);
errorIcon.setVisible(true);
toolbar.setVisible(true);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.platf.client.ui.dialogs;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.google.gwt.user.client.ui.DeckPanel;
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.platf.client.ui.download;
+
+public interface FileConstants {
+ String HASH = "hash";
+ String TOKEN = "token";
+ String DOWNLOAD = "download";
+ String IMGSIZE = "imgsize";
+ String FILENAME = "filename";
+ String TYPE_ID = "typeid";
+ String LOGO_FORM_FIELD = "k-elogov-ff";
+ int LOGO_ICON_DEFAULT_HEIGHT = 60;
+ int LOGO_ICON_DEFAULT_WIDTH = 468;
+ int LOGO_ICON_MIN_HEIGHT = 28;
+ int LOGO_ICON_MIN_WIDTH = 468;
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -48,7 +48,7 @@
}
public String getImageResizedUrl(final StateToken token, ImageSize imageSize) {
- return calculateUrl(token, false) + "&" + new UrlParam(FileParams.IMGSIZE, imageSize.toString());
+ return calculateUrl(token, false) + "&" + new UrlParam(FileConstants.IMGSIZE, imageSize.toString());
}
public String getImageUrl(final StateToken token) {
@@ -67,12 +67,12 @@
}
public String getLogoImageUrl(StateToken token) {
- return new Url(LOGODOWNLOADSERVLET, new UrlParam(FileParams.TOKEN, token.toString())).toString();
+ return new Url(LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, token.toString())).toString();
}
private String calculateUrl(final StateToken token, final boolean download) {
- return new Url(DOWNLOADSERVLET, new UrlParam(FileParams.TOKEN, token.toString()), new UrlParam(FileParams.HASH,
- session.getUserHash()), new UrlParam(FileParams.DOWNLOAD, download)).toString();
+ return new Url(DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(FileConstants.HASH,
+ session.getUserHash()), new UrlParam(FileConstants.DOWNLOAD, download)).toString();
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileParams.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -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.platf.client.ui.download;
-
-public interface FileParams {
- String HASH = "hash";
- String TOKEN = "token";
- String DOWNLOAD = "download";
- String IMGSIZE = "imgsize";
- String FILENAME = "filename";
- String TYPE_ID = "typeid";
-}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/ConfirmationAsk.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/ConfirmationAsk.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/ConfirmationAsk.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,35 @@
+package org.ourproject.kune.platf.client.ui.noti;
+
+import com.calclab.suco.client.events.Listener0;
+
+public class ConfirmationAsk {
+
+ private final String title;
+ private final String message;
+ private final Listener0 onConfirmed;
+ private final Listener0 onCancel;
+
+ public ConfirmationAsk(final String title, final String message, final Listener0 onConfirmed,
+ final Listener0 onCancel) {
+ this.title = title;
+ this.message = message;
+ this.onConfirmed = onConfirmed;
+ this.onCancel = onCancel;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Listener0 getOnCancel() {
+ return onCancel;
+ }
+
+ public Listener0 getOnConfirmed() {
+ return onConfirmed;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+}
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.platf.client.ui.noti;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.calclab.suco.client.events.Event;
import com.calclab.suco.client.events.Event0;
@@ -38,12 +38,19 @@
private static Event2<String, String> onAlert;
+ private static Event<ConfirmationAsk> onConfirmationAsk;
+
private static Event<String> onProgress;
private static Event0 onHideProgress;
private static I18nTranslationService i18n;
+ public static void askConfirmation(String confirmationTitle, String confirmationText, Listener0 onConfirm,
+ Listener0 onCancel) {
+ onConfirmationAsk.fire(new ConfirmationAsk(confirmationTitle, confirmationText, onConfirm, onCancel));
+ }
+
public static void error(final String message) {
onNotify.fire(Level.error, message);
}
@@ -91,15 +98,20 @@
public NotifyUser(I18nTranslationService i18n) {
NotifyUser.i18n = i18n;
onNotify = new Event2<Level, String>("onNotify");
- onAlert = new Event2<String, String>("onNotify");
+ onAlert = new Event2<String, String>("onAlert");
onProgress = new Event<String>("onProgress");
onHideProgress = new Event0("onHideProgress");
+ onConfirmationAsk = new Event<ConfirmationAsk>("onConfirmationAsk");
}
public void addAlerter(final Listener2<String, String> listener) {
onAlert.add(listener);
}
+ public void addConfirmationAsker(final Listener<ConfirmationAsk> listener) {
+ onConfirmationAsk.add(listener);
+ }
+
public void addHideProgressNotifier(final Listener0 listener) {
onHideProgress.add(listener);
}
@@ -111,4 +123,5 @@
public void addProgressNotifier(final Listener<String> listener) {
onProgress.add(listener);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -3,7 +3,7 @@
import java.util.Date;
import org.ourproject.kune.platf.client.actions.ActionCollection;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.BasicFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.ExtendedFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -11,7 +11,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,36 +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.platf.client.ui.upload;
-
-import org.ourproject.kune.platf.client.ui.download.FileParams;
-
-import com.gwtext.client.core.UrlParam;
-
-public class AbstractUploader {
-
- public UrlParam[] genUploadParams(final String userhash, final String currentStateToken, final String typeId) {
- // Warning take into account param[size]
- final UrlParam param[] = new UrlParam[3];
- param[0] = new UrlParam(FileParams.HASH, userhash);
- param[1] = new UrlParam(FileParams.TOKEN, currentStateToken);
- param[2] = new UrlParam(FileParams.TYPE_ID, typeId);
- return param;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,40 +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.platf.client.ui.upload;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-import com.calclab.suco.client.events.Listener;
-
-public interface FileUploader {
-
- void addOnUploadCompleteListener(Listener<StateToken> listener);
-
- boolean hasUploadingFiles();
-
- void hide();
-
- void resetPermittedExtensions();
-
- void setPermittedExtensions(String extensions);
-
- void show();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,195 +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.platf.client.ui.upload;
-
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtextux.client.widgets.upload.UploadDialog;
-import com.gwtextux.client.widgets.upload.UploadDialogListenerAdapter;
-
-public class FileUploaderDialog extends AbstractUploader implements FileUploaderView {
-
- protected static final String SITE_FILE_UPLOADER = "k-site-file-uploader";
-
- private static final String URL = "/kune/servlets/FileUploadManager";
-
- private UploadDialog dialog;
- private ToolbarButton traybarButton;
- private final I18nUITranslationService i18n;
- private final WorkspaceSkeleton ws;
- private final FileUploaderPresenter presenter;
-
- public FileUploaderDialog(final FileUploaderPresenter presenter, final I18nUITranslationService i18n,
- final WorkspaceSkeleton ws) {
- this.presenter = presenter;
- this.i18n = i18n;
- this.ws = ws;
- createDialog(false);
- }
-
- public void destroy() {
- if (hasUploadingFiles()) {
- dialog.stopUpload();
- NotifyUser.important(i18n.t("Upload cancelled after signing out"));
- }
- if (dialog != null) {
- dialog.destroy();
- dialog = null;
- }
- if (traybarButton != null) {
- traybarButton.destroy();
- traybarButton = null;
- }
- }
-
- public boolean hasUploadingFiles() {
- return dialog.hasUnuploadedFiles();
- }
-
- public void hide() {
- dialog.hide();
- }
-
- public void resetPermittedExtensions() {
- final String[] extensions = {};
- setPermittedExtensions(extensions);
- }
-
- public void setPermittedExtensions(final String extensions) {
- final Object[] objs = TextUtils.splitTags(extensions).toArray();
- final String[] exts = new String[objs.length];
- for (int i = 0; i < objs.length; i++) {
- exts[i] = (String) objs[i];
- }
- setPermittedExtensions(exts);
- }
-
- public void setUploadParams(final String userhash, final String currentStateToken, final String typeId) {
- dialog.setBaseParams(genUploadParams(userhash, currentStateToken, typeId));
- }
-
- public void show() {
- if (traybarButton == null) {
- traybarButton = new ToolbarButton();
- traybarButton.setTooltip(i18n.t("Show/hide uploader window"));
- traybarButton.setIcon("images/nav/upload.png");
- traybarButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- if (dialog.isVisible()) {
- dialog.hide();
- } else {
- dialog.show();
- }
- }
- });
- ws.getSiteTraybar().addButton(traybarButton);
- }
- if (dialog == null) {
- createDialog(true);
- } else {
- dialog.show();
- }
- }
-
- private void createDialog(final boolean show) {
- dialog = new UploadDialog(i18n.t("File uploader"), false, true) {
- {
- setAllowCloseOnUpload(true);
- setResetOnHide(false);
- setClosable(true);
- setCloseAction(Window.HIDE);
- setMinimizable(true);
- setUploadAutostart(false);
- }
- };
- // dialog.setId(SITE_FILE_UPLOADER);
- dialog.addListener(new UploadDialogListenerAdapter() {
- @Override
- public boolean onBeforeAdd(final UploadDialog source, final String filename) {
- boolean mustAdd = presenter.checkFolderChange();
- if (!mustAdd) {
- NotifyUser.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location"));
- }
- return mustAdd;
- }
-
- @Override
- public void onMinimize(final Window source) {
- dialog.hide();
- }
-
- @Override
- public void onUploadComplete(final UploadDialog source) {
- if (!dialog.isVisible()) {
- NotifyUser.info(i18n.t("Upload completed"));
- traybarButton.destroy();
- traybarButton = null;
- }
- presenter.onUploadComplete();
- }
-
- @Override
- public void onUploadError(final UploadDialog source, final String filename, final JavaScriptObject data) {
- showError();
- }
-
- @Override
- public void onUploadFailed(final UploadDialog source, final String filename) {
- showError();
- }
-
- private void showError() {
- if (!dialog.isVisible()) {
- NotifyUser.veryImportant(i18n.t("Error uploading"));
- }
- }
-
- });
- dialog.setUrl(URL);
- if (show) {
- dialog.show();
- }
- }
-
- private void setPermittedExtensions(final String[] extensions) {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- if (dialog == null) {
- createDialog(false);
- }
- Log.info("PermittedExtensions: " + extensions.toString() + " length: " + extensions.length);
- dialog.setPermittedExtensions(extensions);
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,101 +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.platf.client.ui.upload;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
-
-import com.calclab.suco.client.events.Event;
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class FileUploaderPresenter implements FileUploader {
-
- private FileUploaderView view;
- private final Session session;
- private StateToken currentUploadStateToken;
- private final Event<StateToken> onUploadComplete;
-
- public FileUploaderPresenter(final Session session) {
- this.session = session;
- this.onUploadComplete = new Event<StateToken>("onUploadComplete");
- }
-
- public void addOnUploadCompleteListener(final Listener<StateToken> slot) {
- onUploadComplete.add(slot);
- }
-
- public boolean checkFolderChange() {
- final StateToken currentFolderStateToken = session.getCurrentStateToken().copy().clearDocument();
- if (sameContainer()) {
- view.setUploadParams(session.getUserHash(), currentFolderStateToken.toString(),
- currentFolderStateToken.getTool() + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX);
- return true;
- }
- if (view.hasUploadingFiles()) {
- return false;
- } else {
- currentUploadStateToken = currentFolderStateToken;
- view.setUploadParams(session.getUserHash(), currentFolderStateToken.toString(),
- currentFolderStateToken.getTool() + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX);
- return true;
- }
- }
-
- public boolean hasUploadingFiles() {
- return view.hasUploadingFiles();
- }
-
- public void hide() {
- view.hide();
- }
-
- public void init(final FileUploaderView view) {
- this.view = view;
- session.onUserSignOut(new Listener0() {
- public void onEvent() {
- view.destroy();
- }
- });
- }
-
- public void onUploadComplete() {
- onUploadComplete.fire(currentUploadStateToken);
- }
-
- public void resetPermittedExtensions() {
- view.resetPermittedExtensions();
- }
-
- public void setPermittedExtensions(final String extensions) {
- view.setPermittedExtensions(extensions);
- }
-
- public void show() {
- view.show();
- }
-
- private boolean sameContainer() {
- final StateToken currentStateToken = session.getCurrentStateToken();
- currentUploadStateToken = currentUploadStateToken == null ? currentStateToken : currentUploadStateToken;
- return currentUploadStateToken.equals(currentStateToken);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,38 +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.platf.client.ui.upload;
-
-public interface FileUploaderView {
-
- void destroy();
-
- boolean hasUploadingFiles();
-
- void hide();
-
- void resetPermittedExtensions();
-
- void setPermittedExtensions(String extensions);
-
- void setUploadParams(String userhash, String currentUploadStateToken, String typeId);
-
- void show();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,13 +24,13 @@
import org.ourproject.kune.app.server.AbstractExtendedModule;
import org.ourproject.kune.chat.server.managers.XmppManager;
import org.ourproject.kune.chat.server.managers.XmppManagerDefault;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.ContentService;
import org.ourproject.kune.platf.client.rpc.GroupService;
import org.ourproject.kune.platf.client.rpc.I18nService;
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.rpc.UserService;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.server.access.AccessRightsService;
import org.ourproject.kune.platf.server.access.AccessRightsServiceDefault;
import org.ourproject.kune.platf.server.access.AccessService;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/i18n/I18nTranslationServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/i18n/I18nTranslationServiceDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/i18n/I18nTranslationServiceDefault.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.platf.server.i18n;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.domain.I18nTranslation;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoDownloadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoDownloadManager.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoDownloadManager.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -28,7 +28,7 @@
import javax.servlet.http.HttpServletResponse;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.ui.download.FileParams;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.manager.GroupManager;
@@ -46,7 +46,7 @@
IOException {
// final String userHash = req.getParameter(FileParams.HASH);
- final StateToken stateToken = new StateToken(req.getParameter(FileParams.TOKEN));
+ final StateToken stateToken = new StateToken(req.getParameter(FileConstants.TOKEN));
Group group = Group.NO_GROUP;
try {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -30,7 +30,8 @@
import org.apache.commons.fileupload.FileItem;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.server.access.AccessRol;
import org.ourproject.kune.platf.server.auth.ActionLevel;
import org.ourproject.kune.platf.server.auth.Authenticated;
@@ -38,7 +39,6 @@
import org.ourproject.kune.platf.server.domain.BasicMimeType;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.manager.GroupManager;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
import com.google.inject.Inject;
import com.wideplay.warp.persist.TransactionType;
@@ -76,7 +76,7 @@
File tmpDestFile = File.createTempFile("logoDest", "");
boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(), tmpDestFile.getAbsolutePath(),
- EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT);
+ FileConstants.LOGO_ICON_DEFAULT_HEIGHT);
if (result) {
group.setLogo(FileUtils.getBytesFromFile(tmpDestFile));
group.setLogoMime(mimeType);
@@ -126,7 +126,7 @@
protected String createXmlResponse(final boolean success, final String message) {
String error = "";
if (!success) {
- error = "<errors><field><id>" + EntityHeaderView.LOGO_FORM_FIELD + "</id><msg><![CDATA[" + message
+ error = "<errors><field><id>" + FileConstants.LOGO_FORM_FIELD + "</id><msg><![CDATA[" + message
+ "]]></msg></field></errors>";
}
return "<response success=\"" + success + "\">" + error + "</response>";
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManager.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -31,7 +31,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.ContentNotFoundException;
-import org.ourproject.kune.platf.client.ui.download.FileParams;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
import org.ourproject.kune.platf.server.access.AccessRol;
import org.ourproject.kune.platf.server.auth.ActionLevel;
@@ -71,10 +71,10 @@
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException,
IOException {
- final String userHash = req.getParameter(FileParams.HASH);
- final StateToken stateToken = new StateToken(req.getParameter(FileParams.TOKEN));
- final String downloadS = req.getParameter(FileParams.DOWNLOAD);
- String imageSizeS = req.getParameter(FileParams.IMGSIZE);
+ final String userHash = req.getParameter(FileConstants.HASH);
+ final StateToken stateToken = new StateToken(req.getParameter(FileConstants.TOKEN));
+ final String downloadS = req.getParameter(FileConstants.DOWNLOAD);
+ String imageSizeS = req.getParameter(FileConstants.IMGSIZE);
try {
Content cnt = getContentForDownload(userHash, stateToken);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileJsonUploadManagerAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileJsonUploadManagerAbstract.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileJsonUploadManagerAbstract.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,7 +26,7 @@
import net.sf.json.JSONObject;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.google.inject.Inject;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManager.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -27,7 +27,7 @@
import org.apache.commons.fileupload.FileItem;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.access.AccessRol;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManagerAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManagerAbstract.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/FileUploadManagerAbstract.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -38,7 +38,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.ui.download.FileParams;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.server.properties.KuneProperties;
import com.google.inject.Inject;
@@ -98,13 +98,13 @@
final String name = item.getFieldName();
final String value = item.getString();
log.info("name: " + name + " value: " + value);
- if (name.equals(FileParams.HASH)) {
+ if (name.equals(FileConstants.HASH)) {
userHash = value;
}
- if (name.equals(FileParams.TOKEN)) {
+ if (name.equals(FileConstants.TOKEN)) {
stateToken = new StateToken(value);
}
- if (name.equals(FileParams.TYPE_ID)) {
+ if (name.equals(FileConstants.TYPE_ID)) {
typeId = value;
}
} else {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.platf.server.state;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.access.AccessRightsService;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Container;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,14 +26,13 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.wiki.client.cnt.WikiViewer;
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
@@ -42,6 +41,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,16 +23,15 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.wiki.client.cnt.WikiFolderContent;
import org.ourproject.kune.wiki.client.cnt.WikiFolderContentPanel;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.wiki.client;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.wiki.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiFolderContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.wiki.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/server/WikiServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/server/WikiServerTool.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/wiki/server/WikiServerTool.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.errors.ContainerNotPermittedException;
import org.ourproject.kune.platf.client.errors.ContentNotPermittedException;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.AccessLists;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -44,16 +44,15 @@
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.cnt.FoldableContent;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -61,6 +60,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -27,7 +27,6 @@
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionCntCtxToolbarPanel;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbar;
@@ -41,9 +40,10 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
-import org.ourproject.kune.platf.client.app.TextEditorInsertElementGroup;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.registry.RenamableRegistry;
@@ -55,8 +55,6 @@
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
@@ -65,9 +63,6 @@
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderDialog;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderPresenter;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
@@ -80,6 +75,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementGroup;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPanel;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPresenter;
import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmail;
@@ -194,6 +190,7 @@
import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenu;
import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPresenter;
+import org.ourproject.kune.workspace.client.skel.ActionCntCtxToolbarPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.BuddiesSummary;
import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPanel;
@@ -223,6 +220,9 @@
import org.ourproject.kune.workspace.client.title.RenameAction;
import org.ourproject.kune.workspace.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.tool.ToolSelectorPresenter;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
+import org.ourproject.kune.workspace.client.upload.FileUploaderDialog;
+import org.ourproject.kune.workspace.client.upload.FileUploaderPresenter;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.NoDecoration;
@@ -236,6 +236,8 @@
@Override
protected void onInstall() {
+ registerDecorator(TextEditorInsertElementGroup.class, new TextEditorInsertElementGroup(container));
+
register(Singleton.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
@Override
public SocialNetworkServiceAsync create() {
@@ -471,23 +473,21 @@
register(Singleton.class, new Factory<ActionManager>(ActionManager.class) {
@Override
public ActionManager create() {
- return new ActionManager($(WorkspaceSkeleton.class));
+ return new ActionManager();
}
});
register(Singleton.class, new Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
@Override
public ActionGroupSummaryToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>($$(ActionManager.class));
final ActionGroupSummaryToolbarPresenter toolbar = new ActionGroupSummaryToolbarPresenter(panel);
return toolbar;
}
}, new Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class) {
@Override
public ActionParticipationToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>($$(ActionManager.class));
final ActionParticipationSummaryToolbarPresenter toolbar = new ActionParticipationSummaryToolbarPresenter(
panel);
return toolbar;
@@ -496,7 +496,7 @@
@Override
public ActionBuddiesSummaryToolbar create() {
final ActionToolbarPanel<UserSimpleDTO> panel = new ActionToolbarPanel<UserSimpleDTO>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ $$(ActionManager.class));
final ActionBuddiesSummaryToolbarPresenter toolbar = new ActionBuddiesSummaryToolbarPresenter(panel);
return toolbar;
}
@@ -964,5 +964,6 @@
return presenter;
}
});
+
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.cnt;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
public interface ContextNavigator {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.actions.MenuItemsContainer;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -38,15 +38,15 @@
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.workspace.client.title.RenameAction;
+import org.ourproject.kune.workspace.client.upload.FileUploader;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/AccessListsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/AccessListsPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/AccessListsPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.ContextPropertyPanel;
import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.editor;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.editor;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/TextEditorInsertElementGroup.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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.editor.insert;
+
+import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstract;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class TextEditorInsertElementGroup extends ProviderCollection {
+
+ public TextEditorInsertElementGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+
+ public void resetAll() {
+ for (final Provider<?> p : getProviders()) {
+ ((TextEditorInsertAbstract) p.get()).reset();
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,8 +19,7 @@
*/
package org.ourproject.kune.workspace.client.editor.insert;
-import org.ourproject.kune.platf.client.app.TextEditorInsertElementGroup;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.workspace.client.options.AbstractOptionsPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.editor.insert.linkemail;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementView;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.editor.insert.linkext;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementView;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementView;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsTheme;
@@ -72,11 +73,12 @@
final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
Image logo;
if (clipped) {
- logo = new Image(imageUrl, 0, 0, LOGO_ICON_DEFAULT_WIDTH, LOGO_ICON_DEFAULT_HEIGHT);
+ logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_ICON_DEFAULT_WIDTH,
+ FileConstants.LOGO_ICON_DEFAULT_HEIGHT);
} else {
logo = new Image(imageUrl);
- logo.setWidth("" + LOGO_ICON_DEFAULT_WIDTH);
- logo.setHeight("" + LOGO_ICON_DEFAULT_HEIGHT);
+ logo.setWidth("" + FileConstants.LOGO_ICON_DEFAULT_WIDTH);
+ logo.setHeight("" + FileConstants.LOGO_ICON_DEFAULT_HEIGHT);
}
add(logo);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -26,14 +26,6 @@
public interface EntityHeaderView {
- int LOGO_ICON_DEFAULT_HEIGHT = 60;
- int LOGO_ICON_DEFAULT_WIDTH = 468;
-
- int LOGO_ICON_MIN_HEIGHT = 28;
- int LOGO_ICON_MIN_WIDTH = 468;
-
- String LOGO_FORM_FIELD = "k-elogov-ff";
-
void addWidget(View view);
void reloadImage(GroupDTO group);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,8 +25,8 @@
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nTranslationServiceMocked;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationServiceMocked;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.i18n;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
import org.ourproject.kune.platf.client.ui.TextUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,8 +21,8 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.i18n;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,8 +20,8 @@
package org.ourproject.kune.workspace.client.licensefoot;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.Window;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,8 +20,8 @@
package org.ourproject.kune.workspace.client.licensewizard;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.licensewizard;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.WizardDialog;
import org.ourproject.kune.platf.client.ui.dialogs.WizardListener;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.licensewizard.pages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFlags.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFlags.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFlags.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.licensewizard.pages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.platf.client.ui.KuneWindowUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardFrdForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,7 +23,7 @@
import java.util.List;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardSndForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.licensewizard.pages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardView;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardTrdForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardTrdForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/pages/LicenseWizardTrdForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.licensewizard.pages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,13 +20,14 @@
package org.ourproject.kune.workspace.client.newgroup;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.KuneWindowUtils;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialogExtended;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
@@ -175,8 +176,8 @@
KuneUiUtils.setQuickTip(licenseImage, license.getLongName());
}
- public void setMessage(final String message, final SiteErrorType type) {
- messageErrorBar.setErrorMessage(message, type);
+ public void setMessage(final String message, final Level level) {
+ messageErrorBar.setErrorMessage(message, level);
}
private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,12 +25,13 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
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.WorkspaceMessages;
import org.ourproject.kune.workspace.client.site.SiteToken;
@@ -116,10 +117,10 @@
throw caught;
} catch (final GroupNameInUseException e) {
view.unMask();
- setMessage(i18n.t(WorkspaceMessages.NAME_IN_ALREADY_IN_USE), SiteErrorType.error);
+ setMessage(i18n.t(WorkspaceMessages.NAME_IN_ALREADY_IN_USE), Level.error);
} catch (final Throwable e) {
view.unMask();
- setMessage(i18n.t("Error creating group"), SiteErrorType.error);
+ setMessage(i18n.t("Error creating group"), Level.error);
GWT.log("Other kind of exception in group registration", null);
throw new RuntimeException();
}
@@ -138,8 +139,8 @@
}
}
- public void setMessage(final String message, final SiteErrorType type) {
- view.setMessage(message, type);
+ public void setMessage(final String message, final Level level) {
+ view.setMessage(message, level);
}
private GroupType getTypeOfGroup() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface NewGroupView extends View {
@@ -54,7 +55,7 @@
void setLicense(LicenseDTO license);
- void setMessage(String message, SiteErrorType type);
+ void setMessage(String message, Level level);
void show();
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,24 +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.newgroup;
-
-public enum SiteErrorType {
- error, veryimp, imp, info
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.nohomepage;
import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.skel.EntityWorkspace;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,13 +20,13 @@
package org.ourproject.kune.workspace.client.options;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface AbstractOptions {
public void hideMessages();
- public void setErrorMessage(String message, SiteErrorType type);
+ public void setErrorMessage(String message, Level level);
void addOptionTab(View view);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Listener0;
@@ -108,8 +108,8 @@
return dialog.isVisible();
}
- public void setErrorMessage(final String message, final SiteErrorType type) {
- messageErrorBar.setErrorMessage(message, type);
+ public void setErrorMessage(final String message, final Level level) {
+ messageErrorBar.setErrorMessage(message, level);
}
public void setFirstTabActive() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.options;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public abstract class AbstractOptionsPresenter {
@@ -46,8 +46,8 @@
this.view = view;
}
- public void setErrorMessage(String message, SiteErrorType type) {
- view.setErrorMessage(message, type);
+ public void setErrorMessage(String message, Level level) {
+ view.setErrorMessage(message, level);
}
public void show() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.options;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface AbstractOptionsView extends View {
@@ -32,6 +32,6 @@
void hideMessages();
- void setErrorMessage(final String message, final SiteErrorType type);
+ void setErrorMessage(final String message, final Level level);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.options;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface EntityOptions extends AbstractOptions {
@@ -30,7 +30,7 @@
public void hideMessages();
- public void setErrorMessage(String message, SiteErrorType type);
+ public void setErrorMessage(String message, Level level);
public void show();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.PlatfMessages;
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderButton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.options.license;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,11 +20,10 @@
package org.ourproject.kune.workspace.client.options.logo;
import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
-import org.ourproject.kune.platf.client.ui.download.FileParams;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
import org.ourproject.kune.workspace.client.options.EntityOptionsView;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -85,17 +84,17 @@
});
dialogInfoLabel = new Label();
super.add(dialogInfoLabel);
- file = new TextField("File", EntityHeaderView.LOGO_FORM_FIELD);
+ file = new TextField("File", FileConstants.LOGO_FORM_FIELD);
EventCallback keyListener = new EventCallback() {
public void execute(EventObject e) {
// setEnableFileField();
}
};
file.addKeyPressListener(keyListener);
- file.setId(EntityHeaderView.LOGO_FORM_FIELD);
+ file.setId(FileConstants.LOGO_FORM_FIELD);
file.setInputType("file");
- userhashField = new Hidden(FileParams.HASH, FileParams.HASH);
- tokenField = new Hidden(FileParams.TOKEN, FileParams.TOKEN);
+ userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
+ tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
super.add(userhashField);
super.add(tokenField);
super.add(file);
@@ -139,7 +138,7 @@
public void setNormalGroupsLabels() {
dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as the logo for this group. "
+ "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT, EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT)
+ FileConstants.LOGO_ICON_DEFAULT_HEIGHT, FileConstants.LOGO_ICON_DEFAULT_HEIGHT)
+ DefaultFormUtils.brbr());
super.setTitle(PlatfMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
doLayoutIfNeeded();
@@ -148,7 +147,7 @@
public void setPersonalGroupsLabels() {
dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as your avatar. "
+ "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT, EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT)
+ FileConstants.LOGO_ICON_DEFAULT_HEIGHT, FileConstants.LOGO_ICON_DEFAULT_HEIGHT)
+ "<br/><br/>");
super.setTitle(PlatfMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
doLayoutIfNeeded();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.options.pscape;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.BasicThumb;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -22,7 +22,7 @@
import java.util.HashMap;
import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.workspace.client.options.EntityOptionsView;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,11 +25,11 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import org.ourproject.kune.workspace.client.options.EntityOptions;
import com.calclab.suco.client.events.Listener2;
@@ -128,7 +128,7 @@
checked, new AsyncCallback<Object>() {
public void onFailure(Throwable caught) {
view.setChecked(toolName, !checked);
- entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), SiteErrorType.error);
+ entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), Level.error);
}
public void onSuccess(Object result) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.rate;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -22,10 +22,10 @@
import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.rate;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.skel.Toolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/AbstractLiveSearcherPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.search;
import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import com.calclab.suco.client.events.Listener;
import com.google.gwt.user.client.Command;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.search;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
public class GroupLiveSearchPanel extends EntityLiveSearcherPanel {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.search;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.search;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
public class UserLiveSearcherPanel extends EntityLiveSearcherPanel {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.signin;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.signin;
import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -28,12 +28,12 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import com.calclab.emiteuimodule.client.SubscriptionMode;
import com.calclab.suco.client.ioc.Provider;
@@ -97,11 +97,11 @@
try {
throw caught;
} catch (final EmailAddressInUseException e) {
- view.setErrorMessage(i18n.t(PlatfMessages.EMAIL_IN_USE), SiteErrorType.error);
+ view.setErrorMessage(i18n.t(PlatfMessages.EMAIL_IN_USE), Level.error);
} catch (final GroupNameInUseException e) {
- view.setErrorMessage(i18n.t(PlatfMessages.NAME_IN_USE), SiteErrorType.error);
+ view.setErrorMessage(i18n.t(PlatfMessages.NAME_IN_USE), Level.error);
} catch (final Throwable e) {
- view.setErrorMessage(i18n.t("Error during registration."), SiteErrorType.error);
+ view.setErrorMessage(i18n.t("Error during registration."), Level.error);
GWT.log("Other kind of exception in user registration" + e.getMessage() + ", "
+ e.getLocalizedMessage(), null);
e.printStackTrace();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,12 +21,12 @@
import java.util.Date;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialogExtended;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import com.calclab.suco.client.events.Listener0;
import com.google.gwt.core.client.GWT;
@@ -83,7 +83,7 @@
GWT.log("Received hash: " + userHash, null);
}
- public void setErrorMessage(final String message, final SiteErrorType type) {
- messageErrorBar.setErrorMessage(message, type);
+ public void setErrorMessage(final String message, final Level level) {
+ messageErrorBar.setErrorMessage(message, level);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.signin;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface SignInAbstractView extends View {
@@ -38,7 +38,7 @@
void setCookie(String userHash);
- void setErrorMessage(final String message, final SiteErrorType type);
+ void setErrorMessage(final String message, final Level level);
void show();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.signin;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import com.gwtext.client.core.EventObject;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.signin;
import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,12 +24,12 @@
import org.ourproject.kune.platf.client.dto.UserDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.UserAuthException;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import org.ourproject.kune.workspace.client.site.SiteToken;
import com.allen_sauer.gwt.log.client.Log;
@@ -96,10 +96,9 @@
try {
throw caught;
} catch (final UserAuthException e) {
- view.setErrorMessage(i18n.t(PlatfMessages.INCORRECT_NICKNAME_EMAIL_OR_PASSWORD),
- SiteErrorType.error);
+ view.setErrorMessage(i18n.t(PlatfMessages.INCORRECT_NICKNAME_EMAIL_OR_PASSWORD), Level.error);
} catch (final Throwable e) {
- view.setErrorMessage("Error in login", SiteErrorType.error);
+ view.setErrorMessage("Error in login", Level.error);
Log.error("Other kind of exception in SignInPresenter/doLogin");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.signin;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface SignInView extends SignInAbstractView {
@@ -45,7 +45,7 @@
void setCookie(final String userHash);
- void setErrorMessage(final String message, final SiteErrorType type);
+ void setErrorMessage(final String message, final Level level);
void show();
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-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,6 +1,7 @@
package org.ourproject.kune.workspace.client.site;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+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;
@@ -52,6 +53,11 @@
ws.get().showAlertMessage(title, msg);
}
});
+ notifyUser.addConfirmationAsker(new Listener<ConfirmationAsk>() {
+ public void onEvent(ConfirmationAsk ask) {
+ ws.get().askConfirmation(ask.getTitle(), ask.getMessage(), ask.getOnConfirmed(), ask.getOnCancel());
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/MessagePresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,12 +19,12 @@
*/
package org.ourproject.kune.workspace.client.site.msg;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface MessagePresenter {
void resetMessage();
- void setMessage(final String message, final SiteErrorType type);
+ void setMessage(final String message, final Level level);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SimpleMessagePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.site.msg;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+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.HTML;
@@ -67,16 +67,16 @@
this.message.setHTML(text);
}
- public void setMessage(final String text, final SiteErrorType lastMessageType, final SiteErrorType type) {
+ public void setMessage(final String text, final Level lastMessageType, final Level type) {
AbstractImagePrototype imagePrototype = null;
switch (type) {
case error:
imagePrototype = images.error();
break;
- case veryimp:
+ case veryImportant:
imagePrototype = images.important();
break;
- case imp:
+ case important:
imagePrototype = images.emblemImportant();
break;
case info:
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.siteoptions;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,10 +19,10 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitepublic;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.Window;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,8 +20,8 @@
package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitesign;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitesign;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -21,9 +21,9 @@
import org.ourproject.kune.platf.client.PlatfMessages;
import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionCntCtxToolbarPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,76 @@
+/*
+ *
+ * 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.skel;
+
+import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class ActionCntCtxToolbarPanel<T> extends ActionToolbarPanel<T> {
+
+ public enum Position {
+ content, context
+ }
+
+ private final Position position;
+ private final WorkspaceSkeleton ws;
+
+ public ActionCntCtxToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
+ final WorkspaceSkeleton ws) {
+ super(actionManagerProvider);
+ this.position = position;
+ this.ws = ws;
+ }
+
+ @Override
+ public void attach() {
+ if (!topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().removeAll();
+ ws.getEntityWorkspace().getContentTopBar().add(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().removeAll();
+ ws.getEntityWorkspace().getContextTopBar().add(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
+ }
+ }
+ }
+
+ @Override
+ public void detach() {
+ if (topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().remove(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().remove(bottombar);
+ }
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,6 +20,7 @@
package org.ourproject.kune.workspace.client.skel;
import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import com.google.gwt.user.client.ui.Widget;
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,97 +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.skel;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-
-public class SimpleToolbar extends Composite {
-
- private final HorizontalPanel childPanel;
- private final HorizontalPanel mainPanel;
-
- public SimpleToolbar() {
- mainPanel = new HorizontalPanel();
- childPanel = new HorizontalPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- mainPanel.setWidth("100%");
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void add(final Widget widget, VerticalAlignmentConstant valign) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, valign);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- this.add(emptyLabel);
- childPanel.setCellWidth(emptyLabel, "100%");
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public void remove(final Widget widget) {
- childPanel.remove(widget);
- }
-
- public void removeAll() {
- childPanel.clear();
- }
-
- public void setCellWidth(Widget widget, String width) {
- childPanel.setCellWidth(widget, width);
- }
-
- public void setCleanStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
- addStyleName("k-blank-toolbar");
- }
-
- @Override
- public void setHeight(String height) {
- mainPanel.setHeight(height);
- mainPanel.setCellHeight(childPanel, height);
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,6 +19,8 @@
\*/
package org.ourproject.kune.workspace.client.skel;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,6 +19,8 @@
\*/
package org.ourproject.kune.workspace.client.skel;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,6 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.skel;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import com.calclab.suco.client.events.Listener0;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -28,9 +28,9 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.BasicThumb;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -39,10 +39,10 @@
import org.ourproject.kune.platf.client.dto.UserBuddiesDataDTO;
import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,11 +25,11 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsTheme;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -40,10 +40,10 @@
import org.ourproject.kune.platf.client.dto.SocialNetworkVisibilityDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.ImageDescriptor;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -24,10 +24,10 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsTheme;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -27,8 +27,8 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -30,19 +30,19 @@
import org.ourproject.kune.platf.client.dto.SocialNetworkDataDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.MenuItemCollection;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.gridmenu.CustomMenu;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -129,7 +129,7 @@
protected String createTooltipWithLogo(String shortName, StateToken token, boolean hasLogo, boolean isPersonal) {
return "<table><tr><td>"
+ (hasLogo ? downloadProvider.get().getLogoAvatarHtml(token, hasLogo, isPersonal,
- EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT, 3) : "") + "</td><td>"
+ FileConstants.LOGO_ICON_DEFAULT_HEIGHT, 3) : "") + "</td><td>"
+ i18n.t(isPersonal ? "Nickname: [%s]" : "Group short name: [%s]", shortName) + "</td></tr></table>";
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -1,6 +1,6 @@
package org.ourproject.kune.workspace.client.socialnet.other;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderButton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.tags;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.themes;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener2;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.title;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Label;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -25,8 +25,8 @@
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
import com.calclab.suco.client.events.Listener;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.title;
import org.ourproject.kune.platf.client.ui.IconLabelEditable;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener2;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -23,8 +23,8 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.NameInUseException;
import org.ourproject.kune.platf.client.errors.NameNotPermittedException;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/AbstractUploader.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/AbstractUploader.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/AbstractUploader.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.upload;
+
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
+
+import com.gwtext.client.core.UrlParam;
+
+public class AbstractUploader {
+
+ public UrlParam[] genUploadParams(final String userhash, final String currentStateToken, final String typeId) {
+ // Warning take into account param[size]
+ final UrlParam param[] = new UrlParam[3];
+ param[0] = new UrlParam(FileConstants.HASH, userhash);
+ param[1] = new UrlParam(FileConstants.TOKEN, currentStateToken);
+ param[2] = new UrlParam(FileConstants.TYPE_ID, typeId);
+ return param;
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploader.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploader.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploader.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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.upload;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+import com.calclab.suco.client.events.Listener;
+
+public interface FileUploader {
+
+ void addOnUploadCompleteListener(Listener<StateToken> listener);
+
+ boolean hasUploadingFiles();
+
+ void hide();
+
+ void resetPermittedExtensions();
+
+ void setPermittedExtensions(String extensions);
+
+ void show();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,195 @@
+/*
+ *
+ * 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.upload;
+
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtextux.client.widgets.upload.UploadDialog;
+import com.gwtextux.client.widgets.upload.UploadDialogListenerAdapter;
+
+public class FileUploaderDialog extends AbstractUploader implements FileUploaderView {
+
+ protected static final String SITE_FILE_UPLOADER = "k-site-file-uploader";
+
+ private static final String URL = "/kune/servlets/FileUploadManager";
+
+ private UploadDialog dialog;
+ private ToolbarButton traybarButton;
+ private final I18nUITranslationService i18n;
+ private final WorkspaceSkeleton ws;
+ private final FileUploaderPresenter presenter;
+
+ public FileUploaderDialog(final FileUploaderPresenter presenter, final I18nUITranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ this.presenter = presenter;
+ this.i18n = i18n;
+ this.ws = ws;
+ createDialog(false);
+ }
+
+ public void destroy() {
+ if (hasUploadingFiles()) {
+ dialog.stopUpload();
+ NotifyUser.important(i18n.t("Upload cancelled after signing out"));
+ }
+ if (dialog != null) {
+ dialog.destroy();
+ dialog = null;
+ }
+ if (traybarButton != null) {
+ traybarButton.destroy();
+ traybarButton = null;
+ }
+ }
+
+ public boolean hasUploadingFiles() {
+ return dialog.hasUnuploadedFiles();
+ }
+
+ public void hide() {
+ dialog.hide();
+ }
+
+ public void resetPermittedExtensions() {
+ final String[] extensions = {};
+ setPermittedExtensions(extensions);
+ }
+
+ public void setPermittedExtensions(final String extensions) {
+ final Object[] objs = TextUtils.splitTags(extensions).toArray();
+ final String[] exts = new String[objs.length];
+ for (int i = 0; i < objs.length; i++) {
+ exts[i] = (String) objs[i];
+ }
+ setPermittedExtensions(exts);
+ }
+
+ public void setUploadParams(final String userhash, final String currentStateToken, final String typeId) {
+ dialog.setBaseParams(genUploadParams(userhash, currentStateToken, typeId));
+ }
+
+ public void show() {
+ if (traybarButton == null) {
+ traybarButton = new ToolbarButton();
+ traybarButton.setTooltip(i18n.t("Show/hide uploader window"));
+ traybarButton.setIcon("images/nav/upload.png");
+ traybarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+ });
+ ws.getSiteTraybar().addButton(traybarButton);
+ }
+ if (dialog == null) {
+ createDialog(true);
+ } else {
+ dialog.show();
+ }
+ }
+
+ private void createDialog(final boolean show) {
+ dialog = new UploadDialog(i18n.t("File uploader"), false, true) {
+ {
+ setAllowCloseOnUpload(true);
+ setResetOnHide(false);
+ setClosable(true);
+ setCloseAction(Window.HIDE);
+ setMinimizable(true);
+ setUploadAutostart(false);
+ }
+ };
+ // dialog.setId(SITE_FILE_UPLOADER);
+ dialog.addListener(new UploadDialogListenerAdapter() {
+ @Override
+ public boolean onBeforeAdd(final UploadDialog source, final String filename) {
+ boolean mustAdd = presenter.checkFolderChange();
+ if (!mustAdd) {
+ NotifyUser.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location"));
+ }
+ return mustAdd;
+ }
+
+ @Override
+ public void onMinimize(final Window source) {
+ dialog.hide();
+ }
+
+ @Override
+ public void onUploadComplete(final UploadDialog source) {
+ if (!dialog.isVisible()) {
+ NotifyUser.info(i18n.t("Upload completed"));
+ traybarButton.destroy();
+ traybarButton = null;
+ }
+ presenter.onUploadComplete();
+ }
+
+ @Override
+ public void onUploadError(final UploadDialog source, final String filename, final JavaScriptObject data) {
+ showError();
+ }
+
+ @Override
+ public void onUploadFailed(final UploadDialog source, final String filename) {
+ showError();
+ }
+
+ private void showError() {
+ if (!dialog.isVisible()) {
+ NotifyUser.veryImportant(i18n.t("Error uploading"));
+ }
+ }
+
+ });
+ dialog.setUrl(URL);
+ if (show) {
+ dialog.show();
+ }
+ }
+
+ private void setPermittedExtensions(final String[] extensions) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ if (dialog == null) {
+ createDialog(false);
+ }
+ Log.info("PermittedExtensions: " + extensions.toString() + " length: " + extensions.length);
+ dialog.setPermittedExtensions(extensions);
+ }
+ });
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderPresenter.java (from rev 1053, trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,101 @@
+/*
+ *
+ * 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.upload;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+
+import com.calclab.suco.client.events.Event;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class FileUploaderPresenter implements FileUploader {
+
+ private FileUploaderView view;
+ private final Session session;
+ private StateToken currentUploadStateToken;
+ private final Event<StateToken> onUploadComplete;
+
+ public FileUploaderPresenter(final Session session) {
+ this.session = session;
+ this.onUploadComplete = new Event<StateToken>("onUploadComplete");
+ }
+
+ public void addOnUploadCompleteListener(final Listener<StateToken> slot) {
+ onUploadComplete.add(slot);
+ }
+
+ public boolean checkFolderChange() {
+ final StateToken currentFolderStateToken = session.getCurrentStateToken().copy().clearDocument();
+ if (sameContainer()) {
+ view.setUploadParams(session.getUserHash(), currentFolderStateToken.toString(),
+ currentFolderStateToken.getTool() + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX);
+ return true;
+ }
+ if (view.hasUploadingFiles()) {
+ return false;
+ } else {
+ currentUploadStateToken = currentFolderStateToken;
+ view.setUploadParams(session.getUserHash(), currentFolderStateToken.toString(),
+ currentFolderStateToken.getTool() + "." + FoldableAbstractClientTool.UPLOADEDFILE_SUFFIX);
+ return true;
+ }
+ }
+
+ public boolean hasUploadingFiles() {
+ return view.hasUploadingFiles();
+ }
+
+ public void hide() {
+ view.hide();
+ }
+
+ public void init(final FileUploaderView view) {
+ this.view = view;
+ session.onUserSignOut(new Listener0() {
+ public void onEvent() {
+ view.destroy();
+ }
+ });
+ }
+
+ public void onUploadComplete() {
+ onUploadComplete.fire(currentUploadStateToken);
+ }
+
+ public void resetPermittedExtensions() {
+ view.resetPermittedExtensions();
+ }
+
+ public void setPermittedExtensions(final String extensions) {
+ view.setPermittedExtensions(extensions);
+ }
+
+ public void show() {
+ view.show();
+ }
+
+ private boolean sameContainer() {
+ final StateToken currentStateToken = session.getCurrentStateToken();
+ currentUploadStateToken = currentUploadStateToken == null ? currentStateToken : currentUploadStateToken;
+ return currentUploadStateToken.equals(currentStateToken);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderView.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderView.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderView.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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.upload;
+
+public interface FileUploaderView {
+
+ void destroy();
+
+ boolean hasUploadingFiles();
+
+ void hide();
+
+ void resetPermittedExtensions();
+
+ void setPermittedExtensions(String extensions);
+
+ void setUploadParams(String userhash, String currentUploadStateToken, String typeId);
+
+ void show();
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -5,7 +5,7 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.services.I18nTranslationServiceMocked;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationServiceMocked;
import com.google.gwt.user.client.ui.KeyboardListener;
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/FileUploaderPresenterTest.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -9,8 +9,8 @@
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderPresenter;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderView;
+import org.ourproject.kune.workspace.client.upload.FileUploaderPresenter;
+import org.ourproject.kune.workspace.client.upload.FileUploaderView;
public class FileUploaderPresenterTest {
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -4,7 +4,7 @@
import java.io.IOException;
import org.junit.Ignore;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
@@ -24,8 +24,7 @@
// PlatfMessages.ENT_OPTIONS_GROUP_TITLE);
click(EntityOptionsLogoPanel.SET_LOGO_ID);
File dir = new File(".");
- type(EntityHeaderView.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator
- + filename);
+ type(FileConstants.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator + filename);
click(EntityOptionsLogoPanel.SET_LOGO_ID);
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/I18nManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/I18nManagerTest.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/I18nManagerTest.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -9,7 +9,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.server.PersistenceTest;
import org.ourproject.kune.platf.server.domain.I18nCountry;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2009-03-02 13:25:37 UTC (rev 1053)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2009-03-02 19:32:02 UTC (rev 1054)
@@ -7,7 +7,7 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
1
0
Author: vjrj
Date: 2009-03-02 14:25:37 +0100 (Mon, 02 Mar 2009)
New Revision: 1053
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateIt.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/Star.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/AbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelector.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItem.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenter.java
trunk/src/test/java/org/ourproject/kune/workspace/client/tool/
trunk/src/test/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/
trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
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
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Site renamed to NotifyUser and now it use Suco Events. In the future we can use different UI notifiers -people with vision difficulties need to use other user notifiers different than a toaster dialog-
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/TODO 2009-03-02 13:25:37 UTC (rev 1053)
@@ -462,6 +462,8 @@
http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
** <v> P2P downloads for bigg uploads (the server acts as seeder).
+** TODO <s> Include CC0 license:
+ http://creativecommons.org/license/zero/
* LONG-TERM
** <s> integrate some blog/wiki converter:
http://code.google.com/p/google-blog-converters-appengine/
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -41,7 +41,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
public class BlogClientTool extends FoldableAbstractClientTool {
public static final String NAME = "blogs";
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -38,11 +38,11 @@
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.ioc.decorator.Singleton;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
public class ChatClientTool extends FoldableAbstractClientTool {
public static final String NAME = "chats";
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -27,9 +27,9 @@
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.ioc.Provider;
@@ -59,7 +59,7 @@
view.setInfo(i18n.t("Select a chat room"));
}
} else {
- view.setInfo("History of room conversations..." + Site.IN_DEVELOPMENT);
+ view.setInfo("History of room conversations..." + TextUtils.IN_DEVELOPMENT_P);
}
super.setState(state);
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.ioc.Provider;
@@ -44,14 +44,14 @@
}
public void addRoom(String roomName) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final String groupShortName = session.getCurrentState().getGroup().getShortName();
contentServiceProvider.get().addRoom(session.getUserHash(),
session.getContainerState().getRootContainer().getStateToken(), groupShortName + "-" + roomName,
new AsyncCallbackSimple<StateContainerDTO>() {
public void onSuccess(final StateContainerDTO state) {
stateManager.setRetrievedState(state);
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -41,7 +41,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
public class DocumentClientTool extends FoldableAbstractClientTool {
public static final String NAME = "docs";
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -41,7 +41,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
public class GalleryClientTool extends FoldableAbstractClientTool {
public static final String NAME = "gallery";
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,7 +20,6 @@
package org.ourproject.kune.platf.client.actions;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
-import org.ourproject.kune.workspace.client.socialnet.RadioMustBeChecked;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.platf.client.actions;
+
+public interface RadioMustBeChecked {
+ boolean mustBeChecked();
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -23,8 +23,8 @@
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SiteServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
-import org.ourproject.kune.workspace.client.site.Site;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event0;
@@ -84,7 +84,7 @@
public void onFailure(final Throwable error) {
RootPanel.get("kuneinitialcurtain").setVisible(false);
RootPanel.get("kuneloading").setVisible(false);
- Site.error("Error fetching initial data");
+ NotifyUser.error("Error fetching initial data");
Log.debug(error.getMessage());
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -31,7 +31,7 @@
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event0;
@@ -56,7 +56,7 @@
public void doSessionExpired() {
onSessionExpired.fire();
- Site.info("Your session has expired. Please log in again.");
+ NotifyUser.info("Your session has expired. Please log in again.");
}
public void onSessionExpired(final Listener0 listener) {
@@ -64,12 +64,12 @@
}
public void process(final Throwable caught) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
try {
throw caught;
} catch (final AccessViolationException e) {
logException(e);
- Site.error(i18n.t("You do not have rights to perform that action"));
+ NotifyUser.error(i18n.t("You do not have rights to perform that action"));
} catch (final SessionExpiredException e) {
logException(e);
doSessionExpired();
@@ -78,39 +78,39 @@
if (session.isLogged()) {
doSessionExpired();
} else {
- Site.important(i18n.t("Please sign in or register to collaborate"));
+ NotifyUser.important(i18n.t("Please sign in or register to collaborate"));
}
} catch (final GroupNotFoundException e) {
logException(e);
- Site.veryImportant(i18n.t("Group not found"));
+ NotifyUser.veryImportant(i18n.t("Group not found"));
stateManagerProvider.get().gotoToken("");
} catch (final IncompatibleRemoteServiceException e) {
- Site.error(i18n.t("Your browser is outdated with the server software. Please reload this page."));
+ NotifyUser.error(i18n.t("Your browser is outdated with the server software. Please reload this page."));
} catch (final ContentNotFoundException e) {
logException(e);
- Site.veryImportant(i18n.t("Content not found"));
+ NotifyUser.veryImportant(i18n.t("Content not found"));
stateManagerProvider.get().gotoToken("");
} catch (final ContentNotPermittedException e) {
logException(e);
- Site.error(i18n.t("Action not permitted in this location"));
+ NotifyUser.error(i18n.t("Action not permitted in this location"));
stateManagerProvider.get().gotoToken("");
} catch (final ContainerNotPermittedException e) {
logException(e);
- Site.error(i18n.t("Action not permitted in this location"));
+ NotifyUser.error(i18n.t("Action not permitted in this location"));
stateManagerProvider.get().gotoToken("");
} catch (final LastAdminInGroupException e) {
logException(e);
- Site.showAlertMessage(i18n.t("Warning"), i18n.t("Sorry, you are the last admin of this group."
+ NotifyUser.showAlertMessage(i18n.t("Warning"), i18n.t("Sorry, you are the last admin of this group."
+ " Look for someone to substitute you appropriately as admin before leaving this group."));
} catch (final AlreadyGroupMemberException e) {
logException(e);
- Site.error(i18n.t("This group is already a group member"));
+ NotifyUser.error(i18n.t("This group is already a group member"));
} catch (final AlreadyUserMemberException e) {
logException(e);
- Site.error(i18n.t("This user is already a group member"));
+ NotifyUser.error(i18n.t("This user is already a group member"));
} catch (final Throwable e) {
logException(e, true);
- Site.error(i18n.t("Error performing operation"));
+ NotifyUser.error(i18n.t("Error performing operation"));
GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
}
}
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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -40,6 +40,7 @@
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePanel;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePresenter;
@@ -212,6 +213,13 @@
// ew TestRTEDialog($(RTEditor.class));
+ register(ApplicationComponentGroup.class, new Factory<NotifyUser>(NotifyUser.class) {
+ @Override
+ public NotifyUser create() {
+ return new NotifyUser($(I18nTranslationService.class));
+ }
+ });
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/ContentProviderDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -43,7 +43,7 @@
}
public void getContent(final String user, final StateToken newState, final AsyncCallback<StateAbstractDTO> callback) {
- Site.showProgressLoading();
+ NotifyUser.showProgressLoading();
final StateAbstractDTO catched = getCached(newState);
if (catched != null) {
callback.onSuccess(catched);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -29,7 +29,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event;
@@ -190,7 +190,7 @@
void setState(final StateAbstractDTO newState) {
session.setCurrentState(newState);
onStateChanged.fire(newState);
- Site.hideProgress();
+ NotifyUser.hideProgress();
checkGroupAndToolChange(newState);
previousToken = newState.getStateToken();
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,35 +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.platf.client.tool;
-
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-public abstract class AbstractClientTool implements ClientTool {
-
- public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
- final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
- final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector,
- wsThemePresenter);
- final ToolSelectorItemPanel panel = new ToolSelectorItemPanel(presenter, ws);
- presenter.init(panel);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,26 +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.platf.client.tool;
-
-public interface ClientTool {
-
- String getName();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,122 +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.platf.client.tool;
-
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-public abstract class FoldableAbstractClientTool extends AbstractClientTool {
- public static final String UPLOADEDFILE_SUFFIX = "uploaded";
-
- protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
-
- public FoldableAbstractClientTool(String shortName, String longName, ToolSelector toolSelector,
- WsThemePresenter wsThemePresenter, WorkspaceSkeleton ws,
- ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
- super(shortName, longName, toolSelector, wsThemePresenter, ws);
- this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
- }
-
- public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
- contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(typeId, mimeType, iconUrl);
- }
-
- public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
- contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
- }
-
- protected void registerAclEditableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getAclEditable().register(typeIds);
- }
-
- protected void registerAuthorableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getAuthorable().register(typeIds);
- }
-
- protected void registerComentableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getComentable().register(typeIds);
- }
-
- protected void registerDragableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getDragable().register(typeIds);
- }
-
- protected void registerDropableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getDropable().register(typeIds);
- }
-
- protected void registerEmailSubscribeAbleTypes(String... typeIds) {
- contentCapabilitiesRegistry.getEmailSubscribeAble().register(typeIds);
- }
-
- protected void registerLicensableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getLicensable().register(typeIds);
- }
-
- protected void registerPublishModerableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
- }
-
- protected void registerRateableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getRateable().register(typeIds);
- }
-
- protected void registerRenamableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getRenamable().register(typeIds);
- }
-
- protected void registerTageableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getTageable().register(typeIds);
- }
-
- protected void registerTranslatableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getTranslatable().register(typeIds);
- }
-
- protected void registerUploadTypesAndMimes(String typeUploadedfile) {
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("video"), "images/nav/film.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "pdf"), "images/nav/page_pdf.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("text"), "images/nav/page_text.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "msword"),
- "images/nav/page_word.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "excel"),
- "images/nav/page_excel.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "mspowerpoint"),
- "images/nav/page_pps.png");
- registerContentTypeIcon(typeUploadedfile, "images/nav/page.png");
- }
-
- protected void registerVersionableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getVersionable().register(typeIds);
- }
-
- protected void registerXmppComentableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getXmppComentable().register(typeIds);
- }
-
- protected void registerXmppNotifyCapableTypes(String... typeIds) {
- contentCapabilitiesRegistry.getXmppNotificyCapable().register(typeIds);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,26 +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.platf.client.tool;
-
-public interface ToolSelector {
-
- void addTool(ToolSelectorItem item);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,32 +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.platf.client.tool;
-
-public interface ToolSelectorItem {
-
- String getShortName();
-
- void setGroupShortName(String groupShortName);
-
- void setSelected(boolean selected);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,69 +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.platf.client.tool;
-
-import org.ourproject.kune.platf.client.ui.RoundedPanel;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.themes.WsTheme;
-
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.ui.Hyperlink;
-
-public class ToolSelectorItemPanel extends RoundedPanel implements ToolSelectorItemView {
- private final Hyperlink hl;
-
- public ToolSelectorItemPanel(final ToolSelectorItemPresenter presenter, final WorkspaceSkeleton ws) {
- super(RoundedPanel.RIGHT, 2);
- hl = new Hyperlink();
- super.setWidget(hl);
- ws.addInTools(this);
- super.sinkEvents(Event.ONCLICK);
- super.addStyleName("k-toolselectoritem");
- }
-
- @Override
- public void onBrowserEvent(final Event event) {
- super.onBrowserEvent(event);
- }
-
- public void setLink(final String text, final String targetHistoryToken) {
- hl.setText(text);
- hl.setTargetHistoryToken(targetHistoryToken);
- }
-
- public void setSelected(final boolean selected) {
- if (selected) {
- hl.setStylePrimaryName("k-toolselectoritem-sel");
- } else {
- hl.setStylePrimaryName("k-toolselectoritem-notsel");
- }
- super.setCornerStyleName(hl.getStyleName());
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- if (oldTheme != null) {
- final String oldName = oldTheme.getName();
- hl.removeStyleDependentName(oldName);
- }
- final String newName = newTheme.getName();
- hl.addStyleDependentName(newName);
- super.setCornerStyleName(hl.getStyleName());
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,79 +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.platf.client.tool;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.workspace.client.themes.WsTheme;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-import com.calclab.suco.client.events.Listener2;
-
-public class ToolSelectorItemPresenter implements ToolSelectorItem {
-
- private ToolSelectorItemView view;
- private final ToolSelector toolSelector;
- private final WsThemePresenter wsThemePresenter;
- private final String shortName;
- private final String longName;
-
- public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector,
- final WsThemePresenter wsThemePresenter) {
- this.shortName = shortName;
- this.longName = longName;
- this.toolSelector = toolSelector;
- this.wsThemePresenter = wsThemePresenter;
- }
-
- public String getShortName() {
- return shortName;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ToolSelectorItemView view) {
- this.view = view;
- toolSelector.addTool(this);
- wsThemePresenter.onThemeChanged(new Listener2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- setTheme(oldTheme, newTheme);
- }
- });
- }
-
- public void setGroupShortName(final String groupShortName) {
- final StateToken token = new StateToken(groupShortName, getShortName(), null, null);
- view.setLink(longName, token.toString());
- }
-
- public void setSelected(final boolean selected) {
- view.setSelected(selected);
- }
-
- public void setVisible(boolean visible) {
- view.setVisible(visible);
- }
-
- private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,34 +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.platf.client.tool;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.themes.WsTheme;
-
-public interface ToolSelectorItemView extends View {
-
- void setLink(String text, String targetHistoryToken);
-
- void setSelected(boolean selected);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
- void setVisible(boolean visible);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,90 +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.platf.client.tool;
-
-import java.util.HashMap;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener2;
-
-public class ToolSelectorPresenter implements ToolSelector {
-
- private final HashMap<String, ToolSelectorItem> tools;
-
- public ToolSelectorPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
- tools = new HashMap<String, ToolSelectorItem>();
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(StateAbstractDTO state) {
- for (String tool : tools.keySet()) {
- List<String> enabledTools = state.getEnabledTools();
- if (enabledTools != null && enabledTools.contains(tool)) {
- tools.get(tool).setVisible(true);
- } else {
- tools.get(tool).setVisible(false);
- }
- }
- }
- });
- stateManager.onGroupChanged(new Listener2<String, String>() {
- public void onEvent(final String oldGroup, final String newGroup) {
- onGroupChanged(newGroup);
- }
- });
- stateManager.onToolChanged(new Listener2<String, String>() {
- public void onEvent(final String oldTool, final String newTool) {
- onToolChanged(oldTool, newTool);
- }
- });
- }
-
- public void addTool(final ToolSelectorItem item) {
- final String name = item.getShortName();
- if (name == null) {
- throw new RuntimeException("You cannot add a tool without a name");
- }
- if (tools.get(name) != null) {
- throw new RuntimeException("A tool with the same name already added");
- }
- tools.put(name, item);
- item.setSelected(false);
- }
-
- void onGroupChanged(final String newGroupName) {
- for (final String name : tools.keySet()) {
- tools.get(name).setGroupShortName(newGroupName);
- }
- }
-
- void onToolChanged(final String oldTool, final String newTool) {
- Log.debug("Registered tools: " + tools.keySet().toString());
- if (!oldTool.equals("")) {
- tools.get(oldTool).setSelected(false);
- }
- if (!newTool.equals("")) {
- tools.get(newTool).setSelected(true);
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,7 +20,6 @@
package org.ourproject.kune.platf.client.ui;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.themes.WsTheme;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
@@ -142,20 +141,18 @@
outerBorder.setHeight(height);
}
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ public void setTheme(final String oldTheme, final String newTheme) {
if (oldTheme != null) {
- final String oldThemeS = oldTheme.toString();
// outerBorder.removeStyleDependentName(oldThemeS);
- vp.removeStyleDependentName(oldThemeS);
- titleHP.removeStyleDependentName(oldThemeS);
- contentPanel.removeStyleDependentName(oldThemeS);
+ vp.removeStyleDependentName(oldTheme);
+ titleHP.removeStyleDependentName(oldTheme);
+ contentPanel.removeStyleDependentName(oldTheme);
}
- final String newThemeS = newTheme.toString();
- outerBorder.setCornerStyleName(stylePrimaryName + "-" + newThemeS);
+ outerBorder.setCornerStyleName(stylePrimaryName + "-" + newTheme);
// outerBorder.addStyleDependentName(newThemeS);
- vp.addStyleDependentName(newThemeS);
- titleHP.addStyleDependentName(newThemeS);
- contentPanel.addStyleDependentName(newThemeS);
+ vp.addStyleDependentName(newTheme);
+ titleHP.addStyleDependentName(newTheme);
+ contentPanel.addStyleDependentName(newTheme);
}
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -22,6 +22,10 @@
import java.util.ArrayList;
public class TextUtils {
+
+ public static final String IN_DEVELOPMENT_P = " (in development)";
+ public static final String IN_DEVELOPMENT = "In development";
+
// Original regexp from http://snippets.dzone.com/posts/show/452
public static final String URL_REGEXP = "((ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -239,7 +239,7 @@
dialog.add(mainPanel);
doLayoutIfNeeded();
} else {
- Site.error("Widget not found in deck of WizardDialog");
+ NotifyUser.error("Widget not found in deck of WizardDialog");
}
}
@@ -271,7 +271,7 @@
} else if (view instanceof DefaultForm) {
return ((DefaultForm) view).getFormPanel();
} else {
- Site.error("Trying to add a unknown element in WizardDialog");
+ NotifyUser.error("Trying to add a unknown element in WizardDialog");
return null;
}
}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java (from rev 1052, trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,114 @@
+/*
+ *
+ * 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.platf.client.ui.noti;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+import com.calclab.suco.client.events.Event;
+import com.calclab.suco.client.events.Event0;
+import com.calclab.suco.client.events.Event2;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.events.Listener2;
+
+public class NotifyUser {
+
+ public enum Level {
+ info, important, veryImportant, error,
+ }
+
+ private static Event2<Level, String> onNotify;
+
+ private static Event2<String, String> onAlert;
+
+ private static Event<String> onProgress;
+
+ private static Event0 onHideProgress;
+
+ private static I18nTranslationService i18n;
+
+ public static void error(final String message) {
+ onNotify.fire(Level.error, message);
+ }
+
+ public static void hideProgress() {
+ onHideProgress.fire();
+ }
+
+ public static void important(final String message) {
+ onNotify.fire(Level.important, message);
+ }
+
+ public static void info(final String message) {
+ onNotify.fire(Level.info, message);
+ }
+
+ public static void showAlertMessage(String title, String message) {
+ onAlert.fire(title, message);
+ }
+
+ public static void showProgress(final String text) {
+ onProgress.fire(text);
+ }
+
+ public static void showProgressLoading() {
+ onProgress.fire(i18n.t("Loading"));
+ }
+
+ public static void showProgressProcessing() {
+ onProgress.fire(i18n.t("Processing"));
+ }
+
+ public static void showProgressSaving() {
+ onProgress.fire(i18n.t("Saving"));
+ }
+
+ public static void showProgressStarting() {
+ onProgress.fire(i18n.t("Starting"));
+ }
+
+ public static void veryImportant(final String message) {
+ onNotify.fire(Level.veryImportant, message);
+ }
+
+ public NotifyUser(I18nTranslationService i18n) {
+ NotifyUser.i18n = i18n;
+ onNotify = new Event2<Level, String>("onNotify");
+ onAlert = new Event2<String, String>("onNotify");
+ onProgress = new Event<String>("onProgress");
+ onHideProgress = new Event0("onHideProgress");
+ }
+
+ public void addAlerter(final Listener2<String, String> listener) {
+ onAlert.add(listener);
+ }
+
+ public void addHideProgressNotifier(final Listener0 listener) {
+ onHideProgress.add(listener);
+ }
+
+ public void addNotifier(final Listener2<Level, String> listener) {
+ onNotify.add(listener);
+ }
+
+ public void addProgressNotifier(final Listener<String> listener) {
+ onProgress.add(listener);
+ }
+}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,26 +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.platf.client.ui.rate;
-
-public interface RateIt {
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,134 +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.platf.client.ui.rate;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.MouseListenerAdapter;
-import com.google.gwt.user.client.ui.Widget;
-
-public class RateItPanel extends Composite implements ClickListener, RateItView {
- private Grid rateGrid;
- private Image[] starImg;
- private Label rateDesc;
- private final Images img;
- private final RateItPresenter presenter;
- private Label rateItLabel;
- private final I18nTranslationService i18n;
-
- public RateItPanel(final RateItPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws,
- Images img) {
- this.presenter = presenter;
- this.i18n = i18n;
- this.img = img;
- initialize();
- layout();
- setProperties();
- ws.getEntityWorkspace().getContentBottomBar().add(this);
- }
-
- public void clearRate() {
- for (int i = 0; i < 5; i++) {
- img.starGrey().applyTo(starImg[i]);
- }
- }
-
- public void onClick(final Widget sender) {
- for (int i = 0; i < 5; i++) {
- if (sender == starImg[i]) {
- presenter.starClicked(i);
- }
- }
- }
-
- public void setDesc(final String desc) {
- rateDesc.setText(desc);
- }
-
- public void setRate(final Star stars[]) {
- for (int i = 0; i < 5; i++) {
- stars[i].getImage().applyTo(starImg[i]);
- }
- }
-
- public void setStars(final Double rate) {
- setRate(Star.genStars(rate.doubleValue()));
- }
-
- private void initialize() {
- rateItLabel = new Label(i18n.t("Rate it:"));
- rateGrid = new Grid(1, 7);
- starImg = new Image[5];
- rateDesc = new Label();
- for (int i = 0; i < 5; i++) {
- starImg[i] = new Image();
- img.starGrey().applyTo(starImg[i]);
- starImg[i].addStyleName("rateit-star");
- starImg[i].setStyleName("rateit-star");
- starImg[i].setTitle(i18n.t("Click to rate this"));
- starImg[i].addClickListener(this);
- starImg[i].addMouseListener(new MouseListenerAdapter() {
- @Override
- public void onMouseEnter(final Widget sender) {
- for (int j = 0; j < 5; j++) {
- if (sender == starImg[j]) {
- presenter.starOver(j);
- }
- }
-
- }
-
- @Override
- public void onMouseLeave(final Widget sender) {
- presenter.revertCurrentRate();
- }
- });
- }
- }
-
- private void layout() {
- initWidget(rateGrid);
- rateGrid.setWidget(0, 0, rateItLabel);
- for (int i = 0; i < 5; i++) {
- rateGrid.setWidget(0, i + 1, starImg[i]);
- }
- rateGrid.setWidget(0, 6, rateDesc);
- }
-
- private void setProperties() {
- rateGrid.setCellPadding(0);
- rateGrid.setCellSpacing(0);
- rateGrid.setBorderWidth(0);
- rateItLabel.addStyleName("kune-Margin-Small-r");
- // rateItLabel.addStyleName("kune-Margin-Medium-l");
- rateItLabel.addStyleName("kune-RatePanel-Label");
- rateGrid.addStyleName("kune-RatePanel-Stars");
- rateGrid.addStyleName("kune-RatePanel-Stars-RateIt");
- rateDesc.addStyleName("kune-RatePanel-Label");
- rateDesc.addStyleName("kune-Margin-Small-l");
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,162 +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.platf.client.ui.rate;
-
-import org.ourproject.kune.platf.client.dto.RateResultDTO;
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.ioc.Provider;
-
-public class RateItPresenter implements RateIt {
-
- private static final Double NOT_RATED = new Double(-1);
- private RateItView view;
- private Double currentRate;
- private boolean isRating;
- private final I18nTranslationService i18n;
- private final Provider<ContentServiceAsync> contentServiceProvider;
- private final Session session;
- private final Provider<RatePresenter> ratePresenterProv;
-
- public RateItPresenter(final I18nTranslationService i18n, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider, final StateManager stateManager,
- Provider<RatePresenter> ratePresenterProvider, final ContentCapabilitiesRegistry capabilitiesRegistry) {
- this.i18n = i18n;
- this.session = session;
- this.contentServiceProvider = contentServiceProvider;
- this.ratePresenterProv = ratePresenterProvider;
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(final StateAbstractDTO state) {
- if (state instanceof StateContentDTO) {
- StateContentDTO stateContentDTO = (StateContentDTO) state;
- setState(capabilitiesRegistry.isRateable(stateContentDTO.getTypeId()),
- stateContentDTO.getCurrentUserRate());
- } else {
- view.setVisible(false);
- }
- }
- });
- }
-
- public void init(final RateItView view) {
- this.view = view;
- currentRate = NOT_RATED;
- isRating = false;
- }
-
- public void setRate(final Double value) {
- currentRate = value;
- if (currentRate == null) {
- currentRate = NOT_RATED;
- }
- isRating = false;
- setRatePanel(currentRate);
- }
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
- protected void revertCurrentRate() {
- if (!isRating) {
- setRatePanel(currentRate);
- }
- }
-
- protected void starClicked(final int starClicked) {
- isRating = true;
- final Double newValue = starClicked + 1d == currentRate ? currentRate - 0.5d : starClicked + 1d;
- setRatePanel(newValue);
- Site.showProgressProcessing();
- final StateAbstractDTO currentState = session.getCurrentState();
- contentServiceProvider.get().rateContent(session.getUserHash(), currentState.getStateToken(), newValue,
- new AsyncCallbackSimple<RateResultDTO>() {
- public void onSuccess(final RateResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Content rated"));
- if (currentState.getStateToken().equals(session.getCurrentStateToken())) {
- session.getContentState().setRate(result);
- setState(true, result.getCurrentUserRate());
- ratePresenterProv.get().setRate(result);
- }
- }
- });
- }
-
- protected void starOver(final int starMouseOver) {
- Double value = new Double(starMouseOver + 1);
- if (Math.ceil(currentRate.doubleValue()) == value.doubleValue()) {
- // use user already rated -> live same value when mouse is over
- value = currentRate;
- }
- if (!isRating) {
- // If we are not doing a rate rpc call
- setRatePanel(value);
- }
- }
-
- private void setDesc(final int rateTruncated) {
- if (rateTruncated >= 0 && rateTruncated <= 1) {
- view.setDesc(i18n.t("Poor"));
- } else if (rateTruncated == 2) {
- view.setDesc(i18n.t("Below average"));
- } else if (rateTruncated == 3) {
- view.setDesc(i18n.t("Average"));
- } else if (rateTruncated == 4) {
- view.setDesc(i18n.t("Above average"));
- } else if (rateTruncated == 5) {
- view.setDesc(i18n.t("Excellent"));
- } else {
- view.setDesc("");
- }
- }
-
- private void setRatePanel(final Double value) {
- if (value.equals(NOT_RATED)) {
- view.clearRate();
- view.setDesc("");
- } else {
- view.setStars(value);
- setDesc((int) Math.ceil(value.doubleValue()));
- }
- }
-
- private void setState(boolean isRateable, Double currentUserRate) {
- if (isRateable) {
- if (session.isLogged()) {
- setRate(currentUserRate);
- view.setVisible(true);
- } else {
- view.setVisible(false);
- }
- } else {
- view.setVisible(false);
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,32 +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.platf.client.ui.rate;
-
-public interface RateItView {
-
- void clearRate();
-
- void setDesc(String desc);
-
- void setStars(Double value);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,102 +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.platf.client.ui.rate;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.Toolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-
-public class RatePanel extends Composite implements RateView {
- private Grid rateGrid;
- private Image[] starImg;
- private Label rateDesc;
- private final I18nTranslationService i18n;
-
- public RatePanel(final Double rate, final Integer byUsers, final I18nTranslationService i18n,
- final WorkspaceSkeleton ws) {
- this.i18n = i18n;
- initialize();
- layout();
- setProperties();
- if (rate != null) {
- setRate(rate);
- }
- if (byUsers != null) {
- setByUsers(byUsers);
- }
- final Toolbar bottomBar = ws.getEntityWorkspace().getContentBottomBar();
- bottomBar.addFill();
- bottomBar.add(this);
- }
-
- public void setByUsers(final Integer byUsers) {
- if (byUsers.intValue() == 0) {
- rateDesc.setText(i18n.t("(Not rated)"));
- } else if (byUsers.intValue() == 1) {
- // i18n params pluralization
- rateDesc.setText(i18n.t("([%d] user)", byUsers));
- } else {
- rateDesc.setText(i18n.t("([%d] users)", byUsers));
- }
- }
-
- public void setRate(final Double rate) {
- setRate(Star.genStars(rate.doubleValue()));
- }
-
- private void initialize() {
- rateGrid = new Grid(1, 6);
- starImg = new Image[5];
- for (int i = 0; i < 5; i++) {
- starImg[i] = new Image();
- new Star(Star.GREY).getImage().applyTo(starImg[i]);
- }
- rateDesc = new Label();
- }
-
- private void layout() {
- initWidget(rateGrid);
- for (int i = 0; i < 5; i++) {
- rateGrid.setWidget(0, i, starImg[i]);
- }
- rateGrid.setWidget(0, 5, rateDesc);
- }
-
- private void setProperties() {
- rateGrid.setCellPadding(0);
- rateGrid.setCellSpacing(0);
- rateGrid.setBorderWidth(0);
- rateGrid.addStyleName("kune-RatePanel-Stars");
- rateDesc.addStyleName("kune-RatePanel-Label");
- rateDesc.addStyleName("kune-Margin-Small-lr");
- }
-
- private void setRate(final Star stars[]) {
- for (int i = 0; i < 5; i++) {
- stars[i].getImage().applyTo(starImg[i]);
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,75 +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.platf.client.ui.rate;
-
-import org.ourproject.kune.platf.client.dto.RateResultDTO;
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-import com.calclab.suco.client.events.Listener;
-
-public class RatePresenter {
-
- private RateView view;
- private final ContentCapabilitiesRegistry capabilitiesRegistry;
-
- public RatePresenter(final StateManager stateManager, ContentCapabilitiesRegistry capabilitiesRegistry) {
- this.capabilitiesRegistry = capabilitiesRegistry;
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(final StateAbstractDTO state) {
- if (state instanceof StateContentDTO) {
- setState((StateContentDTO) state);
- } else {
- view.setVisible(false);
- }
- }
- });
- }
-
- public void init(final RateView view) {
- this.view = view;
- }
-
- public void setRate(RateResultDTO result) {
- setRate(result.getRateByUsers(), result.getRate());
- }
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
- private void setRate(Integer rateByUsers, Double rate) {
- view.setVisible(true);
- view.setRate(rate);
- view.setByUsers(rateByUsers);
- }
-
- private void setState(final StateContentDTO state) {
- Integer rateByUsers = state.getRateByUsers();
- Double rate = state.getRate();
- if (capabilitiesRegistry.isRateable(state.getTypeId())) {
- setRate(rateByUsers, rate);
- } else {
- view.setVisible(false);
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,30 +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.platf.client.ui.rate;
-
-public interface RateView {
-
- void setByUsers(Integer byUsers);
-
- void setRate(Double rate);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,92 +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.platf.client.ui.rate;
-
-import org.ourproject.kune.platf.client.services.Images;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-
-public class Star {
- private static final Images img = Images.App.getInstance();
- public static final int GREY = 0;
- public static final int YELLOW = 1;
-
- public final static Star[] CLEAR = { new Star(), new Star(), new Star(), new Star(), new Star() };
-
- private AbstractImagePrototype image;
-
- public Star() {
- image = img.starGrey();
- }
-
- public AbstractImagePrototype getImage() {
- return image;
- }
-
- public Star(final double rateDecimals) {
- if (rateDecimals == 1) {
- image = img.starYellow();
- } else if (rateDecimals == 0) {
- image = img.starGrey();
- } else {
- final int rateTrucated = (int) rateDecimals;
- final int rateDecimal = (int) ((rateDecimals - rateTrucated) * 10) * 10;
- if (rateDecimal == 10) {
- image = img.star10();
- } else if (rateDecimal == 20) {
- image = img.star20();
- } else if (rateDecimal == 30) {
- image = img.star30();
- } else if (rateDecimal == 40) {
- image = img.star40();
- } else if (rateDecimal == 50) {
- image = img.star50();
- } else if (rateDecimal == 60) {
- image = img.star60();
- } else if (rateDecimal == 70) {
- image = img.star70();
- } else if (rateDecimal == 80) {
- image = img.star80();
- } else if (rateDecimal == 90) {
- image = img.star90();
- }
- }
- }
-
- public static Star[] genStars(final double rate) {
- Star[] stars;
- stars = new Star[5];
- final int rateTruncated = (int) rate;
- final double rateDecimals = rate - rateTruncated;
-
- for (int i = 0; i < 5; i++) {
- if (i < rateTruncated) {
- stars[i] = new Star(Star.YELLOW);
- } else {
- if (i == rateTruncated) {
- stars[i] = new Star(rateDecimals);
- } else {
- stars[i] = new Star(Star.GREY);
- }
- }
- }
- return stars;
- }
-}
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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -13,8 +13,8 @@
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.events.Listener0;
@@ -197,7 +197,7 @@
ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
- Site.info("In dev");
+ NotifyUser.info("In dev");
}
});
editHtml.setTextDescription(i18n.t("Edit HTML"));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
@@ -59,7 +59,7 @@
public void destroy() {
if (hasUploadingFiles()) {
dialog.stopUpload();
- Site.important(i18n.t("Upload cancelled after signing out"));
+ NotifyUser.important(i18n.t("Upload cancelled after signing out"));
}
if (dialog != null) {
dialog.destroy();
@@ -138,7 +138,7 @@
public boolean onBeforeAdd(final UploadDialog source, final String filename) {
boolean mustAdd = presenter.checkFolderChange();
if (!mustAdd) {
- Site.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location"));
+ NotifyUser.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location"));
}
return mustAdd;
}
@@ -151,7 +151,7 @@
@Override
public void onUploadComplete(final UploadDialog source) {
if (!dialog.isVisible()) {
- Site.info(i18n.t("Upload completed"));
+ NotifyUser.info(i18n.t("Upload completed"));
traybarButton.destroy();
traybarButton = null;
}
@@ -170,7 +170,7 @@
private void showError() {
if (!dialog.isVisible()) {
- Site.veryImportant(i18n.t("Error uploading"));
+ NotifyUser.veryImportant(i18n.t("Error uploading"));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
import com.calclab.suco.client.events.Event;
import com.calclab.suco.client.events.Listener;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -31,7 +31,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -52,6 +51,7 @@
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
public class WikiClientTool extends FoldableAbstractClientTool {
public static final String NAME = "wiki";
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -32,6 +32,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
@@ -51,6 +52,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.workspace.client.cnt.FoldableContent;
@@ -58,9 +60,7 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.socialnet.RadioMustBeChecked;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -159,7 +159,7 @@
final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
- Site.info("Sorry, in development");
+ NotifyUser.info("Sorry, in development");
}
});
delContainer.setParentMenuTitle(parentMenuTitle);
@@ -233,24 +233,24 @@
contextPropEditorProvider.get().attach();
editor.editContent(session.getContentState().getContent(), new Listener<String>() {
public void onEvent(final String html) {
- Site.showProgressSaving();
+ NotifyUser.showProgressSaving();
contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
new AsyncCallback<Object>() {
public void onFailure(final Throwable caught) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
try {
throw caught;
} catch (final SessionExpiredException e) {
errorHandler.doSessionExpired();
} catch (final Throwable e) {
- Site.error(i18n.t("Error saving document. Retrying..."));
+ NotifyUser.error(i18n.t("Error saving document. Retrying..."));
errorHandler.process(caught);
editor.onSaveFailed();
}
}
public void onSuccess(Object param) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
session.getContentState().setContent(html);
editor.onSavedSuccessful();
}
@@ -325,7 +325,7 @@
addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
public void onSuccess(final StateContainerDTO state) {
@@ -348,7 +348,7 @@
final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
contentServiceProvider.get().addContent(session.getUserHash(),
session.getCurrentState().getStateToken(), description, typeId,
new AsyncCallbackSimple<StateContentDTO>() {
@@ -424,13 +424,13 @@
setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator,
ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
new AsyncCallbackSimple<ContentSimpleDTO>() {
public void onSuccess(final ContentSimpleDTO defContent) {
session.getCurrentState().getGroup().setDefaultContent(defContent);
- Site.hideProgress();
- Site.info(i18n.t("Content selected as the group homepage"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Content selected as the group homepage"));
}
});
}
@@ -493,7 +493,7 @@
ActionToolbarButtonDescriptor<StateToken> translateContent = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
- Site.important(i18n.t("Sorry, this functionality is currently in development"));
+ NotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
}
});
translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
@@ -552,7 +552,7 @@
groupServiceProvider.get().setGroupFullLogo(session.getUserHash(), token,
new AsyncCallbackSimple<GroupDTO>() {
public void onSuccess(GroupDTO newGroup) {
- Site.info("Logo selected");
+ NotifyUser.info("Logo selected");
if (session.getCurrentState().getGroup().getShortName().equals(
newGroup.getShortName())) {
session.getCurrentState().setGroup(newGroup);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -62,15 +62,9 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
-import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
-import org.ourproject.kune.platf.client.ui.rate.RatePanel;
-import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
import org.ourproject.kune.platf.client.ui.upload.FileUploaderDialog;
import org.ourproject.kune.platf.client.ui.upload.FileUploaderPresenter;
@@ -144,6 +138,11 @@
import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConf;
import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPanel;
import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPresenter;
+import org.ourproject.kune.workspace.client.rate.RateIt;
+import org.ourproject.kune.workspace.client.rate.RateItPanel;
+import org.ourproject.kune.workspace.client.rate.RateItPresenter;
+import org.ourproject.kune.workspace.client.rate.RatePanel;
+import org.ourproject.kune.workspace.client.rate.RatePresenter;
import org.ourproject.kune.workspace.client.search.EntityLiveSearcherView;
import org.ourproject.kune.workspace.client.search.GroupLiveSearchPanel;
import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
@@ -163,8 +162,8 @@
import org.ourproject.kune.workspace.client.signin.SignInPanel;
import org.ourproject.kune.workspace.client.signin.SignInPresenter;
import org.ourproject.kune.workspace.client.signin.SignInView;
-import org.ourproject.kune.workspace.client.site.Site;
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;
@@ -210,10 +209,6 @@
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddie;
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePanel;
import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePresenter;
-import org.ourproject.kune.workspace.client.summary.GroupSummary;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryPanel;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
@@ -226,6 +221,8 @@
import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.title.RenameAction;
+import org.ourproject.kune.workspace.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.tool.ToolSelectorPresenter;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.NoDecoration;
@@ -280,11 +277,11 @@
}
});
- register(ApplicationComponentGroup.class, new Factory<Site>(Site.class) {
+ register(ApplicationComponentGroup.class, new Factory<WorkspaceNotifyUser>(WorkspaceNotifyUser.class) {
@Override
- public Site create() {
- return new Site($(I18nUITranslationService.class), $(SiteProgress.class), $$(SiteToastMessage.class),
- $$(WorkspaceSkeleton.class));
+ public WorkspaceNotifyUser create() {
+ return new WorkspaceNotifyUser($(NotifyUser.class), $(I18nUITranslationService.class),
+ $(SiteProgress.class), $$(SiteToastMessage.class), $$(WorkspaceSkeleton.class));
}
});
@@ -521,18 +518,6 @@
}
});
- register(ApplicationComponentGroup.class, new Factory<GroupSummary>(GroupSummary.class) {
- @Override
- public GroupSummary create() {
- final GroupSummaryPresenter presenter = new GroupSummaryPresenter($(StateManager.class),
- $(WsThemePresenter.class));
- final GroupSummaryView view = new GroupSummaryPanel($(Images.class), presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
- presenter.init(view);
- return presenter;
- }
- });
-
register(ApplicationComponentGroup.class, new Factory<AddAsBuddie>(AddAsBuddie.class) {
@Override
public AddAsBuddie create() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
@@ -239,7 +239,7 @@
public boolean doBeforeNodeDrop(final TreePanel treePanel, final TreeNode target, final DragData dragData,
final String point, final DragDrop source, final TreeNode dropNode,
final DropNodeCallback dropNodeCallback) {
- Site.info("Drag & drop of contents in development");
+ NotifyUser.info("Drag & drop of contents in development");
return false;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -33,7 +33,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.title.EntitySubTitle;
@@ -61,12 +61,12 @@
}
public void addAuthor(final String authorShortName) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
stateManager.reload();
}
});
@@ -81,12 +81,12 @@
}
public void delAuthor(final String authorShortName) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
stateManager.reload();
}
});
@@ -97,12 +97,12 @@
}
public void doChangeLanguage(final String langCode) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode,
new AsyncCallbackSimple<I18nLanguageDTO>() {
public void onSuccess(final I18nLanguageDTO lang) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
});
}
@@ -112,12 +112,12 @@
}
public void setPublishedOn(final Date publishedOn) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn,
new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
entitySubTitle.setContentDate(publishedOn);
}
});
@@ -178,13 +178,13 @@
}
public void setTags(final String tagsString) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString,
new AsyncCallbackSimple<TagCloudResultDTO>() {
public void onSuccess(final TagCloudResultDTO result) {
tagsSummaryProvider.get().setGroupTags(result);
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.I18nTranslationServiceMocked;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
@@ -78,7 +78,7 @@
public void showMessage() {
/** i18n use with parameters **/
- Site.info(i18n.t("Hello [%s]!", "world"));
+ NotifyUser.info(i18n.t("Hello [%s]!", "world"));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -25,8 +25,8 @@
import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.search.SiteBottomTrayButton;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Frame;
@@ -288,10 +288,10 @@
}
private void setLanguage(final String language) {
- Site.showProgressLoading();
+ NotifyUser.showProgressLoading();
query(unTransStore, unTransGrid, language);
query(transStore, transGrid, language);
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
private String[] splitNT(final String textWithNT) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener0;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -52,25 +52,25 @@
}
public void doShowTranslator() {
- Site.showProgressLoading();
+ NotifyUser.showProgressLoading();
if (session.isLogged()) {
view.show();
} else {
- Site.info(i18n.t("Sign in or register to help with the translation"));
+ NotifyUser.info(i18n.t("Sign in or register to help with the translation"));
}
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
public void doTranslation(final String id, final String trKey, final String translation) {
- Site.showProgressSaving();
+ NotifyUser.showProgressSaving();
i18nService.setTranslation(session.getUserHash(), id, translation, new AsyncCallback<String>() {
public void onFailure(final Throwable caught) {
- Site.hideProgress();
- Site.error(i18n.t("Server error saving the translation"));
+ NotifyUser.hideProgress();
+ NotifyUser.error(i18n.t("Server error saving the translation"));
}
public void onSuccess(final String result) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
i18n.setTranslationAfterSave(trKey, result);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.Provider;
@@ -45,12 +45,12 @@
}
public void changeLicense(final LicenseDTO license, final Listener0 onSuccess) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
groupService.get().changeDefLicense(session.getUserHash(), session.getCurrentStateToken(), license,
new AsyncCallback<Object>() {
public void onFailure(Throwable caught) {
- Site.hideProgress();
- Site.error(i18n.t("Error changing default group license"));
+ NotifyUser.hideProgress();
+ NotifyUser.error(i18n.t("Error changing default group license"));
}
public void onSuccess(Object result) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -24,11 +24,11 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdFormView;
-import org.ourproject.kune.workspace.client.site.Site;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Listener;
@@ -119,7 +119,7 @@
}
} else if (in(sndForm)) {
licenseShortName = "by-sa" + ccVers;
- Site.error("Programatic error in LicenseWizardPresenter");
+ NotifyUser.error("Programatic error in LicenseWizardPresenter");
} else {
licenseShortName = frdForm.getSelectedLicense();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -30,8 +30,8 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.SiteToken;
import com.calclab.suco.client.events.Listener0;
@@ -66,14 +66,14 @@
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
if (session.isLogged()) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
view.show();
view.center();
view.setLicense(session.getDefLicense());
- Site.hideProgress();
+ NotifyUser.hideProgress();
} else {
stateManager.restorePreviousToken();
- Site.info(i18n.t(WorkspaceMessages.REGISTER_TO_CREATE_A_GROUP));
+ NotifyUser.info(i18n.t(WorkspaceMessages.REGISTER_TO_CREATE_A_GROUP));
}
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -23,9 +23,9 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.platf.client.ui.download.FileParams;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
import org.ourproject.kune.workspace.client.options.EntityOptionsView;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.gwtext.client.core.Connection;
@@ -102,7 +102,7 @@
FieldListenerAdapter changeListener = new FieldListenerAdapter() {
@Override
public void onChange(Field field, Object newVal, Object oldVal) {
- Site.info("change");
+ NotifyUser.info("change");
// setEnableFileField();
}
};
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -26,9 +26,9 @@
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.options.EntityOptions;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
@@ -80,7 +80,7 @@
}
public void onSubmitFailed(int httpStatus, String responseText) {
- Site.error("Error setting the group logo: " + responseText);
+ NotifyUser.error("Error setting the group logo: " + responseText);
}
private void setState() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -21,8 +21,9 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.BasicThumb;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.options.EntityOptionsView;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -61,7 +62,7 @@
for (int i = 1; i <= 6; i++) {
BasicThumb thumb = new BasicThumb("images/styles/styl" + i + ".png", "Style " + i, new ClickListener() {
public void onClick(Widget sender) {
- Site.info(Site.IN_DEVELOPMENT);
+ NotifyUser.info(TextUtils.IN_DEVELOPMENT_P);
}
});
thumb.setTooltip(i18n.t("Click to select and configure this theme"));
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateIt.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateIt.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.rate;
+
+public interface RateIt {
+
+ void setVisible(boolean visible);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,134 @@
+/*
+ *
+ * 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.rate;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.MouseListenerAdapter;
+import com.google.gwt.user.client.ui.Widget;
+
+public class RateItPanel extends Composite implements ClickListener, RateItView {
+ private Grid rateGrid;
+ private Image[] starImg;
+ private Label rateDesc;
+ private final Images img;
+ private final RateItPresenter presenter;
+ private Label rateItLabel;
+ private final I18nTranslationService i18n;
+
+ public RateItPanel(final RateItPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws,
+ Images img) {
+ this.presenter = presenter;
+ this.i18n = i18n;
+ this.img = img;
+ initialize();
+ layout();
+ setProperties();
+ ws.getEntityWorkspace().getContentBottomBar().add(this);
+ }
+
+ public void clearRate() {
+ for (int i = 0; i < 5; i++) {
+ img.starGrey().applyTo(starImg[i]);
+ }
+ }
+
+ public void onClick(final Widget sender) {
+ for (int i = 0; i < 5; i++) {
+ if (sender == starImg[i]) {
+ presenter.starClicked(i);
+ }
+ }
+ }
+
+ public void setDesc(final String desc) {
+ rateDesc.setText(desc);
+ }
+
+ public void setRate(final Star stars[]) {
+ for (int i = 0; i < 5; i++) {
+ stars[i].getImage().applyTo(starImg[i]);
+ }
+ }
+
+ public void setStars(final Double rate) {
+ setRate(Star.genStars(rate.doubleValue()));
+ }
+
+ private void initialize() {
+ rateItLabel = new Label(i18n.t("Rate it:"));
+ rateGrid = new Grid(1, 7);
+ starImg = new Image[5];
+ rateDesc = new Label();
+ for (int i = 0; i < 5; i++) {
+ starImg[i] = new Image();
+ img.starGrey().applyTo(starImg[i]);
+ starImg[i].addStyleName("rateit-star");
+ starImg[i].setStyleName("rateit-star");
+ starImg[i].setTitle(i18n.t("Click to rate this"));
+ starImg[i].addClickListener(this);
+ starImg[i].addMouseListener(new MouseListenerAdapter() {
+ @Override
+ public void onMouseEnter(final Widget sender) {
+ for (int j = 0; j < 5; j++) {
+ if (sender == starImg[j]) {
+ presenter.starOver(j);
+ }
+ }
+
+ }
+
+ @Override
+ public void onMouseLeave(final Widget sender) {
+ presenter.revertCurrentRate();
+ }
+ });
+ }
+ }
+
+ private void layout() {
+ initWidget(rateGrid);
+ rateGrid.setWidget(0, 0, rateItLabel);
+ for (int i = 0; i < 5; i++) {
+ rateGrid.setWidget(0, i + 1, starImg[i]);
+ }
+ rateGrid.setWidget(0, 6, rateDesc);
+ }
+
+ private void setProperties() {
+ rateGrid.setCellPadding(0);
+ rateGrid.setCellSpacing(0);
+ rateGrid.setBorderWidth(0);
+ rateItLabel.addStyleName("kune-Margin-Small-r");
+ // rateItLabel.addStyleName("kune-Margin-Medium-l");
+ rateItLabel.addStyleName("kune-RatePanel-Label");
+ rateGrid.addStyleName("kune-RatePanel-Stars");
+ rateGrid.addStyleName("kune-RatePanel-Stars-RateIt");
+ rateDesc.addStyleName("kune-RatePanel-Label");
+ rateDesc.addStyleName("kune-Margin-Small-l");
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,162 @@
+/*
+ *
+ * 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.rate;
+
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.ioc.Provider;
+
+public class RateItPresenter implements RateIt {
+
+ private static final Double NOT_RATED = new Double(-1);
+ private RateItView view;
+ private Double currentRate;
+ private boolean isRating;
+ private final I18nTranslationService i18n;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final Session session;
+ private final Provider<RatePresenter> ratePresenterProv;
+
+ public RateItPresenter(final I18nTranslationService i18n, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider, final StateManager stateManager,
+ Provider<RatePresenter> ratePresenterProvider, final ContentCapabilitiesRegistry capabilitiesRegistry) {
+ this.i18n = i18n;
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
+ this.ratePresenterProv = ratePresenterProvider;
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(final StateAbstractDTO state) {
+ if (state instanceof StateContentDTO) {
+ StateContentDTO stateContentDTO = (StateContentDTO) state;
+ setState(capabilitiesRegistry.isRateable(stateContentDTO.getTypeId()),
+ stateContentDTO.getCurrentUserRate());
+ } else {
+ view.setVisible(false);
+ }
+ }
+ });
+ }
+
+ public void init(final RateItView view) {
+ this.view = view;
+ currentRate = NOT_RATED;
+ isRating = false;
+ }
+
+ public void setRate(final Double value) {
+ currentRate = value;
+ if (currentRate == null) {
+ currentRate = NOT_RATED;
+ }
+ isRating = false;
+ setRatePanel(currentRate);
+ }
+
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+
+ protected void revertCurrentRate() {
+ if (!isRating) {
+ setRatePanel(currentRate);
+ }
+ }
+
+ protected void starClicked(final int starClicked) {
+ isRating = true;
+ final Double newValue = starClicked + 1d == currentRate ? currentRate - 0.5d : starClicked + 1d;
+ setRatePanel(newValue);
+ NotifyUser.showProgressProcessing();
+ final StateAbstractDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().rateContent(session.getUserHash(), currentState.getStateToken(), newValue,
+ new AsyncCallbackSimple<RateResultDTO>() {
+ public void onSuccess(final RateResultDTO result) {
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Content rated"));
+ if (currentState.getStateToken().equals(session.getCurrentStateToken())) {
+ session.getContentState().setRate(result);
+ setState(true, result.getCurrentUserRate());
+ ratePresenterProv.get().setRate(result);
+ }
+ }
+ });
+ }
+
+ protected void starOver(final int starMouseOver) {
+ Double value = new Double(starMouseOver + 1);
+ if (Math.ceil(currentRate.doubleValue()) == value.doubleValue()) {
+ // use user already rated -> live same value when mouse is over
+ value = currentRate;
+ }
+ if (!isRating) {
+ // If we are not doing a rate rpc call
+ setRatePanel(value);
+ }
+ }
+
+ private void setDesc(final int rateTruncated) {
+ if (rateTruncated >= 0 && rateTruncated <= 1) {
+ view.setDesc(i18n.t("Poor"));
+ } else if (rateTruncated == 2) {
+ view.setDesc(i18n.t("Below average"));
+ } else if (rateTruncated == 3) {
+ view.setDesc(i18n.t("Average"));
+ } else if (rateTruncated == 4) {
+ view.setDesc(i18n.t("Above average"));
+ } else if (rateTruncated == 5) {
+ view.setDesc(i18n.t("Excellent"));
+ } else {
+ view.setDesc("");
+ }
+ }
+
+ private void setRatePanel(final Double value) {
+ if (value.equals(NOT_RATED)) {
+ view.clearRate();
+ view.setDesc("");
+ } else {
+ view.setStars(value);
+ setDesc((int) Math.ceil(value.doubleValue()));
+ }
+ }
+
+ private void setState(boolean isRateable, Double currentUserRate) {
+ if (isRateable) {
+ if (session.isLogged()) {
+ setRate(currentUserRate);
+ view.setVisible(true);
+ } else {
+ view.setVisible(false);
+ }
+ } else {
+ view.setVisible(false);
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItView.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItView.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.rate;
+
+public interface RateItView {
+
+ void clearRate();
+
+ void setDesc(String desc);
+
+ void setStars(Double value);
+
+ void setVisible(boolean visible);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePanel.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,102 @@
+/*
+ *
+ * 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.rate;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.skel.Toolbar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+
+public class RatePanel extends Composite implements RateView {
+ private Grid rateGrid;
+ private Image[] starImg;
+ private Label rateDesc;
+ private final I18nTranslationService i18n;
+
+ public RatePanel(final Double rate, final Integer byUsers, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ initialize();
+ layout();
+ setProperties();
+ if (rate != null) {
+ setRate(rate);
+ }
+ if (byUsers != null) {
+ setByUsers(byUsers);
+ }
+ final Toolbar bottomBar = ws.getEntityWorkspace().getContentBottomBar();
+ bottomBar.addFill();
+ bottomBar.add(this);
+ }
+
+ public void setByUsers(final Integer byUsers) {
+ if (byUsers.intValue() == 0) {
+ rateDesc.setText(i18n.t("(Not rated)"));
+ } else if (byUsers.intValue() == 1) {
+ // i18n params pluralization
+ rateDesc.setText(i18n.t("([%d] user)", byUsers));
+ } else {
+ rateDesc.setText(i18n.t("([%d] users)", byUsers));
+ }
+ }
+
+ public void setRate(final Double rate) {
+ setRate(Star.genStars(rate.doubleValue()));
+ }
+
+ private void initialize() {
+ rateGrid = new Grid(1, 6);
+ starImg = new Image[5];
+ for (int i = 0; i < 5; i++) {
+ starImg[i] = new Image();
+ new Star(Star.GREY).getImage().applyTo(starImg[i]);
+ }
+ rateDesc = new Label();
+ }
+
+ private void layout() {
+ initWidget(rateGrid);
+ for (int i = 0; i < 5; i++) {
+ rateGrid.setWidget(0, i, starImg[i]);
+ }
+ rateGrid.setWidget(0, 5, rateDesc);
+ }
+
+ private void setProperties() {
+ rateGrid.setCellPadding(0);
+ rateGrid.setCellSpacing(0);
+ rateGrid.setBorderWidth(0);
+ rateGrid.addStyleName("kune-RatePanel-Stars");
+ rateDesc.addStyleName("kune-RatePanel-Label");
+ rateDesc.addStyleName("kune-Margin-Small-lr");
+ }
+
+ private void setRate(final Star stars[]) {
+ for (int i = 0; i < 5; i++) {
+ stars[i].getImage().applyTo(starImg[i]);
+ }
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePresenter.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RatePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,75 @@
+/*
+ *
+ * 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.rate;
+
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.state.StateManager;
+
+import com.calclab.suco.client.events.Listener;
+
+public class RatePresenter {
+
+ private RateView view;
+ private final ContentCapabilitiesRegistry capabilitiesRegistry;
+
+ public RatePresenter(final StateManager stateManager, ContentCapabilitiesRegistry capabilitiesRegistry) {
+ this.capabilitiesRegistry = capabilitiesRegistry;
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(final StateAbstractDTO state) {
+ if (state instanceof StateContentDTO) {
+ setState((StateContentDTO) state);
+ } else {
+ view.setVisible(false);
+ }
+ }
+ });
+ }
+
+ public void init(final RateView view) {
+ this.view = view;
+ }
+
+ public void setRate(RateResultDTO result) {
+ setRate(result.getRateByUsers(), result.getRate());
+ }
+
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+
+ private void setRate(Integer rateByUsers, Double rate) {
+ view.setVisible(true);
+ view.setRate(rate);
+ view.setByUsers(rateByUsers);
+ }
+
+ private void setState(final StateContentDTO state) {
+ Integer rateByUsers = state.getRateByUsers();
+ Double rate = state.getRate();
+ if (capabilitiesRegistry.isRateable(state.getTypeId())) {
+ setRate(rateByUsers, rate);
+ } else {
+ view.setVisible(false);
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateView.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateView.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.rate;
+
+public interface RateView {
+
+ void setByUsers(Integer byUsers);
+
+ void setRate(Double rate);
+
+ void setVisible(boolean visible);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/Star.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/Star.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/Star.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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.rate;
+
+import org.ourproject.kune.platf.client.services.Images;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+
+public class Star {
+ private static final Images img = Images.App.getInstance();
+ public static final int GREY = 0;
+ public static final int YELLOW = 1;
+
+ public final static Star[] CLEAR = { new Star(), new Star(), new Star(), new Star(), new Star() };
+
+ private AbstractImagePrototype image;
+
+ public Star() {
+ image = img.starGrey();
+ }
+
+ public AbstractImagePrototype getImage() {
+ return image;
+ }
+
+ public Star(final double rateDecimals) {
+ if (rateDecimals == 1) {
+ image = img.starYellow();
+ } else if (rateDecimals == 0) {
+ image = img.starGrey();
+ } else {
+ final int rateTrucated = (int) rateDecimals;
+ final int rateDecimal = (int) ((rateDecimals - rateTrucated) * 10) * 10;
+ if (rateDecimal == 10) {
+ image = img.star10();
+ } else if (rateDecimal == 20) {
+ image = img.star20();
+ } else if (rateDecimal == 30) {
+ image = img.star30();
+ } else if (rateDecimal == 40) {
+ image = img.star40();
+ } else if (rateDecimal == 50) {
+ image = img.star50();
+ } else if (rateDecimal == 60) {
+ image = img.star60();
+ } else if (rateDecimal == 70) {
+ image = img.star70();
+ } else if (rateDecimal == 80) {
+ image = img.star80();
+ } else if (rateDecimal == 90) {
+ image = img.star90();
+ }
+ }
+ }
+
+ public static Star[] genStars(final double rate) {
+ Star[] stars;
+ stars = new Star[5];
+ final int rateTruncated = (int) rate;
+ final double rateDecimals = rate - rateTruncated;
+
+ for (int i = 0; i < 5; i++) {
+ if (i < rateTruncated) {
+ stars[i] = new Star(Star.YELLOW);
+ } else {
+ if (i == rateTruncated) {
+ stars[i] = new Star(rateDecimals);
+ } else {
+ stars[i] = new Star(Star.GREY);
+ }
+ }
+ }
+ return stars;
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -23,7 +23,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.ioc.Provider;
@@ -58,11 +58,11 @@
}
public void doSearch(final String text) {
- Site.showProgressLoading();
+ NotifyUser.showProgressLoading();
searchHistory.put(text, null);
view.search(text, currentSearch);
view.show();
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
public void doSearchOfType(final String text, final SiteSearcherType typeOfSearch) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -32,8 +32,8 @@
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.emiteuimodule.client.SubscriptionMode;
import com.calclab.suco.client.ioc.Provider;
@@ -56,10 +56,10 @@
public void doRegister() {
signInProvider.get().hide();
if (!session.isLogged()) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
view.show();
view.center();
- Site.hideProgress();
+ NotifyUser.hideProgress();
} else {
stateManager.restorePreviousToken();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -28,8 +28,8 @@
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.SiteToken;
import com.allen_sauer.gwt.log.client.Log;
@@ -52,10 +52,10 @@
public void doSignIn() {
registerProvider.get().hide();
if (!session.isLogged()) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
view.show();
view.center();
- Site.hideProgress();
+ NotifyUser.hideProgress();
view.focusOnNickname();
} else {
stateManager.restorePreviousToken();
@@ -92,7 +92,7 @@
final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
public void onFailure(final Throwable caught) {
view.unMask();
- Site.hideProgress();
+ NotifyUser.hideProgress();
try {
throw caught;
} catch (final UserAuthException e) {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,93 +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;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
-import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class Site {
- public static final String IN_DEVELOPMENT = " (in development)";
- private static I18nTranslationService i18n;
- private static SiteProgress progress;
- private static Provider<SiteToastMessage> siteMessageProvider;
- private static Provider<WorkspaceSkeleton> ws;
-
- public static void error(final String value) {
- getSiteMessage().showMessage(i18n.t("Error"), value, SiteErrorType.error);
- }
-
- public static void hideProgress() {
- progress.hideProgress();
- }
-
- public static void important(final String value) {
- getSiteMessage().showMessage(i18n.t("Important"), value, SiteErrorType.imp);
- }
-
- public static void info(final String value) {
- getSiteMessage().showMessage(i18n.t("Info"), value, SiteErrorType.info);
- }
-
- public static void showAlertMessage(String title, String message) {
- ws.get().showAlertMessage(title, message);
- }
-
- public static void showProgress(final String text) {
- progress.showProgress(text);
- }
-
- public static void showProgressLoading() {
- progress.showProgress(i18n.t("Loading"));
- }
-
- public static void showProgressProcessing() {
- progress.showProgress(i18n.t("Processing"));
- }
-
- public static void showProgressSaving() {
- progress.showProgress(i18n.t("Saving"));
- }
-
- public static void showProgressStarting() {
- progress.showProgress(i18n.t("Starting"));
- }
-
- public static void veryImportant(final String value) {
- getSiteMessage().showMessage(i18n.t("Alert"), value, SiteErrorType.veryimp);
- }
-
- private static SiteToastMessage getSiteMessage() {
- return siteMessageProvider.get();
- }
-
- public Site(final I18nUITranslationService i18n, final SiteProgress progress,
- final Provider<SiteToastMessage> siteMessageProvider, Provider<WorkspaceSkeleton> ws) {
- Site.i18n = i18n;
- Site.progress = progress;
- Site.siteMessageProvider = siteMessageProvider;
- Site.ws = ws;
- }
-}
Added: 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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,57 @@
+package org.ourproject.kune.workspace.client.site;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+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.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.ioc.Provider;
+
+public class WorkspaceNotifyUser {
+
+ public WorkspaceNotifyUser(NotifyUser notifyUser, final I18nTranslationService i18n,
+ final SiteProgress siteProgress, final Provider<SiteToastMessage> toaster,
+ final Provider<WorkspaceSkeleton> ws) {
+ notifyUser.addProgressNotifier(new Listener<String>() {
+ public void onEvent(String message) {
+ siteProgress.showProgress(message);
+ }
+ });
+ notifyUser.addHideProgressNotifier(new Listener0() {
+ public void onEvent() {
+ siteProgress.hideProgress();
+ }
+ });
+ notifyUser.addNotifier(new Listener2<Level, String>() {
+ public void onEvent(Level level, String msg) {
+ String title = "";
+ switch (level) {
+ case error:
+ title = i18n.t("Error");
+ break;
+ case important:
+ title = i18n.t("Important");
+ break;
+ case veryImportant:
+ title = i18n.t("Alert");
+ break;
+ case info:
+ title = i18n.t("Info");
+ break;
+ }
+ toaster.get().showMessage(title, msg, level);
+ }
+ });
+ notifyUser.addAlerter(new Listener2<String, String>() {
+ public void onEvent(String title, String msg) {
+ ws.get().showAlertMessage(title, msg);
+ }
+ });
+ }
+
+}
Modified: 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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -19,10 +19,10 @@
*/
package org.ourproject.kune.workspace.client.site.msg;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface SiteToastMessage {
- void showMessage(String title, String message, SiteErrorType type);
+ void showMessage(String title, String message, Level level);
}
Modified: 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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.site.msg;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+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;
@@ -29,19 +29,19 @@
public SiteToastMessagePanel() {
}
- public void showMessage(String title, String message, SiteErrorType type) {
+ 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 = "";
- switch (type) {
+ switch (level) {
case info:
iconCls = "k-stm-info-icon";
break;
- case imp:
+ case important:
iconCls = "k-stm-imp-icon";
break;
- case veryimp:
+ case veryImportant:
iconCls = "k-stm-verimp-icon";
break;
case error:
Modified: 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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.site.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public class SiteToastMessagePresenter implements SiteToastMessage {
@@ -37,7 +37,7 @@
this.view = view;
}
- public void showMessage(String title, final String message, final SiteErrorType type) {
- view.showMessage(title, message, type);
+ public void showMessage(String title, final String message, final Level level) {
+ view.showMessage(title, message, level);
}
}
Modified: 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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,10 +20,10 @@
package org.ourproject.kune.workspace.client.site.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
public interface SiteToastMessageView extends View {
- void showMessage(String title, String message, SiteErrorType type);
+ void showMessage(String title, String message, Level level);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -34,7 +34,7 @@
private final Widget progressPanel;
private final Widget progressText;
- private Timer timeProgressMaxTime;
+ private final Timer timeProgressMaxTime;
private final Provider<SitePublicSpaceLink> publicLinkProvider;
@@ -43,6 +43,12 @@
this.publicLinkProvider = publicLinkProvider;
progressPanel = RootPanel.get("kuneprogresspanel");
progressText = RootPanel.get("kuneprogresstext");
+ timeProgressMaxTime = new Timer() {
+ @Override
+ public void run() {
+ hideProgress();
+ }
+ };
}
public void hideProgress() {
@@ -56,14 +62,6 @@
}
public void showProgress(final String text) {
- if (timeProgressMaxTime == null) {
- timeProgressMaxTime = new Timer() {
- @Override
- public void run() {
- hideProgress();
- }
- };
- }
timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
publicLinkProvider.get().setVisible(false);
progressPanel.setVisible(true);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -67,7 +67,7 @@
searchButton.addClickListener(new ClickListener() {
public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
presenter.doSearch(searchTextBox.getText());
}
});
@@ -82,7 +82,7 @@
public void onKeyUp(final Widget widget, final char key, final int mod) {
if (key == KEY_ENTER) {
if (searchTextBox.getText().length() > 0) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
presenter.doSearch(searchTextBox.getText());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
@@ -42,7 +42,7 @@
ws.getSiteBar().add(signOutLabel);
signOutLabel.addClickListener(new ClickListener() {
public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
presenter.doSignOut();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -30,7 +30,7 @@
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -76,7 +76,7 @@
if (beforeSignOutCollection.checkBeforeAction()) {
userServiceProvider.get().logout(session.getUserHash(), new AsyncCallback<Object>() {
public void onFailure(final Throwable caught) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
try {
throw caught;
} catch (final SessionExpiredException e) {
@@ -90,13 +90,13 @@
}
public void onSuccess(final Object arg0) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
clientUIsignOut();
}
});
} else {
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
+import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
@@ -46,7 +47,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -151,7 +152,7 @@
ActionToolbarMenuDescriptor<UserSimpleDTO> addNewBuddiesAction = new ActionToolbarMenuDescriptor<UserSimpleDTO>(
AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
public void onEvent(UserSimpleDTO parameter) {
- Site.info("In development");
+ NotifyUser.info("In development");
}
});
addNewBuddiesAction.setTextDescription(i18n.t("Add a new buddy"));
@@ -168,7 +169,7 @@
session.getCurrentState().getGroup().getStateToken(), visibility,
new AsyncCallbackSimple<Object>() {
public void onSuccess(Object result) {
- Site.info(i18n.t("Buddies visibility changed"));
+ NotifyUser.info(i18n.t("Buddies visibility changed"));
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -26,6 +26,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
+import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
@@ -50,8 +51,8 @@
import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -118,7 +119,7 @@
chatEngineProvider.get().chat(
XmppURI.jid(group.getShortName() + "@" + initData.getChatDomain()));
} else {
- Site.important(i18n.t("To start a chat you need to be 'online'"));
+ NotifyUser.important(i18n.t("To start a chat you need to be 'online'"));
}
}
}), true);
@@ -139,12 +140,12 @@
}
public void addCollab(final String groupShortName) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().addCollabMember(session.getUserHash(), session.getCurrentState().getStateToken(),
groupShortName, new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member added as collaborator"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member added as collaborator"));
stateManager.setSocialNetwork(result);
}
@@ -191,7 +192,7 @@
session.getCurrentState().getGroup().getStateToken(), admissionPolicy,
new AsyncCallbackSimple<Object>() {
public void onSuccess(Object result) {
- Site.info(i18n.t("Members joining policy changed"));
+ NotifyUser.info(i18n.t("Members joining policy changed"));
}
});
}
@@ -215,7 +216,7 @@
session.getCurrentState().getGroup().getStateToken(), visibility,
new AsyncCallbackSimple<Object>() {
public void onSuccess(Object result) {
- Site.info(i18n.t("Members visibility changed"));
+ NotifyUser.info(i18n.t("Members visibility changed"));
}
});
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/RadioMustBeChecked.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,24 +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.socialnet;
-
-public interface RadioMustBeChecked {
- boolean mustBeChecked();
-}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -41,8 +41,8 @@
import org.ourproject.kune.platf.client.ui.gridmenu.CustomMenu;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -143,22 +143,22 @@
participate = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer,
ActionToolbarPosition.bottombar, new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().requestJoinGroup(session.getUserHash(),
session.getCurrentState().getStateToken(), new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
final SocialNetworkRequestResult resultType = (SocialNetworkRequestResult) result;
switch (resultType) {
case accepted:
- Site.info(i18n.t("You are now member of this group"));
+ NotifyUser.info(i18n.t("You are now member of this group"));
stateManager.reload();
break;
case denied:
- Site.important(i18n.t("Sorry this is a closed group"));
+ NotifyUser.important(i18n.t("Sorry this is a closed group"));
break;
case moderated:
- Site.info(i18n.t("Membership requested. Waiting for admins decision"));
+ NotifyUser.info(i18n.t("Membership requested. Waiting for admins decision"));
break;
}
}
@@ -238,13 +238,13 @@
changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif",
i18n.t("Change to collaborator"), new Listener<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
session.getCurrentState().getStateToken(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member type changed"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member type changed"));
stateManager.setSocialNetwork(result);
}
});
@@ -253,13 +253,13 @@
removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
new Listener<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().deleteMember(session.getUserHash(),
session.getCurrentState().getStateToken(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member removed"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member removed"));
stateManager.reload();
// in the
// future,
@@ -276,13 +276,13 @@
changeToAdminMenuItem = new MenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
new Listener<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
session.getCurrentState().getStateToken(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member type changed"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member type changed"));
stateManager.setSocialNetwork(result);
}
});
@@ -291,13 +291,13 @@
acceptJoinGroupMenuItem = new MenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
new Listener<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().acceptJoinGroup(session.getUserHash(),
session.getCurrentState().getStateToken(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member accepted"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member accepted"));
stateManager.setSocialNetwork(result);
}
});
@@ -306,13 +306,13 @@
denyJoinGroupMenuItem = new MenuItem<GroupDTO>("images/cancel.gif", i18n.t("Reject this member"),
new Listener<GroupDTO>() {
public void onEvent(final GroupDTO group) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().denyJoinGroup(session.getUserHash(),
session.getCurrentState().getStateToken(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member rejected"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member rejected"));
stateManager.setSocialNetwork(result);
}
});
@@ -329,12 +329,12 @@
}
private void removeMemberAction(final GroupDTO groupDTO) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
snServiceProvider.get().unJoinGroup(session.getUserHash(), new StateToken(groupDTO.getShortName()),
new AsyncCallbackSimple<SocialNetworkDataDTO>() {
public void onSuccess(final SocialNetworkDataDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Removed as member"));
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Removed as member"));
stateManager.reload();
// in the future with user
// info:
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/other/AddAsBuddiePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -5,7 +5,7 @@
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -42,7 +42,7 @@
public void onAdd() {
chatEngine.get().addNewBuddie(session.getCurrentState().getGroup().getShortName());
- Site.info("Added as buddie. Waiting buddie response");
+ NotifyUser.info("Added as buddie. Waiting buddie response");
view.setVisible(false);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -26,7 +26,7 @@
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Event2;
import com.calclab.suco.client.events.Listener;
@@ -74,12 +74,12 @@
}
protected void onChangeGroupWsTheme(final WsTheme newTheme) {
- Site.showProgressProcessing();
+ NotifyUser.showProgressProcessing();
groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(), session.getCurrentState().getStateToken(),
newTheme.getName(), new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
setTheme(newTheme);
- Site.hideProgress();
+ NotifyUser.hideProgress();
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -26,7 +26,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import com.calclab.suco.client.events.Event2;
import com.calclab.suco.client.events.Listener2;
@@ -58,26 +58,26 @@
public void rename(final StateToken token, final String oldName, final String newName) {
if (!newName.equals(oldName)) {
- Site.showProgress(i18n.t("Renaming"));
+ NotifyUser.showProgress(i18n.t("Renaming"));
final AsyncCallback<StateAbstractDTO> asyncCallback = new AsyncCallback<StateAbstractDTO>() {
public void onFailure(final Throwable caught) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
try {
throw caught;
} catch (final NameInUseException e) {
- Site.error(i18n.tWithNT("This name already exists",
+ NotifyUser.error(i18n.tWithNT("This name already exists",
"It is used when a file or a folder with the same name already exists"));
} catch (final NameNotPermittedException e) {
- Site.error(i18n.tWithNT("This name is not permitted",
+ NotifyUser.error(i18n.tWithNT("This name is not permitted",
"It is used when a file or a folder does not have a permitted name"));
} catch (final Throwable e) {
- Site.error(i18n.t("Error renaming"));
+ NotifyUser.error(i18n.t("Error renaming"));
}
onFail.fire(token, oldName);
}
public void onSuccess(final StateAbstractDTO state) {
- Site.hideProgress();
+ NotifyUser.hideProgress();
session.setCurrentState(state);
onSuccess.fire(token, state.getTitle());
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/AbstractClientTool.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/AbstractClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.tool;
+
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+public abstract class AbstractClientTool implements ClientTool {
+
+ public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector,
+ wsThemePresenter);
+ final ToolSelectorItemPanel panel = new ToolSelectorItemPanel(presenter, ws);
+ presenter.init(panel);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ClientTool.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.tool;
+
+public interface ClientTool {
+
+ String getName();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/FoldableAbstractClientTool.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,122 @@
+/*
+ *
+ * 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.tool;
+
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+public abstract class FoldableAbstractClientTool extends AbstractClientTool {
+ public static final String UPLOADEDFILE_SUFFIX = "uploaded";
+
+ protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
+
+ public FoldableAbstractClientTool(String shortName, String longName, ToolSelector toolSelector,
+ WsThemePresenter wsThemePresenter, WorkspaceSkeleton ws,
+ ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
+ super(shortName, longName, toolSelector, wsThemePresenter, ws);
+ this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
+ }
+
+ public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
+ contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(typeId, mimeType, iconUrl);
+ }
+
+ public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
+ contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
+ }
+
+ protected void registerAclEditableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getAclEditable().register(typeIds);
+ }
+
+ protected void registerAuthorableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getAuthorable().register(typeIds);
+ }
+
+ protected void registerComentableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getComentable().register(typeIds);
+ }
+
+ protected void registerDragableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getDragable().register(typeIds);
+ }
+
+ protected void registerDropableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getDropable().register(typeIds);
+ }
+
+ protected void registerEmailSubscribeAbleTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getEmailSubscribeAble().register(typeIds);
+ }
+
+ protected void registerLicensableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getLicensable().register(typeIds);
+ }
+
+ protected void registerPublishModerableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
+ }
+
+ protected void registerRateableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getRateable().register(typeIds);
+ }
+
+ protected void registerRenamableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getRenamable().register(typeIds);
+ }
+
+ protected void registerTageableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getTageable().register(typeIds);
+ }
+
+ protected void registerTranslatableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getTranslatable().register(typeIds);
+ }
+
+ protected void registerUploadTypesAndMimes(String typeUploadedfile) {
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("video"), "images/nav/film.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "pdf"), "images/nav/page_pdf.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("text"), "images/nav/page_text.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "msword"),
+ "images/nav/page_word.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "excel"),
+ "images/nav/page_excel.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "mspowerpoint"),
+ "images/nav/page_pps.png");
+ registerContentTypeIcon(typeUploadedfile, "images/nav/page.png");
+ }
+
+ protected void registerVersionableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getVersionable().register(typeIds);
+ }
+
+ protected void registerXmppComentableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getXmppComentable().register(typeIds);
+ }
+
+ protected void registerXmppNotifyCapableTypes(String... typeIds) {
+ contentCapabilitiesRegistry.getXmppNotificyCapable().register(typeIds);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelector.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelector.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.tool;
+
+public interface ToolSelector {
+
+ void addTool(ToolSelectorItem item);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItem.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItem.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,32 @@
+/*
+ *
+ * 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.tool;
+
+public interface ToolSelectorItem {
+
+ String getShortName();
+
+ void setGroupShortName(String groupShortName);
+
+ void setSelected(boolean selected);
+
+ void setVisible(boolean visible);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPanel.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPanel.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,69 @@
+/*
+ *
+ * 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.tool;
+
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.ui.Hyperlink;
+
+public class ToolSelectorItemPanel extends RoundedPanel implements ToolSelectorItemView {
+ private final Hyperlink hl;
+
+ public ToolSelectorItemPanel(final ToolSelectorItemPresenter presenter, final WorkspaceSkeleton ws) {
+ super(RoundedPanel.RIGHT, 2);
+ hl = new Hyperlink();
+ super.setWidget(hl);
+ ws.addInTools(this);
+ super.sinkEvents(Event.ONCLICK);
+ super.addStyleName("k-toolselectoritem");
+ }
+
+ @Override
+ public void onBrowserEvent(final Event event) {
+ super.onBrowserEvent(event);
+ }
+
+ public void setLink(final String text, final String targetHistoryToken) {
+ hl.setText(text);
+ hl.setTargetHistoryToken(targetHistoryToken);
+ }
+
+ public void setSelected(final boolean selected) {
+ if (selected) {
+ hl.setStylePrimaryName("k-toolselectoritem-sel");
+ } else {
+ hl.setStylePrimaryName("k-toolselectoritem-notsel");
+ }
+ super.setCornerStyleName(hl.getStyleName());
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ final String oldName = oldTheme.getName();
+ hl.removeStyleDependentName(oldName);
+ }
+ final String newName = newTheme.getName();
+ hl.addStyleDependentName(newName);
+ super.setCornerStyleName(hl.getStyleName());
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPresenter.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,79 @@
+/*
+ *
+ * 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.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+import com.calclab.suco.client.events.Listener2;
+
+public class ToolSelectorItemPresenter implements ToolSelectorItem {
+
+ private ToolSelectorItemView view;
+ private final ToolSelector toolSelector;
+ private final WsThemePresenter wsThemePresenter;
+ private final String shortName;
+ private final String longName;
+
+ public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.toolSelector = toolSelector;
+ this.wsThemePresenter = wsThemePresenter;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorItemView view) {
+ this.view = view;
+ toolSelector.addTool(this);
+ wsThemePresenter.onThemeChanged(new Listener2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setGroupShortName(final String groupShortName) {
+ final StateToken token = new StateToken(groupShortName, getShortName(), null, null);
+ view.setLink(longName, token.toString());
+ }
+
+ public void setSelected(final boolean selected) {
+ view.setSelected(selected);
+ }
+
+ public void setVisible(boolean visible) {
+ view.setVisible(visible);
+ }
+
+ private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemView.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorItemView.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+public interface ToolSelectorItemView extends View {
+
+ void setLink(String text, String targetHistoryToken);
+
+ void setSelected(boolean selected);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+ void setVisible(boolean visible);
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenter.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenter.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,90 @@
+/*
+ *
+ * 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.tool;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener2;
+
+public class ToolSelectorPresenter implements ToolSelector {
+
+ private final HashMap<String, ToolSelectorItem> tools;
+
+ public ToolSelectorPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
+ tools = new HashMap<String, ToolSelectorItem>();
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(StateAbstractDTO state) {
+ for (String tool : tools.keySet()) {
+ List<String> enabledTools = state.getEnabledTools();
+ if (enabledTools != null && enabledTools.contains(tool)) {
+ tools.get(tool).setVisible(true);
+ } else {
+ tools.get(tool).setVisible(false);
+ }
+ }
+ }
+ });
+ stateManager.onGroupChanged(new Listener2<String, String>() {
+ public void onEvent(final String oldGroup, final String newGroup) {
+ onGroupChanged(newGroup);
+ }
+ });
+ stateManager.onToolChanged(new Listener2<String, String>() {
+ public void onEvent(final String oldTool, final String newTool) {
+ onToolChanged(oldTool, newTool);
+ }
+ });
+ }
+
+ public void addTool(final ToolSelectorItem item) {
+ final String name = item.getShortName();
+ if (name == null) {
+ throw new RuntimeException("You cannot add a tool without a name");
+ }
+ if (tools.get(name) != null) {
+ throw new RuntimeException("A tool with the same name already added");
+ }
+ tools.put(name, item);
+ item.setSelected(false);
+ }
+
+ void onGroupChanged(final String newGroupName) {
+ for (final String name : tools.keySet()) {
+ tools.get(name).setGroupShortName(newGroupName);
+ }
+ }
+
+ void onToolChanged(final String oldTool, final String newTool) {
+ Log.debug("Registered tools: " + tools.keySet().toString());
+ if (!oldTool.equals("")) {
+ tools.get(oldTool).setSelected(false);
+ }
+ if (!newTool.equals("")) {
+ tools.get(newTool).setSelected(true);
+ }
+ }
+}
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-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -9,10 +9,8 @@
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.services.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.site.SiteToken;
-import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
import com.calclab.suco.testing.events.MockedListener;
import com.calclab.suco.testing.events.MockedListener0;
@@ -49,7 +47,7 @@
stateManager.onStateChanged(stateChangeListener);
stateManager.onGroupChanged(groupChangeListener);
stateManager.onToolChanged(toolChangeListener);
- new Site(Mockito.mock(I18nUITranslationService.class), Mockito.mock(SiteProgress.class), null, null);
+ new NotifyUser(null);
}
@Test
Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2009-02-26 01:46:09 UTC (rev 1052)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -1,103 +0,0 @@
-package org.ourproject.kune.platf.client.tool;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-public class ToolSelectorPresenterTest {
-
- private static final String TOOL1_NAME = "tool1";
- private static final String TOOL2_NAME = "tool2";
- private static final String GROUP1_NAME = "group1";
- private ToolSelectorPresenter toolSelector;
- private ToolSelectorItem toolSelectorItem1;
- private ToolSelectorItem toolSelectorItem2;
-
- @Test
- public void addFirstToolMustNotSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- }
-
- @Test(expected = RuntimeException.class)
- public void addToolWithoutNameMustGiveException() {
- toolSelector.addTool(toolSelectorItem1);
- }
-
- @Test
- public void addTwoToolsMustSelectNothing() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- Mockito.verify(toolSelectorItem2).setSelected(false);
- }
-
- @Test(expected = RuntimeException.class)
- public void addTwoToolsWithSameNameMustGiveException() {
- setToolNames();
- final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
- Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItemCopy);
- }
-
- @Before
- public void begin() {
- final StateManager stateManager = Mockito.mock(StateManager.class);
- final WsThemePresenter themePresenter = Mockito.mock(WsThemePresenter.class);
- toolSelector = new ToolSelectorPresenter(stateManager, themePresenter);
- toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
- toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
- }
-
- @Test
- public void setStateFirstMustSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.onToolChanged("", TOOL1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
- }
-
- @Test
- public void setStateWithADifferentGroupMustSetLink() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onGroupChanged(GROUP1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- }
-
- @Test
- public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
- }
-
- @Test
- public void setStateWithNoToolNameMustUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, "");
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
- }
-
- public void setToolNames() {
- Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
- Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
- }
-
-}
Copied: trunk/src/test/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenterTest.java (from rev 1042, trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java)
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2009-01-29 18:42:08 UTC (rev 1042)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/tool/ToolSelectorPresenterTest.java 2009-03-02 13:25:37 UTC (rev 1053)
@@ -0,0 +1,105 @@
+package org.ourproject.kune.workspace.client.tool;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.tool.ToolSelectorItem;
+import org.ourproject.kune.workspace.client.tool.ToolSelectorPresenter;
+
+public class ToolSelectorPresenterTest {
+
+ private static final String TOOL1_NAME = "tool1";
+ private static final String TOOL2_NAME = "tool2";
+ private static final String GROUP1_NAME = "group1";
+ private ToolSelectorPresenter toolSelector;
+ private ToolSelectorItem toolSelectorItem1;
+ private ToolSelectorItem toolSelectorItem2;
+
+ @Test
+ public void addFirstToolMustNotSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addToolWithoutNameMustGiveException() {
+ toolSelector.addTool(toolSelectorItem1);
+ }
+
+ @Test
+ public void addTwoToolsMustSelectNothing() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ Mockito.verify(toolSelectorItem2).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addTwoToolsWithSameNameMustGiveException() {
+ setToolNames();
+ final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
+ Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItemCopy);
+ }
+
+ @Before
+ public void begin() {
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ final WsThemePresenter themePresenter = Mockito.mock(WsThemePresenter.class);
+ toolSelector = new ToolSelectorPresenter(stateManager, themePresenter);
+ toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
+ toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
+ }
+
+ @Test
+ public void setStateFirstMustSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.onToolChanged("", TOOL1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithADifferentGroupMustSetLink() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onGroupChanged(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ }
+
+ @Test
+ public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithNoToolNameMustUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, "");
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
+ }
+
+ public void setToolNames() {
+ Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
+ Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
+ }
+
+}
1
0
Author: vjrj
Date: 2009-02-26 02:46:09 +0100 (Thu, 26 Feb 2009)
New Revision: 1052
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserServiceAsync.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignleft.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignright.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/backcolor.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/bold.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/centerpara.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/charfontname.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/decrementindent.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultbullet.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultnumbering.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/edithtml.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontcolor.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontheight.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/hfixedline.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/images.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/incrementindent.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/italic.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/removeFormat.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/strikeout.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/subscript.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/superscript.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/underline.png
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java
Modified:
trunk/TODO
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.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/RTEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceIntegrationTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Code reorganization
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/TODO 2009-02-26 01:46:09 UTC (rev 1052)
@@ -10,6 +10,9 @@
Use org-mode in emacs to easy manage this file
* SHORT-TERM (URGENT)
+** vjrj <v> GWT 1.6
+ http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3e7e…
+ http://code.google.com/p/google-web-toolkit/wiki/WAR_Design_1_6
** TODO <v> User preferences storing
(See also variables in 'Styling braimstorming')
We need a way to store (in db) User preferences (like emite chat configurations) in a extensible way.
@@ -90,7 +93,7 @@
- youtube videos
+ Edit HTML
+ Easy extensible for new actions
- + Try to be a reusable module (like emite)
+ + Try (yes, only try) to be a reusable module (like emite)
+ autosave on/off
*** Charactericts
+ Builded over gwt RTE (or any similar RTE) and based in gwt mouse/keyboard events
@@ -127,6 +130,7 @@
*** Links
http://www.ongwt.com/post/2009/01/08/XWiki-:-Wysiwyg-editor-based-on-GWT
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/in…
+ http://www.mozilla.org/editor/midas-spec.html
http://mozilla.org/editor/midasdemo/
** vjrj <v> rails group-shortname.kune-site-domain/tool-name/folder-id/doc-id routing, maybe use:
http://agilewebdevelopment.com/plugins/request_routing
@@ -457,10 +461,11 @@
other links:
http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
+** <v> P2P downloads for bigg uploads (the server acts as seeder).
* LONG-TERM
** <s> integrate some blog/wiki converter:
http://code.google.com/p/google-blog-converters-appengine/
http://toolserver.org/~merphant/wiki2html/
* IDEAS
** <d> Try to find a way dozer maps directly without use getters/setters (less js code and better performance)
-
+
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/pom.xml 2009-02-26 01:46:09 UTC (rev 1052)
@@ -39,6 +39,11 @@
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
+ <artifactId>gwt-incubator</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>1.5.3</version>
</dependency>
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -24,11 +24,10 @@
import org.ourproject.kune.docs.client.DocumentClientModule;
import org.ourproject.kune.gallery.client.GalleryClientModule;
import org.ourproject.kune.platf.client.services.KuneCoreModule;
-import org.ourproject.kune.platf.client.services.KuneModule;
import org.ourproject.kune.platf.client.services.KunePlatformModule;
-import org.ourproject.kune.platf.client.services.KuneRegistryModule;
-import org.ourproject.kune.platf.client.services.KuneWorkspaceModule;
import org.ourproject.kune.wiki.client.WikiClientModule;
+import org.ourproject.kune.workspace.client.KuneRegistryModule;
+import org.ourproject.kune.workspace.client.KuneWorkspaceModule;
import org.ourproject.kune.workspace.client.hello.HelloWorldModule;
import com.allen_sauer.gwt.log.client.Log;
@@ -64,9 +63,9 @@
}
public void onModuleLoadCont() {
- Suco.install(new KuneCoreModule(), new KuneRegistryModule(), new KunePlatformModule(),
- new KuneWorkspaceModule(), new EmiteUIModule(), new DocumentClientModule(), new BlogClientModule(),
- new WikiClientModule(), new GalleryClientModule(), new ChatClientModule(), new KuneModule());
+ Suco.install(new KuneCoreModule(), new KuneRegistryModule(), new KunePlatformModule(), new EmiteUIModule(),
+ new DocumentClientModule(), new BlogClientModule(), new WikiClientModule(), new GalleryClientModule(),
+ new ChatClientModule(), new KuneWorkspaceModule());
// We install our HelloWorldModule
Suco.install(new HelloWorldModule());
Modified: trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,6 +28,7 @@
import org.ourproject.kune.platf.client.rpc.I18nService;
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.server.LoggerMethodInterceptor;
import org.ourproject.kune.platf.server.PlatformServerModule;
import org.ourproject.kune.platf.server.manager.file.EntityLogoDownloadManager;
@@ -48,7 +49,6 @@
import org.ourproject.kune.rack.filters.RedirectFilter;
import org.ourproject.kune.rack.filters.rest.RESTServicesModule;
import org.ourproject.kune.wiki.server.WikiServerModule;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.google.inject.AbstractModule;
import com.google.inject.Module;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -40,7 +41,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -37,6 +37,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -48,7 +49,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,9 +20,9 @@
package org.ourproject.kune.blogs.client;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -23,11 +23,11 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -32,9 +32,9 @@
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.wiki.client.WikiClientTool;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -35,12 +35,12 @@
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -24,11 +24,11 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -40,7 +41,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -37,6 +37,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -48,7 +49,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,9 +20,9 @@
package org.ourproject.kune.docs.client;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -23,11 +23,11 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,6 +28,7 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -39,7 +40,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -37,6 +37,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -48,7 +49,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,9 +20,9 @@
package org.ourproject.kune.gallery.client;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/GalleryViewerPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -23,11 +23,11 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-02-26 01:46:09 UTC (rev 1052)
@@ -5,6 +5,10 @@
<inherits name='com.google.gwt.i18n.I18N' />
<inherits name="com.google.gwt.user.UserAgent" />
<inherits name="org.ourproject.kune.platf.RichText" />
+
+ <inherits name="com.google.gwt.libideas.ImmutableResources" />
+ <inherits name="com.google.gwt.libideas.StyleInjector" />
+
<public path="public" />
</module>
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -33,6 +33,9 @@
/** The icon url. */
private String iconUrl;
+ /** The icon cls. */
+ private String iconCls;
+
/** The icon descriptor. */
private ImageDescriptor iconDescriptor;
@@ -184,6 +187,10 @@
return confirmationTitle;
}
+ public String getIconCls() {
+ return iconCls;
+ }
+
/**
* Gets the icon descriptor.
*
@@ -313,6 +320,10 @@
this.enableCondition = enableCondition;
}
+ public void setIconCls(String iconCls) {
+ this.iconCls = iconCls;
+ }
+
/**
* Sets the icon descriptor.
*
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.actions;
+
+public interface ActionPressedCondition<T> {
+ boolean mustBePressed(T param);
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,54 @@
+package org.ourproject.kune.platf.client.actions;
+
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class ActionToolbarPushButtonDescriptor<T> extends ActionToolbarButtonDescriptor<T> {
+
+ ActionPressedCondition<T> mustInitialyPressed;
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall);
+ }
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
+ final ActionAddCondition<T> addCondition) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
+ }
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
+ final ActionEnableCondition<T> enableCondition) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
+ }
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall);
+ }
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
+ final ActionAddCondition<T> addCondition) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
+ }
+
+ public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
+ final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
+ final ActionEnableCondition<T> enableCondition) {
+ super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
+ }
+
+ public ActionPressedCondition<T> getMustInitialyPressed() {
+ return mustInitialyPressed;
+ }
+
+ public void setMustInitialyPressed(ActionPressedCondition<T> mustInitialyPressed) {
+ this.mustInitialyPressed = mustInitialyPressed;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -31,6 +31,7 @@
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -73,17 +74,24 @@
public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
+ T item = actionItem.getItem();
final ActionToolbarPosition pos = action.getActionPosition();
final ToolbarButton button = new ToolbarButton();
final String text = action.getText();
+ final String id = action.getId();
final String iconUrl = action.getIconUrl();
+ final String iconCls = action.getIconCls();
if (text != null) {
button.setText(text);
}
- final String id = action.getId();
if (id != null) {
button.setId(id);
}
+ if (action instanceof ActionToolbarPushButtonDescriptor) {
+ button.setEnableToggle(true);
+ button.setPressed(((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed().mustBePressed(
+ item));
+ }
button.addListener(new ButtonListenerAdapter() {
@Override
public void onClick(final Button button, final EventObject e) {
@@ -93,6 +101,9 @@
if (iconUrl != null) {
button.setIcon(iconUrl);
}
+ if (iconCls != null) {
+ button.setIconCls(iconCls);
+ }
button.setTooltip(action.getToolTip());
setEnableButton(button, enable);
@@ -204,7 +215,12 @@
}
};
item.addListener(clickListener);
- item.setIcon(action.getIconUrl());
+ if (action.getIconCls() != null) {
+ item.setIconCls(action.getIconCls());
+ }
+ if (action.getIconUrl() != null) {
+ item.setIcon(action.getIconUrl());
+ }
// ToolTip tip = new ToolTip();
// tip.setHtml(action.getToolTip());
// tip.setShowDelay(5000);
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserService.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserService.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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.platf.client.rpc;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
+import org.ourproject.kune.platf.client.dto.UserDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.errors.DefaultException;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+public interface UserService extends RemoteService {
+
+ UserInfoDTO createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
+
+ String getUserAvatarBaser64(String userHash, StateToken userToken) throws DefaultException;
+
+ UserInfoDTO login(String nickOrEmail, String passwd) throws DefaultException;
+
+ void logout(String userHash) throws DefaultException;
+
+ void onlyCheckSession(String userHash) throws DefaultException;
+
+ UserInfoDTO reloadUserInfo(String userHash) throws DefaultException;
+
+ void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserServiceAsync.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/UserServiceAsync.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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.platf.client.rpc;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
+import org.ourproject.kune.platf.client.dto.UserDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public interface UserServiceAsync {
+
+ void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<UserInfoDTO> asyncCallback);
+
+ void getUserAvatarBaser64(String userHash, StateToken userToken, AsyncCallback<?> asyncCallback);
+
+ void login(String nickOrEmail, String passwd, AsyncCallback<UserInfoDTO> asyncCallback);
+
+ void logout(String userHash, AsyncCallback<?> asyncCallback);
+
+ void onlyCheckSession(String userHash, AsyncCallback<?> asyncCallback);
+
+ void reloadUserInfo(String userHash, AsyncCallback<UserInfoDTO> asyncCallback);
+
+ void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility,
+ AsyncCallback<?> asyncCallback);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListener.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.platf.client.services;
+
+import com.google.gwt.user.client.EventListener;
+
+public interface I18nChangeListener extends EventListener {
+
+ void onI18nLanguageChange();
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java (from rev 1044, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java 2009-02-01 14:46:12 UTC (rev 1044)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nChangeListenerCollection.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.platf.client.services;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * A helper class for implementers of the SourcesI18nChangeEvents interface.
+ * This subclass of {@link ArrayList} assumes that all objects added to it will
+ * be of type {@link org.ourproject.kune.platf.client.services.I18nChangeListener}.
+ */
+public class I18nChangeListenerCollection extends ArrayList<I18nChangeListener> {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Fires a locale change event to all listeners.
+ *
+ */
+ public void fireI18nLanguageChange() {
+ for (Iterator<I18nChangeListener> it = iterator(); it.hasNext();) {
+ I18nChangeListener listener = it.next();
+ listener.onI18nLanguageChange();
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java (from rev 1045, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2009-02-03 10:15:36 UTC (rev 1045)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/I18nUITranslationService.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,226 @@
+/*
+ *
+ * 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.platf.client.services;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.Location;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class I18nUITranslationService extends I18nTranslationService {
+ private HashMap<String, String> lexicon;
+ private String currentLanguageCode;
+ private I18nChangeListenerCollection i18nChangeListeners;
+ private I18nLanguageDTO currentLang;
+ private I18nServiceAsync i18nService;
+ private Session session;
+
+ /*
+ * If a UI element need to be fired when (for instance) the language changes
+ * use this. Useful if you widget have to take in account text language
+ * direction, for instance.
+ */
+ public void addI18nChangeListener(final I18nChangeListener listener) {
+ if (i18nChangeListeners == null) {
+ i18nChangeListeners = new I18nChangeListenerCollection();
+ }
+ i18nChangeListeners.add(listener);
+ }
+
+ public void changeCurrentLanguage(final String newLanguage) {
+ if (!newLanguage.equals(this.currentLanguageCode)) {
+ setCurrentLanguage(newLanguage);
+ changeLocale(newLanguage);
+ }
+ }
+
+ public String formatDateWithLocale(final Date date) {
+ String dateFormat = currentLang.getDateFormat();
+ final DateTimeFormat fmt;
+ if (dateFormat == null) {
+ fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+ } else {
+ String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
+ String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
+ dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
+ fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+ }
+ String dateFormated = fmt.format(date);
+ return dateFormated;
+ }
+
+ public String getCurrentLanguage() {
+ return currentLanguageCode;
+ }
+
+ public HashMap<String, String> getLexicon() {
+ return lexicon;
+ }
+
+ public void init(final I18nServiceAsync i18nService, final Session session, final Listener0 onReady) {
+ this.i18nService = i18nService;
+ this.session = session;
+ final Location loc = WindowUtils.getLocation();
+ final String locale = loc.getParameter("locale");
+ i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final I18nLanguageDTO result) {
+ currentLang = result;
+ currentLanguageCode = currentLang.getCode();
+ session.setCurrentLanguage(currentLang);
+ i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final HashMap<String, String> result) {
+ lexicon = result;
+ onReady.onEvent();
+ }
+ });
+ }
+ });
+ }
+
+ public void removeI18nChangeListener(final I18nChangeListener listener) {
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.remove(listener);
+ }
+ }
+
+ public void setCurrentLanguage(final String newLanguage) {
+ this.currentLanguageCode = newLanguage;
+ }
+
+ public void setLexicon(final HashMap<String, String> lexicon) {
+ this.lexicon = lexicon;
+ fireI18nLanguageChange();
+ }
+
+ public void setTranslationAfterSave(final String text, final String translation) {
+ lexicon.put(text, translation);
+ fireI18nLanguageChange();
+ }
+
+ /**
+ * In production, this method uses a hashmap. In development, if the text is
+ * not in the hashmap, it makes a server petition (that stores the text
+ * pending for translation in db).
+ *
+ * Warning: text is escaped as html before insert in the db. Don't use html
+ * here (o user this method with params).
+ *
+ * @param text
+ * @return text translated in the current language
+ */
+ @Override
+ public String t(final String text) {
+ final String encodeText = TextUtils.escapeHtmlLight(text);
+ String translation = lexicon.get(encodeText);
+ if (lexicon.containsKey(encodeText)) {
+ if (translation == UNTRANSLATED_VALUE) {
+ // Not translated but in db, return text
+ translation = removeNT(encodeText);
+ }
+ } else {
+ // Not translated and not in db, make a petition for translation
+ if (session.isLogged()) {
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+ new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ }
+
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
+ translation = removeNT(encodeText);
+ }
+ return decodeHtml(translation);
+ }
+
+ /**
+ *
+ * See in:
+ * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread
+ * /5e4e25050d3be984/7035ec39354d06aa?lnk=gst&q=get+locale&rnum=23
+ *
+ * JSNI method to change the locale of the application - it effectively
+ * parses the existing URL and creates a new one for the chosen locale.
+ *
+ * It additionally launches any JavaScript debugger that might be attached
+ * to the system (Windows only). To disable this functionality just remove
+ * the "debugger" line.
+ *
+ * @param newLocale
+ * String value of the new locale to go to.
+ */
+ private native void changeLocale(String newLocale)
+ /*-{
+ // Uncomment the "debugger;" line to see how to set debug statements in JSNI code
+ // When in web mode, if your browser has a JavaScript debugger attached, it will
+ // launch at this point in the code (when the user changes locale through the menu system).
+ // debugger;
+
+ // Get the current location
+ var currLocation = $wnd.location.toString();
+ // Get rid of any GWT History tokens that might be present
+ var noHistoryCurrLocArray = currLocation.split("#");
+ var noHistoryCurrLoc = noHistoryCurrLocArray[0];
+ var currHistory = noHistoryCurrLocArray[1];
+ // Get rid of any locale string
+ var locArray = noHistoryCurrLoc.split("?");
+ // Build the new href location and then send the browser there.
+ // $wnd.location.href = locArray[0]+"?locale="+newLocale+"#"+currHistory;
+ $wnd.location.href = locArray[0]+"?locale="+newLocale
+
+ // extjs part:
+ // commented because the error: "Ext is not defined"
+ // we have to try other way
+ // var head = document.getElementsByTagName("head")[0];
+ // var script = document.createElement('script');
+ // script.id = 'localScript';
+ // script.type = 'text/javascript';
+ // script.src = "js/ext/locale/ext-lang-"+newLocale+".js";
+ // head.appendChild(script);
+ }-*/;
+
+ private void fireI18nLanguageChange() {
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.fireI18nLanguageChange();
+ }
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -32,7 +32,6 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event0;
@@ -44,15 +43,13 @@
public class KuneErrorHandler {
private final Session session;
private final I18nTranslationService i18n;
- private final Provider<WorkspaceSkeleton> wsProvider;
private final Event0 onSessionExpired;
private final Provider<StateManager> stateManagerProvider;
public KuneErrorHandler(final Session session, final I18nTranslationService i18n,
- final Provider<WorkspaceSkeleton> wsProvider, final Provider<StateManager> stateManagerProvider) {
+ final Provider<StateManager> stateManagerProvider) {
this.session = session;
this.i18n = i18n;
- this.wsProvider = wsProvider;
this.stateManagerProvider = stateManagerProvider;
this.onSessionExpired = new Event0("onSessionExpired");
}
@@ -62,10 +59,6 @@
Site.info("Your session has expired. Please log in again.");
}
- public WorkspaceSkeleton getWorkspaceSkeleton() {
- return wsProvider.get();
- }
-
public void onSessionExpired(final Listener0 listener) {
onSessionExpired.add(listener);
}
@@ -107,10 +100,8 @@
stateManagerProvider.get().gotoToken("");
} catch (final LastAdminInGroupException e) {
logException(e);
- getWorkspaceSkeleton().showAlertMessage(
- i18n.t("Warning"),
- i18n.t("Sorry, you are the last admin of this group."
- + " Look for someone to substitute you appropriately as admin before leaving this group."));
+ Site.showAlertMessage(i18n.t("Warning"), i18n.t("Sorry, you are the last admin of this group."
+ + " Look for someone to substitute you appropriately as admin before leaving this group."));
} catch (final AlreadyGroupMemberException e) {
logException(e);
Site.error(i18n.t("This group is already a group member"));
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,576 +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.platf.client.services;
-
-import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionCntCtxToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationSummaryToolbarPresenter;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
-import org.ourproject.kune.platf.client.app.Application;
-import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
-import org.ourproject.kune.platf.client.app.ApplicationDefault;
-import org.ourproject.kune.platf.client.app.HistoryWrapper;
-import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
-import org.ourproject.kune.platf.client.app.TextEditorInsertElementGroup;
-import org.ourproject.kune.platf.client.app.ToolGroup;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentService;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.rpc.GroupService;
-import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.rpc.I18nService;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-import org.ourproject.kune.platf.client.state.ContentProvider;
-import org.ourproject.kune.platf.client.state.ContentProviderDefault;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.SessionDefault;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.state.StateManagerDefault;
-import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
-import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPresenter;
-import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
-import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPanel;
-import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPresenter;
-import org.ourproject.kune.workspace.client.cxt.ContextPropEditorView;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
-import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPanel;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmail;
-import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExt;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtView;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocal;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPanel;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
-import org.ourproject.kune.workspace.client.newgroup.NewGroup;
-import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
-import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
-import org.ourproject.kune.workspace.client.search.EntityLiveSearcherView;
-import org.ourproject.kune.workspace.client.search.GroupLiveSearchPanel;
-import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
-import org.ourproject.kune.workspace.client.search.GroupLiveSearcherPresenter;
-import org.ourproject.kune.workspace.client.search.SiteSearcher;
-import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
-import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
-import org.ourproject.kune.workspace.client.search.SiteSearcherView;
-import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
-import org.ourproject.kune.workspace.client.search.UserLiveSearcherPanel;
-import org.ourproject.kune.workspace.client.search.UserLiveSearcherPresenter;
-import org.ourproject.kune.workspace.client.signin.Register;
-import org.ourproject.kune.workspace.client.signin.RegisterPanel;
-import org.ourproject.kune.workspace.client.signin.RegisterPresenter;
-import org.ourproject.kune.workspace.client.signin.RegisterView;
-import org.ourproject.kune.workspace.client.signin.SignIn;
-import org.ourproject.kune.workspace.client.signin.SignInPanel;
-import org.ourproject.kune.workspace.client.signin.SignInPresenter;
-import org.ourproject.kune.workspace.client.signin.SignInView;
-import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.site.SiteToken;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.title.EntitySubTitle;
-import org.ourproject.kune.workspace.client.title.RenameAction;
-
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.decorator.NoDecoration;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-import com.calclab.suco.client.ioc.module.AbstractModule;
-import com.calclab.suco.client.ioc.module.Factory;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.Cookies;
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
-
-public class KuneModule extends AbstractModule {
-
- @Override
- public void onInstall() {
- register(Singleton.class, new Factory<Session>(Session.class) {
- @Override
- public Session create() {
- return new SessionDefault(Cookies.getCookie(Site.USERHASH), $$(UserServiceAsync.class));
- }
- }, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
- @Override
- public I18nServiceAsync create() {
- final I18nServiceAsync service = (I18nServiceAsync) GWT.create(I18nService.class);
- ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "I18nService");
- return service;
- }
- }, new Factory<UserServiceAsync>(UserServiceAsync.class) {
- @Override
- public UserServiceAsync create() {
- final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
- ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
- return service;
- }
- }, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
- @Override
- public SocialNetworkServiceAsync create() {
- final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT.create(SocialNetworkService.class);
- ((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
- + "SocialNetworkService");
- return snServiceAsync;
- }
- }, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
- @Override
- public GroupServiceAsync create() {
- final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
- ((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
- return groupServiceAsync;
- }
- }, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
- @Override
- public ContentServiceAsync create() {
- final ContentServiceAsync contentServiceAsync = (ContentServiceAsync) GWT.create(ContentService.class);
- ((ServiceDefTarget) contentServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "ContentService");
- return contentServiceAsync;
- }
- });
-
- register(Singleton.class, new Factory<I18nUITranslationService>(I18nUITranslationService.class) {
- @Override
- public I18nUITranslationService create() {
- final I18nUITranslationService i18n = new I18nUITranslationService();
- i18n.init($(I18nServiceAsync.class), $(Session.class), new Listener0() {
- public void onEvent() {
- onI18nReady();
- }
- });
- return i18n;
- }
- });
-
- register(Singleton.class, new Factory<QuickTipsHelper>(QuickTipsHelper.class) {
- @Override
- public QuickTipsHelper create() {
- return new QuickTipsHelper();
- }
- });
-
- $(I18nUITranslationService.class);
- $(QuickTipsHelper.class);
- }
-
- private void onI18nReady() {
- final I18nUITranslationService i18n = $(I18nUITranslationService.class);
-
- if (container.hasProvider(I18nTranslationService.class)) {
- container.removeProvider(I18nTranslationService.class);
- }
-
- register(Singleton.class, new Factory<I18nTranslationService>(I18nTranslationService.class) {
- @Override
- public I18nTranslationService create() {
- return i18n;
- }
- });
-
- register(Singleton.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
- @Override
- public HistoryWrapper create() {
- return new HistoryWrapperDefault();
- }
- }, new Factory<ContentProvider>(ContentProvider.class) {
- @Override
- public ContentProvider create() {
- return new ContentProviderDefault($(ContentServiceAsync.class));
- }
- }, new Factory<StateManager>(StateManager.class) {
- @Override
- public StateManager create() {
- final StateManagerDefault stateManager = new StateManagerDefault($(ContentProvider.class),
- $(Session.class), $(HistoryWrapper.class));
- History.addHistoryListener(stateManager);
- return stateManager;
- }
- });
-
- register(Singleton.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
- @Override
- public KuneErrorHandler create() {
- return new KuneErrorHandler($(Session.class), i18n, $$(WorkspaceSkeleton.class), $$(StateManager.class));
- }
- });
-
- register(Singleton.class, new Factory<Images>(Images.class) {
- @Override
- public Images create() {
- return Images.App.getInstance();
- }
- }, new Factory<ImageUtils>(ImageUtils.class) {
- @Override
- public ImageUtils create() {
- return new ImageUtils($(Images.class));
- }
- });
-
- AsyncCallbackSimple.init($(KuneErrorHandler.class));
-
- register(Singleton.class, new Factory<Application>(Application.class) {
- @Override
- public Application create() {
- return new ApplicationDefault($(Session.class));
- }
-
- @Override
- public void onAfterCreated(final Application instance) {
- }
- });
-
- register(Singleton.class, new Factory<SiteSearcher>(SiteSearcher.class) {
- @Override
- public SiteSearcher create() {
- final SiteSearcherPresenter presenter = new SiteSearcherPresenter($$(StateManager.class));
- final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, $(WorkspaceSkeleton.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<I18nTranslator>(I18nTranslator.class) {
- @Override
- public I18nTranslator create() {
- final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter($(Session.class),
- $(I18nServiceAsync.class), i18n);
- final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n, $(LanguageSelector.class),
- $(WorkspaceSkeleton.class), $(Images.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<SignIn>(SignIn.class) {
- @Override
- public SignIn create() {
- final SignInPresenter presenter = new SignInPresenter($(Session.class), $(StateManager.class), i18n,
- $$(UserServiceAsync.class), $$(Register.class));
- final SignInView panel = new SignInPanel(presenter, i18n, $(WorkspaceSkeleton.class), $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<Register>(Register.class) {
- @Override
- public Register create() {
- final RegisterPresenter presenter = new RegisterPresenter($(Session.class), $(StateManager.class),
- i18n, $$(UserServiceAsync.class), $$(SignIn.class));
- final RegisterView panel = new RegisterPanel(presenter, i18n, $(WorkspaceSkeleton.class),
- $(Session.class), $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<NewGroup>(NewGroup.class) {
- @Override
- public NewGroup create() {
- final NewGroupPresenter presenter = new NewGroupPresenter(i18n, $(Session.class),
- $(StateManager.class), $$(GroupServiceAsync.class));
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $$(LicenseWizard.class), $(Images.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<UserLiveSearcher>(UserLiveSearcher.class) {
- @Override
- public UserLiveSearcher create() {
- final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter();
- final EntityLiveSearcherView view = new UserLiveSearcherPanel(presenter, i18n,
- $(FileDownloadUtils.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<GroupLiveSearcher>(GroupLiveSearcher.class) {
- @Override
- public GroupLiveSearcher create() {
- final GroupLiveSearcherPresenter presenter = new GroupLiveSearcherPresenter();
- final EntityLiveSearcherView view = new GroupLiveSearchPanel(presenter, i18n,
- $(FileDownloadUtils.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<ToolSelector>(ToolSelector.class) {
- @Override
- public ToolSelector create() {
- final ToolSelectorPresenter presenter = new ToolSelectorPresenter($(StateManager.class),
- $(WsThemePresenter.class));
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<DeferredCommandWrapper>(DeferredCommandWrapper.class) {
- @Override
- public DeferredCommandWrapper create() {
- return new DeferredCommandWrapper();
- }
- });
-
- register(Singleton.class, new Factory<TextEditorInsertElement>(TextEditorInsertElement.class) {
- @Override
- public TextEditorInsertElement create() {
- final TextEditorInsertElementPresenter presenter = new TextEditorInsertElementPresenter();
- final TextEditorInsertElementPanel panel = new TextEditorInsertElementPanel(presenter,
- $(WorkspaceSkeleton.class), $(Images.class), $(I18nTranslationService.class),
- $(TextEditorInsertElementGroup.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkLocal>(
- TextEditorInsertLinkLocal.class) {
- @Override
- public TextEditorInsertLinkLocal create() {
- final TextEditorInsertLinkLocalPresenter presenter = new TextEditorInsertLinkLocalPresenter(
- $(TextEditorInsertElement.class));
- final TextEditorInsertLinkLocalPanel panel = new TextEditorInsertLinkLocalPanel(presenter,
- $(WorkspaceSkeleton.class), $(I18nTranslationService.class), $(FileDownloadUtils.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(TextEditorInsertElementGroup.class,
- new Factory<TextEditorInsertLinkExt>(TextEditorInsertLinkExt.class) {
- @Override
- public TextEditorInsertLinkExt create() {
- final TextEditorInsertLinkExtPresenter presenter = new TextEditorInsertLinkExtPresenter(
- $(TextEditorInsertElement.class));
- final TextEditorInsertLinkExtView panel = new TextEditorInsertLinkExtPanel(presenter,
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkEmail>(
- TextEditorInsertLinkEmail.class) {
- @Override
- public TextEditorInsertLinkEmail create() {
- final TextEditorInsertLinkEmailPresenter presenter = new TextEditorInsertLinkEmailPresenter(
- $(TextEditorInsertElement.class));
- final TextEditorInsertLinkEmailPanel panel = new TextEditorInsertLinkEmailPanel(presenter,
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<TextEditor>(TextEditor.class) {
- @Override
- public TextEditor create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
- contentNavigatorToolbar);
-
- final TextEditorPresenter presenter = new TextEditorPresenter(true, toolbar,
- $(I18nUITranslationService.class), $(StateManager.class), $(SiteSignOutLink.class),
- $(DeferredCommandWrapper.class));
- final TextEditorPanel panel = new TextEditorPanel(presenter, $(I18nTranslationService.class),
- $(WorkspaceSkeleton.class), $(ColorWebSafePalette.class), $(TextEditorInsertElement.class),
- false);
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<LanguageSelector>(LanguageSelector.class) {
- @Override
- public LanguageSelector create() {
- final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter($(Session.class));
- final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<ActionManager>(ActionManager.class) {
- @Override
- public ActionManager create() {
- return new ActionManager($(WorkspaceSkeleton.class));
- }
- });
-
- register(NoDecoration.class, new Factory<ActionContentToolbar>(ActionContentToolbar.class) {
- @Override
- public ActionContentToolbar create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(contentNavigatorToolbar);
- return toolbar;
- }
- });
-
- register(NoDecoration.class, new Factory<ActionContextToolbar>(ActionContextToolbar.class) {
- @Override
- public ActionContextToolbar create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionContextToolbar toolbar = new ActionContextToolbarPresenter(contentNavigatorToolbar);
- return toolbar;
- }
- });
-
- register(Singleton.class, new Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
- @Override
- public ActionGroupSummaryToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionGroupSummaryToolbarPresenter toolbar = new ActionGroupSummaryToolbarPresenter(panel);
- return toolbar;
- }
- }, new Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class) {
- @Override
- public ActionParticipationToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionParticipationSummaryToolbarPresenter toolbar = new ActionParticipationSummaryToolbarPresenter(
- panel);
- return toolbar;
- }
- }, new Factory<ActionBuddiesSummaryToolbar>(ActionBuddiesSummaryToolbar.class) {
- @Override
- public ActionBuddiesSummaryToolbar create() {
- final ActionToolbarPanel<UserSimpleDTO> panel = new ActionToolbarPanel<UserSimpleDTO>(
- $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionBuddiesSummaryToolbarPresenter toolbar = new ActionBuddiesSummaryToolbarPresenter(panel);
- return toolbar;
- }
- });
-
- register(Singleton.class, new Factory<ContextNavigator>(ContextNavigator.class) {
- @Override
- public ContextNavigator create() {
- final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
- $(Session.class), i18n, $(ContentIconsRegistry.class), $(ContentCapabilitiesRegistry.class),
- $(ActionContextToolbar.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
- true, $(RenameAction.class));
- final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter, i18n,
- $(WorkspaceSkeleton.class), $(ActionManager.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<ContextPropEditor>(ContextPropEditor.class) {
- @Override
- public ContextPropEditor create() {
- final ContextPropEditorPresenter presenter = new ContextPropEditorPresenter($(Session.class),
- $(StateManager.class), $(ContentCapabilitiesRegistry.class), $$(TagsSummary.class),
- $$(ContentServiceAsync.class), $(EntitySubTitle.class));
- final ContextPropEditorView view = new ContextPropEditorPanel(presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $$(LanguageSelector.class),
- $(Images.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<FileDownloadUtils>(FileDownloadUtils.class) {
- @Override
- public FileDownloadUtils create() {
- return new FileDownloadUtils($(Session.class), $(ImageUtils.class));
- }
- });
-
- // Register of tokens like "signin", "newgroup", "translate" etcetera
- $(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Listener0() {
- public void onEvent() {
- $(SignIn.class).doSignIn();
- }
- });
-
- $(StateManager.class).addSiteToken(SiteToken.register.toString(), new Listener0() {
- public void onEvent() {
- $(Register.class).doRegister();
- }
- });
-
- $(StateManager.class).addSiteToken(SiteToken.newgroup.toString(), new Listener0() {
- public void onEvent() {
- $(NewGroup.class).doNewGroup();
- }
- });
-
- $(StateManager.class).addSiteToken(SiteToken.translate.toString(), new Listener0() {
- public void onEvent() {
- $(I18nTranslator.class).doShowTranslator();
- }
- });
-
- $(ApplicationComponentGroup.class).createAll();
- $(ToolGroup.class).createAll();
- $(Application.class).start();
- // $(HelloWorld.class);
- }
-}
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-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,63 +20,202 @@
package org.ourproject.kune.platf.client.services;
import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
+import org.ourproject.kune.platf.client.app.Application;
+import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
+import org.ourproject.kune.platf.client.app.ApplicationDefault;
+import org.ourproject.kune.platf.client.app.HistoryWrapper;
+import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
+import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.rpc.I18nService;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
+import org.ourproject.kune.platf.client.rpc.UserService;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.state.ContentProvider;
+import org.ourproject.kune.platf.client.state.ContentProviderDefault;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.SessionDefault;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.state.StateManagerDefault;
+import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePanel;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePresenter;
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPanel;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPresenter;
-import org.ourproject.kune.platf.client.ui.upload.FileUploader;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderDialog;
-import org.ourproject.kune.platf.client.ui.upload.FileUploaderPresenter;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
import com.calclab.suco.client.ioc.module.Factory;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
public class KunePlatformModule extends AbstractModule {
@Override
protected void onInstall() {
- register(Singleton.class, new Factory<ColorWebSafePalette>(ColorWebSafePalette.class) {
+
+ register(Singleton.class, new Factory<Session>(Session.class) {
@Override
- public ColorWebSafePalette create() {
- final ColorWebSafePalettePresenter presenter = new ColorWebSafePalettePresenter();
- final ColorWebSafePalettePanel panel = new ColorWebSafePalettePanel(presenter);
- presenter.init(panel);
- return presenter;
+ public Session create() {
+ return new SessionDefault(Cookies.getCookie(Session.USERHASH), $$(UserServiceAsync.class));
}
+ }, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
+ @Override
+ public I18nServiceAsync create() {
+ final I18nServiceAsync service = (I18nServiceAsync) GWT.create(I18nService.class);
+ ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "I18nService");
+ return service;
+ }
+ }, new Factory<UserServiceAsync>(UserServiceAsync.class) {
+ @Override
+ public UserServiceAsync create() {
+ final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
+ ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
+ return service;
+ }
});
- register(Singleton.class, new Factory<FileUploader>(FileUploader.class) {
+ register(Singleton.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
@Override
- public FileUploader create() {
- final FileUploaderPresenter presenter = new FileUploaderPresenter($(Session.class));
- final FileUploaderDialog panel = new FileUploaderDialog(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
+ public HistoryWrapper create() {
+ return new HistoryWrapperDefault();
}
+ }, new Factory<ContentProvider>(ContentProvider.class) {
+ @Override
+ public ContentProvider create() {
+ return new ContentProviderDefault($(ContentServiceAsync.class));
+ }
+ }, new Factory<StateManager>(StateManager.class) {
+ @Override
+ public StateManager create() {
+ final StateManagerDefault stateManager = new StateManagerDefault($(ContentProvider.class),
+ $(Session.class), $(HistoryWrapper.class));
+ History.addHistoryListener(stateManager);
+ return stateManager;
+ }
+ });
+ register(Singleton.class, new Factory<I18nUITranslationService>(I18nUITranslationService.class) {
@Override
- public void onAfterCreated(FileUploader uploader) {
- $(ContextNavigator.class).addFileUploaderListener(uploader);
+ public I18nUITranslationService create() {
+ final I18nUITranslationService i18n = new I18nUITranslationService();
+ i18n.init($(I18nServiceAsync.class), $(Session.class), new Listener0() {
+ public void onEvent() {
+ onI18nReady();
+ }
+ });
+ return i18n;
}
});
+ register(Singleton.class, new Factory<FileDownloadUtils>(FileDownloadUtils.class) {
+ @Override
+ public FileDownloadUtils create() {
+ return new FileDownloadUtils($(Session.class), $(ImageUtils.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<QuickTipsHelper>(QuickTipsHelper.class) {
+ @Override
+ public QuickTipsHelper create() {
+ return new QuickTipsHelper();
+ }
+ });
+
+ $(I18nUITranslationService.class);
+ $(QuickTipsHelper.class);
+
+ }
+
+ private void onI18nReady() {
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
+
+ if (container.hasProvider(I18nTranslationService.class)) {
+ container.removeProvider(I18nTranslationService.class);
+ }
+
+ register(Singleton.class, new Factory<I18nTranslationService>(I18nTranslationService.class) {
+ @Override
+ public I18nTranslationService create() {
+ return i18n;
+ }
+ });
+
+ register(Singleton.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
+ @Override
+ public KuneErrorHandler create() {
+ return new KuneErrorHandler($(Session.class), i18n, $$(StateManager.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<Images>(Images.class) {
+ @Override
+ public Images create() {
+ return Images.App.getInstance();
+ }
+ }, new Factory<ImageUtils>(ImageUtils.class) {
+ @Override
+ public ImageUtils create() {
+ return new ImageUtils($(Images.class));
+ }
+ });
+
+ AsyncCallbackSimple.init($(KuneErrorHandler.class));
+
+ register(Singleton.class, new Factory<Application>(Application.class) {
+ @Override
+ public Application create() {
+ return new ApplicationDefault($(Session.class));
+ }
+
+ @Override
+ public void onAfterCreated(final Application instance) {
+ }
+ });
+
+ register(Singleton.class, new Factory<DeferredCommandWrapper>(DeferredCommandWrapper.class) {
+ @Override
+ public DeferredCommandWrapper create() {
+ return new DeferredCommandWrapper();
+ }
+ });
+
+ register(Singleton.class, new Factory<ColorWebSafePalette>(ColorWebSafePalette.class) {
+ @Override
+ public ColorWebSafePalette create() {
+ final ColorWebSafePalettePresenter presenter = new ColorWebSafePalettePresenter();
+ final ColorWebSafePalettePanel panel = new ColorWebSafePalettePanel(presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
register(Singleton.class, new Factory<RTEditor>(RTEditor.class) {
@Override
public RTEditor create() {
final RTEditorPresenter presenter = new RTEditorPresenter($(ContentEditorActionRegistry.class),
- $(I18nTranslationService.class), $(Session.class));
+ $(I18nTranslationService.class), $(Session.class), RTEImgResources.INSTANCE);
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class));
presenter.init(panel);
return presenter;
}
});
+
+ // ew TestRTEDialog($(RTEditor.class));
+
+ $(ApplicationComponentGroup.class).createAll();
+ $(ToolGroup.class).createAll();
+ $(Application.class).start();
+ // $(HelloWorld.class);
+
}
-}
+}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,220 +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.platf.client.services;
-
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
-import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
-import org.ourproject.kune.platf.client.registry.AclEditableRegistry;
-import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
-import org.ourproject.kune.platf.client.registry.CanBeHomepageRegistry;
-import org.ourproject.kune.platf.client.registry.ComentableRegistry;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.registry.DragableRegistry;
-import org.ourproject.kune.platf.client.registry.DropableRegistry;
-import org.ourproject.kune.platf.client.registry.EmailSubscribeAbleRegistry;
-import org.ourproject.kune.platf.client.registry.LicensableRegistry;
-import org.ourproject.kune.platf.client.registry.PublishModerableRegistry;
-import org.ourproject.kune.platf.client.registry.RateableRegistry;
-import org.ourproject.kune.platf.client.registry.RenamableRegistry;
-import org.ourproject.kune.platf.client.registry.TageableRegistry;
-import org.ourproject.kune.platf.client.registry.TranslatableRegistry;
-import org.ourproject.kune.platf.client.registry.VersionableRegistry;
-import org.ourproject.kune.platf.client.registry.XmppComentableRegistry;
-import org.ourproject.kune.platf.client.registry.XmppNotifyCapableRegistry;
-
-import com.calclab.suco.client.ioc.decorator.Singleton;
-import com.calclab.suco.client.ioc.module.AbstractModule;
-import com.calclab.suco.client.ioc.module.Factory;
-
-public class KuneRegistryModule extends AbstractModule {
-
- @Override
- protected void onInstall() {
-
- register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
- @Override
- public AclEditableRegistry create() {
- return new AclEditableRegistry();
- }
- });
- register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
- @Override
- public AuthorableRegistry create() {
- return new AuthorableRegistry();
- }
- });
- register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
- @Override
- public CanBeHomepageRegistry create() {
- return new CanBeHomepageRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
- @Override
- public ComentableRegistry create() {
- return new ComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
- @Override
- public DragableRegistry create() {
- return new DragableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
- @Override
- public DropableRegistry create() {
- return new DropableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
- @Override
- public EmailSubscribeAbleRegistry create() {
- return new EmailSubscribeAbleRegistry();
- }
- });
-
- register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
- @Override
- public LicensableRegistry create() {
- return new LicensableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
- @Override
- public PublishModerableRegistry create() {
- return new PublishModerableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
- @Override
- public RateableRegistry create() {
- return new RateableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
- @Override
- public TageableRegistry create() {
- return new TageableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
- @Override
- public RenamableRegistry create() {
- return new RenamableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
- @Override
- public TranslatableRegistry create() {
- return new TranslatableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
- @Override
- public VersionableRegistry create() {
- return new VersionableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
- @Override
- public XmppComentableRegistry create() {
- return new XmppComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
- @Override
- public XmppNotifyCapableRegistry create() {
- return new XmppNotifyCapableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ContentIconsRegistry>(ContentIconsRegistry.class) {
- @Override
- public ContentIconsRegistry create() {
- return new ContentIconsRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class) {
- @Override
- public ContentCapabilitiesRegistry create() {
- return new ContentCapabilitiesRegistry($(AuthorableRegistry.class), $(AclEditableRegistry.class),
- $(ContentIconsRegistry.class), $(CanBeHomepageRegistry.class), $(ComentableRegistry.class),
- $(DragableRegistry.class), $(DropableRegistry.class), $(EmailSubscribeAbleRegistry.class),
- $(LicensableRegistry.class), $(PublishModerableRegistry.class), $(RateableRegistry.class),
- $(TageableRegistry.class), $(RenamableRegistry.class), $(TranslatableRegistry.class),
- $(VersionableRegistry.class), $(XmppComentableRegistry.class),
- $(XmppNotifyCapableRegistry.class));
- }
- });
-
- register(Singleton.class, new Factory<ContextActionRegistry>(ContextActionRegistry.class) {
- @Override
- public ContextActionRegistry create() {
- return new ContextActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ContentEditorActionRegistry>(ContentEditorActionRegistry.class) {
- @Override
- public ContentEditorActionRegistry create() {
- return new ContentEditorActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ContentActionRegistry>(ContentActionRegistry.class) {
- @Override
- public ContentActionRegistry create() {
- return new ContentActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<GroupActionRegistry>(GroupActionRegistry.class) {
- @Override
- public GroupActionRegistry create() {
- return new GroupActionRegistry();
- }
- });
-
- register(Singleton.class, new Factory<UserActionRegistry>(UserActionRegistry.class) {
- @Override
- public UserActionRegistry create() {
- return new UserActionRegistry();
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,581 +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.platf.client.services;
-
-import org.ourproject.kune.chat.client.ChatEngine;
-import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
-import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
-import org.ourproject.kune.platf.client.actions.UserActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
-import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
-import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
-import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
-import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
-import org.ourproject.kune.platf.client.registry.RenamableRegistry;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
-import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
-import org.ourproject.kune.platf.client.ui.rate.RatePanel;
-import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePanel;
-import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePresenter;
-import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
-import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
-import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPanel;
-import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPresenter;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstForm;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdForm;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndForm;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdForm;
-import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdFormView;
-import org.ourproject.kune.workspace.client.nohomepage.NoHomePage;
-import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePanel;
-import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePresenter;
-import org.ourproject.kune.workspace.client.options.EntityOptions;
-import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
-import org.ourproject.kune.workspace.client.options.EntityOptionsPresenter;
-import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicense;
-import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePanel;
-import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePresenter;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogo;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPresenter;
-import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConf;
-import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPanel;
-import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPresenter;
-import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConf;
-import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPanel;
-import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPresenter;
-import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
-import org.ourproject.kune.workspace.client.search.SiteSearcher;
-import org.ourproject.kune.workspace.client.site.Site;
-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.rpc.UserServiceAsync;
-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;
-import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLink;
-import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPresenter;
-import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptions;
-import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPresenter;
-import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
-import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPresenter;
-import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPresenter;
-import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearch;
-import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPanel;
-import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPresenter;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLink;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPresenter;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPresenter;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenu;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPresenter;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.socialnet.BuddiesSummary;
-import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPanel;
-import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPresenter;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationSummary;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPanel;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter;
-import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
-import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddie;
-import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePanel;
-import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePresenter;
-import org.ourproject.kune.workspace.client.summary.GroupSummary;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryPanel;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
-import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
-import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
-import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
-import org.ourproject.kune.workspace.client.themes.WsThemePanel;
-import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.title.EntitySubTitle;
-import org.ourproject.kune.workspace.client.title.EntitySubTitlePanel;
-import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.title.EntityTitle;
-import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
-import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.title.RenameAction;
-
-import com.calclab.suco.client.ioc.decorator.NoDecoration;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-import com.calclab.suco.client.ioc.module.AbstractModule;
-import com.calclab.suco.client.ioc.module.Factory;
-
-public class KuneWorkspaceModule extends AbstractModule {
- @Override
- protected void onInstall() {
-
- register(ApplicationComponentGroup.class, new Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
- @Override
- public WorkspaceSkeleton create() {
- return new WorkspaceSkeleton();
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteProgress>(SiteProgress.class) {
- @Override
- public SiteProgress create() {
- final SiteProgressPresenter presenter = new SiteProgressPresenter();
- final SiteProgressPanel panel = new SiteProgressPanel(presenter, $$(SitePublicSpaceLink.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<Site>(Site.class) {
- @Override
- public Site create() {
- return new Site($(I18nUITranslationService.class), $(SiteProgress.class), $$(SiteToastMessage.class));
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
- @Override
- public SitePublicSpaceLink create() {
- final SitePublicSpaceLinkPresenter presenter = new SitePublicSpaceLinkPresenter($(StateManager.class));
- final SitePublicSpaceLinkPanel panel = new SitePublicSpaceLinkPanel(presenter,
- $(WorkspaceSkeleton.class), $(I18nUITranslationService.class), $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(NoDecoration.class, new Factory<SiteToastMessage>(SiteToastMessage.class) {
- @Override
- public SiteToastMessage create() {
- final SiteToastMessagePresenter presenter = new SiteToastMessagePresenter();
- final SiteToastMessagePanel panel = new SiteToastMessagePanel();
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteUserMenu>(SiteUserMenu.class) {
- @Override
- public SiteUserMenu create() {
- final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter($(Session.class),
- $(StateManager.class), $$(EntityOptions.class), $$(FileDownloadUtils.class));
- final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nUITranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteSignInLink>(SiteSignInLink.class) {
- @Override
- public SiteSignInLink create() {
- final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter($(Session.class));
- final SiteSignInLinkPanel panel = new SiteSignInLinkPanel(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteSignOutLink>(SiteSignOutLink.class) {
- @Override
- public SiteSignOutLink create() {
- final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter($(Session.class),
- $$(UserServiceAsync.class), $$(KuneErrorHandler.class));
- final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteNewGroupLink>(SiteNewGroupLink.class) {
- @Override
- public SiteNewGroupLink create() {
- final SiteNewGroupLinkPresenter presenter = new SiteNewGroupLinkPresenter();
- final SiteNewGroupLinkPanel panel = new SiteNewGroupLinkPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nUITranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteOptions>(SiteOptions.class) {
- @Override
- public SiteOptions create() {
- final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
- final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nUITranslationService.class), $$(I18nTranslator.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteSearch>(SiteSearch.class) {
- @Override
- public SiteSearch create() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter($$(SiteSearcher.class),
- $(I18nTranslationService.class));
- final SiteSearchPanel panel = new SiteSearchPanel(presenter, $(WorkspaceSkeleton.class),
- $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<SiteLogo>(SiteLogo.class) {
- @Override
- public SiteLogo create() {
- final SiteLogoPresenter presenter = new SiteLogoPresenter($(Session.class));
- final SiteLogoPanel panel = new SiteLogoPanel(presenter, $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<EntityHeader>(EntityHeader.class) {
- @Override
- public EntityHeader create() {
- final EntityHeaderPresenter presenter = new EntityHeaderPresenter($(StateManager.class),
- $(WsThemePresenter.class), $(Session.class));
- final EntityHeaderPanel panel = new EntityHeaderPanel($(WorkspaceSkeleton.class),
- $$(FileDownloadUtils.class), $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
- @Override
- public WsThemePresenter create() {
- final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $$(GroupServiceAsync.class),
- $(StateManager.class));
- final WsThemePanel panel = new WsThemePanel($(WorkspaceSkeleton.class), presenter,
- $(I18nUITranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<EntityTitle>(EntityTitle.class) {
- @Override
- public EntityTitle create() {
- final EntityTitlePresenter presenter = new EntityTitlePresenter($(StateManager.class),
- $(Session.class), $(ContentIconsRegistry.class), $(RenamableRegistry.class),
- $(RenameAction.class));
- final EntityTitlePanel panel = new EntityTitlePanel($(WorkspaceSkeleton.class), presenter);
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<EntitySubTitle>(EntitySubTitle.class) {
- @Override
- public EntitySubTitle create() {
- final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(
- $(I18nUITranslationService.class), $(StateManager.class), false, $(AuthorableRegistry.class));
- final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
- @Override
- public EntityLicensePresenter create() {
- final EntityLicensePresenter presenter = new EntityLicensePresenter($(StateManager.class));
- final EntityLicensePanel panel = new EntityLicensePanel(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<RateIt>(RateIt.class) {
- @Override
- public RateIt create() {
- final RateItPresenter presenter = new RateItPresenter($(I18nUITranslationService.class),
- $(Session.class), $$(ContentServiceAsync.class), $(StateManager.class),
- $$(RatePresenter.class), $(ContentCapabilitiesRegistry.class));
- final RateItPanel panel = new RateItPanel(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class), $(Images.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<RatePresenter>(RatePresenter.class) {
- @Override
- public RatePresenter create() {
- final RatePresenter presenter = new RatePresenter($(StateManager.class),
- $(ContentCapabilitiesRegistry.class));
- final RatePanel panel = new RatePanel(null, null, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<GroupMembersSummary>(GroupMembersSummary.class) {
- @Override
- public GroupMembersSummary create() {
- final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(
- $(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
- $(Session.class), $$(SocialNetworkServiceAsync.class), $$(GroupServiceAsync.class),
- $$(GroupLiveSearcher.class), $(WsThemePresenter.class), $$(ChatEngine.class),
- $(GroupActionRegistry.class), $(ActionGroupSummaryToolbar.class), $$(FileDownloadUtils.class));
- final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $(
- ActionGroupSummaryToolbar.class).getView());
- presenter.init(view);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<GroupSummary>(GroupSummary.class) {
- @Override
- public GroupSummary create() {
- final GroupSummaryPresenter presenter = new GroupSummaryPresenter($(StateManager.class),
- $(WsThemePresenter.class));
- final GroupSummaryView view = new GroupSummaryPanel($(Images.class), presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<AddAsBuddie>(AddAsBuddie.class) {
- @Override
- public AddAsBuddie create() {
- final AddAsBuddiePresenter presenter = new AddAsBuddiePresenter($$(ChatEngine.class),
- $(StateManager.class), $(Session.class));
- final AddAsBuddiePanel panel = new AddAsBuddiePanel(presenter, $(EntityHeader.class), $(Images.class),
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<BuddiesSummary>(BuddiesSummary.class) {
- @Override
- public BuddiesSummary create() {
- final BuddiesSummaryPresenter presenter = new BuddiesSummaryPresenter($(StateManager.class),
- $(Session.class), $$(UserServiceAsync.class), $(UserActionRegistry.class),
- $(I18nTranslationService.class), $$(ChatEngine.class), $(ActionBuddiesSummaryToolbar.class),
- $$(FileDownloadUtils.class), $(ImageUtils.class), $$(SocialNetworkServiceAsync.class),
- $(GroupActionRegistry.class));
- final BuddiesSummaryPanel panel = new BuddiesSummaryPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class), $(ActionManager.class),
- $(ActionBuddiesSummaryToolbar.class).getView());
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<ParticipationSummary>(ParticipationSummary.class) {
- @Override
- public ParticipationSummary create() {
- final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(
- $(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
- $(Session.class), $$(SocialNetworkServiceAsync.class), $(WsThemePresenter.class),
- $(GroupActionRegistry.class), $(ActionParticipationToolbar.class), $$(FileDownloadUtils.class));
- final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
- ($(ActionParticipationToolbar.class).getView()));
- presenter.init(view);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<TagsSummary>(TagsSummary.class) {
- @Override
- public TagsSummary create() {
- final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
- $$(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
- final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<NoHomePage>(NoHomePage.class) {
- @Override
- public NoHomePage create() {
- final NoHomePagePresenter presenter = new NoHomePagePresenter($(StateManager.class),
- $$(EntityHeader.class));
- final NoHomePagePanel panel = new NoHomePagePanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(ApplicationComponentGroup.class, new Factory<EntityOptions>(EntityOptions.class) {
- @Override
- public EntityOptions create() {
- final EntityOptionsPresenter presenter = new EntityOptionsPresenter($(StateManager.class));
- final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, $(EntityHeader.class),
- $(I18nTranslationService.class), $(Images.class), $(EntityOptionsGroup.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(EntityOptionsGroup.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
- @Override
- public EntityOptionsToolsConf create() {
- final EntityOptionsToolsConfPresenter presenter = new EntityOptionsToolsConfPresenter(
- $(StateManager.class), $(Session.class), $(I18nTranslationService.class),
- $(EntityOptions.class), $$(GroupServiceAsync.class));
- final EntityOptionsToolsConfPanel panel = new EntityOptionsToolsConfPanel(presenter,
- $(WorkspaceSkeleton.class), $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(EntityOptionsGroup.class, new Factory<EntityOptionsLogo>(EntityOptionsLogo.class) {
- @Override
- public EntityOptionsLogo create() {
- final EntityOptionsLogoPresenter presenter = new EntityOptionsLogoPresenter($(Session.class),
- $(EntityHeader.class), $(EntityOptions.class), $(StateManager.class),
- $$(UserServiceAsync.class), $$(ChatEngine.class));
- final EntityOptionsLogoPanel panel = new EntityOptionsLogoPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(EntityOptionsGroup.class, new Factory<EntityOptionsDefLicense>(EntityOptionsDefLicense.class) {
- @Override
- public EntityOptionsDefLicense create() {
- final EntityOptionsDefLicensePresenter presenter = new EntityOptionsDefLicensePresenter(
- $(EntityOptions.class), $(StateManager.class), $(Session.class), $$(LicenseWizard.class),
- $$(LicenseChangeAction.class));
- final EntityOptionsDefLicensePanel panel = new EntityOptionsDefLicensePanel(presenter,
- $(WorkspaceSkeleton.class), $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(EntityOptionsGroup.class,
- new Factory<EntityOptionsPublicSpaceConf>(EntityOptionsPublicSpaceConf.class) {
- @Override
- public EntityOptionsPublicSpaceConf create() {
- final EntityOptionsPublicSpaceConfPresenter presenter = new EntityOptionsPublicSpaceConfPresenter(
- $(EntityOptions.class));
- final EntityOptionsPublicSpaceConfPanel panel = new EntityOptionsPublicSpaceConfPanel(
- presenter, $(WorkspaceSkeleton.class), $(I18nTranslationService.class),
- $(WsThemePresenter.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<LicenseChangeAction>(LicenseChangeAction.class) {
- @Override
- public LicenseChangeAction create() {
- return new LicenseChangeAction($$(GroupServiceAsync.class), $(Session.class),
- $(I18nTranslationService.class), $(StateManager.class));
- }
- });
-
- register(Singleton.class, new Factory<RenameAction>(RenameAction.class) {
- @Override
- public RenameAction create() {
- return new RenameAction($(I18nTranslationService.class), $(Session.class),
- $$(ContentServiceAsync.class));
- }
- });
-
- register(Singleton.class, new Factory<LicenseWizard>(LicenseWizard.class) {
- @Override
- public LicenseWizard create() {
- final LicenseWizardPresenter presenter = new LicenseWizardPresenter(
- $(LicenseWizardFirstFormView.class), $(LicenseWizardSndFormView.class),
- $(LicenseWizardTrdFormView.class), $(LicenseWizardFrdFormView.class), $(Session.class));
- final LicenseWizardPanel panel = new LicenseWizardPanel(presenter, $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(Singleton.class, new Factory<LicenseWizardFirstFormView>(LicenseWizardFirstFormView.class) {
- @Override
- public LicenseWizardFirstFormView create() {
- return new LicenseWizardFirstForm($(I18nTranslationService.class));
- }
- });
-
- register(Singleton.class, new Factory<LicenseWizardSndFormView>(LicenseWizardSndFormView.class) {
- @Override
- public LicenseWizardSndFormView create() {
- return new LicenseWizardSndForm($(I18nTranslationService.class));
- }
- });
-
- register(Singleton.class, new Factory<LicenseWizardTrdFormView>(LicenseWizardTrdFormView.class) {
- @Override
- public LicenseWizardTrdFormView create() {
- return new LicenseWizardTrdForm($(Images.class), $(I18nTranslationService.class));
- }
- });
-
- register(Singleton.class, new Factory<LicenseWizardFrdFormView>(LicenseWizardFrdFormView.class) {
- @Override
- public LicenseWizardFrdFormView create() {
- return new LicenseWizardFrdForm($(I18nTranslationService.class), $(Session.class));
- }
- });
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -65,6 +65,8 @@
*/
int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
+ String USERHASH = "userHash";
+
void check(AsyncCallbackSimple<?> callback);
StateContainerDTO getContainerState();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -35,7 +35,7 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Event;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -7,10 +7,14 @@
public interface RTEditor {
- void addAction(ActionDescriptor<Object> action);
+ void addBasicAction(ActionDescriptor<Object> action);
- void addActions(ActionCollection<Object> actions);
+ void addBasicActions(ActionCollection<Object> actions);
+ void addExtendedAction(ActionDescriptor<Object> action);
+
+ void addExtendedActions(ActionCollection<Object> actions);
+
void editContent(String content);
View getView();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -3,12 +3,17 @@
import java.util.Date;
import org.ourproject.kune.platf.client.actions.ActionCollection;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.BasicFormatter;
import org.ourproject.kune.platf.client.ui.rte.RichTextArea.ExtendedFormatter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea.Justification;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.libideas.client.StyleInjector;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.Widget;
public class RTEditorPanel implements RTEditorView {
@@ -22,6 +27,7 @@
rta = new RichTextArea();
basic = rta.getBasicFormatter();
extended = rta.getExtendedFormatter();
+ StyleInjector.injectStylesheet(RTEImgResources.INSTANCE.css().getText());
}
public void addComment(String userName) {
@@ -29,8 +35,8 @@
Element span = DOM.createSpan();
span.setInnerText(i18n.t("type here") + " -" + userName + time);
DOM.setElementAttribute((com.google.gwt.user.client.Element) span, "backgroundColor", "rgb(255,255,215");
- // addCustomStyle
- // insertHtml
+ // FIXME: addCustomStyle
+ insertHtml(span.getString());
}
public boolean canBeExtended() {
@@ -38,148 +44,168 @@
}
public void copy() {
- extended.undo();
+ extended.copy();
}
- public void createlink(String url) {
- // TODO Auto-generated method stub
-
+ public void createLink(String url) {
+ extended.createLink(url);
}
public void cut() {
- extended.undo();
+ extended.cut();
}
public void delete() {
- // TODO Auto-generated method stub
-
+ extended.delete();
}
- public void fontname(String name) {
- // TODO Auto-generated method stub
-
+ public Widget getRTE() {
+ return rta;
}
- public void fontsize(String size) {
- // TODO Auto-generated method stub
-
+ public void insertHorizontalRule() {
+ extended.insertHorizontalRule();
}
- public void forecolor(String color) {
- // TODO Auto-generated method stub
-
+ public void insertHR() {
+ extended.insertHorizontalRule();
}
- public void indent() {
- // TODO Auto-generated method stub
-
+ public void insertHtml(String html) {
+ extended.insertHtml(html);
}
- public void inserthorizontalrule() {
- // TODO Auto-generated method stub
-
+ public void insertImage(String url) {
+ extended.insertImage(url);
}
- public void insertHR() {
- extended.insertHorizontalRule();
+ public void insertOrderedList() {
+ extended.insertOrderedList();
}
- public void inserthtml(String html) {
- // TODO Auto-generated method stub
-
+ public void insertUnorderedList() {
+ extended.insertUnorderedList();
}
- public void insertimage(String url) {
- // TODO Auto-generated method stub
-
+ public boolean isBold() {
+ return basic.isBold();
}
- public void insertorderedlist() {
- // TODO Auto-generated method stub
-
+ public boolean isItalic() {
+ return basic.isItalic();
}
- public void insertparagraph() {
- // TODO Auto-generated method stub
-
+ public boolean isStrikethrough() {
+ return extended.isStrikethrough();
}
- public void insertunorderedlist() {
- // TODO Auto-generated method stub
-
+ public boolean isSubscript() {
+ return basic.isSubscript();
}
- public void italic() {
- // TODO Auto-generated method stub
-
+ public boolean isSuperscript() {
+ return basic.isSuperscript();
}
- public void justifycenter() {
- // TODO Auto-generated method stub
-
+ public boolean isUnderlined() {
+ return basic.isUnderlined();
}
- public void justifyfull() {
- // TODO Auto-generated method stub
-
+ public void justifyCenter() {
+ basic.setJustification(Justification.CENTER);
}
- public void justifyleft() {
- // TODO Auto-generated method stub
-
+ public void justifyLeft() {
+ basic.setJustification(Justification.LEFT);
}
- public void justifyright() {
- // TODO Auto-generated method stub
-
+ public void justifyRight() {
+ basic.setJustification(Justification.RIGHT);
}
- public void outdent() {
- // TODO Auto-generated method stub
-
+ public void leftIndent() {
+ extended.leftIndent();
}
public void paste() {
- extended.undo();
+ extended.paste();
}
public void redo() {
extended.redo();
}
- public void removeformat() {
- // TODO Auto-generated method stub
+ public void removeFormat() {
+ extended.removeFormat();
}
- public void selectall() {
- // TODO Auto-generated method stub
+ public void rightIndent() {
+ extended.rightIndent();
}
public void selectAll() {
- // TODO Auto-generated method stub
+ basic.selectAll();
}
public void setActions(ActionCollection<Object> actions) {
// TODO Auto-generated method stub
+ }
+ public void setFontName(String name) {
+ basic.setFontName(name);
}
- public void strikethrough() {
- // TODO Auto-generated method stub
+ public void setFontSize(int size) {
+ switch (size) {
+ case 1:
+ basic.setFontSize(FontSize.XX_SMALL);
+ break;
+ case 2:
+ basic.setFontSize(FontSize.X_SMALL);
+ break;
+ case 3:
+ basic.setFontSize(FontSize.SMALL);
+ break;
+ case 4:
+ basic.setFontSize(FontSize.MEDIUM);
+ break;
+ case 5:
+ basic.setFontSize(FontSize.LARGE);
+ break;
+ case 6:
+ basic.setFontSize(FontSize.X_LARGE);
+ break;
+ case 7:
+ basic.setFontSize(FontSize.XX_LARGE);
+ break;
+ }
+ }
+ public void setForeColor(String color) {
+ basic.setForeColor(color);
}
- public void subscript() {
- // TODO Auto-generated method stub
+ public void toggleBold() {
+ basic.toggleBold();
+ }
+ public void toggleItalic() {
+ basic.toggleItalic();
}
- public void superscript() {
- // TODO Auto-generated method stub
+ public void toggleStrikethrough() {
+ extended.toggleStrikethrough();
+ }
+ public void toggleSubscript() {
+ basic.toggleSubscript();
}
- public void underline() {
+ public void toggleSuperscript() {
+ basic.toggleSuperscript();
+ }
+
+ public void toggleUnderline() {
basic.toggleUnderline();
}
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-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -4,13 +4,16 @@
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
+import org.ourproject.kune.platf.client.actions.ActionPressedCondition;
import org.ourproject.kune.platf.client.actions.ActionShortcut;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.events.Listener0;
@@ -24,30 +27,41 @@
private AccessRolDTO accessRol;
private final I18nTranslationService i18n;
private final Session session;
- private final ActionCollection<Object> actions;
+ private final ActionCollection<Object> extendedActions;
+ private final ActionCollection<Object> basicActions;
+ private final RTEImgResources imgResources;
public RTEditorPresenter(ContentEditorActionRegistry contentEditorActionRegistry, I18nTranslationService i18n,
- Session session) {
+ Session session, RTEImgResources imgResources) {
this.i18n = i18n;
this.session = session;
+ this.imgResources = imgResources;
extended = true;
accessRol = AccessRolDTO.Editor;
- actions = createDefActions();
+ extendedActions = createDefExtendedActions();
+ basicActions = createDefBasicActions();
}
- public void addAction(ActionDescriptor<Object> action) {
- actions.add(action);
+ public void addBasicAction(ActionDescriptor<Object> action) {
+ basicActions.add(action);
}
- public void addActions(ActionCollection<Object> actions) {
- this.actions.addAll(actions);
+ public void addBasicActions(ActionCollection<Object> actions) {
+ basicActions.addAll(actions);
}
- public void editContent(String content) {
- view.setActions(actions);
+ public void addExtendedAction(ActionDescriptor<Object> action) {
+ extendedActions.add(action);
+ }
+ public void addExtendedActions(ActionCollection<Object> actions) {
+ extendedActions.addAll(actions);
}
+ public void editContent(String content) {
+ view.setActions(extendedActions);
+ }
+
public View getView() {
return view;
}
@@ -64,9 +78,72 @@
this.extended = extended;
}
- private ActionCollection<Object> createDefActions() {
- ActionCollection<Object> defActions = new ActionCollection<Object>();
+ private ActionCollection<Object> createDefBasicActions() {
+ ActionCollection<Object> actions = new ActionCollection<Object>();
+ ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.selectAll();
+ }
+ });
+ selectAll.setShortcut(new ActionShortcut(true, 'A'));
+ selectAll.setTextDescription(i18n.t("Select all"));
+ selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
+
+ ActionToolbarPushButtonDescriptor<Object> bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.toggleBold();
+ }
+ });
+ bold.setIconCls(imgResources.bold().getName());
+ bold.setToolTip(i18n.t("Toggle Bold"));
+ bold.setMustInitialyPressed(new ActionPressedCondition<Object>() {
+ public boolean mustBePressed(Object param) {
+ return view.isBold();
+ }
+ });
+
+ ActionToolbarPushButtonDescriptor<Object> italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.toggleItalic();
+ }
+ });
+ italic.setIconCls(imgResources.italic().getName());
+ italic.setToolTip(i18n.t("Toggle Italic"));
+ italic.setMustInitialyPressed(new ActionPressedCondition<Object>() {
+ public boolean mustBePressed(Object param) {
+ return view.isItalic();
+ }
+ });
+
+ ActionToolbarPushButtonDescriptor<Object> underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.toggleUnderline();
+ }
+ });
+ underline.setIconCls(imgResources.underline().getName());
+ underline.setToolTip(i18n.t("Toggle Underline"));
+ underline.setMustInitialyPressed(new ActionPressedCondition<Object>() {
+ public boolean mustBePressed(Object param) {
+ return view.isUnderlined();
+ }
+ });
+
+ actions.add(bold);
+ actions.add(italic);
+ actions.add(underline);
+ actions.add(selectAll);
+
+ return actions;
+ }
+
+ private ActionCollection<Object> createDefExtendedActions() {
+ ActionCollection<Object> actions = new ActionCollection<Object>();
+
ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -117,16 +194,6 @@
paste.setTextDescription(i18n.t("Paste"));
paste.setParentMenuTitle(i18n.t(EDIT_MENU));
- ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
- public void onEvent() {
- view.selectall();
- }
- });
- selectAll.setShortcut(new ActionShortcut(true, 'A'));
- selectAll.setTextDescription(i18n.t("Select all"));
- selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
-
ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -150,7 +217,7 @@
ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
- view.inserthorizontalrule();
+ view.insertHorizontalRule();
}
});
hr.setShortcut(new ActionShortcut(true, 'M'));
@@ -158,16 +225,31 @@
hr.setParentMenuTitle(i18n.t(INSERT_MENU));
hr.setEnableCondition(isExtended());
- defActions.add(undo);
- defActions.add(redo);
- defActions.add(copy);
- defActions.add(cut);
- defActions.add(paste);
- defActions.add(selectAll);
- defActions.add(editHtml);
- defActions.add(comment);
- defActions.add(hr);
- return defActions;
+ ActionToolbarPushButtonDescriptor<Object> strikethrough = new ActionToolbarPushButtonDescriptor<Object>(
+ accessRol, ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.toggleStrikethrough();
+ }
+ });
+ strikethrough.setIconCls(imgResources.strikeout().getName());
+ strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
+ strikethrough.setMustInitialyPressed(new ActionPressedCondition<Object>() {
+ public boolean mustBePressed(Object param) {
+ return view.isStrikethrough();
+ }
+ });
+
+ actions.add(undo);
+ actions.add(redo);
+ actions.add(copy);
+ actions.add(cut);
+ actions.add(paste);
+ actions.add(editHtml);
+ actions.add(comment);
+ actions.add(hr);
+ actions.add(strikethrough);
+
+ return actions;
}
private ActionEnableCondition<Object> isExtended() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -11,62 +11,72 @@
void copy();
- void createlink(String url);
+ void createLink(String url);
void cut();
void delete();
- void fontname(String name);
+ void insertHorizontalRule();
- void fontsize(String size);
+ void insertHtml(String html);
- void forecolor(String color);
+ void insertImage(String url);
- void indent();
+ void insertOrderedList();
- void inserthorizontalrule();
+ void insertUnorderedList();
- void inserthtml(String html);
+ boolean isBold();
- void insertimage(String url);
+ boolean isItalic();
- void insertorderedlist();
+ boolean isStrikethrough();
- void insertparagraph();
+ boolean isSubscript();
- void insertunorderedlist();
+ boolean isSuperscript();
- void italic();
+ boolean isUnderlined();
- void justifycenter();
+ void justifyCenter();
- void justifyfull();
+ void justifyLeft();
- void justifyleft();
+ void justifyRight();
- void justifyright();
+ void leftIndent();
- void outdent();
-
void paste();
void redo();
- void removeformat();
+ void removeFormat();
- void selectall();
+ void rightIndent();
+ void selectAll();
+
void setActions(ActionCollection<Object> actions);
- void strikethrough();
+ void setFontName(String name);
- void subscript();
+ void setFontSize(int size);
- void superscript();
+ void setForeColor(String color);
- void underline();
+ void toggleBold();
+ void toggleItalic();
+
+ void toggleStrikethrough();
+
+ void toggleSubscript();
+
+ void toggleSuperscript();
+
+ void toggleUnderline();
+
void undo();
void unlink();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -193,6 +193,11 @@
void cut();
+ /*
+ * delete all text and objects that are selected.
+ */
+ void delete();
+
/**
* Inserts a horizontal rule.
*/
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,12 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+
+public class TestRTEDialog {
+
+ public TestRTEDialog(RTEditor editor) {
+ BasicDialog dialog = new BasicDialog("Testing RTE", false);
+ dialog.add(((RTEditorPanel) editor.getView()).getRTE());
+ dialog.show();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,84 @@
+package org.ourproject.kune.platf.client.ui.rte.img;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.libideas.resources.client.CssResource;
+import com.google.gwt.libideas.resources.client.ImageResource;
+import com.google.gwt.libideas.resources.client.ImmutableResourceBundle;
+
+public interface RTEImgResources extends ImmutableResourceBundle {
+
+ public static final RTEImgResources INSTANCE = GWT.create(RTEImgResources.class);
+
+ @Resource("alignleft.png")
+ ImageResource alignleft();
+
+ @Resource("alignright.png")
+ ImageResource alignright();
+
+ @Resource("backcolor.png")
+ ImageResource backcolor();
+
+ @Resource("bold.png")
+ ImageResource bold();
+
+ @Resource("centerpara.png")
+ ImageResource centerpara();
+
+ @Resource("charfontname.png")
+ ImageResource charfontname();
+
+ @Resource("rteimg.css")
+ CssResource css();
+
+ @Resource("decrementindent.png")
+ ImageResource decrementindent();
+
+ @Resource("defaultbullet.png")
+ ImageResource defaultbullet();
+
+ @Resource("defaultnumbering.png")
+ ImageResource defaultnumbering();
+
+ @Resource("edithtml.png")
+ ImageResource edithtml();
+
+ @Resource("fontcolor.png")
+ ImageResource fontcolor();
+
+ @Resource("fontheight.png")
+ ImageResource fontheight();
+
+ @Resource("hfixedline.png")
+ ImageResource hfixedline();
+
+ @Resource("images.png")
+ ImageResource images();
+
+ @Resource("incrementindent.png")
+ ImageResource incrementindent();
+
+ @Resource("italic.png")
+ ImageResource italic();
+
+ @Resource("link.png")
+ ImageResource link();
+
+ @Resource("link_break.png")
+ ImageResource link_break();
+
+ @Resource("removeFormat.png")
+ ImageResource removeFormat();
+
+ @Resource("strikeout.png")
+ ImageResource strikeout();
+
+ @Resource("subscript.png")
+ ImageResource subscript();
+
+ @Resource("superscript.png")
+ ImageResource superscript();
+
+ @Resource("underline.png")
+ ImageResource underline();
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignleft.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignleft.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignright.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/alignright.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/backcolor.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/backcolor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/bold.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/bold.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/centerpara.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/centerpara.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/charfontname.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/charfontname.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/decrementindent.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/decrementindent.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultbullet.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultbullet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultnumbering.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/defaultnumbering.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/edithtml.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/edithtml.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontcolor.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontcolor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontheight.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/fontheight.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/hfixedline.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/hfixedline.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/images.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/images.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/incrementindent.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/incrementindent.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/italic.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/italic.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/link_break.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/removeFormat.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/removeFormat.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,91 @@
+@stripe .k-rte-underline {
+ gwt-image: 'underline';
+}
+
+@stripe .k-rte-superscript {
+ gwt-image: 'superscript';
+}
+
+@stripe .k-rte-subscript {
+ gwt-image: 'subscript';
+}
+
+@stripe .k-rte-strikeout {
+ gwt-image: 'strikeout';
+}
+
+@stripe .k-rte-removeFormat {
+ gwt-image: 'removeFormat';
+}
+
+@stripe .k-rte-link {
+ gwt-image: 'link';
+}
+
+@stripe .k-rte-link_break {
+ gwt-image: 'link_break';
+}
+
+@stripe .k-rte-italic {
+ gwt-image: 'italic';
+}
+
+@stripe .k-rte-incrementindent {
+ gwt-image: 'incrementindent';
+}
+
+@stripe .k-rte-images {
+ gwt-image: 'images';
+}
+
+@stripe .k-rte-hfixedline {
+ gwt-image: 'hfixedline';
+}
+
+@stripe .k-rte-fontheight {
+ gwt-image: 'fontheight';
+}
+
+@stripe .k-rte-fontcolor {
+ gwt-image: 'fontcolor';
+}
+
+@stripe .k-rte-edithtml {
+ gwt-image: 'edithtml';
+}
+
+@stripe .k-rte-defaultnumbering {
+ gwt-image: 'defaultnumbering';
+}
+
+@stripe .k-rte-defaultbullet {
+ gwt-image: 'defaultbullet';
+}
+
+@stripe .k-rte-decrementindent {
+ gwt-image: 'decrementindent';
+}
+
+@stripe .k-rte-charfontname {
+ gwt-image: 'charfontname';
+}
+
+@stripe .k-rte-centerpara {
+ gwt-image: 'centerpara';
+}
+
+@stripe .k-rte-bold {
+ gwt-image: 'bold';
+}
+
+@stripe .k-rte-backcolor {
+ gwt-image: 'backcolor';
+}
+
+@stripe .k-rte-alignright {
+ gwt-image: 'alignright';
+}
+
+@stripe .k-rte-alignleft {
+ gwt-image: 'alignleft';
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/strikeout.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/strikeout.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/subscript.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/subscript.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/superscript.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/superscript.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/underline.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/underline.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/RichTextAreaImplStandard.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -48,8 +48,8 @@
@Override
public native Element createElement() /*-{
- return $doc.createElement('iframe');
- }-*/;
+ return $doc.createElement('iframe');
+ }-*/;
public void createLink(String url) {
execCommand("CreateLink", url);
@@ -59,6 +59,10 @@
execCommand("Cut", null);
}
+ public void delete() {
+ execCommand("Delete", null);
+ }
+
public String getBackColor() {
return queryCommandValue("BackColor");
}
@@ -79,19 +83,19 @@
@Override
public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- setTimeout(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+ // Most browsers don't like setting designMode until slightly _after_
+ // the iframe becomes attached to the DOM. Any non-zero timeout will do
+ // just fine.
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ setTimeout(function() {
+ // Turn on design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
public void insertHorizontalRule() {
execCommand("InsertHorizontalRule", null);
@@ -181,12 +185,12 @@
@Override
public native void setFocus(boolean focused) /*-{
- if (focused) {
- this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.focus();
- } else {
- this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.blur();
- }
- }-*/;
+ if (focused) {
+ this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.focus();
+ } else {
+ this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.blur();
+ }
+ }-*/;
public void setFontName(String name) {
execCommand("FontName", name);
@@ -280,55 +284,55 @@
}
protected native String getHTMLImpl() /*-{
- return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML;
- }-*/;
+ return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML;
+ }-*/;
protected native String getTextImpl() /*-{
- return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent;
- }-*/;
+ return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent;
+ }-*/;
@Override
protected native void hookEvents() /*-{
- var elem = this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var wnd = elem.contentWindow;
+ var elem = this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var wnd = elem.contentWindow;
- elem.__gwt_handler = function(evt) {
- if (elem.__listener) {
- elem.__listener.@org.ourproject.kune.platf.client.ui.rte.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
- }
- };
+ elem.__gwt_handler = function(evt) {
+ if (elem.__listener) {
+ elem.__listener.@org.ourproject.kune.platf.client.ui.rte.RichTextArea::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
+ }
+ };
- elem.__gwt_focusHandler = function(evt) {
- if (elem.__gwt_isFocused) {
- return;
- }
+ elem.__gwt_focusHandler = function(evt) {
+ if (elem.__gwt_isFocused) {
+ return;
+ }
- elem.__gwt_isFocused = true;
- elem.__gwt_handler(evt);
- };
+ elem.__gwt_isFocused = true;
+ elem.__gwt_handler(evt);
+ };
- elem.__gwt_blurHandler = function(evt) {
- if (!elem.__gwt_isFocused) {
- return;
- }
+ elem.__gwt_blurHandler = function(evt) {
+ if (!elem.__gwt_isFocused) {
+ return;
+ }
- elem.__gwt_isFocused = false;
- elem.__gwt_handler(evt);
- };
+ elem.__gwt_isFocused = false;
+ elem.__gwt_handler(evt);
+ };
- wnd.addEventListener('keydown', elem.__gwt_handler, true);
- wnd.addEventListener('keyup', elem.__gwt_handler, true);
- wnd.addEventListener('keypress', elem.__gwt_handler, true);
- wnd.addEventListener('mousedown', elem.__gwt_handler, true);
- wnd.addEventListener('mouseup', elem.__gwt_handler, true);
- wnd.addEventListener('mousemove', elem.__gwt_handler, true);
- wnd.addEventListener('mouseover', elem.__gwt_handler, true);
- wnd.addEventListener('mouseout', elem.__gwt_handler, true);
- wnd.addEventListener('click', elem.__gwt_handler, true);
+ wnd.addEventListener('keydown', elem.__gwt_handler, true);
+ wnd.addEventListener('keyup', elem.__gwt_handler, true);
+ wnd.addEventListener('keypress', elem.__gwt_handler, true);
+ wnd.addEventListener('mousedown', elem.__gwt_handler, true);
+ wnd.addEventListener('mouseup', elem.__gwt_handler, true);
+ wnd.addEventListener('mousemove', elem.__gwt_handler, true);
+ wnd.addEventListener('mouseover', elem.__gwt_handler, true);
+ wnd.addEventListener('mouseout', elem.__gwt_handler, true);
+ wnd.addEventListener('click', elem.__gwt_handler, true);
- wnd.addEventListener('focus', elem.__gwt_focusHandler, true);
- wnd.addEventListener('blur', elem.__gwt_blurHandler, true);
- }-*/;
+ wnd.addEventListener('focus', elem.__gwt_focusHandler, true);
+ wnd.addEventListener('blur', elem.__gwt_blurHandler, true);
+ }-*/;
@Override
protected void onElementInitialized() {
@@ -350,34 +354,34 @@
}
protected native void setHTMLImpl(String html) /*-{
- this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML = html;
- }-*/;
+ this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.innerHTML = html;
+ }-*/;
protected native void setTextImpl(String text) /*-{
- this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent = text;
- }-*/;
+ this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.body.textContent = text;
+ }-*/;
protected native void unhookEvents() /*-{
- var elem = this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var wnd = elem.contentWindow;
+ var elem = this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var wnd = elem.contentWindow;
- wnd.removeEventListener('keydown', elem.__gwt_handler, true);
- wnd.removeEventListener('keyup', elem.__gwt_handler, true);
- wnd.removeEventListener('keypress', elem.__gwt_handler, true);
- wnd.removeEventListener('mousedown', elem.__gwt_handler, true);
- wnd.removeEventListener('mouseup', elem.__gwt_handler, true);
- wnd.removeEventListener('mousemove', elem.__gwt_handler, true);
- wnd.removeEventListener('mouseover', elem.__gwt_handler, true);
- wnd.removeEventListener('mouseout', elem.__gwt_handler, true);
- wnd.removeEventListener('click', elem.__gwt_handler, true);
+ wnd.removeEventListener('keydown', elem.__gwt_handler, true);
+ wnd.removeEventListener('keyup', elem.__gwt_handler, true);
+ wnd.removeEventListener('keypress', elem.__gwt_handler, true);
+ wnd.removeEventListener('mousedown', elem.__gwt_handler, true);
+ wnd.removeEventListener('mouseup', elem.__gwt_handler, true);
+ wnd.removeEventListener('mousemove', elem.__gwt_handler, true);
+ wnd.removeEventListener('mouseover', elem.__gwt_handler, true);
+ wnd.removeEventListener('mouseout', elem.__gwt_handler, true);
+ wnd.removeEventListener('click', elem.__gwt_handler, true);
- wnd.removeEventListener('focus', elem.__gwt_focusHandler, true);
- wnd.removeEventListener('blur', elem.__gwt_blurHandler, true);
+ wnd.removeEventListener('focus', elem.__gwt_focusHandler, true);
+ wnd.removeEventListener('blur', elem.__gwt_blurHandler, true);
- elem.__gwt_handler = null;
- elem.__gwt_focusHandler = null;
- elem.__gwt_blurHandler = null;
- }-*/;
+ elem.__gwt_handler = null;
+ elem.__gwt_focusHandler = null;
+ elem.__gwt_blurHandler = null;
+ }-*/;
void execCommand(String cmd, String param) {
if (isRichEditingActive(elem)) {
@@ -390,12 +394,12 @@
}
native void execCommandAssumingFocus(String cmd, String param) /*-{
- this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.execCommand(cmd, false, param);
- }-*/;
+ this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.execCommand(cmd, false, param);
+ }-*/;
native boolean isRichEditingActive(Element e) /*-{
- return ((e.contentWindow.document.designMode).toUpperCase()) == 'ON';
- }-*/;
+ return ((e.contentWindow.document.designMode).toUpperCase()) == 'ON';
+ }-*/;
boolean queryCommandState(String cmd) {
if (isRichEditingActive(elem)) {
@@ -410,8 +414,8 @@
}
native boolean queryCommandStateAssumingFocus(String cmd) /*-{
- return !!this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandState(cmd);
- }-*/;
+ return !!this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandState(cmd);
+ }-*/;
String queryCommandValue(String cmd) {
// When executing a command, focus the iframe first, since some commands
@@ -421,6 +425,6 @@
}
native String queryCommandValueAssumingFocus(String cmd) /*-{
- return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandValue(cmd);
- }-*/;
+ return this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.queryCommandValue(cmd);
+ }-*/;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/upload/FileUploaderDialog.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,8 +19,8 @@
\*/
package org.ourproject.kune.platf.client.ui.upload;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.rpc.I18nService;
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.server.access.AccessRightsService;
import org.ourproject.kune.platf.server.access.AccessRightsServiceDefault;
@@ -94,7 +95,6 @@
import org.ourproject.kune.platf.server.tool.ServerToolRegistry;
import org.ourproject.kune.platf.server.users.UserInfoService;
import org.ourproject.kune.platf.server.users.UserInfoServiceDefault;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.google.inject.matcher.Matchers;
import com.wideplay.warp.persist.PersistenceService;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -59,7 +59,6 @@
private final Content contentFinder;
private final Container containerFinder;
private final TagUserContentManager tagManager;
- private final Provider<EntityManager> provider;
@Inject
public ContentManagerDefault(final Content contentFinder, final Container containerFinder,
@@ -68,7 +67,6 @@
super(provider, Content.class);
this.contentFinder = contentFinder;
this.containerFinder = containerFinder;
- this.provider = provider;
this.finder = finder;
this.userFinder = userFinder;
this.languageFinder = languageFinder;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/UserRPC.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.DefaultException;
import org.ourproject.kune.platf.client.errors.UserAuthException;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.access.AccessRol;
import org.ourproject.kune.platf.server.auth.ActionLevel;
@@ -43,7 +44,6 @@
import org.ourproject.kune.platf.server.mapper.Mapper;
import org.ourproject.kune.platf.server.users.UserInfo;
import org.ourproject.kune.platf.server.users.UserInfoService;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.google.inject.Inject;
import com.google.inject.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,6 +28,7 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -40,7 +41,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -27,6 +27,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -48,7 +49,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,9 +20,9 @@
package org.ourproject.kune.wiki.client;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/cnt/WikiViewerPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -22,12 +22,12 @@
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.wiki.client.WikiClientTool;
import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -46,6 +46,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -57,7 +58,6 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.socialnet.RadioMustBeChecked;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java (from rev 1045, trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneRegistryModule.java 2009-02-03 10:15:36 UTC (rev 1045)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneRegistryModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,220 @@
+/*
+ *
+ * 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;
+
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContentEditorActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
+import org.ourproject.kune.platf.client.actions.UserActionRegistry;
+import org.ourproject.kune.platf.client.registry.AclEditableRegistry;
+import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
+import org.ourproject.kune.platf.client.registry.CanBeHomepageRegistry;
+import org.ourproject.kune.platf.client.registry.ComentableRegistry;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.registry.DragableRegistry;
+import org.ourproject.kune.platf.client.registry.DropableRegistry;
+import org.ourproject.kune.platf.client.registry.EmailSubscribeAbleRegistry;
+import org.ourproject.kune.platf.client.registry.LicensableRegistry;
+import org.ourproject.kune.platf.client.registry.PublishModerableRegistry;
+import org.ourproject.kune.platf.client.registry.RateableRegistry;
+import org.ourproject.kune.platf.client.registry.RenamableRegistry;
+import org.ourproject.kune.platf.client.registry.TageableRegistry;
+import org.ourproject.kune.platf.client.registry.TranslatableRegistry;
+import org.ourproject.kune.platf.client.registry.VersionableRegistry;
+import org.ourproject.kune.platf.client.registry.XmppComentableRegistry;
+import org.ourproject.kune.platf.client.registry.XmppNotifyCapableRegistry;
+
+import com.calclab.suco.client.ioc.decorator.Singleton;
+import com.calclab.suco.client.ioc.module.AbstractModule;
+import com.calclab.suco.client.ioc.module.Factory;
+
+public class KuneRegistryModule extends AbstractModule {
+
+ @Override
+ protected void onInstall() {
+
+ register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
+ @Override
+ public AclEditableRegistry create() {
+ return new AclEditableRegistry();
+ }
+ });
+ register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
+ @Override
+ public AuthorableRegistry create() {
+ return new AuthorableRegistry();
+ }
+ });
+ register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
+ @Override
+ public CanBeHomepageRegistry create() {
+ return new CanBeHomepageRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
+ @Override
+ public ComentableRegistry create() {
+ return new ComentableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
+ @Override
+ public DragableRegistry create() {
+ return new DragableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
+ @Override
+ public DropableRegistry create() {
+ return new DropableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
+ @Override
+ public EmailSubscribeAbleRegistry create() {
+ return new EmailSubscribeAbleRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
+ @Override
+ public LicensableRegistry create() {
+ return new LicensableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
+ @Override
+ public PublishModerableRegistry create() {
+ return new PublishModerableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
+ @Override
+ public RateableRegistry create() {
+ return new RateableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
+ @Override
+ public TageableRegistry create() {
+ return new TageableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
+ @Override
+ public RenamableRegistry create() {
+ return new RenamableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
+ @Override
+ public TranslatableRegistry create() {
+ return new TranslatableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
+ @Override
+ public VersionableRegistry create() {
+ return new VersionableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
+ @Override
+ public XmppComentableRegistry create() {
+ return new XmppComentableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
+ @Override
+ public XmppNotifyCapableRegistry create() {
+ return new XmppNotifyCapableRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<ContentIconsRegistry>(ContentIconsRegistry.class) {
+ @Override
+ public ContentIconsRegistry create() {
+ return new ContentIconsRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class) {
+ @Override
+ public ContentCapabilitiesRegistry create() {
+ return new ContentCapabilitiesRegistry($(AuthorableRegistry.class), $(AclEditableRegistry.class),
+ $(ContentIconsRegistry.class), $(CanBeHomepageRegistry.class), $(ComentableRegistry.class),
+ $(DragableRegistry.class), $(DropableRegistry.class), $(EmailSubscribeAbleRegistry.class),
+ $(LicensableRegistry.class), $(PublishModerableRegistry.class), $(RateableRegistry.class),
+ $(TageableRegistry.class), $(RenamableRegistry.class), $(TranslatableRegistry.class),
+ $(VersionableRegistry.class), $(XmppComentableRegistry.class),
+ $(XmppNotifyCapableRegistry.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<ContextActionRegistry>(ContextActionRegistry.class) {
+ @Override
+ public ContextActionRegistry create() {
+ return new ContextActionRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<ContentEditorActionRegistry>(ContentEditorActionRegistry.class) {
+ @Override
+ public ContentEditorActionRegistry create() {
+ return new ContentEditorActionRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<ContentActionRegistry>(ContentActionRegistry.class) {
+ @Override
+ public ContentActionRegistry create() {
+ return new ContentActionRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<GroupActionRegistry>(GroupActionRegistry.class) {
+ @Override
+ public GroupActionRegistry create() {
+ return new GroupActionRegistry();
+ }
+ });
+
+ register(Singleton.class, new Factory<UserActionRegistry>(UserActionRegistry.class) {
+ @Override
+ public UserActionRegistry create() {
+ return new UserActionRegistry();
+ }
+ });
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java (from rev 1046, trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2009-02-03 10:53:22 UTC (rev 1046)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -0,0 +1,983 @@
+/*
+ *
+ * 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;
+
+import org.ourproject.kune.chat.client.ChatEngine;
+import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
+import org.ourproject.kune.platf.client.actions.UserActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionBuddiesSummaryToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionCntCtxToolbarPanel;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationSummaryToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
+import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
+import org.ourproject.kune.platf.client.app.TextEditorInsertElementGroup;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.registry.RenamableRegistry;
+import org.ourproject.kune.platf.client.rpc.ContentService;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.rpc.GroupService;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
+import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
+import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.ImageUtils;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
+import org.ourproject.kune.platf.client.ui.rate.RateIt;
+import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
+import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
+import org.ourproject.kune.platf.client.ui.rate.RatePanel;
+import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
+import org.ourproject.kune.platf.client.ui.upload.FileUploader;
+import org.ourproject.kune.platf.client.ui.upload.FileUploaderDialog;
+import org.ourproject.kune.platf.client.ui.upload.FileUploaderPresenter;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPresenter;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPanel;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPresenter;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditorView;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPanel;
+import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElementPresenter;
+import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmail;
+import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPanel;
+import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPresenter;
+import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExt;
+import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPanel;
+import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPresenter;
+import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtView;
+import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocal;
+import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPanel;
+import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPresenter;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPanel;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
+import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePanel;
+import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePresenter;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPanel;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPresenter;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstForm;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdForm;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndForm;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdForm;
+import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardTrdFormView;
+import org.ourproject.kune.workspace.client.newgroup.NewGroup;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
+import org.ourproject.kune.workspace.client.nohomepage.NoHomePage;
+import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePanel;
+import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePresenter;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
+import org.ourproject.kune.workspace.client.options.EntityOptionsPresenter;
+import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicense;
+import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePanel;
+import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePresenter;
+import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogo;
+import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
+import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPresenter;
+import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConf;
+import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPanel;
+import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPresenter;
+import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConf;
+import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPanel;
+import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPresenter;
+import org.ourproject.kune.workspace.client.search.EntityLiveSearcherView;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearchPanel;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcherPresenter;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
+import org.ourproject.kune.workspace.client.search.SiteSearcherView;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPresenter;
+import org.ourproject.kune.workspace.client.signin.Register;
+import org.ourproject.kune.workspace.client.signin.RegisterPanel;
+import org.ourproject.kune.workspace.client.signin.RegisterPresenter;
+import org.ourproject.kune.workspace.client.signin.RegisterView;
+import org.ourproject.kune.workspace.client.signin.SignIn;
+import org.ourproject.kune.workspace.client.signin.SignInPanel;
+import org.ourproject.kune.workspace.client.signin.SignInPresenter;
+import org.ourproject.kune.workspace.client.signin.SignInView;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.site.SiteToken;
+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.sitebar.sitelogo.SiteLogo;
+import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLink;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptions;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearch;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLink;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenu;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPresenter;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.socialnet.BuddiesSummary;
+import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPanel;
+import org.ourproject.kune.workspace.client.socialnet.BuddiesSummaryPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummary;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPanel;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddie;
+import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePanel;
+import org.ourproject.kune.workspace.client.socialnet.other.AddAsBuddiePresenter;
+import org.ourproject.kune.workspace.client.summary.GroupSummary;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPanel;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
+import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
+import org.ourproject.kune.workspace.client.themes.WsThemePanel;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
+import org.ourproject.kune.workspace.client.title.EntitySubTitlePanel;
+import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
+import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
+import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.title.RenameAction;
+
+import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.ioc.decorator.NoDecoration;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+import com.calclab.suco.client.ioc.module.AbstractModule;
+import com.calclab.suco.client.ioc.module.Factory;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+
+public class KuneWorkspaceModule extends AbstractModule {
+ @Override
+ protected void onInstall() {
+
+ register(Singleton.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
+ @Override
+ public SocialNetworkServiceAsync create() {
+ final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT.create(SocialNetworkService.class);
+ ((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
+ + "SocialNetworkService");
+ return snServiceAsync;
+ }
+ }, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
+ @Override
+ public GroupServiceAsync create() {
+ final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
+ ((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
+ return groupServiceAsync;
+ }
+ }, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
+ @Override
+ public ContentServiceAsync create() {
+ final ContentServiceAsync contentServiceAsync = (ContentServiceAsync) GWT.create(ContentService.class);
+ ((ServiceDefTarget) contentServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "ContentService");
+ return contentServiceAsync;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
+ @Override
+ public WorkspaceSkeleton create() {
+ return new WorkspaceSkeleton();
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteProgress>(SiteProgress.class) {
+ @Override
+ public SiteProgress create() {
+ final SiteProgressPresenter presenter = new SiteProgressPresenter();
+ final SiteProgressPanel panel = new SiteProgressPanel(presenter, $$(SitePublicSpaceLink.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<Site>(Site.class) {
+ @Override
+ public Site create() {
+ return new Site($(I18nUITranslationService.class), $(SiteProgress.class), $$(SiteToastMessage.class),
+ $$(WorkspaceSkeleton.class));
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
+ @Override
+ public SitePublicSpaceLink create() {
+ final SitePublicSpaceLinkPresenter presenter = new SitePublicSpaceLinkPresenter($(StateManager.class));
+ final SitePublicSpaceLinkPanel panel = new SitePublicSpaceLinkPanel(presenter,
+ $(WorkspaceSkeleton.class), $(I18nUITranslationService.class), $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(NoDecoration.class, new Factory<SiteToastMessage>(SiteToastMessage.class) {
+ @Override
+ public SiteToastMessage create() {
+ final SiteToastMessagePresenter presenter = new SiteToastMessagePresenter();
+ final SiteToastMessagePanel panel = new SiteToastMessagePanel();
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteUserMenu>(SiteUserMenu.class) {
+ @Override
+ public SiteUserMenu create() {
+ final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter($(Session.class),
+ $(StateManager.class), $$(EntityOptions.class), $$(FileDownloadUtils.class));
+ final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nUITranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteSignInLink>(SiteSignInLink.class) {
+ @Override
+ public SiteSignInLink create() {
+ final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter($(Session.class));
+ final SiteSignInLinkPanel panel = new SiteSignInLinkPanel(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteSignOutLink>(SiteSignOutLink.class) {
+ @Override
+ public SiteSignOutLink create() {
+ final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter($(Session.class),
+ $$(UserServiceAsync.class), $$(KuneErrorHandler.class));
+ final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteNewGroupLink>(SiteNewGroupLink.class) {
+ @Override
+ public SiteNewGroupLink create() {
+ final SiteNewGroupLinkPresenter presenter = new SiteNewGroupLinkPresenter();
+ final SiteNewGroupLinkPanel panel = new SiteNewGroupLinkPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nUITranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteOptions>(SiteOptions.class) {
+ @Override
+ public SiteOptions create() {
+ final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
+ final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nUITranslationService.class), $$(I18nTranslator.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteSearch>(SiteSearch.class) {
+ @Override
+ public SiteSearch create() {
+ final SiteSearchPresenter presenter = new SiteSearchPresenter($$(SiteSearcher.class),
+ $(I18nTranslationService.class));
+ final SiteSearchPanel panel = new SiteSearchPanel(presenter, $(WorkspaceSkeleton.class),
+ $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<SiteLogo>(SiteLogo.class) {
+ @Override
+ public SiteLogo create() {
+ final SiteLogoPresenter presenter = new SiteLogoPresenter($(Session.class));
+ final SiteLogoPanel panel = new SiteLogoPanel(presenter, $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<EntityHeader>(EntityHeader.class) {
+ @Override
+ public EntityHeader create() {
+ final EntityHeaderPresenter presenter = new EntityHeaderPresenter($(StateManager.class),
+ $(WsThemePresenter.class), $(Session.class));
+ final EntityHeaderPanel panel = new EntityHeaderPanel($(WorkspaceSkeleton.class),
+ $$(FileDownloadUtils.class), $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
+ @Override
+ public WsThemePresenter create() {
+ final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $$(GroupServiceAsync.class),
+ $(StateManager.class));
+ final WsThemePanel panel = new WsThemePanel($(WorkspaceSkeleton.class), presenter,
+ $(I18nUITranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<EntityTitle>(EntityTitle.class) {
+ @Override
+ public EntityTitle create() {
+ final EntityTitlePresenter presenter = new EntityTitlePresenter($(StateManager.class),
+ $(Session.class), $(ContentIconsRegistry.class), $(RenamableRegistry.class),
+ $(RenameAction.class));
+ final EntityTitlePanel panel = new EntityTitlePanel($(WorkspaceSkeleton.class), presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<EntitySubTitle>(EntitySubTitle.class) {
+ @Override
+ public EntitySubTitle create() {
+ final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(
+ $(I18nUITranslationService.class), $(StateManager.class), false, $(AuthorableRegistry.class));
+ final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
+ @Override
+ public EntityLicensePresenter create() {
+ final EntityLicensePresenter presenter = new EntityLicensePresenter($(StateManager.class));
+ final EntityLicensePanel panel = new EntityLicensePanel(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<RateIt>(RateIt.class) {
+ @Override
+ public RateIt create() {
+ final RateItPresenter presenter = new RateItPresenter($(I18nUITranslationService.class),
+ $(Session.class), $$(ContentServiceAsync.class), $(StateManager.class),
+ $$(RatePresenter.class), $(ContentCapabilitiesRegistry.class));
+ final RateItPanel panel = new RateItPanel(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class), $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<RatePresenter>(RatePresenter.class) {
+ @Override
+ public RatePresenter create() {
+ final RatePresenter presenter = new RatePresenter($(StateManager.class),
+ $(ContentCapabilitiesRegistry.class));
+ final RatePanel panel = new RatePanel(null, null, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<ActionManager>(ActionManager.class) {
+ @Override
+ public ActionManager create() {
+ return new ActionManager($(WorkspaceSkeleton.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
+ @Override
+ public ActionGroupSummaryToolbar create() {
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
+ $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionGroupSummaryToolbarPresenter toolbar = new ActionGroupSummaryToolbarPresenter(panel);
+ return toolbar;
+ }
+ }, new Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class) {
+ @Override
+ public ActionParticipationToolbar create() {
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
+ $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionParticipationSummaryToolbarPresenter toolbar = new ActionParticipationSummaryToolbarPresenter(
+ panel);
+ return toolbar;
+ }
+ }, new Factory<ActionBuddiesSummaryToolbar>(ActionBuddiesSummaryToolbar.class) {
+ @Override
+ public ActionBuddiesSummaryToolbar create() {
+ final ActionToolbarPanel<UserSimpleDTO> panel = new ActionToolbarPanel<UserSimpleDTO>(
+ $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionBuddiesSummaryToolbarPresenter toolbar = new ActionBuddiesSummaryToolbarPresenter(panel);
+ return toolbar;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<GroupMembersSummary>(GroupMembersSummary.class) {
+ @Override
+ public GroupMembersSummary create() {
+ final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(
+ $(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
+ $(Session.class), $$(SocialNetworkServiceAsync.class), $$(GroupServiceAsync.class),
+ $$(GroupLiveSearcher.class), $(WsThemePresenter.class), $$(ChatEngine.class),
+ $(GroupActionRegistry.class), $(ActionGroupSummaryToolbar.class), $$(FileDownloadUtils.class));
+ final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $(
+ ActionGroupSummaryToolbar.class).getView());
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<GroupSummary>(GroupSummary.class) {
+ @Override
+ public GroupSummary create() {
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
+ final GroupSummaryView view = new GroupSummaryPanel($(Images.class), presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<AddAsBuddie>(AddAsBuddie.class) {
+ @Override
+ public AddAsBuddie create() {
+ final AddAsBuddiePresenter presenter = new AddAsBuddiePresenter($$(ChatEngine.class),
+ $(StateManager.class), $(Session.class));
+ final AddAsBuddiePanel panel = new AddAsBuddiePanel(presenter, $(EntityHeader.class), $(Images.class),
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<BuddiesSummary>(BuddiesSummary.class) {
+ @Override
+ public BuddiesSummary create() {
+ final BuddiesSummaryPresenter presenter = new BuddiesSummaryPresenter($(StateManager.class),
+ $(Session.class), $$(UserServiceAsync.class), $(UserActionRegistry.class),
+ $(I18nTranslationService.class), $$(ChatEngine.class), $(ActionBuddiesSummaryToolbar.class),
+ $$(FileDownloadUtils.class), $(ImageUtils.class), $$(SocialNetworkServiceAsync.class),
+ $(GroupActionRegistry.class));
+ final BuddiesSummaryPanel panel = new BuddiesSummaryPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class), $(ActionManager.class),
+ $(ActionBuddiesSummaryToolbar.class).getView());
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<ParticipationSummary>(ParticipationSummary.class) {
+ @Override
+ public ParticipationSummary create() {
+ final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(
+ $(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
+ $(Session.class), $$(SocialNetworkServiceAsync.class), $(WsThemePresenter.class),
+ $(GroupActionRegistry.class), $(ActionParticipationToolbar.class), $$(FileDownloadUtils.class));
+ final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
+ ($(ActionParticipationToolbar.class).getView()));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<TagsSummary>(TagsSummary.class) {
+ @Override
+ public TagsSummary create() {
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
+ $$(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
+ final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<NoHomePage>(NoHomePage.class) {
+ @Override
+ public NoHomePage create() {
+ final NoHomePagePresenter presenter = new NoHomePagePresenter($(StateManager.class),
+ $$(EntityHeader.class));
+ final NoHomePagePanel panel = new NoHomePagePanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(ApplicationComponentGroup.class, new Factory<EntityOptions>(EntityOptions.class) {
+ @Override
+ public EntityOptions create() {
+ final EntityOptionsPresenter presenter = new EntityOptionsPresenter($(StateManager.class));
+ final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, $(EntityHeader.class),
+ $(I18nTranslationService.class), $(Images.class), $(EntityOptionsGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(EntityOptionsGroup.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
+ @Override
+ public EntityOptionsToolsConf create() {
+ final EntityOptionsToolsConfPresenter presenter = new EntityOptionsToolsConfPresenter(
+ $(StateManager.class), $(Session.class), $(I18nTranslationService.class),
+ $(EntityOptions.class), $$(GroupServiceAsync.class));
+ final EntityOptionsToolsConfPanel panel = new EntityOptionsToolsConfPanel(presenter,
+ $(WorkspaceSkeleton.class), $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(EntityOptionsGroup.class, new Factory<EntityOptionsLogo>(EntityOptionsLogo.class) {
+ @Override
+ public EntityOptionsLogo create() {
+ final EntityOptionsLogoPresenter presenter = new EntityOptionsLogoPresenter($(Session.class),
+ $(EntityHeader.class), $(EntityOptions.class), $(StateManager.class),
+ $$(UserServiceAsync.class), $$(ChatEngine.class));
+ final EntityOptionsLogoPanel panel = new EntityOptionsLogoPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(EntityOptionsGroup.class, new Factory<EntityOptionsDefLicense>(EntityOptionsDefLicense.class) {
+ @Override
+ public EntityOptionsDefLicense create() {
+ final EntityOptionsDefLicensePresenter presenter = new EntityOptionsDefLicensePresenter(
+ $(EntityOptions.class), $(StateManager.class), $(Session.class), $$(LicenseWizard.class),
+ $$(LicenseChangeAction.class));
+ final EntityOptionsDefLicensePanel panel = new EntityOptionsDefLicensePanel(presenter,
+ $(WorkspaceSkeleton.class), $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(EntityOptionsGroup.class,
+ new Factory<EntityOptionsPublicSpaceConf>(EntityOptionsPublicSpaceConf.class) {
+ @Override
+ public EntityOptionsPublicSpaceConf create() {
+ final EntityOptionsPublicSpaceConfPresenter presenter = new EntityOptionsPublicSpaceConfPresenter(
+ $(EntityOptions.class));
+ final EntityOptionsPublicSpaceConfPanel panel = new EntityOptionsPublicSpaceConfPanel(
+ presenter, $(WorkspaceSkeleton.class), $(I18nTranslationService.class),
+ $(WsThemePresenter.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseChangeAction>(LicenseChangeAction.class) {
+ @Override
+ public LicenseChangeAction create() {
+ return new LicenseChangeAction($$(GroupServiceAsync.class), $(Session.class),
+ $(I18nTranslationService.class), $(StateManager.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<RenameAction>(RenameAction.class) {
+ @Override
+ public RenameAction create() {
+ return new RenameAction($(I18nTranslationService.class), $(Session.class),
+ $$(ContentServiceAsync.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseWizard>(LicenseWizard.class) {
+ @Override
+ public LicenseWizard create() {
+ final LicenseWizardPresenter presenter = new LicenseWizardPresenter(
+ $(LicenseWizardFirstFormView.class), $(LicenseWizardSndFormView.class),
+ $(LicenseWizardTrdFormView.class), $(LicenseWizardFrdFormView.class), $(Session.class));
+ final LicenseWizardPanel panel = new LicenseWizardPanel(presenter, $(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseWizardFirstFormView>(LicenseWizardFirstFormView.class) {
+ @Override
+ public LicenseWizardFirstFormView create() {
+ return new LicenseWizardFirstForm($(I18nTranslationService.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseWizardSndFormView>(LicenseWizardSndFormView.class) {
+ @Override
+ public LicenseWizardSndFormView create() {
+ return new LicenseWizardSndForm($(I18nTranslationService.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseWizardTrdFormView>(LicenseWizardTrdFormView.class) {
+ @Override
+ public LicenseWizardTrdFormView create() {
+ return new LicenseWizardTrdForm($(Images.class), $(I18nTranslationService.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<LicenseWizardFrdFormView>(LicenseWizardFrdFormView.class) {
+ @Override
+ public LicenseWizardFrdFormView create() {
+ return new LicenseWizardFrdForm($(I18nTranslationService.class), $(Session.class));
+ }
+ });
+
+ register(Singleton.class, new Factory<FileUploader>(FileUploader.class) {
+ @Override
+ public FileUploader create() {
+ final FileUploaderPresenter presenter = new FileUploaderPresenter($(Session.class));
+ final FileUploaderDialog panel = new FileUploaderDialog(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(panel);
+ return presenter;
+ }
+
+ @Override
+ public void onAfterCreated(FileUploader uploader) {
+ $(ContextNavigator.class).addFileUploaderListener(uploader);
+ }
+ });
+
+ register(Singleton.class, new Factory<SiteSearcher>(SiteSearcher.class) {
+ @Override
+ public SiteSearcher create() {
+ final SiteSearcherPresenter presenter = new SiteSearcherPresenter($$(StateManager.class));
+ final SiteSearcherView view = new SiteSearcherPanel(presenter, $(I18nTranslationService.class),
+ $(WorkspaceSkeleton.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<I18nTranslator>(I18nTranslator.class) {
+ @Override
+ public I18nTranslator create() {
+ final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter($(Session.class),
+ $(I18nServiceAsync.class), $(I18nUITranslationService.class));
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, $(I18nTranslationService.class),
+ $(LanguageSelector.class), $(WorkspaceSkeleton.class), $(Images.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<SignIn>(SignIn.class) {
+ @Override
+ public SignIn create() {
+ final SignInPresenter presenter = new SignInPresenter($(Session.class), $(StateManager.class),
+ $(I18nUITranslationService.class), $$(UserServiceAsync.class), $$(Register.class));
+ final SignInView panel = new SignInPanel(presenter, $(I18nTranslationService.class),
+ $(WorkspaceSkeleton.class), $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<Register>(Register.class) {
+ @Override
+ public Register create() {
+ final RegisterPresenter presenter = new RegisterPresenter($(Session.class), $(StateManager.class),
+ $(I18nUITranslationService.class), $$(UserServiceAsync.class), $$(SignIn.class));
+ final RegisterView panel = new RegisterPanel(presenter, $(I18nTranslationService.class),
+ $(WorkspaceSkeleton.class), $(Session.class), $(Images.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<NewGroup>(NewGroup.class) {
+ @Override
+ public NewGroup create() {
+ final NewGroupPresenter presenter = new NewGroupPresenter($(I18nTranslationService.class),
+ $(Session.class), $(StateManager.class), $$(GroupServiceAsync.class));
+ final NewGroupPanel view = new NewGroupPanel(presenter, $(I18nTranslationService.class),
+ $$(LicenseWizard.class), $(Images.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<UserLiveSearcher>(UserLiveSearcher.class) {
+ @Override
+ public UserLiveSearcher create() {
+ final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter();
+ final EntityLiveSearcherView view = new UserLiveSearcherPanel(presenter,
+ $(I18nTranslationService.class), $(FileDownloadUtils.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<GroupLiveSearcher>(GroupLiveSearcher.class) {
+ @Override
+ public GroupLiveSearcher create() {
+ final GroupLiveSearcherPresenter presenter = new GroupLiveSearcherPresenter();
+ final EntityLiveSearcherView view = new GroupLiveSearchPanel(presenter,
+ $(I18nTranslationService.class), $(FileDownloadUtils.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<ToolSelector>(ToolSelector.class) {
+ @Override
+ public ToolSelector create() {
+ final ToolSelectorPresenter presenter = new ToolSelectorPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<TextEditorInsertElement>(TextEditorInsertElement.class) {
+ @Override
+ public TextEditorInsertElement create() {
+ final TextEditorInsertElementPresenter presenter = new TextEditorInsertElementPresenter();
+ final TextEditorInsertElementPanel panel = new TextEditorInsertElementPanel(presenter,
+ $(WorkspaceSkeleton.class), $(Images.class), $(I18nTranslationService.class),
+ $(TextEditorInsertElementGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkLocal>(
+ TextEditorInsertLinkLocal.class) {
+ @Override
+ public TextEditorInsertLinkLocal create() {
+ final TextEditorInsertLinkLocalPresenter presenter = new TextEditorInsertLinkLocalPresenter(
+ $(TextEditorInsertElement.class));
+ final TextEditorInsertLinkLocalPanel panel = new TextEditorInsertLinkLocalPanel(presenter,
+ $(WorkspaceSkeleton.class), $(I18nTranslationService.class), $(FileDownloadUtils.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(TextEditorInsertElementGroup.class,
+ new Factory<TextEditorInsertLinkExt>(TextEditorInsertLinkExt.class) {
+ @Override
+ public TextEditorInsertLinkExt create() {
+ final TextEditorInsertLinkExtPresenter presenter = new TextEditorInsertLinkExtPresenter(
+ $(TextEditorInsertElement.class));
+ final TextEditorInsertLinkExtView panel = new TextEditorInsertLinkExtPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkEmail>(
+ TextEditorInsertLinkEmail.class) {
+ @Override
+ public TextEditorInsertLinkEmail create() {
+ final TextEditorInsertLinkEmailPresenter presenter = new TextEditorInsertLinkEmailPresenter(
+ $(TextEditorInsertElement.class));
+ final TextEditorInsertLinkEmailPanel panel = new TextEditorInsertLinkEmailPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<TextEditor>(TextEditor.class) {
+ @Override
+ public TextEditor create() {
+ final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
+ ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
+ contentNavigatorToolbar);
+
+ final TextEditorPresenter presenter = new TextEditorPresenter(true, toolbar,
+ $(I18nUITranslationService.class), $(StateManager.class), $(SiteSignOutLink.class),
+ $(DeferredCommandWrapper.class));
+ final TextEditorPanel panel = new TextEditorPanel(presenter, $(I18nTranslationService.class),
+ $(WorkspaceSkeleton.class), $(ColorWebSafePalette.class), $(TextEditorInsertElement.class),
+ false);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<LanguageSelector>(LanguageSelector.class) {
+ @Override
+ public LanguageSelector create() {
+ final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter($(Session.class));
+ final LanguageSelectorView view = new LanguageSelectorPanel(presenter, $(I18nTranslationService.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ // Register of tokens like "signin", "newgroup", "translate" etcetera
+ $(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Listener0() {
+ public void onEvent() {
+ $(SignIn.class).doSignIn();
+ }
+ });
+
+ $(StateManager.class).addSiteToken(SiteToken.register.toString(), new Listener0() {
+ public void onEvent() {
+ $(Register.class).doRegister();
+ }
+ });
+
+ $(StateManager.class).addSiteToken(SiteToken.newgroup.toString(), new Listener0() {
+ public void onEvent() {
+ $(NewGroup.class).doNewGroup();
+ }
+ });
+
+ $(StateManager.class).addSiteToken(SiteToken.translate.toString(), new Listener0() {
+ public void onEvent() {
+ $(I18nTranslator.class).doShowTranslator();
+ }
+ });
+
+ register(NoDecoration.class, new Factory<ActionContentToolbar>(ActionContentToolbar.class) {
+ @Override
+ public ActionContentToolbar create() {
+ final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
+ ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(contentNavigatorToolbar);
+ return toolbar;
+ }
+ });
+
+ register(NoDecoration.class, new Factory<ActionContextToolbar>(ActionContextToolbar.class) {
+ @Override
+ public ActionContextToolbar create() {
+ final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
+ ActionCntCtxToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionContextToolbar toolbar = new ActionContextToolbarPresenter(contentNavigatorToolbar);
+ return toolbar;
+ }
+ });
+
+ register(Singleton.class, new Factory<ContextNavigator>(ContextNavigator.class) {
+ @Override
+ public ContextNavigator create() {
+ final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
+ $(Session.class), $(I18nTranslationService.class), $(ContentIconsRegistry.class),
+ $(ContentCapabilitiesRegistry.class), $(ActionContextToolbar.class),
+ $(ContextActionRegistry.class), $$(FileDownloadUtils.class), true, $(RenameAction.class));
+ final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter,
+ $(I18nTranslationService.class), $(WorkspaceSkeleton.class), $(ActionManager.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<ContextPropEditor>(ContextPropEditor.class) {
+ @Override
+ public ContextPropEditor create() {
+ final ContextPropEditorPresenter presenter = new ContextPropEditorPresenter($(Session.class),
+ $(StateManager.class), $(ContentCapabilitiesRegistry.class), $$(TagsSummary.class),
+ $$(ContentServiceAsync.class), $(EntitySubTitle.class));
+ final ContextPropEditorView view = new ContextPropEditorPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $$(LanguageSelector.class),
+ $(Images.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -39,13 +39,13 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
import org.ourproject.kune.platf.client.ui.upload.FileUploader;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.title.RenameAction;
import com.calclab.suco.client.events.Listener;
@@ -58,7 +58,7 @@
private ContextNavigatorView view;
private final StateManager stateManager;
private final Session session;
- private final I18nUITranslationService i18n;
+ private final I18nTranslationService i18n;
private final HashMap<StateToken, ActionItemCollection<StateToken>> actionsByItem;
private boolean editOnNextStateChange;
private final ContentIconsRegistry contentIconsRegistry;
@@ -70,7 +70,7 @@
private final RenameAction renameAction;
public ContextNavigatorPresenter(final StateManager stateManager, final Session session,
- final I18nUITranslationService i18n, final ContentIconsRegistry contentIconsRegistry,
+ final I18nTranslationService i18n, final ContentIconsRegistry contentIconsRegistry,
ContentCapabilitiesRegistry capabilitiesRegistry, final ActionToolbar<StateToken> toolbar,
final ActionRegistry<StateToken> actionRegistry, Provider<FileDownloadUtils> downloadUtilsProvider,
boolean useGenericImageIcon, RenameAction renameAction) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,9 +28,9 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener;
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListener.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,27 +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.i18n;
-
-import com.google.gwt.user.client.EventListener;
-
-public interface I18nChangeListener extends EventListener {
-
- void onI18nLanguageChange();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nChangeListenerCollection.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,44 +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.i18n;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * A helper class for implementers of the SourcesI18nChangeEvents interface.
- * This subclass of {@link ArrayList} assumes that all objects added to it will
- * be of type {@link com.google.gwt.user.client.ui.I18nChangeListener}.
- */
-public class I18nChangeListenerCollection extends ArrayList<I18nChangeListener> {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Fires a locale change event to all listeners.
- *
- */
- public void fireI18nLanguageChange() {
- for (Iterator<I18nChangeListener> it = iterator(); it.hasNext();) {
- I18nChangeListener listener = it.next();
- listener.onI18nLanguageChange();
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -22,6 +22,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.site.Site;
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,227 +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.i18n;
-
-import java.util.Date;
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.Location;
-import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener0;
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class I18nUITranslationService extends I18nTranslationService {
- private HashMap<String, String> lexicon;
- private String currentLanguageCode;
- private I18nChangeListenerCollection i18nChangeListeners;
- private I18nLanguageDTO currentLang;
- private I18nServiceAsync i18nService;
- private Session session;
-
- /*
- * If a UI element need to be fired when (for instance) the language changes
- * use this. Useful if you widget have to take in account text language
- * direction, for instance.
- */
- public void addI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners == null) {
- i18nChangeListeners = new I18nChangeListenerCollection();
- }
- i18nChangeListeners.add(listener);
- }
-
- public void changeCurrentLanguage(final String newLanguage) {
- if (!newLanguage.equals(this.currentLanguageCode)) {
- setCurrentLanguage(newLanguage);
- changeLocale(newLanguage);
- }
- }
-
- public String formatDateWithLocale(final Date date) {
- String dateFormat = currentLang.getDateFormat();
- final DateTimeFormat fmt;
- if (dateFormat == null) {
- fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
- } else {
- String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(date);
- String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
- dateFormat = dateFormat.replaceFirst("MMM", "'" + t(monthToTranslate) + "'");
- fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
- }
- String dateFormated = fmt.format(date);
- return dateFormated;
- }
-
- public String getCurrentLanguage() {
- return currentLanguageCode;
- }
-
- public HashMap<String, String> getLexicon() {
- return lexicon;
- }
-
- public void init(final I18nServiceAsync i18nService, final Session session, final Listener0 onReady) {
- this.i18nService = i18nService;
- this.session = session;
- final Location loc = WindowUtils.getLocation();
- final String locale = loc.getParameter("locale");
- i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
- public void onFailure(final Throwable caught) {
- Log.error("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final I18nLanguageDTO result) {
- currentLang = result;
- currentLanguageCode = currentLang.getCode();
- session.setCurrentLanguage(currentLang);
- i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
- public void onFailure(final Throwable caught) {
- Log.error("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final HashMap<String, String> result) {
- lexicon = result;
- onReady.onEvent();
- }
- });
- }
- });
- }
-
- public void removeI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.remove(listener);
- }
- }
-
- public void setCurrentLanguage(final String newLanguage) {
- this.currentLanguageCode = newLanguage;
- }
-
- public void setLexicon(final HashMap<String, String> lexicon) {
- this.lexicon = lexicon;
- fireI18nLanguageChange();
- }
-
- public void setTranslationAfterSave(final String text, final String translation) {
- lexicon.put(text, translation);
- fireI18nLanguageChange();
- }
-
- /**
- * In production, this method uses a hashmap. In development, if the text is
- * not in the hashmap, it makes a server petition (that stores the text
- * pending for translation in db).
- *
- * Warning: text is escaped as html before insert in the db. Don't use html
- * here (o user this method with params).
- *
- * @param text
- * @return text translated in the current language
- */
- @Override
- public String t(final String text) {
- final String encodeText = TextUtils.escapeHtmlLight(text);
- String translation = lexicon.get(encodeText);
- if (lexicon.containsKey(encodeText)) {
- if (translation == UNTRANSLATED_VALUE) {
- // Not translated but in db, return text
- translation = removeNT(encodeText);
- }
- } else {
- // Not translated and not in db, make a petition for translation
- if (session.isLogged()) {
- i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
- new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- }
-
- public void onSuccess(final String result) {
- }
- });
- Log.debug("Registering in db '" + text + "' as pending translation");
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
- }
- translation = removeNT(encodeText);
- }
- return decodeHtml(translation);
- }
-
- /**
- *
- * See in:
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread
- * /5e4e25050d3be984/7035ec39354d06aa?lnk=gst&q=get+locale&rnum=23
- *
- * JSNI method to change the locale of the application - it effectively
- * parses the existing URL and creates a new one for the chosen locale.
- *
- * It additionally launches any JavaScript debugger that might be attached
- * to the system (Windows only). To disable this functionality just remove
- * the "debugger" line.
- *
- * @param newLocale
- * String value of the new locale to go to.
- */
- private native void changeLocale(String newLocale)
- /*-{
- // Uncomment the "debugger;" line to see how to set debug statements in JSNI code
- // When in web mode, if your browser has a JavaScript debugger attached, it will
- // launch at this point in the code (when the user changes locale through the menu system).
- // debugger;
-
- // Get the current location
- var currLocation = $wnd.location.toString();
- // Get rid of any GWT History tokens that might be present
- var noHistoryCurrLocArray = currLocation.split("#");
- var noHistoryCurrLoc = noHistoryCurrLocArray[0];
- var currHistory = noHistoryCurrLocArray[1];
- // Get rid of any locale string
- var locArray = noHistoryCurrLoc.split("?");
- // Build the new href location and then send the browser there.
- // $wnd.location.href = locArray[0]+"?locale="+newLocale+"#"+currHistory;
- $wnd.location.href = locArray[0]+"?locale="+newLocale
-
- // extjs part:
- // commented because the error: "Ext is not defined"
- // we have to try other way
- // var head = document.getElementsByTagName("head")[0];
- // var script = document.createElement('script');
- // script.id = 'localScript';
- // script.type = 'text/javascript';
- // script.src = "js/ext/locale/ext-lang-"+newLocale+".js";
- // head.appendChild(script);
- }-*/;
-
- private void fireI18nLanguageChange() {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.fireI18nLanguageChange();
- }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,6 +20,7 @@
package org.ourproject.kune.workspace.client.newgroup;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.KuneWindowUtils;
@@ -27,7 +28,6 @@
import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
import com.calclab.suco.client.events.Listener;
@@ -82,11 +82,11 @@
private TextField tags;
private final MessageToolbar messageErrorBar;
private final Provider<LicenseWizard> licenseWizard;
- private final I18nUITranslationService i18n;
+ private final I18nTranslationService i18n;
private Image licenseImage;
private LicenseDTO license;
- public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n,
+ public NewGroupPanel(final NewGroupPresenter presenter, final I18nTranslationService i18n,
final Provider<LicenseWizard> licenseWizard, Images img) {
super(NEWGROUP_WIZARD, WorkspaceMessages.REGISTER_A_NEW_GROUP_TITLE, true, true, 450, 430, "k-newgroup-icon",
i18n.t("Cancel"), CANCEL_BUTTON, i18n.t("Register"), REGISTER_BUTTON, new Listener0() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -23,12 +23,12 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.options.EntityOptions;
import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,10 +19,10 @@
\*/
package org.ourproject.kune.workspace.client.signin;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
import org.ourproject.kune.workspace.client.WorkspaceMessages;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
@@ -59,9 +59,9 @@
private final ComboBox timezoneCombo;
private final Radio wantPersonalHomePage;
private final Radio noPersonalHomePage;
- private final I18nUITranslationService i18n;
+ private final I18nTranslationService i18n;
- public RegisterForm(final I18nUITranslationService i18n, Session session) {
+ public RegisterForm(final I18nTranslationService i18n, Session session) {
this.i18n = i18n;
super.addStyleName("kune-Margin-Large-l");
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,11 +20,11 @@
package org.ourproject.kune.workspace.client.signin;
import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.dialogs.InfoDialog;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener0;
@@ -47,7 +47,7 @@
public static final String WELCOME_DIALOG = "k-regp-wdiag";
public static final String REGISTER_DIALOG = "k-regp-dialog";
- public RegisterPanel(final RegisterPresenter presenter, I18nUITranslationService i18n, final WorkspaceSkeleton ws,
+ public RegisterPanel(final RegisterPresenter presenter, I18nTranslationService i18n, final WorkspaceSkeleton ws,
Session session, Images images) {
super(REGISTER_DIALOG, i18n, i18n.t(PlatfMessages.REGISTER_TITLE), true, true, 390, 450, "",
i18n.t(PlatfMessages.REGISTER_TITLE), REGISTER_BUTTON_ID, i18n.tWithNT("Cancel", "used in button"),
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,12 +28,12 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
import com.calclab.emiteuimodule.client.SubscriptionMode;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -21,13 +21,12 @@
import java.util.Date;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialogExtended;
import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
-import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.events.Listener0;
import com.google.gwt.core.client.GWT;
@@ -36,10 +35,10 @@
public abstract class SignInAbstractPanel extends BasicDialogExtended {
- protected final I18nUITranslationService i18n;
+ protected final I18nTranslationService i18n;
private final MessageToolbar messageErrorBar;
- public SignInAbstractPanel(String dialogId, I18nUITranslationService i18n, String title, boolean modal,
+ public SignInAbstractPanel(String dialogId, I18nTranslationService i18n, String title, boolean modal,
boolean autoscroll, int width, int heigth, String icon, String firstButtonTitle, String cancelButtonTitle,
Listener0 onFirstButtonClick, Listener0 onCancelButtonClick, Images images, String errorLabelId,
int tabIndexStart) {
@@ -48,7 +47,7 @@
tabIndexStart);
}
- public SignInAbstractPanel(String dialogId, I18nUITranslationService i18n, final String title, final boolean modal,
+ public SignInAbstractPanel(String dialogId, I18nTranslationService i18n, final String title, final boolean modal,
final boolean autoscroll, final int width, final int heigth, final String icon,
final String firstButtonTitle, final String firstButtonId, final String cancelButtonTitle,
final String cancelButtonId, final Listener0 onFirstButtonClick, final Listener0 onCancelButtonClick,
@@ -80,7 +79,7 @@
// http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
final long duration = Session.SESSION_DURATION;
final Date expires = new Date(System.currentTimeMillis() + duration);
- Cookies.setCookie(Site.USERHASH, userHash, expires, null, "/", false);
+ Cookies.setCookie(Session.USERHASH, userHash, expires, null, "/", false);
GWT.log("Received hash: " + userHash, null);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInAbstractPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -21,9 +21,9 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
public class SignInAbstractPresenter {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,9 +20,9 @@
package org.ourproject.kune.workspace.client.signin;
import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener0;
@@ -45,7 +45,7 @@
static SignInForm signInForm;
private final SignInPresenter presenter;
- public SignInPanel(final SignInPresenter presenter, I18nUITranslationService i18n, final WorkspaceSkeleton ws,
+ public SignInPanel(final SignInPresenter presenter, I18nTranslationService i18n, final WorkspaceSkeleton ws,
Images images) {
super(SIGNIN_DIALOG, i18n, i18n.t(PlatfMessages.SIGN_IN_TITLE), true, true, 340, 240, "",
i18n.t(PlatfMessages.SIGN_IN_TITLE), SIGN_IN_BUTTON_ID, i18n.tWithNT("Cancel", "used in button"),
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -24,13 +24,13 @@
import org.ourproject.kune.platf.client.dto.UserDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.UserAuthException;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.SiteToken;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.ioc.Provider;
@@ -100,7 +100,7 @@
SiteErrorType.error);
} catch (final Throwable e) {
view.setErrorMessage("Error in login", SiteErrorType.error);
- Log.error("Other kind of exception in LoginFormPresenter/doLogin");
+ Log.error("Other kind of exception in SignInPresenter/doLogin");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -20,19 +20,20 @@
package org.ourproject.kune.workspace.client.site;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.ioc.Provider;
public class Site {
- public static final String USERHASH = "userHash";
public static final String IN_DEVELOPMENT = " (in development)";
private static I18nTranslationService i18n;
private static SiteProgress progress;
private static Provider<SiteToastMessage> siteMessageProvider;
+ private static Provider<WorkspaceSkeleton> ws;
public static void error(final String value) {
getSiteMessage().showMessage(i18n.t("Error"), value, SiteErrorType.error);
@@ -50,6 +51,10 @@
getSiteMessage().showMessage(i18n.t("Info"), value, SiteErrorType.info);
}
+ public static void showAlertMessage(String title, String message) {
+ ws.get().showAlertMessage(title, message);
+ }
+
public static void showProgress(final String text) {
progress.showProgress(text);
}
@@ -79,10 +84,10 @@
}
public Site(final I18nUITranslationService i18n, final SiteProgress progress,
- final Provider<SiteToastMessage> siteMessageProvider) {
+ final Provider<SiteToastMessage> siteMessageProvider, Provider<WorkspaceSkeleton> ws) {
Site.i18n = i18n;
Site.progress = progress;
Site.siteMessageProvider = siteMessageProvider;
+ Site.ws = ws;
}
-
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserService.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,46 +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.rpc;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
-import org.ourproject.kune.platf.client.dto.UserDTO;
-import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.errors.DefaultException;
-
-import com.google.gwt.user.client.rpc.RemoteService;
-
-public interface UserService extends RemoteService {
-
- UserInfoDTO createUser(UserDTO user, boolean wantPersonalHomepage) throws DefaultException;
-
- String getUserAvatarBaser64(String userHash, StateToken userToken) throws DefaultException;
-
- UserInfoDTO login(String nickOrEmail, String passwd) throws DefaultException;
-
- void logout(String userHash) throws DefaultException;
-
- void onlyCheckSession(String userHash) throws DefaultException;
-
- UserInfoDTO reloadUserInfo(String userHash) throws DefaultException;
-
- void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/rpc/UserServiceAsync.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,46 +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.rpc;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.dto.UserBuddiesVisibilityDTO;
-import org.ourproject.kune.platf.client.dto.UserDTO;
-import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public interface UserServiceAsync {
-
- void createUser(UserDTO user, boolean wantPersonalHomepage, AsyncCallback<UserInfoDTO> asyncCallback);
-
- void getUserAvatarBaser64(String userHash, StateToken userToken, AsyncCallback<?> asyncCallback);
-
- void login(String nickOrEmail, String passwd, AsyncCallback<UserInfoDTO> asyncCallback);
-
- void logout(String userHash, AsyncCallback<?> asyncCallback);
-
- void onlyCheckSession(String userHash, AsyncCallback<?> asyncCallback);
-
- void reloadUserInfo(String userHash, AsyncCallback<UserInfoDTO> asyncCallback);
-
- void setBuddiesVisibility(String userHash, StateToken groupToken, UserBuddiesVisibilityDTO visibility,
- AsyncCallback<?> asyncCallback);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,8 +19,8 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.siteoptions;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,9 +19,9 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitepublic;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitesign;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.sitebar.sitesign;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -27,10 +27,10 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -118,9 +118,9 @@
// issue:
// http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ded8…
// http://code.google.com/p/google-web-toolkit/issues/detail?id=1735&q=removeC…
- Cookies.removeCookie(Site.USERHASH);
+ Cookies.removeCookie(Session.USERHASH);
// Workaround:
- Cookies.setCookie(Site.USERHASH, null, new Date(0), null, "/", false);
+ Cookies.setCookie(Session.USERHASH, null, new Date(0), null, "/", false);
session.setUserHash(null);
session.setCurrentUserInfo(null);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -21,8 +21,8 @@
import org.ourproject.kune.platf.client.PlatfMessages;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -40,13 +40,13 @@
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -25,10 +25,10 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -42,6 +42,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.ImageDescriptor;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
@@ -49,7 +50,6 @@
import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.themes.WsTheme;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -28,12 +28,12 @@
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -19,7 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.themes;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener2;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -26,8 +26,8 @@
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.registry.AuthorableRegistry;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.events.Listener;
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-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -9,7 +9,7 @@
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
@@ -49,7 +49,7 @@
stateManager.onStateChanged(stateChangeListener);
stateManager.onGroupChanged(groupChangeListener);
stateManager.onToolChanged(toolChangeListener);
- new Site(Mockito.mock(I18nUITranslationService.class), Mockito.mock(SiteProgress.class), null);
+ new Site(Mockito.mock(I18nUITranslationService.class), Mockito.mock(SiteProgress.class), null, null);
}
@Test
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/IntegrationTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -1,9 +1,9 @@
package org.ourproject.kune.platf.integration;
import org.ourproject.kune.platf.client.errors.DefaultException;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.properties.DatabaseProperties;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.google.inject.Inject;
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceIntegrationTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceIntegrationTest.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceIntegrationTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -3,8 +3,8 @@
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.ContentService;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.integration.IntegrationTest;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.google.inject.Inject;
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -6,11 +6,11 @@
import org.junit.Test;
import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePanel;
import org.ourproject.kune.workspace.client.signin.RegisterPanel;
import org.ourproject.kune.workspace.client.signin.SignInForm;
import org.ourproject.kune.workspace.client.signin.SignInPanel;
-import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
@@ -97,7 +97,7 @@
public void testSignInAndOutRemovingCookie() throws Exception {
openDefPage();
signIn();
- assertNotNull(selenium.getCookieByName(Site.USERHASH));
+ assertNotNull(selenium.getCookieByName(Session.USERHASH));
verifyLoggedUserShorName("admin");
signOut();
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/site/UserServiceTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -17,6 +17,7 @@
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
+import org.ourproject.kune.platf.client.rpc.UserService;
import org.ourproject.kune.platf.integration.IntegrationTest;
import org.ourproject.kune.platf.integration.IntegrationTestHelper;
import org.ourproject.kune.platf.server.UserSession;
@@ -26,7 +27,6 @@
import org.ourproject.kune.platf.server.properties.DatabaseProperties;
import org.ourproject.kune.platf.server.users.UserInfo;
import org.ourproject.kune.platf.server.users.UserInfoService;
-import org.ourproject.kune.workspace.client.site.rpc.UserService;
import com.calclab.emiteuimodule.client.SubscriptionMode;
import com.google.inject.Inject;
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2009-02-22 16:21:35 UTC (rev 1051)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2009-02-26 01:46:09 UTC (rev 1052)
@@ -7,9 +7,9 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.services.I18nUITranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener0;
1
0
22 Feb '09
Author: vjrj
Date: 2009-02-22 17:21:35 +0100 (Sun, 22 Feb 2009)
New Revision: 1051
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Rate.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManagerTest.java
Log:
Complete - task Content name verifications
Complete - task Add CreatedOn and other Date info to Domain
Complete - task Tags refactorization (Samer recomendations)
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/TODO 2009-02-22 16:21:35 UTC (rev 1051)
@@ -10,10 +10,6 @@
Use org-mode in emacs to easy manage this file
* SHORT-TERM (URGENT)
-** TODO <s> tag refactorization
- [Tag] <-1--m-> [TagUserContent (fecha)] <-m--1-> [Content] ^--m-------1-> [User]
- Think agout wikipedia suggestions:
- http://www.mediawiki.org/wiki/API
** TODO <v> User preferences storing
(See also variables in 'Styling braimstorming')
We need a way to store (in db) User preferences (like emite chat configurations) in a extensible way.
@@ -144,6 +140,9 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** TODO <s> tag UI refactorization
+ Think about wikipedia suggestions:
+ http://www.mediawiki.org/wiki/API
** <s,v> Integrate recommendations/suggestions subsystem
*** Samer suggests to implement a CBR system for suggests :)
http://en.wikipedia.org/wiki/Case-based_reasoning
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -130,8 +130,8 @@
translations = new ArrayList<ContentTranslation>();
authors = new ArrayList<User>();
comments = new HashSet<Comment>();
- this.createdOn = System.currentTimeMillis();
- this.lastRevision = new Revision(this);
+ createdOn = System.currentTimeMillis();
+ lastRevision = new Revision(this);
accessLists = null;
status = ContentStatus.editingInProgress;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Group.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map;
+import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
@@ -106,6 +107,9 @@
@Embedded
private BasicMimeType logoMime;
+ @Basic(optional = false)
+ private final Long createdOn;
+
public Group() {
this(null, null, null, null);
}
@@ -122,6 +126,7 @@
this.defaultLicense = defaultLicense;
this.groupType = type;
this.admissionType = AdmissionType.Moderated;
+ this.createdOn = System.currentTimeMillis();
}
@Override
@@ -184,6 +189,10 @@
return null;
}
+ public Long getCreatedOn() {
+ return createdOn;
+ }
+
public Content getDefaultContent() {
return defaultContent;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Rate.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Rate.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Rate.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.platf.server.domain;
+import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -47,61 +48,69 @@
@Range(min = 0, max = 5)
Double value;
+ @Basic(optional = false)
+ private final Long createdOn;
+
+ public Rate() {
+ this(null, null, null);
+ }
+
public Rate(final User rater, final Content content, final Double value) {
this.rater = rater;
this.content = content;
this.value = value;
+ this.createdOn = System.currentTimeMillis();
}
- public Rate() {
- this(null, null, null);
+ @Finder(query = "SELECT AVG(r.value) FROM Rate r WHERE r.content = :content")
+ public Double calculateRate(@Named("content") final Content content) {
+ return null;
}
- public Long getId() {
- return id;
+ @Finder(query = "SELECT count(*) FROM Rate r WHERE r.content = :content")
+ public Long calculateRateNumberOfUsers(@Named("content") final Content content) {
+ return null;
}
- public void setId(final Long id) {
- this.id = id;
+ @Finder(query = "SELECT r FROM Rate r WHERE r.rater = :user AND r.content = :content")
+ public Rate find(@Named("user") final User user, @Named("content") final Content content) {
+ return null;
}
public Content getContent() {
return content;
}
- public void setContent(final Content content) {
- this.content = content;
+ public Long getCreatedOn() {
+ return createdOn;
}
+ public Long getId() {
+ return id;
+ }
+
public User getRater() {
return rater;
}
- public void setRater(final User rater) {
- this.rater = rater;
- }
-
public Double getValue() {
return value;
}
- public void setValue(final Double value) {
- this.value = value;
+ public void setContent(final Content content) {
+ this.content = content;
}
- @Finder(query = "SELECT r FROM Rate r WHERE r.rater = :user AND r.content = :content")
- public Rate find(@Named("user") final User user, @Named("content") final Content content) {
- return null;
+ public void setId(final Long id) {
+ this.id = id;
}
- @Finder(query = "SELECT AVG(r.value) FROM Rate r WHERE r.content = :content")
- public Double calculateRate(@Named("content") final Content content) {
- return null;
+ public void setRater(final User rater) {
+ this.rater = rater;
}
- @Finder(query = "SELECT count(*) FROM Rate r WHERE r.content = :content")
- public Long calculateRateNumberOfUsers(@Named("content") final Content content) {
- return null;
+ public void setValue(final Double value) {
+ this.value = value;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.platf.server.domain;
+import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -48,12 +49,16 @@
@Column(unique = true)
private String name;
+ @Basic(optional = false)
+ private final Long createdOn;
+
public Tag() {
this(null);
}
public Tag(final String name) {
this.name = name;
+ this.createdOn = System.currentTimeMillis();
}
@Finder(query = "FROM Tag g WHERE g.name = :name")
@@ -61,6 +66,10 @@
return null;
}
+ public Long getCreatedOn() {
+ return createdOn;
+ }
+
public Long getId() {
return id;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -2,6 +2,7 @@
import java.util.List;
+import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
@@ -55,6 +56,9 @@
@ManyToOne(fetch = FetchType.LAZY)
private User user;
+ @Basic(optional = false)
+ private final Long createdOn;
+
public TagUserContent() {
this(null, null, null);
}
@@ -63,6 +67,7 @@
this.tag = tag;
this.user = user;
this.content = content;
+ this.createdOn = System.currentTimeMillis();
}
@Finder(query = "FROM TagUserContent t WHERE t.user = :user AND t.content = :content")
@@ -79,6 +84,10 @@
return content;
}
+ public Long getCreatedOn() {
+ return createdOn;
+ }
+
public Long getId() {
return id;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -22,6 +22,7 @@
import java.util.List;
import java.util.TimeZone;
+import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -104,6 +105,9 @@
private UserBuddiesVisibility buddiesVisibility;
+ @Basic(optional = false)
+ private final Long createdOn;
+
public User() {
this(null, null, null, null, null, null, null);
}
@@ -120,6 +124,7 @@
this.timezone = timezone;
customProperties = new CustomProperties();
buddiesVisibility = UserBuddiesVisibility.anyone;
+ this.createdOn = System.currentTimeMillis();
}
@Finder(query = "from User")
@@ -145,6 +150,10 @@
return country;
}
+ public Long getCreatedOn() {
+ return createdOn;
+ }
+
public CustomProperties getCustomProperties() {
return customProperties;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -43,9 +43,9 @@
public SitePublicSpaceLinkPanel(final SitePublicSpaceLinkPresenter presenter, final WorkspaceSkeleton ws,
final I18nUITranslationService i18n, final Images img) {
publicHP = new HorizontalPanel();
- gotoPublic = new IconLabel(img.anybody(), i18n.t("Public Space"), false);
+ gotoPublic = new IconLabel(img.anybody(), i18n.t("Go to Public Space"), false);
gotoPublic.ensureDebugId(SITE_GOTO_PUBLIC);
- contentNoPublic = new IconLabel(img.anybody(), i18n.t("This is not public"));
+ contentNoPublic = new IconLabel(img.nobody(), i18n.t("Not published"));
contentNoPublic.ensureDebugId(SITE_CONTENT_NO_PUBLIC);
publicHP.add(gotoPublic);
publicHP.add(contentNoPublic);
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -3,14 +3,14 @@
import java.io.File;
import java.io.IOException;
-import org.junit.Test;
+import org.junit.Ignore;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderView;
import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
public class EntityLogoSeleniumTest extends KuneSeleniumTestHelper {
- @Test
+ @Ignore
public void testEntityLogoUpload() throws Exception {
openDefPage();
signIn();
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManagerTest.java 2009-02-20 13:41:17 UTC (rev 1050)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/FileDownloadManagerTest.java 2009-02-22 16:21:35 UTC (rev 1051)
@@ -8,6 +8,7 @@
import javax.servlet.http.HttpServletResponse;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -58,7 +59,7 @@
Mockito.when(content.getTitle()).thenReturn(SOMETITLE);
}
- @Test
+ @Ignore
public void fileWithNoExtensionDownloadTest() throws Exception {
throw new Exception("TODO");
}
1
0
Author: vjrj
Date: 2009-02-20 14:41:17 +0100 (Fri, 20 Feb 2009)
New Revision: 1050
Added:
trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManagerDefault.java
trunk/src/test/java/org/ourproject/kune/platf/server/PersistencePreLoadedDataTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/TagUserContentTest.java
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/TagManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/finders/UserFinderTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
Log:
Complete - task Tags refactorization (Samer recomendations)
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/TODO 2009-02-20 13:41:17 UTC (rev 1050)
@@ -464,3 +464,4 @@
http://toolserver.org/~merphant/wiki2html/
* IDEAS
** <d> Try to find a way dozer maps directly without use getters/setters (less js code and better performance)
+
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -60,6 +60,8 @@
import org.ourproject.kune.platf.server.manager.RateManager;
import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
import org.ourproject.kune.platf.server.manager.TagManager;
+import org.ourproject.kune.platf.server.manager.TagUserContentManager;
+import org.ourproject.kune.platf.server.manager.TagUserContentManagerDefault;
import org.ourproject.kune.platf.server.manager.ToolConfigurationManager;
import org.ourproject.kune.platf.server.manager.UserManager;
import org.ourproject.kune.platf.server.manager.file.EntityLogoDownloadManager;
@@ -135,6 +137,7 @@
bind(I18nLanguageManager.class).to(I18nLanguageManagerDefault.class);
bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
bind(TagManager.class).to(TagManagerDefault.class);
+ bind(TagUserContentManager.class).to(TagUserContentManagerDefault.class);
bind(CommentManager.class).to(CommentManagerDefault.class);
bind(FileManager.class).to(FileManagerDefault.class);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManager.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -24,9 +24,10 @@
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
+import org.ourproject.kune.platf.server.manager.Manager;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
-public interface ContainerManager {
+public interface ContainerManager extends Manager<Container, Long> {
Container createFolder(Group group, Container parent, String name, I18nLanguage language, String typeId);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -19,11 +19,9 @@
*/
package org.ourproject.kune.platf.server.content;
-import java.util.ArrayList;
import java.util.Date;
import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryParser.MultiFieldQueryParser;
@@ -33,7 +31,6 @@
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
import org.ourproject.kune.platf.client.errors.NameInUseException;
import org.ourproject.kune.platf.client.errors.UserNotFoundException;
-import org.ourproject.kune.platf.client.ui.TextUtils;
import org.ourproject.kune.platf.server.access.FinderService;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
@@ -42,9 +39,8 @@
import org.ourproject.kune.platf.server.domain.Rate;
import org.ourproject.kune.platf.server.domain.RateResult;
import org.ourproject.kune.platf.server.domain.Revision;
-import org.ourproject.kune.platf.server.domain.Tag;
import org.ourproject.kune.platf.server.domain.User;
-import org.ourproject.kune.platf.server.manager.TagManager;
+import org.ourproject.kune.platf.server.manager.TagUserContentManager;
import org.ourproject.kune.platf.server.manager.file.FileUtils;
import org.ourproject.kune.platf.server.manager.impl.DefaultManager;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
@@ -60,17 +56,19 @@
private final FinderService finder;
private final User userFinder;
private final I18nLanguage languageFinder;
- private final TagManager tagManager;
private final Content contentFinder;
private final Container containerFinder;
+ private final TagUserContentManager tagManager;
+ private final Provider<EntityManager> provider;
@Inject
public ContentManagerDefault(final Content contentFinder, final Container containerFinder,
final Provider<EntityManager> provider, final FinderService finder, final User userFinder,
- final I18nLanguage languageFinder, final TagManager tagManager) {
+ final I18nLanguage languageFinder, final TagUserContentManager tagManager) {
super(provider, Content.class);
this.contentFinder = contentFinder;
this.containerFinder = containerFinder;
+ this.provider = provider;
this.finder = finder;
this.userFinder = userFinder;
this.languageFinder = languageFinder;
@@ -223,21 +221,7 @@
public void setTags(final User user, final Long contentId, final String tags) throws DefaultException {
final Content content = finder.getContent(contentId);
- final ArrayList<String> tagsStripped = TextUtils.splitTags(tags);
- final ArrayList<Tag> tagList = new ArrayList<Tag>();
- for (String tagString : tagsStripped) {
- Tag tag;
- try {
- tag = tagManager.findByTagName(tagString);
- } catch (final NoResultException e) {
- tag = new Tag(tagString);
- tagManager.persist(tag);
- }
- if (!tagList.contains(tag)) {
- tagList.add(tag);
- }
- }
- content.setTags(tagList);
+ tagManager.setTags(user, content, tags);
}
private String findInexistentTitle(Container container, String title) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -22,7 +22,6 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -43,7 +42,6 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
-import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
@@ -74,11 +72,6 @@
@Version
private int version;
- @OrderBy("name DESC")
- @IndexedEmbedded
- @ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST })
- private List<Tag> tags;
-
@OneToOne
private License license;
@@ -136,7 +129,6 @@
public Content() {
translations = new ArrayList<ContentTranslation>();
authors = new ArrayList<User>();
- tags = new ArrayList<Tag>();
comments = new HashSet<Comment>();
this.createdOn = System.currentTimeMillis();
this.lastRevision = new Revision(this);
@@ -242,22 +234,6 @@
return status;
}
- public List<Tag> getTags() {
- return tags;
- }
-
- public String getTagsAsString() {
- String tagConcatenated = "";
- for (final Iterator<Tag> iterator = tags.iterator(); iterator.hasNext();) {
- final Tag tag = iterator.next();
- tagConcatenated = tagConcatenated + tag.getName();
- if (iterator.hasNext()) {
- tagConcatenated = tagConcatenated + " ";
- }
- }
- return tagConcatenated;
- }
-
public String getTitle() {
return lastRevision.getTitle();
}
@@ -339,10 +315,6 @@
this.status = status;
}
- public void setTags(final List<Tag> tags) {
- this.tags = tags;
- }
-
public void setTranslations(final List<ContentTranslation> translations) {
this.translations = translations;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Tag.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -23,8 +23,6 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.search.annotations.DocumentId;
@@ -39,17 +37,7 @@
@Entity
@Indexed
@Table(name = "tags")
-// See:
-// http://openjpa.apache.org/docs/latest/manual/manual.html#jpa_langref_result…
-@NamedQueries( {
- @NamedQuery(name = "tagsgrouped", query = "SELECT NEW org.ourproject.kune.platf.server.domain.TagCount(t.name, COUNT(c.id)) "
- + "FROM Content c JOIN c.tags t WHERE c.container.owner = :group " + "GROUP BY t.name ORDER BY t.name"),
- @NamedQuery(name = "tagsmaxgrouped", query = "SELECT Count(c.id) FROM Content c JOIN c.tags t WHERE c.container.owner = :group GROUP BY t.name ORDER BY count(*) DESC LIMIT 0,1"),
- @NamedQuery(name = "tagsmingrouped", query = "SELECT Count(c.id) FROM Content c JOIN c.tags t WHERE c.container.owner = :group GROUP BY t.name ORDER BY count(*) ASC LIMIT 0,1") })
public class Tag implements HasId {
- public static final String TAGSGROUPED = "tagsgrouped";
- public static final String TAGSMINGROUPED = "tagsmingrouped";
- public static final String TAGSMAXGROUPED = "tagsmaxgrouped";
@Id
@GeneratedValue
Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/TagUserContent.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -0,0 +1,109 @@
+package org.ourproject.kune.platf.server.domain;
+
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.IndexedEmbedded;
+import org.hibernate.validator.NotNull;
+
+import com.google.inject.name.Named;
+import com.wideplay.warp.persist.dao.Finder;
+
+//See:
+//http://openjpa.apache.org/docs/latest/manual/manual.html#jpa_langref_resulttype
+@NamedQueries( {
+ @NamedQuery(name = "tagsgrouped", query = "SELECT NEW org.ourproject.kune.platf.server.domain.TagCount(t.name, COUNT(tuc.content.id)) "
+ + "FROM TagUserContent tuc JOIN tuc.tag t WHERE tuc.content.container.owner = :group "
+ + "GROUP BY t.name ORDER BY t.name"),
+ @NamedQuery(name = "tagsmaxgrouped", query = "SELECT Count(tuc.content.id) FROM TagUserContent tuc JOIN tuc.tag t WHERE tuc.content.container.owner = :group GROUP BY t.name ORDER BY count(*) DESC LIMIT 0,1"),
+ @NamedQuery(name = "tagsmingrouped", query = "SELECT Count(tuc.content.id) FROM TagUserContent tuc JOIN tuc.tag t WHERE tuc.content.container.owner = :group GROUP BY t.name ORDER BY count(*) ASC LIMIT 0,1") })
+@Entity
+@Indexed
+@Table(name = "tag_user_content")
+public class TagUserContent implements HasId {
+ public static final String TAGSGROUPED = "tagsgrouped";
+ public static final String TAGSMINGROUPED = "tagsmingrouped";
+ public static final String TAGSMAXGROUPED = "tagsmaxgrouped";
+
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Long id;
+
+ @IndexedEmbedded
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY)
+ private Tag tag;
+
+ @IndexedEmbedded
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY)
+ private Content content;
+
+ @IndexedEmbedded
+ @NotNull
+ @ManyToOne(fetch = FetchType.LAZY)
+ private User user;
+
+ public TagUserContent() {
+ this(null, null, null);
+ }
+
+ public TagUserContent(Tag tag, User user, Content content) {
+ this.tag = tag;
+ this.user = user;
+ this.content = content;
+ }
+
+ @Finder(query = "FROM TagUserContent t WHERE t.user = :user AND t.content = :content")
+ public List<TagUserContent> find(@Named("user") final User user, @Named("content") final Content content) {
+ return null;
+ }
+
+ @Finder(query = "SELECT t.tag FROM TagUserContent t WHERE t.user = :user AND t.content = :content")
+ public List<Tag> findTags(@Named("user") final User user, @Named("content") final Content content) {
+ return null;
+ }
+
+ public Content getContent() {
+ return content;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public Tag getTag() {
+ return tag;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setContent(Content content) {
+ this.content = content;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public void setTag(Tag tag) {
+ this.tag = tag;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagManager.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagManager.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -19,14 +19,10 @@
*/
package org.ourproject.kune.platf.server.manager;
-import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.Tag;
-import org.ourproject.kune.platf.server.domain.TagCloudResult;
public interface TagManager extends Manager<Tag, Long> {
Tag findByTagName(String tag);
- TagCloudResult getTagCloudResultByGroup(Group group);
-
}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManager.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManager.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -0,0 +1,24 @@
+package org.ourproject.kune.platf.server.manager;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.Tag;
+import org.ourproject.kune.platf.server.domain.TagCloudResult;
+import org.ourproject.kune.platf.server.domain.TagUserContent;
+import org.ourproject.kune.platf.server.domain.User;
+
+public interface TagUserContentManager extends Manager<TagUserContent, Long> {
+
+ List<Tag> find(User user, Content content);
+
+ TagCloudResult getTagCloudResultByGroup(Group group);
+
+ String getTagsAsString(User user, Content content);
+
+ void remove(User user, Content content);
+
+ void setTags(User user, Content content, String tags);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManagerDefault.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/TagUserContentManagerDefault.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -0,0 +1,110 @@
+package org.ourproject.kune.platf.server.manager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.Tag;
+import org.ourproject.kune.platf.server.domain.TagCloudResult;
+import org.ourproject.kune.platf.server.domain.TagCount;
+import org.ourproject.kune.platf.server.domain.TagUserContent;
+import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.impl.DefaultManager;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+@Singleton
+public class TagUserContentManagerDefault extends DefaultManager<TagUserContent, Long> implements TagUserContentManager {
+ private final Provider<EntityManager> provider;
+ private final TagManager tagManager;
+ private final TagUserContent finder;
+
+ @Inject
+ public TagUserContentManagerDefault(Provider<EntityManager> provider, TagManager tagManager, TagUserContent finder) {
+ super(provider, TagUserContent.class);
+ this.provider = provider;
+ this.tagManager = tagManager;
+ this.finder = finder;
+ }
+
+ public List<Tag> find(User user, Content content) {
+ return finder.findTags(user, content);
+ }
+
+ public TagCloudResult getTagCloudResultByGroup(Group group) {
+ return new TagCloudResult(getSummaryByGroup(group), getMaxCount(group), getMinCount(group));
+ }
+
+ public String getTagsAsString(User user, Content content) {
+ String tagConcatenated = "";
+ if (user.getId() != null) {
+ // FIXME: User must be persisted (this fails on tests)
+ List<Tag> tags = find(user, content);
+ for (Tag tag : tags) {
+ tagConcatenated += " " + tag.getName();
+ }
+ }
+ return tagConcatenated.replaceFirst(" ", "");
+ }
+
+ public void remove(User user, Content content) {
+ for (TagUserContent item : finder.find(user, content)) {
+ provider.get().remove(item);
+ }
+ }
+
+ public void setTags(User user, Content content, String tags) {
+ final ArrayList<String> tagsStripped = TextUtils.splitTags(tags);
+ final ArrayList<Tag> tagList = new ArrayList<Tag>();
+
+ for (String tagString : tagsStripped) {
+ Tag tag;
+ try {
+ tag = tagManager.findByTagName(tagString);
+ } catch (final NoResultException e) {
+ tag = new Tag(tagString);
+ tagManager.persist(tag);
+ }
+ if (!tagList.contains(tag)) {
+ tagList.add(tag);
+ }
+ }
+ remove(user, content);
+ for (Tag tag : tagList) {
+ TagUserContent tagUserContent = new TagUserContent(tag, user, content);
+ persist(tagUserContent);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private int getMaxCount(Group group) {
+ Query q = provider.get().createNamedQuery(TagUserContent.TAGSMAXGROUPED);
+ q.setParameter("group", group);
+ List resultList = q.getResultList();
+ return (resultList.size() == 0 ? 0 : ((Long) resultList.get(0)).intValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ private int getMinCount(Group group) {
+ Query q = provider.get().createNamedQuery(TagUserContent.TAGSMINGROUPED);
+ q.setParameter("group", group);
+ List resultList = q.getResultList();
+ return (resultList.size() == 0 ? 0 : ((Long) resultList.get(0)).intValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ private List<TagCount> getSummaryByGroup(final Group group) {
+ Query q = provider.get().createNamedQuery(TagUserContent.TAGSGROUPED);
+ q.setParameter("group", group);
+ List<TagCount> results = q.getResultList();
+ return results;
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/TagManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/TagManagerDefault.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/TagManagerDefault.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -19,15 +19,9 @@
*/
package org.ourproject.kune.platf.server.manager.impl;
-import java.util.List;
-
import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.Tag;
-import org.ourproject.kune.platf.server.domain.TagCloudResult;
-import org.ourproject.kune.platf.server.domain.TagCount;
import org.ourproject.kune.platf.server.manager.TagManager;
import com.google.inject.Inject;
@@ -38,44 +32,14 @@
public class TagManagerDefault extends DefaultManager<Tag, Long> implements TagManager {
private final Tag tagFinder;
- private final Provider<EntityManager> provider;
@Inject
public TagManagerDefault(final Provider<EntityManager> provider, final Tag tagFinder) {
super(provider, Tag.class);
- this.provider = provider;
this.tagFinder = tagFinder;
}
public Tag findByTagName(final String tag) {
return tagFinder.findByTagName(tag);
}
-
- public TagCloudResult getTagCloudResultByGroup(Group group) {
- return new TagCloudResult(getSummaryByGroup(group), getMaxCount(group), getMinCount(group));
- }
-
- @SuppressWarnings("unchecked")
- private int getMaxCount(Group group) {
- Query q = provider.get().createNamedQuery(Tag.TAGSMAXGROUPED);
- q.setParameter("group", group);
- List resultList = q.getResultList();
- return (resultList.size() == 0 ? 0 : ((Long) resultList.get(0)).intValue());
- }
-
- @SuppressWarnings("unchecked")
- private int getMinCount(Group group) {
- Query q = provider.get().createNamedQuery(Tag.TAGSMINGROUPED);
- q.setParameter("group", group);
- List resultList = q.getResultList();
- return (resultList.size() == 0 ? 0 : ((Long) resultList.get(0)).intValue());
- }
-
- @SuppressWarnings("unchecked")
- private List<TagCount> getSummaryByGroup(final Group group) {
- Query q = provider.get().createNamedQuery(Tag.TAGSGROUPED);
- q.setParameter("group", group);
- List<TagCount> results = q.getResultList();
- return results;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -69,7 +69,7 @@
import org.ourproject.kune.platf.server.domain.TagCloudResult;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
-import org.ourproject.kune.platf.server.manager.TagManager;
+import org.ourproject.kune.platf.server.manager.TagUserContentManager;
import org.ourproject.kune.platf.server.mapper.Mapper;
import org.ourproject.kune.platf.server.state.StateContainer;
import org.ourproject.kune.platf.server.state.StateContent;
@@ -92,7 +92,7 @@
private final XmppManager xmppManager;
private final ContentManager contentManager;
private final ContainerManager containerManager;
- private final TagManager tagManager;
+ private final TagUserContentManager tagManager;
private final CommentManager commentManager;
private final AccessRightsService rightsService;
private final FinderService finderService;
@@ -102,8 +102,8 @@
final AccessService accessService, final AccessRightsService rightsService,
final StateService stateService, final CreationService creationService, final GroupManager groupManager,
final XmppManager xmppManager, final ContentManager contentManager,
- final ContainerManager containerManager, final TagManager tagManager, final CommentManager commentManager,
- final Mapper mapper) {
+ final ContainerManager containerManager, final TagUserContentManager tagManager,
+ final CommentManager commentManager, final Mapper mapper) {
this.finderService = finderService;
this.userSessionProvider = userSessionProvider;
this.accessService = accessService;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -30,7 +30,7 @@
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
-import org.ourproject.kune.platf.server.manager.TagManager;
+import org.ourproject.kune.platf.server.manager.TagUserContentManager;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -41,13 +41,13 @@
private final AccessRightsService rightsService;
private final SocialNetworkManager socialNetworkManager;
private final GroupManager groupManager;
- private final TagManager tagManager;
+ private final TagUserContentManager tagManager;
private final ContentManager contentManager;
private final I18nTranslationService i18n;
@Inject
public StateServiceDefault(GroupManager groupManager, SocialNetworkManager socialNetworkManager,
- ContentManager contentManager, TagManager tagManager, AccessRightsService rightsService,
+ ContentManager contentManager, TagUserContentManager tagManager, AccessRightsService rightsService,
I18nTranslationService i18n) {
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
@@ -79,7 +79,7 @@
state.setLanguage(content.getLanguage());
state.setPublishedOn(content.getPublishedOn());
state.setAuthors(content.getAuthors());
- state.setTags(content.getTagsAsString());
+ state.setTags(tagManager.getTagsAsString(userLogged, content));
state.setStatus(content.getStatus());
state.setStateToken(content.getStateToken());
Revision revision = content.getLastRevision();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -35,19 +35,19 @@
public abstract class AbstractOptionsPanel {
private BasicDialog dialog;
+ private final String dialogId;
+ private TabPanel tabPanel;
private MessageToolbar messageErrorBar;
- private TabPanel tabPanel;
private String title;
private final int width;
private final int height;
private final int minWidth;
private final int minHeight;
+ private final boolean modal;
private final Images images;
private final String errorLabelId;
private String iconCls;
- private final String dialogId;
private Listener0 onHideListener;
- private final boolean modal;
public AbstractOptionsPanel(String dialogId, String title, int width, int height, int minWidth, int minHeight,
boolean modal, Images images, String errorLabelId) {
Added: trunk/src/test/java/org/ourproject/kune/platf/server/PersistencePreLoadedDataTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/PersistencePreLoadedDataTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/PersistencePreLoadedDataTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -0,0 +1,97 @@
+package org.ourproject.kune.platf.server;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.TimeZone;
+
+import org.junit.After;
+import org.junit.Before;
+import org.ourproject.kune.docs.server.DocumentServerTool;
+import org.ourproject.kune.platf.server.content.ContainerManager;
+import org.ourproject.kune.platf.server.content.ContentManager;
+import org.ourproject.kune.platf.server.domain.Container;
+import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.I18nCountry;
+import org.ourproject.kune.platf.server.domain.I18nLanguage;
+import org.ourproject.kune.platf.server.domain.License;
+import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.GroupManager;
+import org.ourproject.kune.platf.server.manager.I18nCountryManager;
+import org.ourproject.kune.platf.server.manager.I18nLanguageManager;
+import org.ourproject.kune.platf.server.manager.LicenseManager;
+import org.ourproject.kune.platf.server.manager.UserManager;
+
+import com.google.inject.Inject;
+
+public abstract class PersistencePreLoadedDataTest extends PersistenceTest {
+ protected static final String USER_SHORT_NAME = "user-shortname";
+ protected static final String USER_LONG_NAME = "the user long name";
+ protected static final String USER_PASSWORD = "userPassword";
+ protected static final String USER_EMAIL = "useremail(a)example.com";
+
+ @Inject
+ protected User userFinder;
+ @Inject
+ protected Group groupFinder;
+ @Inject
+ protected License licenseFinder;
+ @Inject
+ protected ContentManager contentManager;
+ @Inject
+ protected ContainerManager containerManager;
+ @Inject
+ protected GroupManager groupManager;
+ @Inject
+ protected UserManager userManager;
+ @Inject
+ protected LicenseManager licenseManager;
+ @Inject
+ protected I18nLanguageManager languageManager;
+ @Inject
+ protected I18nCountryManager countryManager;
+
+ protected User user;
+ protected License defLicense;
+ protected I18nLanguage english;
+ protected I18nCountry gb;
+ protected Content content;
+ protected Container container;
+
+ public PersistencePreLoadedDataTest() {
+ // test: use memory
+ // test_db: use mysql
+ super("test", "kune.properties");
+ }
+
+ @After
+ public void close() {
+ if (getTransaction().isActive()) {
+ getTransaction().rollback();
+ }
+ }
+
+ @Before
+ public void preLoadData() throws Exception {
+ openTransaction();
+ assertEquals(0, userFinder.getAll().size());
+ assertEquals(0, groupFinder.getAll().size());
+ assertEquals(0, licenseFinder.getAll().size());
+ english = new I18nLanguage(new Long(1819), "English", "English", "en");
+ languageManager.persist(english);
+ gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
+ countryManager.persist(gb);
+ user = userManager.createUser(USER_SHORT_NAME, USER_LONG_NAME, USER_EMAIL, USER_PASSWORD, "en", "GB",
+ TimeZone.getDefault().getID());
+ defLicense = new License("by-sa-v3.0", "Creative Commons Attribution-ShareAlike", "",
+ "http://creativecommons.org/licenses/by-sa/3.0/", true, true, false, "", "");
+ licenseManager.persist(defLicense);
+ groupManager.createUserGroup(user, true);
+ content = new Content();
+ content.setLanguage(english);
+ contentManager.persist(content);
+ container = new Container();
+ container.setTypeId(DocumentServerTool.TYPE_FOLDER);
+ containerManager.persist(container);
+ }
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/PersistenceTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -61,7 +61,7 @@
getManager().getTransaction().rollback();
}
- private EntityManager getManager() {
+ protected EntityManager getManager() {
return provider.get();
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -6,55 +6,33 @@
import javax.persistence.EntityManager;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.server.PersistenceTest;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
import org.ourproject.kune.platf.server.TestDomainHelper;
import org.ourproject.kune.platf.server.domain.Content;
-import org.ourproject.kune.platf.server.domain.I18nCountry;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.Rate;
import org.ourproject.kune.platf.server.domain.User;
-import org.ourproject.kune.platf.server.manager.I18nCountryManager;
-import org.ourproject.kune.platf.server.manager.I18nLanguageManager;
import com.google.inject.Inject;
-public class RateFinderTest extends PersistenceTest {
+public class RateFinderTest extends PersistencePreLoadedDataTest {
@Inject
Rate rateFinder;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- I18nCountryManager countryManager;
- private I18nLanguage english;
- private I18nCountry gb;
+ private EntityManager entityManager;
- @After
- public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
- }
-
@Before
- public void insertData() throws Exception {
- english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
- countryManager.persist(gb);
+ public void before() {
+ entityManager = getManager();
}
@Test
public void testContentNotRated() {
- final EntityManager manager = openTransaction();
-
final Content cd = new Content();
cd.setLanguage(english);
cd.setPublishedOn(new Date());
- manager.persist(cd);
+ entityManager.persist(cd);
closeTransaction();
final Double rate = rateFinder.calculateRate(cd);
@@ -67,8 +45,6 @@
@Test
public void testContentRateAverage() {
- final EntityManager manager = openTransaction();
-
final User user1 = TestDomainHelper.createUser(1);
final User user2 = TestDomainHelper.createUser(2);
@@ -78,20 +54,20 @@
user1.setCountry(gb);
user2.setCountry(gb);
- manager.persist(user1);
- manager.persist(user2);
+ entityManager.persist(user1);
+ entityManager.persist(user2);
final Content cd = new Content();
cd.setLanguage(english);
cd.setPublishedOn(new Date());
- manager.persist(cd);
+ entityManager.persist(cd);
- manager.persist(new Rate(user1, cd, 1.3));
- manager.persist(new Rate(user2, cd, 3.3));
+ entityManager.persist(new Rate(user1, cd, 1.3));
+ entityManager.persist(new Rate(user2, cd, 3.3));
// same user and content other rate
final Rate rateFinded = rateFinder.find(user2, cd);
rateFinded.setValue(4.3);
- manager.persist(rateFinded);
+ entityManager.persist(rateFinded);
closeTransaction();
final Double rate = rateFinder.calculateRate(cd);
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/finders/UserFinderTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/finders/UserFinderTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/finders/UserFinderTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -6,42 +6,21 @@
import java.util.List;
import java.util.TimeZone;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.server.PersistenceTest;
-import org.ourproject.kune.platf.server.domain.I18nCountry;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
import org.ourproject.kune.platf.server.domain.User;
-import org.ourproject.kune.platf.server.manager.I18nCountryManager;
-import org.ourproject.kune.platf.server.manager.I18nLanguageManager;
import com.google.inject.Inject;
-public class UserFinderTest extends PersistenceTest {
+public class UserFinderTest extends PersistencePreLoadedDataTest {
@Inject
User finder;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- I18nCountryManager countryManager;
- @Before
- public void initData() {
- openTransaction();
- I18nLanguage english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- I18nCountry gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western",
- ",");
- countryManager.persist(gb);
- persist(new User("shortname1", "the name1", "one(a)here.com", "password1", english, gb, TimeZone.getDefault()));
- persist(new User("shortname2", "the name2", "two(a)here.com", "password1", english, gb, TimeZone.getDefault()));
- }
-
@Test
public void findAll() {
List<User> all = finder.getAll();
- assertEquals(2, all.size());
+ assertEquals(3, all.size());
}
@Test
@@ -50,11 +29,10 @@
assertNotNull(user);
}
- @After
- public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
+ @Before
+ public void initData() {
+ persist(new User("shortname1", "the name1", "one(a)here.com", "password1", english, gb, TimeZone.getDefault()));
+ persist(new User("shortname2", "the name2", "two(a)here.com", "password1", english, gb, TimeZone.getDefault()));
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/ContentManagerTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -2,81 +2,14 @@
import static org.junit.Assert.assertEquals;
-import java.util.TimeZone;
-
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mockito;
import org.ourproject.kune.docs.server.DocumentServerTool;
-import org.ourproject.kune.platf.server.PersistenceTest;
-import org.ourproject.kune.platf.server.content.ContentManager;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
import org.ourproject.kune.platf.server.domain.BasicMimeType;
-import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
-import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.I18nCountry;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
-import org.ourproject.kune.platf.server.domain.License;
-import org.ourproject.kune.platf.server.domain.User;
-import com.google.inject.Inject;
+public class ContentManagerTest extends PersistencePreLoadedDataTest {
-public class ContentManagerTest extends PersistenceTest {
-
- @Inject
- User userFinder;
- @Inject
- Group groupFinder;
- @Inject
- License licenseFinder;
- @Inject
- ContentManager contentManager;
- @Inject
- GroupManager groupManager;
- @Inject
- UserManager userManager;
- @Inject
- LicenseManager licenseManager;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- I18nCountryManager countryManager;
- private User user;
- private License defLicense;
-
- public ContentManagerTest() {
- // Testing with mysql because utf-8 normally fails with mysql and not in
- // memory
- super("test_db", "kune.properties");
- }
-
- @After
- public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
- }
-
- @Before
- public void insertData() throws Exception {
- openTransaction();
- assertEquals(0, userFinder.getAll().size());
- assertEquals(0, groupFinder.getAll().size());
- assertEquals(0, licenseFinder.getAll().size());
- final I18nLanguage english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- final I18nCountry gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom",
- "western", ",");
- countryManager.persist(gb);
- user = userManager.createUser("username", "the user name", "email(a)example.com", "userPassword", "en", "GB",
- TimeZone.getDefault().getID());
- defLicense = new License("by-sa-v3.0", "Creative Commons Attribution-ShareAlike", "",
- "http://creativecommons.org/licenses/by-sa/3.0/", true, true, false, "", "");
- licenseManager.persist(defLicense);
- groupManager.createUserGroup(user, true);
- }
-
@Test
public void testBasicMimePersist() {
final String mimetype = "application/pdf";
@@ -95,8 +28,6 @@
*/
@Test
public void testUTF8Persist() {
- final Container container = Mockito.mock(Container.class);
- Mockito.when(container.getTypeId()).thenReturn(DocumentServerTool.TYPE_FOLDER);
final Content cnt = contentManager.createContent("汉语/漢語", "汉语/漢語", user, container,
DocumentServerTool.TYPE_DOCUMENT);
final Content newCnt = contentManager.find(cnt.getId());
@@ -104,8 +35,6 @@
}
private void createContentWithMime(final String mimetype) {
- final Container container = Mockito.mock(Container.class);
- Mockito.when(container.getTypeId()).thenReturn(DocumentServerTool.TYPE_FOLDER);
final Content cnt = contentManager.createContent("title", "body", user, container,
DocumentServerTool.TYPE_UPLOADEDFILE);
cnt.setMimeType(new BasicMimeType(mimetype));
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/GroupManagerTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -6,53 +6,20 @@
import java.util.TimeZone;
import org.apache.lucene.queryParser.ParseException;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
-import org.ourproject.kune.platf.server.PersistenceTest;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.I18nCountry;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
-import org.ourproject.kune.platf.server.domain.License;
import org.ourproject.kune.platf.server.domain.SocialNetwork;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
-import com.google.inject.Inject;
+public class GroupManagerTest extends PersistencePreLoadedDataTest {
-public class GroupManagerTest extends PersistenceTest {
- @Inject
- User userFinder;
- @Inject
- Group groupFinder;
- @Inject
- License licenseFinder;
- @Inject
- GroupManager groupManager;
- @Inject
- UserManager userManager;
- @Inject
- LicenseManager licenseManager;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- I18nCountryManager countryManager;
-
- private User user;
- private License defLicense;
-
- @After
- public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
- }
-
@Test
public void createdGroupShoudHaveValidSocialNetwork() throws Exception {
final Group group = new Group("short", "longName", defLicense, GroupType.PROJECT);
@@ -151,15 +118,15 @@
@Test(expected = EmailAddressInUseException.class)
public void createUserWithExistingEmail() throws Exception {
- final User user2 = userManager.createUser("username2", "the user name 2", "email(a)example.com", "userPassword",
- "en", "GB", TimeZone.getDefault().getID());
+ final User user2 = userManager.createUser("username2", "the user name 2", USER_EMAIL, "userPassword", "en",
+ "GB", TimeZone.getDefault().getID());
groupManager.createUserGroup(user2);
rollbackTransaction();
}
@Test(expected = GroupNameInUseException.class)
public void createUserWithExistingLongName() throws Exception {
- final User user2 = userManager.createUser("username2", "the user name", "email2(a)example.com", "userPassword",
+ final User user2 = userManager.createUser("username2", USER_LONG_NAME, "email2(a)example.com", "userPassword",
"en", "GB", TimeZone.getDefault().getID());
groupManager.createUserGroup(user2);
rollbackTransaction();
@@ -167,8 +134,8 @@
@Test(expected = GroupNameInUseException.class)
public void createUserWithExistingShortName() throws Exception {
- final User user2 = userManager.createUser("username", "the user name 2", "email2(a)example.com", "userPassword",
- "en", "GB", TimeZone.getDefault().getID());
+ final User user2 = userManager.createUser(USER_SHORT_NAME, "the user name 2", "email2(a)example.com",
+ "userPassword", "en", "GB", TimeZone.getDefault().getID());
groupManager.createUserGroup(user2);
rollbackTransaction();
}
@@ -188,25 +155,6 @@
rollbackTransaction();
}
- @Before
- public void insertData() throws Exception {
- openTransaction();
- assertEquals(0, userFinder.getAll().size());
- assertEquals(0, groupFinder.getAll().size());
- assertEquals(0, licenseFinder.getAll().size());
- final I18nLanguage english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- final I18nCountry gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom",
- "western", ",");
- countryManager.persist(gb);
- user = userManager.createUser("username", "the user name", "email(a)example.com", "userPassword", "en", "GB",
- TimeZone.getDefault().getID());
- defLicense = new License("by-sa-v3.0", "Creative Commons Attribution-ShareAlike", "",
- "http://creativecommons.org/licenses/by-sa/3.0/", true, true, false, "", "");
- licenseManager.persist(defLicense);
- groupManager.createUserGroup(user);
- }
-
private void createTestGroup(final int number) throws Exception {
final Group g = new Group("ysei" + number, "Yellow Submarine Environmental Initiative " + number, defLicense,
GroupType.PROJECT);
Added: trunk/src/test/java/org/ourproject/kune/platf/server/manager/TagUserContentTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/TagUserContentTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/TagUserContentTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -0,0 +1,87 @@
+package org.ourproject.kune.platf.server.manager;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
+import org.ourproject.kune.platf.server.domain.Tag;
+import org.ourproject.kune.platf.server.domain.TagUserContent;
+
+import com.google.inject.Inject;
+
+public class TagUserContentTest extends PersistencePreLoadedDataTest {
+ private static final String DUMMY_TAG = "dummy";
+ @Inject
+ TagUserContentManager manager;
+ private Tag tag;
+ @Inject
+ TagManager tagManager;
+
+ @Before
+ public void before() {
+ tag = new Tag(DUMMY_TAG);
+ tagManager.persist(tag);
+ }
+
+ @Test
+ public void getTagsAsString() {
+ manager.setTags(user, content, DUMMY_TAG);
+ String tagS = manager.getTagsAsString(user, content);
+ assertEquals(DUMMY_TAG, tagS);
+ }
+
+ @Test
+ public void insertSomeUserContent() {
+ createSomeTagUserContent();
+ }
+
+ @Test
+ public void removeSomeUserContent() {
+ createSomeTagUserContent();
+ manager.remove(user, content);
+ List<Tag> tags = manager.find(user, content);
+ assertEquals(0, tags.size());
+ }
+
+ @Test
+ public void setTags() {
+ List<Tag> tags = manager.find(user, content);
+ assertEquals(0, tags.size());
+ manager.setTags(user, content, DUMMY_TAG + " " + DUMMY_TAG);
+ tags = manager.find(user, content);
+ assertEquals(1, tags.size());
+ }
+
+ @Test
+ public void setTagsRemoveBefore() {
+ manager.setTags(user, content, "foo");
+ manager.setTags(user, content, DUMMY_TAG);
+ List<Tag> tags = manager.find(user, content);
+ assertEquals(1, tags.size());
+ assertEquals(DUMMY_TAG, tags.get(0).getName());
+ }
+
+ @Test
+ public void testInsertData() {
+ TagUserContent tagUC = createTagUserContent();
+ assertNotNull(tagUC.getId());
+ }
+
+ private void createSomeTagUserContent() {
+ List<Tag> tags = manager.find(user, content);
+ assertEquals(0, tags.size());
+ createTagUserContent();
+ tags = manager.find(user, content);
+ assertEquals(1, tags.size());
+ }
+
+ private TagUserContent createTagUserContent() {
+ TagUserContent tagUC = new TagUserContent(tag, user, content);
+ manager.persist(tagUC);
+ return tagUC;
+ }
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2009-02-14 11:23:09 UTC (rev 1049)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/UserManagerTest.java 2009-02-20 13:41:17 UTC (rev 1050)
@@ -10,47 +10,21 @@
import org.apache.lucene.queryParser.ParseException;
import org.hibernate.validator.InvalidStateException;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.platf.client.errors.I18nNotFoundException;
-import org.ourproject.kune.platf.server.PersistenceTest;
+import org.ourproject.kune.platf.server.PersistencePreLoadedDataTest;
import org.ourproject.kune.platf.server.domain.Group;
-import org.ourproject.kune.platf.server.domain.I18nCountry;
-import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
import com.google.inject.Inject;
-public class UserManagerTest extends PersistenceTest {
- private static final String USER_SHORT_NAME = "user-shortname";
- private static final String USER_LONG_NAME = "the user long name";
- private static final String USER_PASSWORD = "userPassword";
- private static final String USER_EMAIL = "useremail(a)example.com";
+public class UserManagerTest extends PersistencePreLoadedDataTest {
- @Inject
- UserManager userManager;
- @Inject
User userFinder;
@Inject
Group groupFinder;
- @Inject
- I18nLanguageManager languageManager;
- @Inject
- I18nCountryManager countryManager;
- private User user;
- private I18nCountry gb;
- private I18nLanguage english;
-
- @After
- public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
- }
-
@Test
public void emailCorrect() {
user = new User("test1", "test1 name", "test(a)example.com", "some passwd", english, gb, getTimeZone());
@@ -69,19 +43,6 @@
persist(user);
}
- @Before
- public void insertData() throws Exception {
- openTransaction();
- assertEquals(0, userFinder.getAll().size());
- assertEquals(0, groupFinder.getAll().size());
- english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
- countryManager.persist(gb);
- user = new User(USER_SHORT_NAME, USER_LONG_NAME, USER_EMAIL, USER_PASSWORD, english, gb, getTimeZone());
- persist(user);
- }
-
@Test
public void loginIncorrect() {
final User result = userManager.login("test", "test");
1
0