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
March 2009
- 1 participants
- 37 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