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-11 14:21:45 +0100 (Wed, 11 Mar 2009)
New Revision: 1069
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImage.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExt.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElement.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstract.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmail.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExt.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocal.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.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/TextEditorInsertElementPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.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/linkemail/TextEditorInsertLinkEmailPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.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/linkext/TextEditorInsertLinkExtPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java
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/TextEditorInsertLinkLocalPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java
Modified:
trunk/TODO
trunk/script/generateBasicUIElements.sh
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
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/BeforeActionListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support. InsertImage action and code reorganization
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/TODO 2009-03-11 13:21:45 UTC (rev 1069)
@@ -88,6 +88,14 @@
**** File > Rename (F2)
**** Insert > Special char
**** Insert > Page break (for printing)
+**** Shortcut to fonts (Ctrl + numbers)
+**** W3C Range support in RTE (selection)
+ As an intro:
+ http://www.quirksmode.org/dom/range_intro.html
+ http://maven.xwiki.org/site/xwiki-web/xwiki-web-wysiwyg/apidocs/com/xpn/xwi…
+ other links:
+ http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
+ http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
*** Links
http://www.ongwt.com/post/2009/01/08/XWiki-:-Wysiwyg-editor-based-on-GWT
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/in…
@@ -415,16 +423,11 @@
** FIXED <v> browser font size (different from default) issues (scroll in dialogs, buttons background, etc)
CLOSED: [2009-01-03 sáb 01:37]
-** W3C Range support in RTE (selection)
- As an intro:
- http://www.quirksmode.org/dom/range_intro.html
- http://maven.xwiki.org/site/xwiki-web/xwiki-web-wysiwyg/apidocs/com/xpn/xwi…
- other links:
- http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c…
- http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/…
** <v> P2P downloads for bigg uploads (the server acts as seeder).
** TODO <s> Include CC0 license:
http://creativecommons.org/license/zero/
+** TODO <v> Revise use the HP and VP in gwt code
+ http://groups.google.com/group/Google-Web-Toolkit/browse_frm/thread/5d01cd8…
* LONG-TERM
** <s> integrate some blog/wiki converter:
http://code.google.com/p/google-blog-converters-appengine/
Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/script/generateBasicUIElements.sh 2009-03-11 13:21:45 UTC (rev 1069)
@@ -65,11 +65,9 @@
cat <<EOF > $DIR/${NAME}Panel.java
package $PACKAGE;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
public class ${NAME}Panel implements ${NAME}View {
-public ${NAME}Panel(final ${NAME}Presenter presenter, final WorkspaceSkeleton ws) {
+public ${NAME}Panel(final ${NAME}Presenter presenter) {
}
}
EOF
@@ -86,7 +84,7 @@
register(Singleton.class, new Factory<${NAME}>(${NAME}.class) {
public ${NAME} create() {
final ${NAME}Presenter presenter = new ${NAME}Presenter();
- final ${NAME}Panel panel = new ${NAME}Panel(presenter, \$(WorkspaceSkeleton.class));
+ final ${NAME}Panel panel = new ${NAME}Panel(presenter));
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-11 13:21:45 UTC (rev 1069)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:3px;background-color:#D7FFD7;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;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/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-11 13:21:45 UTC (rev 1069)
@@ -877,6 +877,6 @@
.k-rte-comment {
border:1px dashed #C0C0C0;
line-height:1.4;
- padding:3px;
+ padding:1px;
background-color:#D7FFD7;
}
\ No newline at end of file
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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;line-height:1.4;padding:3px;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{border:1px dashed silver;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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-11 13:21:45 UTC (rev 1069)
@@ -6,6 +6,6 @@
.k-rte-comment {
border:1px dashed #C0C0C0;
line-height:1.4;
- padding:3px;
+ padding:1px;
background-color:#D7FFD7;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -21,6 +21,11 @@
public interface BeforeActionListener {
+ /**
+ * Return false to cancel the action
+ *
+ * @return
+ */
boolean beforeAction();
}
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -22,6 +22,8 @@
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementGroup;
import com.calclab.suco.client.ioc.module.AbstractModule;
@@ -32,5 +34,7 @@
registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup(container));
registerDecorator(ToolGroup.class, new ToolGroup(container));
registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
+ registerDecorator(InsertImageGroup.class, new InsertImageGroup(container));
+ registerDecorator(TextEditorInsertElementGroup.class, new TextEditorInsertElementGroup(container));
}
}
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -70,10 +70,26 @@
import org.ourproject.kune.platf.client.ui.rte.edithtml.preview.EditHtmlPreviewPanel;
import org.ourproject.kune.platf.client.ui.rte.edithtml.preview.EditHtmlPreviewPresenter;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImage;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImagePanel;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImagePresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertimgext.InsertImageExt;
+import org.ourproject.kune.platf.client.ui.rte.insertimgext.InsertImageExtPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertimgext.InsertImageExtPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.email.TextEditorInsertLinkEmail;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.email.TextEditorInsertLinkEmailPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.email.TextEditorInsertLinkEmailPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.TextEditorInsertLinkExt;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.TextEditorInsertLinkExtPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.TextEditorInsertLinkExtPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.TextEditorInsertLinkExtView;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.NoDecoration;
@@ -266,7 +282,8 @@
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
$(Session.class), topBar, sndBar, $(RTEImgResources.class), $(TextEditorInsertElement.class),
- $(ColorWebSafePalette.class), $$(EditHtml.class), $(DeferredCommandWrapper.class));
+ $(ColorWebSafePalette.class), $$(EditHtml.class), $$(InsertImage.class),
+ $(DeferredCommandWrapper.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class));
presenter.init(panel);
@@ -276,8 +293,8 @@
@Override
public RTESavingEditor create() {
RTESavingEditorPresenter presenter = new RTESavingEditorPresenter($(RTEditor.class), true,
- $(I18nTranslationService.class), $(StateManager.class), $(SiteSignOutLink.class),
- $(DeferredCommandWrapper.class), $(RTEImgResources.class), $(TimerWrapper.class));
+ $(I18nTranslationService.class), $(StateManager.class), $(DeferredCommandWrapper.class),
+ $(RTEImgResources.class), $(TimerWrapper.class));
RTESavingEditorPanel panel = new RTESavingEditorPanel();
presenter.init(panel);
return presenter;
@@ -309,7 +326,7 @@
registerDecorator(EditHtmlGroup.class, new EditHtmlGroup(container));
- register(EditHtmlGroup.class, new Factory<EditHtml>(EditHtml.class) {
+ register(Singleton.class, new Factory<EditHtml>(EditHtml.class) {
@Override
public EditHtml create() {
final EditHtmlPresenter presenter = new EditHtmlPresenter();
@@ -338,6 +355,64 @@
}
});
+ register(Singleton.class, new Factory<InsertImage>(InsertImage.class) {
+ @Override
+ public InsertImage create() {
+ final InsertImagePresenter presenter = new InsertImagePresenter();
+ final InsertImagePanel panel = new InsertImagePanel(presenter, $(I18nTranslationService.class),
+ $(Images.class), $(InsertImageGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(InsertImageGroup.class, new Factory<InsertImageExt>(InsertImageExt.class) {
+ @Override
+ public InsertImageExt create() {
+ final InsertImageExtPresenter presenter = new InsertImageExtPresenter($(InsertImage.class));
+ final InsertImageExtPanel panel = new InsertImageExtPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<TextEditorInsertElement>(TextEditorInsertElement.class) {
+ @Override
+ public TextEditorInsertElement create() {
+ final TextEditorInsertElementPresenter presenter = new TextEditorInsertElementPresenter();
+ final TextEditorInsertElementPanel panel = new TextEditorInsertElementPanel(presenter, $(Images.class),
+ $(I18nTranslationService.class), $(TextEditorInsertElementGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(TextEditorInsertElementGroup.class,
+ new Factory<TextEditorInsertLinkExt>(TextEditorInsertLinkExt.class) {
+ @Override
+ public TextEditorInsertLinkExt create() {
+ final TextEditorInsertLinkExtPresenter presenter = new TextEditorInsertLinkExtPresenter(
+ $(TextEditorInsertElement.class));
+ final TextEditorInsertLinkExtView panel = new TextEditorInsertLinkExtPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkEmail>(
+ TextEditorInsertLinkEmail.class) {
+ @Override
+ public TextEditorInsertLinkEmail create() {
+ final TextEditorInsertLinkEmailPresenter presenter = new TextEditorInsertLinkEmailPresenter(
+ $(TextEditorInsertElement.class));
+ final TextEditorInsertLinkEmailPanel panel = new TextEditorInsertLinkEmailPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,5 +1,7 @@
package org.ourproject.kune.platf.client.ui.rte;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
+
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -9,6 +11,14 @@
RTEditor getBasicEditor();
+ /**
+ * This is use for listen to changes as url changes, window close, and
+ * save/cancel or stop these actions
+ *
+ * @return
+ */
+ BeforeActionListener getBeforeSavingListener();
+
void onSavedSuccessful();
void onSaveFailed();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -11,7 +11,6 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
@@ -35,19 +34,16 @@
private final I18nTranslationService i18n;
private final StateManager stateManager;
private final BeforeActionListener beforeStateChangeListener;
- @Deprecated
- private final SiteSignOutLink siteSignOutLink;
ActionToolbarButtonDescriptor<Object> saveBtn;
private RTESavingEditorView view;
public RTESavingEditorPresenter(RTEditor editor, final boolean autoSave, final I18nTranslationService i18n,
- StateManager stateManager, SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
+ StateManager stateManager, DeferredCommandWrapper deferredCommandWrapper,
RTEImgResources imgResources, TimerWrapper timer) {
this.editor = editor;
this.autoSave = autoSave;
this.i18n = i18n;
this.stateManager = stateManager;
- this.siteSignOutLink = siteSignOutLink;
this.deferredCommandWrapper = deferredCommandWrapper;
this.imgResources = imgResources;
this.savePending = false;
@@ -78,7 +74,6 @@
editor.setHtml(html);
editor.attach();
stateManager.addBeforeStateChangeListener(beforeStateChangeListener);
- siteSignOutLink.addBeforeSignOut(beforeStateChangeListener);
enableSaveBtn(false);
}
@@ -86,6 +81,10 @@
return editor;
}
+ public BeforeActionListener getBeforeSavingListener() {
+ return beforeStateChangeListener;
+ }
+
public void init(RTESavingEditorView view) {
this.view = view;
}
@@ -136,7 +135,6 @@
protected void onCancelConfirmed() {
stateManager.removeBeforeStateChangeListener(beforeStateChangeListener);
- siteSignOutLink.removeBeforeSignOut(beforeStateChangeListener);
stateManager.resumeTokenChange();
reset();
editor.reset();
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -16,13 +16,12 @@
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.TextUtils;
-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.edithtml.EditHtml;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImage;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
import com.calclab.suco.client.events.Event0;
import com.calclab.suco.client.events.Listener;
@@ -64,10 +63,12 @@
private final ActionAddCondition<Object> canBeBasic;
private final ActionAddCondition<Object> canBeExtended;
private final Provider<EditHtml> editHtmlDialog;
+ private final Provider<InsertImage> insertImageDialog;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement,
- ColorWebSafePalette palette, Provider<EditHtml> editHtmlDialog, DeferredCommandWrapper deferred) {
+ ColorWebSafePalette palette, Provider<EditHtml> editHtmlDialog, Provider<InsertImage> insertImageDialog,
+ DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
@@ -75,6 +76,7 @@
this.insertElement = textEditorInsertElement;
this.palette = palette;
this.editHtmlDialog = editHtmlDialog;
+ this.insertImageDialog = insertImageDialog;
this.deferred = deferred;
styleToolbar(sndBar);
sndBar.attach();
@@ -520,7 +522,7 @@
ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
new Listener0() {
public void onEvent() {
- NotifyUser.info(TextUtils.IN_DEVELOPMENT);
+ insertImageDialog.get().show();
}
});
img.setIconCls(getCssName(imgResources.images()));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,6 +1,5 @@
package org.ourproject.kune.platf.client.ui.rte.edithtml;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlAgent;
import org.ourproject.kune.workspace.client.options.AbstractOptionsPresenter;
@@ -9,7 +8,6 @@
public class EditHtmlPresenter extends AbstractOptionsPresenter implements EditHtml {
- private EditHtmlView view;
private Listener<String> updateListener;
private Listener0 cancelListener;
private EditHtmlAgent agent;
@@ -21,21 +19,11 @@
return agent.getHtml();
}
- @Override
- public View getView() {
- return view;
- }
-
- public void init(EditHtmlView view) {
- super.init(view);
- this.view = view;
- }
-
public void onCancel() {
if (cancelListener != null) {
cancelListener.onEvent();
}
- view.hide();
+ hide();
}
public void onUpdate() {
@@ -43,7 +31,7 @@
// FIXME
updateListener.onEvent(agent.getHtml());
}
- view.hide();
+ hide();
}
public void setAgent(EditHtmlAgent agent) {
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImage.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImage.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.workspace.client.options.AbstractOptions;
+
+public interface InsertImage extends AbstractOptions {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+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 InsertImageGroup extends ProviderCollection {
+
+ public InsertImageGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePanel.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,26 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsPanel;
+
+public class InsertImagePanel extends AbstractOptionsPanel implements InsertImageView {
+
+ private static final String INSERT_IMG_DIALOG = "iip-dial";
+ private static final String INSERT_IMG_DIALOG_ERROR_ID = "iip-err";
+ private final InsertImageGroup insertImageGroup;
+
+ public InsertImagePanel(final InsertImagePresenter presenter, I18nTranslationService i18n, Images images,
+ InsertImageGroup insertImageGroup) {
+ super(INSERT_IMG_DIALOG, i18n.t("Insert an image"), 380, HEIGHT + 90, 380, HEIGHT + 90, true, images,
+ INSERT_IMG_DIALOG_ERROR_ID);
+ super.setIconCls("k-picture-icon");
+ this.insertImageGroup = insertImageGroup;
+ }
+
+ @Override
+ public void createAndShow() {
+ insertImageGroup.createAll();
+ super.createAndShow();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImagePresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.workspace.client.options.AbstractOptionsPresenter;
+
+public class InsertImagePresenter extends AbstractOptionsPresenter implements InsertImage {
+
+ public InsertImagePresenter() {
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsView;
+
+public interface InsertImageView extends AbstractOptionsView, View {
+ int HEIGHT = 225;
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExt.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExt.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimgext;
+
+public interface InsertImageExt {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,61 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimgext;
+
+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.rte.insertimg.InsertImageView;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.PaddedPanel;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class InsertImageExtPanel extends DefaultForm implements InsertImageExtView {
+
+ private static final String LINK_FIELD = "iiep-img-field";
+ private final TextField linkField;
+ private final Panel previewPanel;
+
+ public InsertImageExtPanel(final InsertImageExtPresenter presenter, I18nTranslationService i18n) {
+ super(i18n.t("External image"));
+ super.setAutoWidth(true);
+ super.setHeight(InsertImageView.HEIGHT);
+ linkField = new TextField();
+ linkField.setTabIndex(1);
+ linkField.setFieldLabel(i18n.t("External image link (URL)"));
+ linkField.setRegex(TextUtils.URL_REGEXP);
+ linkField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
+ linkField.setName(LINK_FIELD);
+ linkField.setWidth(DEF_FIELD_WIDTH);
+ linkField.setAllowBlank(false);
+ linkField.setMinLength(3);
+ linkField.setMaxLength(250);
+ linkField.setValidationEvent(false);
+ linkField.setId(LINK_FIELD);
+ add(linkField);
+ previewPanel = new Panel();
+ previewPanel.setLayout(new FitLayout());
+ previewPanel.setHeight(125);
+ add(new PaddedPanel(previewPanel, 0));
+ Button preview = new Button(i18n.t("Preview"));
+ preview.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onPreview();
+ }
+ });
+ addButton(preview);
+
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onInsert();
+ }
+ });
+ addButton(insert);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,26 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimgext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImage;
+
+public class InsertImageExtPresenter implements InsertImageExt {
+
+ private final InsertImage insertImageDialog;
+
+ public InsertImageExtPresenter(InsertImage insertImageDialog) {
+ this.insertImageDialog = insertImageDialog;
+ }
+
+ public void init(InsertImageExtView view) {
+ insertImageDialog.addOptionTab(view);
+ }
+
+ public void onInsert() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onPreview() {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext/InsertImageExtView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimgext;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertImageExtView extends View {
+}
+
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElement.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElement.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.rte.insertlink;
+
+import org.ourproject.kune.workspace.client.options.AbstractOptions;
+
+import com.calclab.suco.client.events.Listener2;
+
+public interface TextEditorInsertElement extends AbstractOptions {
+
+ @Deprecated
+ void addOnCreateLink(Listener2<String, String> slot);
+
+ @Deprecated
+ void fireOnCreateLink(String name, String link);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementGroup.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementGroup.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package org.ourproject.kune.platf.client.ui.rte.insertlink;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.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/ui/rte/insertlink/TextEditorInsertElementPanel.java (from rev 1054, 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 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,52 @@
+/*
+ *
+ * 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.rte.insertlink;
+
+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 com.calclab.suco.client.events.Listener0;
+
+public class TextEditorInsertElementPanel extends AbstractOptionsPanel implements TextEditorInsertElementView {
+ public static final String TEXT_EDT_INSERT_DIALOG = "k-ted-iep-dialog";
+ public static final String TEXT_EDT_INSERT_DIALOG_ERROR_ID = "k-ted-iep-dialog-err";
+ private final TextEditorInsertElementGroup textEditorInsertElementGroup;
+
+ public TextEditorInsertElementPanel(final TextEditorInsertElementPresenter presenter, Images images,
+ I18nTranslationService i18n, final TextEditorInsertElementGroup textEditorInsertElementGroup) {
+ super(TEXT_EDT_INSERT_DIALOG, i18n.tWithNT("Insert a link",
+ "Option in a text editor to insert links and other elements"), 380, HEIGHT + 90, 380, HEIGHT + 90,
+ true, images, TEXT_EDT_INSERT_DIALOG_ERROR_ID);
+ super.setIconCls("k-link-icon");
+ this.textEditorInsertElementGroup = textEditorInsertElementGroup;
+ super.addHideListener(new Listener0() {
+ public void onEvent() {
+ textEditorInsertElementGroup.resetAll();
+ }
+ });
+ }
+
+ @Override
+ public void createAndShow() {
+ textEditorInsertElementGroup.createAll();
+ super.createAndShow();
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementPresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,52 @@
+/*
+ *
+ * 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.rte.insertlink;
+
+import org.ourproject.kune.workspace.client.options.AbstractOptionsPresenter;
+
+import com.calclab.suco.client.events.Event2;
+import com.calclab.suco.client.events.Listener2;
+
+public class TextEditorInsertElementPresenter extends AbstractOptionsPresenter implements TextEditorInsertElement {
+
+ private final Event2<String, String> onCreateLink;
+
+ public TextEditorInsertElementPresenter() {
+ this.onCreateLink = new Event2<String, String>("onCreateLink");
+ }
+
+ @Deprecated
+ public void addOnCreateLink(final Listener2<String, String> slot) {
+ onCreateLink.add(slot);
+ }
+
+ @Deprecated
+ public void fireOnCreateLink(String name, String link) {
+ onCreateLink.fire(name, link);
+ super.hide();
+ }
+
+ @Deprecated
+ public void fireOnInsertHtml(String name, String link) {
+ onCreateLink.fire(name, link);
+ super.hide();
+ }
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/TextEditorInsertElementView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.ui.rte.insertlink;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsView;
+
+public interface TextEditorInsertElementView extends AbstractOptionsView, View {
+ int HEIGHT = 225;
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstract.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstract.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.abstractlink;
+
+public interface TextEditorInsertAbstract {
+
+ void reset();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractPresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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.rte.insertlink.abstractlink;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+
+public class TextEditorInsertAbstractPresenter implements TextEditorInsertAbstract {
+
+ private TextEditorInsertAbstractView view;
+ private final TextEditorInsertElement editorInsertElement;
+
+ public TextEditorInsertAbstractPresenter(TextEditorInsertElement editorInsertElement) {
+ this.editorInsertElement = editorInsertElement;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(TextEditorInsertAbstractView view) {
+ this.view = view;
+ editorInsertElement.addOptionTab(view);
+ }
+
+ public void onInsert(String name, String link) {
+ editorInsertElement.fireOnCreateLink(name, link);
+ reset();
+ }
+
+ public void reset() {
+ view.reset();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/TextEditorInsertAbstractView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface TextEditorInsertAbstractView extends View {
+
+ void reset();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmail.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmail.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.email;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstract;
+
+public interface TextEditorInsertLinkEmail extends TextEditorInsertAbstract {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPanel.java (from rev 1054, 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 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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.rte.insertlink.email;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementView;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.VType;
+
+public class TextEditorInsertLinkEmailPanel extends DefaultForm implements TextEditorInsertLinkEmailView {
+
+ public static final String EMAIL_FIELD = "k-teilep-email-field";
+ private final TextField emailField;
+
+ public TextEditorInsertLinkEmailPanel(final TextEditorInsertLinkEmailPresenter presenter,
+ I18nTranslationService i18n) {
+ super(i18n.t("Email link"));
+ super.setAutoWidth(true);
+ super.setHeight(TextEditorInsertElementView.HEIGHT);
+ emailField = new TextField();
+ emailField.setTabIndex(4);
+ emailField.setFieldLabel(i18n.t("Email"));
+ emailField.setName(EMAIL_FIELD);
+ emailField.setVtype(VType.EMAIL);
+ emailField.setWidth(DEF_MEDIUM_FIELD_WIDTH);
+ emailField.setAllowBlank(false);
+ emailField.setValidationEvent(false);
+ emailField.setId(EMAIL_FIELD);
+ add(emailField);
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ if (getFormPanel().getForm().isValid()) {
+ presenter.onInsert("", "mailto://" + emailField.getRawValue());
+ }
+ }
+ });
+ addButton(insert);
+ }
+
+ public void clear() {
+ super.reset();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.email;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractPresenter;
+
+public class TextEditorInsertLinkEmailPresenter extends TextEditorInsertAbstractPresenter implements
+ TextEditorInsertLinkEmail {
+
+ public TextEditorInsertLinkEmailPresenter(TextEditorInsertElement editorInsertElement) {
+ super(editorInsertElement);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/TextEditorInsertLinkEmailView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.rte.insertlink.email;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractView;
+
+public interface TextEditorInsertLinkEmailView extends TextEditorInsertAbstractView {
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExt.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExt.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstract;
+
+public interface TextEditorInsertLinkExt extends TextEditorInsertAbstract {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPanel.java (from rev 1054, 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 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,103 @@
+/*
+ *
+ * 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.rte.insertlink.ext;
+
+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.rte.insertlink.TextEditorInsertElementView;
+
+import com.google.gwt.user.client.ui.Frame;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.PaddedPanel;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class TextEditorInsertLinkExtPanel extends DefaultForm implements TextEditorInsertLinkExtView {
+
+ public static final String LINK_FIELD = "k-teilep-link-f";
+ final TextField linkField;
+ final Panel previewPanel;
+
+ public TextEditorInsertLinkExtPanel(final TextEditorInsertLinkExtPresenter presenter,
+ final I18nTranslationService i18n) {
+ super(i18n.t("External link"));
+ super.setAutoWidth(true);
+ super.setHeight(TextEditorInsertElementView.HEIGHT);
+ linkField = new TextField();
+ linkField.setTabIndex(1);
+ linkField.setFieldLabel(i18n.t("External link (URL)"));
+ linkField.setRegex(TextUtils.URL_REGEXP);
+ linkField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
+ linkField.setName(LINK_FIELD);
+ linkField.setWidth(DEF_FIELD_WIDTH);
+ linkField.setAllowBlank(false);
+ linkField.setMinLength(3);
+ linkField.setMaxLength(250);
+ linkField.setValidationEvent(false);
+ linkField.setId(LINK_FIELD);
+ add(linkField);
+ previewPanel = new Panel();
+ previewPanel.setLayout(new FitLayout());
+ previewPanel.setHeight(125);
+ add(new PaddedPanel(previewPanel, 0));
+ Button preview = new Button(i18n.t("Preview"));
+ preview.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onPreview();
+ }
+ });
+ addButton(preview);
+
+ Button insert = new Button(i18n.t("Insert"));
+ insert.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onInsert();
+ }
+ });
+ addButton(insert);
+ }
+
+ public String getUrl() {
+ return linkField.getRawValue();
+ }
+
+ @Override
+ public void reset() {
+ super.reset();
+ previewPanel.clear();
+ }
+
+ public void setPreviewUrl(String url) {
+ Frame previewFrame = new Frame(url);
+ previewPanel.clear();
+ previewPanel.add(previewFrame);
+ previewPanel.doLayout();
+ }
+
+ public void setUrl(String url) {
+ linkField.setValue(url);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.ext;
+
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractPresenter;
+
+public class TextEditorInsertLinkExtPresenter extends TextEditorInsertAbstractPresenter implements
+ TextEditorInsertLinkExt {
+
+ interface Action {
+ void onValid(String url);
+ }
+
+ private TextEditorInsertLinkExtView view;
+
+ public TextEditorInsertLinkExtPresenter(TextEditorInsertElement editorInsertElement) {
+ super(editorInsertElement);
+ }
+
+ public void init(TextEditorInsertLinkExtView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ public void onInsert() {
+ doActionIfValid(new Action() {
+ public void onValid(String url) {
+ onInsert("", url);
+ }
+ });
+ }
+
+ public void onPreview() {
+ doActionIfValid(new Action() {
+ public void onValid(String url) {
+ view.setPreviewUrl(url);
+ }
+ });
+ }
+
+ private void doActionIfValid(Action action) {
+ String url = view.getUrl();
+ if (url.matches(TextUtils.URL_REGEXP)) {
+ action.onValid(url);
+ } else {
+ if (!url.startsWith("http://")) {
+ url = "http://" + url;
+ if (url.matches(TextUtils.URL_REGEXP)) {
+ view.setUrl(url);
+ action.onValid(url);
+ } else {
+ view.isValid();
+ }
+ } else {
+ // Seems is not valid
+ view.isValid();
+ }
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/TextEditorInsertLinkExtView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.platf.client.ui.rte.insertlink.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractView;
+
+public interface TextEditorInsertLinkExtView extends TextEditorInsertAbstractView {
+
+ public String getUrl();
+
+ public boolean isValid();
+
+ public void setPreviewUrl(String url);
+
+ public void setUrl(String url);
+}
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -50,6 +50,10 @@
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
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.ui.rte.insertimg.InsertImage;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElementGroup;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
@@ -66,20 +70,12 @@
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPresenter;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorView;
import org.ourproject.kune.workspace.client.editor.ContentEditor;
-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;
-import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linkemail.TextEditorInsertLinkEmailPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExt;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtPresenter;
-import org.ourproject.kune.workspace.client.editor.insert.linkext.TextEditorInsertLinkExtView;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocal;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPanel;
-import org.ourproject.kune.workspace.client.editor.insert.linklocal.TextEditorInsertLinkLocalPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocalimg.InsertImageLocal;
+import org.ourproject.kune.workspace.client.editor.insertlocalimg.InsertImageLocalPanel;
+import org.ourproject.kune.workspace.client.editor.insertlocalimg.InsertImageLocalPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocallink.TextEditorInsertLinkLocal;
+import org.ourproject.kune.workspace.client.editor.insertlocallink.TextEditorInsertLinkLocalPanel;
+import org.ourproject.kune.workspace.client.editor.insertlocallink.TextEditorInsertLinkLocalPresenter;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
@@ -236,8 +232,6 @@
@Override
protected void onInstall() {
- registerDecorator(TextEditorInsertElementGroup.class, new TextEditorInsertElementGroup(container));
-
register(Singleton.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
@Override
public SocialNetworkServiceAsync create() {
@@ -812,18 +806,6 @@
}
});
- register(Singleton.class, new Factory<TextEditorInsertElement>(TextEditorInsertElement.class) {
- @Override
- public TextEditorInsertElement create() {
- final TextEditorInsertElementPresenter presenter = new TextEditorInsertElementPresenter();
- final TextEditorInsertElementPanel panel = new TextEditorInsertElementPanel(presenter,
- $(WorkspaceSkeleton.class), $(Images.class), $(I18nTranslationService.class),
- $(TextEditorInsertElementGroup.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkLocal>(
TextEditorInsertLinkLocal.class) {
@Override
@@ -837,32 +819,6 @@
}
});
- register(TextEditorInsertElementGroup.class,
- new Factory<TextEditorInsertLinkExt>(TextEditorInsertLinkExt.class) {
- @Override
- public TextEditorInsertLinkExt create() {
- final TextEditorInsertLinkExtPresenter presenter = new TextEditorInsertLinkExtPresenter(
- $(TextEditorInsertElement.class));
- final TextEditorInsertLinkExtView panel = new TextEditorInsertLinkExtPanel(presenter,
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
- register(TextEditorInsertElementGroup.class, new Factory<TextEditorInsertLinkEmail>(
- TextEditorInsertLinkEmail.class) {
- @Override
- public TextEditorInsertLinkEmail create() {
- final TextEditorInsertLinkEmailPresenter presenter = new TextEditorInsertLinkEmailPresenter(
- $(TextEditorInsertElement.class));
- final TextEditorInsertLinkEmailPanel panel = new TextEditorInsertLinkEmailPanel(presenter,
- $(I18nTranslationService.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<LanguageSelector>(LanguageSelector.class) {
@Override
public LanguageSelector create() {
@@ -969,5 +925,16 @@
}
});
+ register(InsertImageGroup.class, new Factory<InsertImageLocal>(InsertImageLocal.class) {
+ @Override
+ public InsertImageLocal create() {
+ final InsertImageLocalPresenter presenter = new InsertImageLocalPresenter($(InsertImage.class));
+ final InsertImageLocalPanel panel = new InsertImageLocalPanel(presenter,
+ $(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -29,11 +29,13 @@
private final RTEditor basicEditor;
private final RTEditorPanel editorPanel;
private final AbstractToolbar topbar;
+ private final SiteSignOutLink siteSignOutLink;
public ContentEditor(RTEditor editor, boolean autoSave, I18nTranslationService i18n, StateManager stateManager,
SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
RTEImgResources imgResources, WorkspaceSkeleton ws, TimerWrapper timer, RTESavingEditorView view) {
- super(editor, autoSave, i18n, stateManager, siteSignOutLink, deferredCommandWrapper, imgResources, timer);
+ super(editor, autoSave, i18n, stateManager, deferredCommandWrapper, imgResources, timer);
+ this.siteSignOutLink = siteSignOutLink;
super.init(view);
this.ws = ws;
@@ -62,12 +64,14 @@
ws.getEntityWorkspace().setContent(vp);
super.edit(html, onSave, onEditCancelled);
adjHeight(ws.getEntityWorkspace().getContentHeight());
+ siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
}
@Override
protected void onCancelConfirmed() {
ws.getEntityWorkspace().clearContent();
super.onCancelConfirmed();
+ siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
}
private void adjHeight(final int height) {
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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -22,7 +22,7 @@
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;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
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/editor/TextEditorToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -23,7 +23,7 @@
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;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener2;
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElement.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert;
-
-import org.ourproject.kune.workspace.client.options.AbstractOptions;
-
-import com.calclab.suco.client.events.Listener2;
-
-public interface TextEditorInsertElement extends AbstractOptions {
-
- void addOnCreateLink(Listener2<String, String> slot);
-
- void fireOnCreateLink(String name, String link);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementGroup.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.workspace.client.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();
- }
- }
-}
Deleted: 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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,53 +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.editor.insert;
-
-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;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class TextEditorInsertElementPanel extends AbstractOptionsPanel implements TextEditorInsertElementView {
- public static final String TEXT_EDT_INSERT_DIALOG = "k-ted-iep-dialog";
- public static final String TEXT_EDT_INSERT_DIALOG_ERROR_ID = "k-ted-iep-dialog-err";
- private final TextEditorInsertElementGroup textEditorInsertElementGroup;
-
- public TextEditorInsertElementPanel(final TextEditorInsertElementPresenter presenter, final WorkspaceSkeleton ws,
- Images images, I18nTranslationService i18n, final TextEditorInsertElementGroup textEditorInsertElementGroup) {
- super(TEXT_EDT_INSERT_DIALOG, i18n.tWithNT("Insert a link",
- "Option in a text editor to insert links and other elements"), 380, HEIGHT + 90, 380, HEIGHT + 90,
- true, images, TEXT_EDT_INSERT_DIALOG_ERROR_ID);
- super.setIconCls("k-link-icon");
- this.textEditorInsertElementGroup = textEditorInsertElementGroup;
- super.addHideListener(new Listener0() {
- public void onEvent() {
- textEditorInsertElementGroup.resetAll();
- }
- });
- }
-
- @Override
- public void createAndShow() {
- textEditorInsertElementGroup.createAll();
- super.createAndShow();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert;
-
-import org.ourproject.kune.workspace.client.options.AbstractOptionsPresenter;
-
-import com.calclab.suco.client.events.Event2;
-import com.calclab.suco.client.events.Listener2;
-
-public class TextEditorInsertElementPresenter extends AbstractOptionsPresenter implements TextEditorInsertElement {
-
- private final Event2<String, String> onCreateLink;
-
- public TextEditorInsertElementPresenter() {
- this.onCreateLink = new Event2<String, String>("onCreateLink");
- }
-
- public void addOnCreateLink(final Listener2<String, String> slot) {
- onCreateLink.add(slot);
- }
-
- public void fireOnCreateLink(String name, String link) {
- onCreateLink.fire(name, link);
- super.hide();
- }
-
- public void fireOnInsertHtml(String name, String link) {
- onCreateLink.fire(name, link);
- super.hide();
- }
-
- public void init(TextEditorInsertElementView view) {
- super.init(view);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/TextEditorInsertElementView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor.insert;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.options.AbstractOptionsView;
-
-public interface TextEditorInsertElementView extends AbstractOptionsView, View {
- int HEIGHT = 225;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstract.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.abstractlink;
-
-public interface TextEditorInsertAbstract {
-
- void reset();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,51 +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.editor.insert.abstractlink;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-
-public class TextEditorInsertAbstractPresenter implements TextEditorInsertAbstract {
-
- private TextEditorInsertAbstractView view;
- private final TextEditorInsertElement editorInsertElement;
-
- public TextEditorInsertAbstractPresenter(TextEditorInsertElement editorInsertElement) {
- this.editorInsertElement = editorInsertElement;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(TextEditorInsertAbstractView view) {
- this.view = view;
- editorInsertElement.addOptionTab(view);
- }
-
- public void onInsert(String name, String link) {
- editorInsertElement.fireOnCreateLink(name, link);
- reset();
- }
-
- public void reset() {
- view.reset();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/abstractlink/TextEditorInsertAbstractView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor.insert.abstractlink;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface TextEditorInsertAbstractView extends View {
-
- void reset();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmail.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linkemail;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstract;
-
-public interface TextEditorInsertLinkEmail extends TextEditorInsertAbstract {
-
-}
Deleted: 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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,67 +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.editor.insert.linkemail;
-
-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;
-
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.form.VType;
-
-public class TextEditorInsertLinkEmailPanel extends DefaultForm implements TextEditorInsertLinkEmailView {
-
- public static final String EMAIL_FIELD = "k-teilep-email-field";
- private final TextField emailField;
-
- public TextEditorInsertLinkEmailPanel(final TextEditorInsertLinkEmailPresenter presenter,
- I18nTranslationService i18n) {
- super(i18n.t("Email link"));
- super.setAutoWidth(true);
- super.setHeight(TextEditorInsertElementView.HEIGHT);
- emailField = new TextField();
- emailField.setTabIndex(4);
- emailField.setFieldLabel(i18n.t("Email"));
- emailField.setName(EMAIL_FIELD);
- emailField.setVtype(VType.EMAIL);
- emailField.setWidth(DEF_MEDIUM_FIELD_WIDTH);
- emailField.setAllowBlank(false);
- emailField.setValidationEvent(false);
- emailField.setId(EMAIL_FIELD);
- add(emailField);
- Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- if (getFormPanel().getForm().isValid()) {
- presenter.onInsert("", "mailto://" + emailField.getRawValue());
- }
- }
- });
- addButton(insert);
- }
-
- public void clear() {
- super.reset();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linkemail;
-
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractPresenter;
-
-public class TextEditorInsertLinkEmailPresenter extends TextEditorInsertAbstractPresenter implements
- TextEditorInsertLinkEmail {
-
- public TextEditorInsertLinkEmailPresenter(TextEditorInsertElement editorInsertElement) {
- super(editorInsertElement);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkemail/TextEditorInsertLinkEmailView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linkemail;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractView;
-
-public interface TextEditorInsertLinkEmailView extends TextEditorInsertAbstractView {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExt.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linkext;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstract;
-
-public interface TextEditorInsertLinkExt extends TextEditorInsertAbstract {
-
-}
Deleted: 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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,103 +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.editor.insert.linkext;
-
-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;
-
-import com.google.gwt.user.client.ui.Frame;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.PaddedPanel;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.layout.FitLayout;
-
-public class TextEditorInsertLinkExtPanel extends DefaultForm implements TextEditorInsertLinkExtView {
-
- public static final String LINK_FIELD = "k-teilep-link-f";
- final TextField linkField;
- final Panel previewPanel;
-
- public TextEditorInsertLinkExtPanel(final TextEditorInsertLinkExtPresenter presenter,
- final I18nTranslationService i18n) {
- super(i18n.t("External link"));
- super.setAutoWidth(true);
- super.setHeight(TextEditorInsertElementView.HEIGHT);
- linkField = new TextField();
- linkField.setTabIndex(1);
- linkField.setFieldLabel(i18n.t("External link (URL)"));
- linkField.setRegex(TextUtils.URL_REGEXP);
- linkField.setRegexText(i18n.t("The link should be a URL in the format 'http://www.domain.com'"));
- linkField.setName(LINK_FIELD);
- linkField.setWidth(DEF_FIELD_WIDTH);
- linkField.setAllowBlank(false);
- linkField.setMinLength(3);
- linkField.setMaxLength(250);
- linkField.setValidationEvent(false);
- linkField.setId(LINK_FIELD);
- add(linkField);
- previewPanel = new Panel();
- previewPanel.setLayout(new FitLayout());
- previewPanel.setHeight(125);
- add(new PaddedPanel(previewPanel, 0));
- Button preview = new Button(i18n.t("Preview"));
- preview.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- presenter.onPreview();
- }
- });
- addButton(preview);
-
- Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(Button button, EventObject e) {
- presenter.onInsert();
- }
- });
- addButton(insert);
- }
-
- public String getUrl() {
- return linkField.getRawValue();
- }
-
- @Override
- public void reset() {
- super.reset();
- previewPanel.clear();
- }
-
- public void setPreviewUrl(String url) {
- Frame previewFrame = new Frame(url);
- previewPanel.clear();
- previewPanel.add(previewFrame);
- previewPanel.doLayout();
- }
-
- public void setUrl(String url) {
- linkField.setValue(url);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linkext;
-
-import org.ourproject.kune.platf.client.ui.TextUtils;
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractPresenter;
-
-public class TextEditorInsertLinkExtPresenter extends TextEditorInsertAbstractPresenter implements
- TextEditorInsertLinkExt {
-
- interface Action {
- void onValid(String url);
- }
-
- private TextEditorInsertLinkExtView view;
-
- public TextEditorInsertLinkExtPresenter(TextEditorInsertElement editorInsertElement) {
- super(editorInsertElement);
- }
-
- public void init(TextEditorInsertLinkExtView view) {
- super.init(view);
- this.view = view;
- }
-
- public void onInsert() {
- doActionIfValid(new Action() {
- public void onValid(String url) {
- onInsert("", url);
- }
- });
- }
-
- public void onPreview() {
- doActionIfValid(new Action() {
- public void onValid(String url) {
- view.setPreviewUrl(url);
- }
- });
- }
-
- private void doActionIfValid(Action action) {
- String url = view.getUrl();
- if (url.matches(TextUtils.URL_REGEXP)) {
- action.onValid(url);
- } else {
- if (!url.startsWith("http://")) {
- url = "http://" + url;
- if (url.matches(TextUtils.URL_REGEXP)) {
- view.setUrl(url);
- action.onValid(url);
- } else {
- view.isValid();
- }
- } else {
- // Seems is not valid
- view.isValid();
- }
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linkext/TextEditorInsertLinkExtView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,33 +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.editor.insert.linkext;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractView;
-
-public interface TextEditorInsertLinkExtView extends TextEditorInsertAbstractView {
-
- public String getUrl();
-
- public boolean isValid();
-
- public void setPreviewUrl(String url);
-
- public void setUrl(String url);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linklocal;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstract;
-
-public interface TextEditorInsertLinkLocal extends TextEditorInsertAbstract {
-
-}
Deleted: 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-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -1,51 +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.editor.insert.linklocal;
-
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-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;
-import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherPanel;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.calclab.suco.client.events.Listener;
-
-public class TextEditorInsertLinkLocalPanel extends AbstractLiveSearcherPanel implements TextEditorInsertLinkLocalView {
-
- private static final String DATA_PROXY_URL = "/kune/json/ContentJSONService/search";
-
- public TextEditorInsertLinkLocalPanel(final TextEditorInsertLinkLocalPresenter presenter,
- final WorkspaceSkeleton ws, I18nTranslationService i18n, FileDownloadUtils downloadUtils) {
- super(i18n, TEMPLATE_TEXT_PREFIX + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
- + TEMPLATE_TEXT_SUFFIX, DATA_PROXY_URL, new Listener<LinkDTO>() {
- public void onEvent(LinkDTO link) {
- // FIXME
- presenter.onInsert("", WindowUtils.getLocation().getHref() + link.getLink());
- }
- });
- super.setTitle(i18n.t("Local link"));
- super.setFrame(true);
- super.setHeight(TextEditorInsertElementView.HEIGHT);
- super.setPaddings(20);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linklocal;
-
-import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractPresenter;
-
-public class TextEditorInsertLinkLocalPresenter extends TextEditorInsertAbstractPresenter implements
- TextEditorInsertLinkLocal {
-
- public TextEditorInsertLinkLocalPresenter(TextEditorInsertElement editorInsertElement) {
- super(editorInsertElement);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.workspace.client.editor.insert.linklocal;
-
-import org.ourproject.kune.workspace.client.editor.insert.abstractlink.TextEditorInsertAbstractView;
-
-public interface TextEditorInsertLinkLocalView extends TextEditorInsertAbstractView {
-}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocal.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalimg;
+
+public interface InsertImageLocal {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalimg;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageView;
+
+import com.google.gwt.user.client.ui.Label;
+import com.gwtext.client.widgets.Panel;
+
+public class InsertImageLocalPanel extends Panel implements InsertImageLocalView {
+
+ public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, I18nTranslationService i18n) {
+ super(i18n.t("Local image"));
+ setAutoWidth(true);
+ setHeight(InsertImageView.HEIGHT);
+ setPaddings(20);
+ add(new Label(TextUtils.IN_DEVELOPMENT));
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalimg;
+
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImage;
+
+public class InsertImageLocalPresenter implements InsertImageLocal {
+
+ private final InsertImage insertImageDialog;
+
+ public InsertImageLocalPresenter(InsertImage insertImageDialog) {
+ this.insertImageDialog = insertImageDialog;
+ }
+
+ public void init(InsertImageLocalView view) {
+ insertImageDialog.addOptionTab(view);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalimg;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertImageLocalView extends View {
+}
+
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocal.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocal.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocal.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.editor.insertlocallink;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstract;
+
+public interface TextEditorInsertLinkLocal extends TextEditorInsertAbstract {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPanel.java (from rev 1054, 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 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPanel.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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.insertlocallink;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+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.platf.client.ui.rte.insertlink.TextEditorInsertElementView;
+import org.ourproject.kune.workspace.client.search.AbstractLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.calclab.suco.client.events.Listener;
+
+public class TextEditorInsertLinkLocalPanel extends AbstractLiveSearcherPanel implements TextEditorInsertLinkLocalView {
+
+ private static final String DATA_PROXY_URL = "/kune/json/ContentJSONService/search";
+
+ public TextEditorInsertLinkLocalPanel(final TextEditorInsertLinkLocalPresenter presenter,
+ final WorkspaceSkeleton ws, I18nTranslationService i18n, FileDownloadUtils downloadUtils) {
+ super(i18n, TEMPLATE_TEXT_PREFIX + downloadUtils.getLogoImageUrl(new StateToken("{shortName}"))
+ + TEMPLATE_TEXT_SUFFIX, DATA_PROXY_URL, new Listener<LinkDTO>() {
+ public void onEvent(LinkDTO link) {
+ // FIXME
+ presenter.onInsert("", WindowUtils.getLocation().getHref() + link.getLink());
+ }
+ });
+ super.setTitle(i18n.t("Local link"));
+ super.setFrame(true);
+ super.setHeight(TextEditorInsertElementView.HEIGHT);
+ super.setPaddings(20);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalPresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalPresenter.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -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.editor.insertlocallink;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.TextEditorInsertElement;
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractPresenter;
+
+public class TextEditorInsertLinkLocalPresenter extends TextEditorInsertAbstractPresenter implements
+ TextEditorInsertLinkLocal {
+
+ public TextEditorInsertLinkLocalPresenter(TextEditorInsertElement editorInsertElement) {
+ super(editorInsertElement);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insert/linklocal/TextEditorInsertLinkLocalView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/TextEditorInsertLinkLocalView.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.insertlocallink;
+
+import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.TextEditorInsertAbstractView;
+
+public interface TextEditorInsertLinkLocalView extends TextEditorInsertAbstractView {
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java 2009-03-11 00:16:51 UTC (rev 1068)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java 2009-03-11 13:21:45 UTC (rev 1069)
@@ -13,7 +13,6 @@
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
-import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.testing.events.MockedListener;
@@ -26,7 +25,6 @@
private MockedListener<String> saveListener;
private MockedListener0 cancelListener;
private StateManager stateManager;
- private SiteSignOutLink signOutLink;
private DeferredCommandWrapper deferredCommandWrapper;
private RTEditor rteEditor;
private TimerWrapper timer;
@@ -39,7 +37,6 @@
public void createObjects() {
I18nUITranslationService i18n = Mockito.mock(I18nUITranslationService.class);
stateManager = Mockito.mock(StateManager.class);
- signOutLink = Mockito.mock(SiteSignOutLink.class);
deferredCommandWrapper = Mockito.mock(DeferredCommandWrapper.class);
rteEditor = Mockito.mock(RTEditor.class);
RTEImgResources imgResources = Mockito.mock(RTEImgResources.class);
@@ -50,8 +47,8 @@
Mockito.when(rteEditor.getSndBar()).thenReturn(sndbar);
timer = Mockito.mock(TimerWrapper.class);
view = Mockito.mock(RTESavingEditorView.class);
- presenter = new RTESavingEditorPresenter(rteEditor, true, i18n, stateManager, signOutLink,
- deferredCommandWrapper, imgResources, timer);
+ presenter = new RTESavingEditorPresenter(rteEditor, true, i18n, stateManager, deferredCommandWrapper,
+ imgResources, timer);
presenter.init(view);
saveListener = new MockedListener<String>();
cancelListener = new MockedListener0();
1
0
Author: vjrj
Date: 2009-03-11 01:16:51 +0100 (Wed, 11 Mar 2009)
New Revision: 1068
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
Complete - task editHtml dialog (editor/preview) for RTE
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -294,7 +294,7 @@
register(ApplicationComponentGroup.class, new Factory<NotifyUser>(NotifyUser.class) {
@Override
public NotifyUser create() {
- return new NotifyUser($(I18nTranslationService.class));
+ return new NotifyUser($(I18nTranslationService.class), $(Images.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -20,8 +20,10 @@
package org.ourproject.kune.platf.client.ui.dialogs;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.gwtext.client.widgets.Toolbar;
@@ -57,11 +59,11 @@
toolbar.setVisible(false);
}
- public void setErrorMessage(final String message, final Level type) {
+ public void setErrorMessage(final String message, final Level level) {
errorLabel.setText(message);
+ AbstractImagePrototype icon = NotifyUser.getImage(level);
+ icon.applyTo(errorIcon);
errorIcon.setVisible(true);
- // FIXME
- // String iconCls = NotifyUser.getCls(level);
toolbar.setVisible(true);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -20,6 +20,7 @@
package org.ourproject.kune.platf.client.ui.noti;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
import com.calclab.suco.client.events.Event;
import com.calclab.suco.client.events.Event0;
@@ -27,6 +28,7 @@
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.events.Listener2;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
public class NotifyUser {
@@ -46,6 +48,8 @@
private static I18nTranslationService i18n;
+ private static Images images;
+
public static void askConfirmation(String confirmationTitle, String confirmationText, Listener0 onConfirm,
Listener0 onCancel) {
onConfirmationAsk.fire(new ConfirmationAsk(confirmationTitle, confirmationText, onConfirm, onCancel));
@@ -56,24 +60,33 @@
}
public static String getCls(Level level) {
- String iconCls = "";
switch (level) {
case info:
- iconCls = "k-stm-info-icon";
- break;
+ return "k-stm-info-icon";
case important:
- iconCls = "k-stm-imp-icon";
- break;
+ return "k-stm-imp-icon";
case veryImportant:
- iconCls = "k-stm-verimp-icon";
- break;
+ return "k-stm-verimp-icon";
case error:
- iconCls = "k-stm-error-icon";
- break;
+ default:
+ return "k-stm-error-icon";
}
- return iconCls;
}
+ public static AbstractImagePrototype getImage(Level level) {
+ switch (level) {
+ case info:
+ return images.info();
+ case important:
+ return images.important();
+ case veryImportant:
+ return images.alert();
+ case error:
+ default:
+ return images.error();
+ }
+ }
+
public static void hideProgress() {
onHideProgress.fire();
}
@@ -114,8 +127,9 @@
onNotify.fire(Level.veryImportant, message);
}
- public NotifyUser(I18nTranslationService i18n) {
+ public NotifyUser(I18nTranslationService i18n, Images images) {
NotifyUser.i18n = i18n;
+ NotifyUser.images = images;
onNotify = new Event2<Level, String>("onNotify");
onAlert = new Event2<String, String>("onAlert");
onProgress = new Event<String>("onProgress");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -400,6 +400,7 @@
dialog.setUpdateListener(new Listener<String>() {
public void onEvent(String html) {
view.setHtml(html);
+ fireOnEdit();
}
});
dialog.show();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -15,7 +15,7 @@
super("HTML");
super.setAutoWidth(true);
super.setHideLabels(true);
- super.setHeight(EditHtmlView.HEIGHT - 35);
+ super.setHeight(EditHtmlView.HEIGHT - 20);
editorField = new TextArea();
editorField.setHeight(EditHtmlView.HEIGHT - 70);
editorField.setWidth("98%");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -11,14 +11,16 @@
public EditHtmlPreviewPanel(I18nTranslationService i18n, final EditHtmlPreviewPresenter presenter) {
setTitle(i18n.t("Preview"));
- super.setCls("kune-Content-Main");
- setHeight(EditHtmlView.HEIGHT - 40);
+ setCls("kune-Content-Main");
+ setHeight(EditHtmlView.HEIGHT - 45);
+ setPaddings(5);
setAutoScroll(true);
setAutoWidth(true);
- super.addListener(new PanelListenerAdapter() {
+ addListener(new PanelListenerAdapter() {
@Override
public void onActivate(Panel panel) {
clear();
+ setHeight(EditHtmlView.HEIGHT - 45);
add(new HTML(presenter.getHtml()));
if (isRendered()) {
doLayout();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -152,9 +152,9 @@
import org.ourproject.kune.workspace.client.signin.SignInView;
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.site.WorkspaceNotifyUser;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessagePanel;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessagePresenter;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessage;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessagePanel;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessagePresenter;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPresenter;
@@ -283,7 +283,7 @@
@Override
public WorkspaceNotifyUser create() {
return new WorkspaceNotifyUser($(NotifyUser.class), $(I18nUITranslationService.class),
- $(SiteProgress.class), $$(SiteToastMessage.class), $$(WorkspaceSkeleton.class));
+ $(SiteProgress.class), $$(ToastMessage.class), $$(WorkspaceSkeleton.class));
}
});
@@ -298,11 +298,11 @@
}
});
- register(NoDecoration.class, new Factory<SiteToastMessage>(SiteToastMessage.class) {
+ register(NoDecoration.class, new Factory<ToastMessage>(ToastMessage.class) {
@Override
- public SiteToastMessage create() {
- final SiteToastMessagePresenter presenter = new SiteToastMessagePresenter();
- final SiteToastMessagePanel panel = new SiteToastMessagePanel();
+ public ToastMessage create() {
+ final ToastMessagePresenter presenter = new ToastMessagePresenter();
+ final ToastMessagePanel panel = new ToastMessagePanel();
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -4,7 +4,7 @@
import org.ourproject.kune.platf.client.ui.noti.ConfirmationAsk;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-import org.ourproject.kune.workspace.client.site.msg.SiteToastMessage;
+import org.ourproject.kune.workspace.client.site.msg.ToastMessage;
import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -16,7 +16,7 @@
public class WorkspaceNotifyUser {
public WorkspaceNotifyUser(NotifyUser notifyUser, final I18nTranslationService i18n,
- final SiteProgress siteProgress, final Provider<SiteToastMessage> toaster,
+ final SiteProgress siteProgress, final Provider<ToastMessage> toaster,
final Provider<WorkspaceSkeleton> ws) {
notifyUser.addProgressNotifier(new Listener<String>() {
public void onEvent(String message) {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public interface SiteToastMessage {
-
- void showMessage(String title, String message, Level level);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.gwtextux.client.widgets.window.ToastWindow;
-
-public class SiteToastMessagePanel implements SiteToastMessageView {
-
- public SiteToastMessagePanel() {
- }
-
- public void showMessage(String title, String message, Level level) {
- HTML html = new HTML(message);
- html.addStyleName("kune-Margin-Medium-trbl");
- ToastWindow toastWindow = new ToastWindow(title, html.toString());
- String iconCls = NotifyUser.getCls(level);
- toastWindow.setIconCls(iconCls);
- toastWindow.show();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public class SiteToastMessagePresenter implements SiteToastMessage {
-
- private SiteToastMessageView view;
-
- public SiteToastMessagePresenter() {
- }
-
- public View getView() {
- return view;
- }
-
- public void init(SiteToastMessageView view) {
- this.view = view;
- }
-
- public void showMessage(String title, final String message, final Level level) {
- view.showMessage(title, message, level);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.site.msg;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
-
-public interface SiteToastMessageView extends View {
-
- void showMessage(String title, String message, Level level);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessage.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public interface ToastMessage {
+
+ void showMessage(String title, String message, Level level);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java (from rev 1067, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.gwtextux.client.widgets.window.ToastWindow;
+
+public class ToastMessagePanel implements ToastMessageView {
+
+ public ToastMessagePanel() {
+ }
+
+ public void showMessage(String title, String message, Level level) {
+ HTML html = new HTML(message);
+ html.addStyleName("kune-Margin-Medium-trbl");
+ ToastWindow toastWindow = new ToastWindow(title, html.toString());
+ String iconCls = NotifyUser.getCls(level);
+ toastWindow.setIconCls(iconCls);
+ toastWindow.show();
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePresenter.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public class ToastMessagePresenter implements ToastMessage {
+
+ private ToastMessageView view;
+
+ public ToastMessagePresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(ToastMessageView view) {
+ this.view = view;
+ }
+
+ public void showMessage(String title, final String message, final Level level) {
+ view.showMessage(title, message, level);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessageView.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.site.msg;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+
+public interface ToastMessageView extends View {
+
+ void showMessage(String title, String message, Level level);
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-03-10 17:53:08 UTC (rev 1067)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2009-03-11 00:16:51 UTC (rev 1068)
@@ -47,7 +47,7 @@
stateManager.onStateChanged(stateChangeListener);
stateManager.onGroupChanged(groupChangeListener);
stateManager.onToolChanged(toolChangeListener);
- new NotifyUser(null);
+ new NotifyUser(null, null);
}
@Test
1
0
Author: vjrj
Date: 2009-03-10 18:53:08 +0100 (Tue, 10 Mar 2009)
New Revision: 1067
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtml.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlAgent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreview.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewView.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java
Log:
Complete - task editHtml dialog (editor/preview) for RTE
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -59,6 +59,16 @@
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.edithtml.EditHtml;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlGroup;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlPanel;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlPresenter;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlEditor;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlEditorPanel;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlEditorPresenter;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.preview.EditHtmlPreview;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.preview.EditHtmlPreviewPanel;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.preview.EditHtmlPreviewPresenter;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
@@ -256,7 +266,7 @@
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
$(Session.class), topBar, sndBar, $(RTEImgResources.class), $(TextEditorInsertElement.class),
- $(ColorWebSafePalette.class), $(DeferredCommandWrapper.class));
+ $(ColorWebSafePalette.class), $$(EditHtml.class), $(DeferredCommandWrapper.class));
final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
$(ActionManager.class));
presenter.init(panel);
@@ -297,6 +307,37 @@
}
});
+ registerDecorator(EditHtmlGroup.class, new EditHtmlGroup(container));
+
+ register(EditHtmlGroup.class, new Factory<EditHtml>(EditHtml.class) {
+ @Override
+ public EditHtml create() {
+ final EditHtmlPresenter presenter = new EditHtmlPresenter();
+ final EditHtmlPanel panel = new EditHtmlPanel(presenter, $(I18nTranslationService.class),
+ $(RTEImgResources.class), $(Images.class), $(EditHtmlGroup.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(EditHtmlGroup.class, new Factory<EditHtmlEditor>(EditHtmlEditor.class) {
+ @Override
+ public EditHtmlEditor create() {
+ final EditHtmlEditorPresenter presenter = new EditHtmlEditorPresenter($(EditHtml.class));
+ final EditHtmlEditorPanel panel = new EditHtmlEditorPanel(i18n, presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, new Factory<EditHtmlPreview>(EditHtmlPreview.class) {
+ @Override
+ public EditHtmlPreview create() {
+ final EditHtmlPreviewPresenter presenter = new EditHtmlPreviewPresenter($(EditHtml.class));
+ final EditHtmlPreviewPanel panel = new EditHtmlPreviewPanel(i18n, presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
$(ApplicationComponentGroup.class).createAll();
$(ToolGroup.class).createAll();
$(Application.class).start();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/MessageToolbar.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -60,6 +60,8 @@
public void setErrorMessage(final String message, final Level type) {
errorLabel.setText(message);
errorIcon.setVisible(true);
+ // FIXME
+ // String iconCls = NotifyUser.getCls(level);
toolbar.setVisible(true);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -55,6 +55,25 @@
onNotify.fire(Level.error, message);
}
+ public static String getCls(Level level) {
+ String iconCls = "";
+ switch (level) {
+ case info:
+ iconCls = "k-stm-info-icon";
+ break;
+ case important:
+ iconCls = "k-stm-imp-icon";
+ break;
+ case veryImportant:
+ iconCls = "k-stm-verimp-icon";
+ break;
+ case error:
+ iconCls = "k-stm-error-icon";
+ break;
+ }
+ return iconCls;
+ }
+
public static void hideProgress() {
onHideProgress.fire();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -19,6 +19,7 @@
import org.ourproject.kune.platf.client.ui.TextUtils;
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.edithtml.EditHtml;
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;
@@ -27,6 +28,7 @@
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.ioc.Provider;
import com.google.gwt.libideas.resources.client.ImageResource;
public class RTEditorPresenter implements RTEditor {
@@ -61,16 +63,18 @@
private final DeferredCommandWrapper deferred;
private final ActionAddCondition<Object> canBeBasic;
private final ActionAddCondition<Object> canBeExtended;
+ private final Provider<EditHtml> editHtmlDialog;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement,
- ColorWebSafePalette palette, DeferredCommandWrapper deferred) {
+ ColorWebSafePalette palette, Provider<EditHtml> editHtmlDialog, DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
this.sndBar = sndBar;
this.insertElement = textEditorInsertElement;
this.palette = palette;
+ this.editHtmlDialog = editHtmlDialog;
this.deferred = deferred;
styleToolbar(sndBar);
sndBar.attach();
@@ -392,7 +396,14 @@
ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
new Listener0() {
public void onEvent() {
- NotifyUser.info("In dev");
+ EditHtml dialog = editHtmlDialog.get();
+ dialog.setUpdateListener(new Listener<String>() {
+ public void onEvent(String html) {
+ view.setHtml(html);
+ }
+ });
+ dialog.show();
+ dialog.setHtml(view.getHtml());
}
});
editHtml.setIconCls(getCssName(imgResources.edithtml()));
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtml.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtml.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtml.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,21 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml;
+
+import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlAgent;
+import org.ourproject.kune.workspace.client.options.AbstractOptions;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public interface EditHtml extends AbstractOptions {
+
+ String getHtml();
+
+ void setAgent(EditHtmlAgent agent);
+
+ void setCancelListener(Listener0 cancelListener);
+
+ void setHtml(String html);
+
+ void setUpdateListener(Listener<String> updateListener);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml;
+
+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 EditHtmlGroup extends ProviderCollection {
+
+ public EditHtmlGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPanel.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,60 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsPanel;
+
+import com.google.gwt.user.client.Window;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class EditHtmlPanel extends AbstractOptionsPanel implements EditHtmlView {
+
+ public static final String EDIT_HTML_DIALOG = "ehtml-dialog";
+ public static final String EDIG_HTML_DIALOG_ERROR_ID = "ehtml-dialgo-error";
+ private final EditHtmlGroup editHtmlGroup;
+ private final I18nTranslationService i18n;
+ private Button cancel;
+ private final EditHtmlPresenter presenter;
+
+ public EditHtmlPanel(final EditHtmlPresenter presenter, I18nTranslationService i18n, RTEImgResources resources,
+ Images images, EditHtmlGroup editHtmlGroup) {
+ super(EDIT_HTML_DIALOG, i18n.tWithNT("Edit the HTML",
+ "Option in a content editor to edit the html internal code (for advance users)"),
+ Window.getClientWidth() - 100, HEIGHT + 80, Window.getClientWidth() - 100, HEIGHT + 80, true, images,
+ EDIG_HTML_DIALOG_ERROR_ID);
+ this.presenter = presenter;
+ this.i18n = i18n;
+ this.editHtmlGroup = editHtmlGroup;
+ // super.setIconCls(RTEImgResources.SUFFIX +
+ // resources.edithtml().getName());
+ }
+
+ @Override
+ public void createAndShow() {
+ if (cancel == null) {
+ cancel = new Button(i18n.t("Cancel"));
+ Button update = new Button(i18n.t("Update"));
+ cancel.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onCancel();
+ }
+ });
+ update.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ presenter.onUpdate();
+ }
+ });
+ super.addButton(update);
+ super.addButton(cancel);
+ }
+ editHtmlGroup.createAll();
+ super.createAndShow();
+ super.setErrorMessage(i18n.t("This option is only for advanced users"), Level.info);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,64 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.editor.EditHtmlAgent;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsPresenter;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class EditHtmlPresenter extends AbstractOptionsPresenter implements EditHtml {
+
+ private EditHtmlView view;
+ private Listener<String> updateListener;
+ private Listener0 cancelListener;
+ private EditHtmlAgent agent;
+
+ public EditHtmlPresenter() {
+ }
+
+ public String getHtml() {
+ return agent.getHtml();
+ }
+
+ @Override
+ public View getView() {
+ return view;
+ }
+
+ public void init(EditHtmlView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ public void onCancel() {
+ if (cancelListener != null) {
+ cancelListener.onEvent();
+ }
+ view.hide();
+ }
+
+ public void onUpdate() {
+ if (updateListener != null) {
+ // FIXME
+ updateListener.onEvent(agent.getHtml());
+ }
+ view.hide();
+ }
+
+ public void setAgent(EditHtmlAgent agent) {
+ this.agent = agent;
+ }
+
+ public void setCancelListener(Listener0 cancelListener) {
+ this.cancelListener = cancelListener;
+ }
+
+ public void setHtml(String html) {
+ agent.setHtml(html);
+ }
+
+ public void setUpdateListener(Listener<String> updateListener) {
+ this.updateListener = updateListener;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlView.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlView.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.options.AbstractOptionsView;
+
+public interface EditHtmlView extends AbstractOptionsView, View {
+ int HEIGHT = 225;
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlAgent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlAgent.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlAgent.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.editor;
+
+public interface EditHtmlAgent {
+
+ String getHtml();
+
+ void setHtml(String html);
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditor.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditor.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.editor;
+
+public interface EditHtmlEditor {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,35 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.editor;
+
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlView;
+
+import com.gwtext.client.widgets.form.TextArea;
+
+public class EditHtmlEditorPanel extends DefaultForm implements EditHtmlEditorView {
+
+ public static final String HTML_FIELD = "ehtp-html-f";
+ private final TextArea editorField;
+
+ public EditHtmlEditorPanel(I18nUITranslationService i18n, final EditHtmlEditorPresenter presenter) {
+ super("HTML");
+ super.setAutoWidth(true);
+ super.setHideLabels(true);
+ super.setHeight(EditHtmlView.HEIGHT - 35);
+ editorField = new TextArea();
+ editorField.setHeight(EditHtmlView.HEIGHT - 70);
+ editorField.setWidth("98%");
+ editorField.setTabIndex(4);
+ editorField.setName(HTML_FIELD);
+ editorField.setId(HTML_FIELD);
+ add(editorField);
+ }
+
+ public String getHtml() {
+ return editorField.getRawValue();
+ }
+
+ public void setHtml(String html) {
+ editorField.setValue(html);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,32 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.editor;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtml;
+
+public class EditHtmlEditorPresenter implements EditHtmlEditor, EditHtmlAgent {
+
+ private EditHtmlEditorView view;
+ private final EditHtml editHtml;
+
+ public EditHtmlEditorPresenter(EditHtml editHtml) {
+ this.editHtml = editHtml;
+ editHtml.setAgent(this);
+ }
+
+ public String getHtml() {
+ return view.getHtml();
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(EditHtmlEditorView view) {
+ this.view = view;
+ editHtml.addOptionTab(view);
+ }
+
+ public void setHtml(String html) {
+ view.setHtml(html);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorView.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/EditHtmlEditorView.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,10 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.editor;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EditHtmlEditorView extends View {
+
+ String getHtml();
+
+ void setHtml(String html);
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreview.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreview.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreview.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.preview;
+
+public interface EditHtmlPreview {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,29 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.preview;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlView;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
+
+public class EditHtmlPreviewPanel extends Panel implements EditHtmlPreviewView {
+
+ public EditHtmlPreviewPanel(I18nTranslationService i18n, final EditHtmlPreviewPresenter presenter) {
+ setTitle(i18n.t("Preview"));
+ super.setCls("kune-Content-Main");
+ setHeight(EditHtmlView.HEIGHT - 40);
+ setAutoScroll(true);
+ setAutoWidth(true);
+ super.addListener(new PanelListenerAdapter() {
+ @Override
+ public void onActivate(Panel panel) {
+ clear();
+ add(new HTML(presenter.getHtml()));
+ if (isRendered()) {
+ doLayout();
+ }
+ }
+ });
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewPresenter.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,27 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.preview;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtml;
+
+public class EditHtmlPreviewPresenter implements EditHtmlPreview {
+
+ private EditHtmlPreviewView view;
+ private final EditHtml editHtml;
+
+ public EditHtmlPreviewPresenter(EditHtml editHtml) {
+ this.editHtml = editHtml;
+ }
+
+ public String getHtml() {
+ return editHtml.getHtml();
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(EditHtmlPreviewView view) {
+ this.view = view;
+ editHtml.addOptionTab(view);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewView.java 2009-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/EditHtmlPreviewView.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.edithtml.preview;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EditHtmlPreviewView extends 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-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -19,6 +19,8 @@
*/
package org.ourproject.kune.workspace.client.options;
+import java.util.ArrayList;
+
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
@@ -28,6 +30,7 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
@@ -48,6 +51,7 @@
private final String errorLabelId;
private String iconCls;
private Listener0 onHideListener;
+ private final ArrayList<Button> buttons;
public AbstractOptionsPanel(String dialogId, String title, int width, int height, int minWidth, int minHeight,
boolean modal, Images images, String errorLabelId) {
@@ -60,8 +64,18 @@
this.modal = modal;
this.images = images;
this.errorLabelId = errorLabelId;
+ buttons = new ArrayList<Button>();
}
+ /**
+ * User before show/render
+ *
+ * @param button
+ */
+ public void addButton(Button button) {
+ buttons.add(button);
+ }
+
public void addHideListener(final Listener0 onHideListener) {
this.onHideListener = onHideListener;
if (dialog != null) {
@@ -168,6 +182,9 @@
if (onHideListener != null) {
addHideListener();
}
+ for (Button button : buttons) {
+ dialog.addButton(button);
+ }
}
private void createDialogIfNecessary() {
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-03-10 13:43:43 UTC (rev 1066)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/SiteToastMessagePanel.java 2009-03-10 17:53:08 UTC (rev 1067)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.workspace.client.site.msg;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import com.google.gwt.user.client.ui.HTML;
@@ -33,22 +34,9 @@
HTML html = new HTML(message);
html.addStyleName("kune-Margin-Medium-trbl");
ToastWindow toastWindow = new ToastWindow(title, html.toString());
- String iconCls = "";
- switch (level) {
- case info:
- iconCls = "k-stm-info-icon";
- break;
- case important:
- iconCls = "k-stm-imp-icon";
- break;
- case veryImportant:
- iconCls = "k-stm-verimp-icon";
- break;
- case error:
- iconCls = "k-stm-error-icon";
- break;
- }
+ String iconCls = NotifyUser.getCls(level);
toastWindow.setIconCls(iconCls);
toastWindow.show();
}
+
}
1
0
Author: vjrj
Date: 2009-03-10 14:43:43 +0100 (Tue, 10 Mar 2009)
New Revision: 1066
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorView.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java
Removed:
trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Modified:
trunk/DEV-GUIDE
trunk/TODO
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.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/utils/TimerWrapper.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/DEV-GUIDE 2009-03-10 13:43:43 UTC (rev 1066)
@@ -18,6 +18,14 @@
svn checkout svn+ssh://[email protected]/svnroot/kune/trunk
+== Mailing lists==
+
+We use mainly two lists:
+* [https://lists.ourproject.org/cgi-bin/mailman/listinfo/kune-devel kune-devel] for all development related topics
+* [https://lists.ourproject.org/cgi-bin/mailman/listinfo/kune-commits kune-commits] where the svn sends the commit logs and summaries
+
+It's recommended to be subscribed to both if you want to participate in the development.
+
==Some relevant docs for kune development==
See this files in trunk directory:
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/TODO 2009-03-10 13:43:43 UTC (rev 1066)
@@ -78,55 +78,16 @@
http://en.wikipedia.org/wiki/Fragment_identifier
http://www.w3.org/DesignIssues/Fragment.html
** vjrj <v> better RTE
-*** Functionality
- + We can have several RTE in use
- - with different menus (File/Blog ...)
- - with different save/close actions
- - with different capabilities depending on:
- - the browser
- - the functionality
- + bidi support
- + shortcuts (for insert comments, italic, bold, and soon).
- + Add new capabilities (based on InsertHTML):
- - Insert tables
- - Insert special chars (for table or from unicode).
- - youtube videos
- + Edit HTML
- + Easy extensible for new actions
- + Try (yes, only try) to be a reusable module (like emite)
- + autosave on/off
-*** Charactericts
- + Builded over gwt RTE (or any similar RTE) and based in gwt mouse/keyboard events
-*** Menus
-**** File
- + Save (Ctrl+S) [Always active?]
- + Save as new copy ...
- + Rename... (F2)
- + Delete...
-**** Edit
- + Undo (Ctrl+Z)
- + Redo (Ctrl+Y)
- ---------------
- + Copy
- + Cut
- + Paste
- ---------------
- + Select all (Ctrl+A)
- + Edit HTML
-**** Insert
- + Picture...
- + Link... (Ctrl+K)
- + Table...
- ----------------
- + Comment...(Ctrl+M)
- + Special char
- + Horizontal line
- + Page break (for printing)
-*** Buttons
-*** Elements
- + A register of actions (menus/buttons)
- + Every RTE instance selects the actions to use
- + Two topbars, one for menus, other for buttons, font/color selections
+*** Pending
+**** with different menus (File/Blog ...)
+**** bidi support
+**** Insert special chars (for table or from unicode).
+**** images (local/remote) with preview
+**** youtube videos/podcasts
+**** Edit HTML
+**** File > Rename (F2)
+**** Insert > Special char
+**** Insert > Page break (for printing)
*** Links
http://www.ongwt.com/post/2009/01/08/XWiki-:-Wysiwyg-editor-based-on-GWT
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/in…
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-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -79,6 +79,7 @@
Position.ctx, TYPE_BLOG);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+ createEditAction(TYPE_POST);
createContentModeratedActions(parentMenuTitle, contentsModerated);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
@@ -95,7 +96,6 @@
createGoAction(all);
createGoHomeAction(containers);
- createEditAction(TYPE_POST);
// ContentRPC Authorized must permit folders
// contentActionRegistry.addAction(setAsDefGroupCxt, TYPE_BLOG);
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-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -80,6 +80,7 @@
Position.ctx, TYPE_ROOT, TYPE_FOLDER);
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+ createEditAction(TYPE_DOCUMENT);
createContentModeratedActions(parentMenuTitle, contentsModerated);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
@@ -100,8 +101,6 @@
createGoHomeAction(containers);
- createEditAction(TYPE_DOCUMENT);
-
createTranslateAction(TYPE_DOCUMENT, TYPE_FOLDER);
createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -53,6 +53,7 @@
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.RTESavingEditor;
+import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPanel;
import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPresenter;
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPanel;
@@ -60,6 +61,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.platf.client.utils.TimerWrapper;
import org.ourproject.kune.workspace.client.editor.insert.TextEditorInsertElement;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
@@ -240,6 +242,13 @@
}
});
+ register(Singleton.class, new Factory<TimerWrapper>(TimerWrapper.class) {
+ @Override
+ public TimerWrapper create() {
+ return new TimerWrapper();
+ }
+ });
+
register(NoDecoration.class, new Factory<RTEditor>(RTEditor.class) {
@Override
public RTEditor create() {
@@ -256,9 +265,12 @@
}, new Factory<RTESavingEditor>(RTESavingEditor.class) {
@Override
public RTESavingEditor create() {
- return new RTESavingEditorPresenter($(RTEditor.class), true, $(I18nTranslationService.class),
- $(StateManager.class), $(SiteSignOutLink.class), $(DeferredCommandWrapper.class),
- $(RTEImgResources.class));
+ RTESavingEditorPresenter presenter = new RTESavingEditorPresenter($(RTEditor.class), true,
+ $(I18nTranslationService.class), $(StateManager.class), $(SiteSignOutLink.class),
+ $(DeferredCommandWrapper.class), $(RTEImgResources.class), $(TimerWrapper.class));
+ RTESavingEditorPanel panel = new RTESavingEditorPanel();
+ presenter.init(panel);
+ return presenter;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -48,6 +48,7 @@
public Widget addFill() {
final Label emptyLabel = new Label("");
+ emptyLabel.addStyleName("kune-floatleft");
this.add(emptyLabel);
return emptyLabel;
}
@@ -56,6 +57,7 @@
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-sep");
emptyLabel.addStyleName("k-toolbar-sep");
+ emptyLabel.addStyleName("kune-floatleft");
this.add(emptyLabel);
return emptyLabel;
}
@@ -63,6 +65,7 @@
public Widget addSpacer() {
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-spacer");
+ emptyLabel.addStyleName("kune-floatleft");
this.add(emptyLabel);
return emptyLabel;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPanel.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+
+import com.calclab.suco.client.events.Listener0;
+
+public class RTESavingEditorPanel implements RTESavingEditorView {
+
+ public void askConfirmation(String confirmationTitle, String confirmationText, Listener0 onConfirm,
+ Listener0 onCancel) {
+ NotifyUser.askConfirmation(confirmationTitle, confirmationText, onConfirm, onCancel);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -8,7 +8,6 @@
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
import org.ourproject.kune.platf.client.utils.TimerWrapper;
@@ -38,11 +37,12 @@
private final BeforeActionListener beforeStateChangeListener;
@Deprecated
private final SiteSignOutLink siteSignOutLink;
- private ActionToolbarButtonDescriptor<Object> saveBtn;
+ ActionToolbarButtonDescriptor<Object> saveBtn;
+ private RTESavingEditorView view;
public RTESavingEditorPresenter(RTEditor editor, final boolean autoSave, final I18nTranslationService i18n,
StateManager stateManager, SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
- RTEImgResources imgResources) {
+ RTEImgResources imgResources, TimerWrapper timer) {
this.editor = editor;
this.autoSave = autoSave;
this.i18n = i18n;
@@ -53,7 +53,9 @@
this.savePending = false;
this.saveAndCloseConfirmed = false;
createActions();
- this.timer = new TimerWrapper(new Listener0() {
+ this.timer = timer;
+ timer.configure(new Listener0() {;
+
public void onEvent() {
onAutoSave();
}
@@ -84,6 +86,10 @@
return editor;
}
+ public void init(RTESavingEditorView view) {
+ this.view = view;
+ }
+
public void onDoSaveAndClose() {
saveAndCloseConfirmed = true;
onDoSave();
@@ -121,7 +127,7 @@
onCancelConfirmed();
}
};
- NotifyUser.askConfirmation(i18n.t("Save confirmation"),
+ view.askConfirmation(i18n.t("Save confirmation"),
i18n.t("Do you want to save before closing the editor?"), onYes, onCancel);
} else {
onCancelConfirmed();
@@ -155,23 +161,34 @@
}
}
+ void onEdit() {
+ if (!savePending) {
+ savePending = true;
+ if (autoSave) {
+ timer.schedule(AUTOSAVE_IN_MILLISECONDS);
+ }
+ enableSaveBtn(true);
+ }
+ }
+
private void createActions() {
Listener0 onPerformSaveCall = new Listener0() {
public void onEvent() {
onDoSave();
}
};
- saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.topbar, onPerformSaveCall);
+ saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.sndbar, onPerformSaveCall);
saveBtn.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
saveBtn.setToolTip(i18n.t("Save"));
saveBtn.setShortcut(new ActionShortcut(true, 'S'));
- saveBtn.setPosition(20);
+ saveBtn.setPosition(0);
ActionToolbarMenuDescriptor<Object> save = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
RTEditor.topbar, onPerformSaveCall);
save.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
save.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
save.setTextDescription(i18n.t("Save"));
+ save.setShortcut(new ActionShortcut(true, 'S'));
save.setPosition(0);
ActionToolbarMenuDescriptor<Object> close = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
@@ -185,7 +202,12 @@
Listener0 onPerformSaveAndCloseCall = new Listener0() {
public void onEvent() {
- onDoSaveAndClose();
+ if (savePending) {
+ timer.cancel();
+ onDoSaveAndClose();
+ } else {
+ onCancelConfirmed();
+ }
}
};
ActionToolbarMenuDescriptor<Object> saveclose = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
@@ -208,23 +230,13 @@
}
private void enableSaveBtn(boolean enable) {
- editor.getTopBar().setButtonEnable(saveBtn, enable);
+ editor.getSndBar().setButtonEnable(saveBtn, enable);
}
private void onDoEditCancelled() {
onEditCancelled.onEvent();
}
- private void onEdit() {
- if (!savePending) {
- savePending = true;
- if (autoSave) {
- timer.schedule(AUTOSAVE_IN_MILLISECONDS);
- }
- enableSaveBtn(true);
- }
- }
-
private void reset() {
timer.cancel();
savePending = false;
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorView.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorView.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -0,0 +1,10 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.View;
+
+import com.calclab.suco.client.events.Listener0;
+
+public interface RTESavingEditorView extends View {
+
+ void askConfirmation(String confirmationTitle, String confirmationText, Listener0 onConfirm, Listener0 onCancel);
+}
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-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -115,7 +115,7 @@
public void addComment(String userName) {
String time = i18n.formatDateWithLocale(new Date(), true);
Element span = DOM.createSpan();
- span.setInnerHTML("<em>" + i18n.t("type your commment here") + "</em> -" + userName + " " + time);
+ span.setInnerHTML("<em>" + i18n.t("type your comment here") + "</em> -" + userName + " " + time);
DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
insertHtml(" " + span.getString() + " ");
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -297,7 +297,6 @@
justifyRight.setIconCls(getCssName(imgResources.alignright()));
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, topbar,
@@ -327,7 +326,7 @@
redo.setBottomSeparator(true);
redo.setIconCls(getCssName(imgResources.redo()));
- ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, topbar,
+ ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
new Listener0() {
public void onEvent() {
view.undo();
@@ -337,8 +336,9 @@
undoBtn.setToolTip(i18n.t("Undo"));
undoBtn.setAddCondition(canBeExtended);
undoBtn.setIconCls(getCssName(imgResources.undo()));
+ undoBtn.setPosition(0);
- ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, topbar,
+ ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
new Listener0() {
public void onEvent() {
view.redo();
@@ -348,6 +348,7 @@
redoBtn.setToolTip(i18n.t("Redo"));
redoBtn.setAddCondition(canBeExtended);
redoBtn.setIconCls(getCssName(imgResources.redo()));
+ redoBtn.setPosition(1);
redoBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
@@ -454,7 +455,7 @@
});
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Strikethrough"));
- // strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
strikethrough.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> decreaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -477,7 +478,6 @@
});
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, sndbar,
@@ -502,7 +502,7 @@
ul.setIconCls(getCssName(imgResources.defaultbullet()));
ul.setToolTip(i18n.t("Bullet List"));
ul.setShortcut(new ActionShortcut(true, '8'));
- // ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
@@ -559,17 +559,12 @@
removeFormat.setToolTip(i18n.t("Clear Formatting"));
removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
removeFormat.setAddCondition(canBeExtended);
- // removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
final ActionToolbarMenuDescriptor<Object> insertTable = new ActionToolbarMenuDescriptor<Object>(accessRol,
topbar, new Listener0() {
public void onEvent() {
- view.insertHtml("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
- + "<tbody>\n" + "<tr>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
- + "<td width=\"50%\"><br>\n" + "</td>\n" + "</tr>\n" + "<tr>\n"
- + "<td width=\"50%\"><br>\n" + "</td>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
- + "</tr>\n</tbody>\n</table>");
- fireOnEdit();
+ insertSimpleTable();
}
});
insertTable.setIconCls(getCssName(imgResources.inserttable()));
@@ -577,6 +572,17 @@
insertTable.setAddCondition(canBeExtended);
insertTable.setParentMenuTitle(i18n.t(INSERT_MENU));
+ final ActionToolbarButtonDescriptor<Object> insertTableBtn = new ActionToolbarButtonDescriptor<Object>(
+ accessRol, sndbar, new Listener0() {
+ public void onEvent() {
+ insertSimpleTable();
+ }
+ });
+ insertTableBtn.setIconCls(getCssName(imgResources.inserttable()));
+ insertTableBtn.setToolTip(i18n.t("Insert Table"));
+ insertTableBtn.setAddCondition(canBeExtended);
+ insertTableBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
+
final ActionToolbarButtonDescriptor<Object> fontColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
sndbar, new Listener0() {
public void onEvent() {
@@ -639,6 +645,7 @@
actions.add(withNoItem(img));
actions.add(withNoItem(createLink));
actions.add(withNoItem(removeLink));
+ actions.add(withNoItem(insertTableBtn));
actions.add(withNoItem(insertTable));
actions.add(withNoItem(comment));
actions.add(withNoItem(undoBtn));
@@ -701,6 +708,14 @@
return RTEImgResources.SUFFIX + imageResource.getName();
}
+ private void insertSimpleTable() {
+ view.insertHtml("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n" + "<tbody>\n"
+ + "<tr>\n" + "<td width=\"50%\"><br>\n" + "</td>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
+ + "</tr>\n" + "<tr>\n" + "<td width=\"50%\"><br>\n" + "</td>\n" + "<td width=\"50%\"><br>\n"
+ + "</td>\n" + "</tr>\n</tbody>\n</table>");
+ fireOnEdit();
+ }
+
private boolean isExtended() {
return extended && view.canBeExtended();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -4,9 +4,16 @@
import com.google.gwt.user.client.Timer;
public class TimerWrapper {
- private final Timer timer;
+ private Timer timer;
- public TimerWrapper(final Listener0 onTime) {
+ public TimerWrapper() {
+ }
+
+ public void cancel() {
+ timer.cancel();
+ }
+
+ public void configure(final Listener0 onTime) {
timer = new Timer() {
@Override
public void run() {
@@ -15,10 +22,6 @@
};
}
- public void cancel() {
- timer.cancel();
- }
-
public void run() {
timer.run();
}
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-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -83,6 +83,7 @@
createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
+ createEditAction(TYPE_WIKIPAGE);
// final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
// createSetAsDefContent(parentMenuTitleCtx);
@@ -101,8 +102,6 @@
createGoHomeAction(containers);
- createEditAction(TYPE_WIKIPAGE);
-
createTranslateAction(TYPE_FOLDER, TYPE_WIKIPAGE);
createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -46,10 +46,12 @@
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.rte.RTESavingEditorPanel;
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
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.platf.client.utils.TimerWrapper;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
@@ -912,7 +914,8 @@
public ContentEditor create() {
return new ContentEditor($(RTEditor.class), true, $(I18nTranslationService.class),
$(StateManager.class), $(SiteSignOutLink.class), $(DeferredCommandWrapper.class),
- $(RTEImgResources.class), $(WorkspaceSkeleton.class));
+ $(RTEImgResources.class), $(WorkspaceSkeleton.class), $(TimerWrapper.class),
+ new RTESavingEditorPanel());
}
});
register(NoDecoration.class, new Factory<ActionContextTopToolbar>(ActionContextTopToolbar.class) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -5,10 +5,12 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPresenter;
+import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorView;
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.img.RTEImgResources;
import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.platf.client.utils.TimerWrapper;
import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import org.ourproject.kune.workspace.client.skel.Toolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -30,8 +32,9 @@
public ContentEditor(RTEditor editor, boolean autoSave, I18nTranslationService i18n, StateManager stateManager,
SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
- RTEImgResources imgResources, WorkspaceSkeleton ws) {
- super(editor, autoSave, i18n, stateManager, siteSignOutLink, deferredCommandWrapper, imgResources);
+ RTEImgResources imgResources, WorkspaceSkeleton ws, TimerWrapper timer, RTESavingEditorView view) {
+ super(editor, autoSave, i18n, stateManager, siteSignOutLink, deferredCommandWrapper, imgResources, timer);
+ super.init(view);
this.ws = ws;
vp = new VerticalPanel();
Added: trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java 2009-03-10 03:17:33 UTC (rev 1065)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenterTest.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -0,0 +1,161 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.internal.verification.api.VerificationMode;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.platf.client.utils.TimerWrapper;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
+
+import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.testing.events.MockedListener;
+import com.calclab.suco.testing.events.MockedListener0;
+import com.google.gwt.libideas.resources.client.ImageResource;
+
+public class RTESavingEditorPresenterTest {
+
+ private RTESavingEditorPresenter presenter;
+ private MockedListener<String> saveListener;
+ private MockedListener0 cancelListener;
+ private StateManager stateManager;
+ private SiteSignOutLink signOutLink;
+ private DeferredCommandWrapper deferredCommandWrapper;
+ private RTEditor rteEditor;
+ private TimerWrapper timer;
+ @SuppressWarnings("unchecked")
+ private ActionToolbar sndbar;
+ private RTESavingEditorView view;
+
+ @SuppressWarnings("unchecked")
+ @Before
+ public void createObjects() {
+ I18nUITranslationService i18n = Mockito.mock(I18nUITranslationService.class);
+ stateManager = Mockito.mock(StateManager.class);
+ signOutLink = Mockito.mock(SiteSignOutLink.class);
+ deferredCommandWrapper = Mockito.mock(DeferredCommandWrapper.class);
+ rteEditor = Mockito.mock(RTEditor.class);
+ RTEImgResources imgResources = Mockito.mock(RTEImgResources.class);
+ ImageResource imageResource = Mockito.mock(ImageResource.class);
+ Mockito.when(imageResource.getName()).thenReturn("save");
+ Mockito.when(imgResources.save()).thenReturn(imageResource);
+ sndbar = Mockito.mock(ActionToolbar.class);
+ Mockito.when(rteEditor.getSndBar()).thenReturn(sndbar);
+ timer = Mockito.mock(TimerWrapper.class);
+ view = Mockito.mock(RTESavingEditorView.class);
+ presenter = new RTESavingEditorPresenter(rteEditor, true, i18n, stateManager, signOutLink,
+ deferredCommandWrapper, imgResources, timer);
+ presenter.init(view);
+ saveListener = new MockedListener<String>();
+ cancelListener = new MockedListener0();
+ }
+
+ @Test
+ public void historyChangeWithoutPendingMustAccept() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ boolean change = presenter.beforeTokenChange();
+ assertTrue(change);
+ verifyAskConfirmationCalled(Mockito.never());
+ Mockito.verify(deferredCommandWrapper, Mockito.times(1)).addCommand((Listener0) Mockito.anyObject());
+ }
+
+ @Test
+ public void historyChangeWithPendingSaveAndCancelMustPosponeIt() {
+ editAndChangeHistoryToken();
+ presenter.onCancelConfirmed();
+ assertTrue(saveListener.isNotCalled());
+ Mockito.verify(stateManager, Mockito.times(1)).resumeTokenChange();
+ }
+
+ @Test
+ public void historyChangeWithPendingSaveMustPosponeIt() {
+ editAndChangeHistoryToken();
+ presenter.onDoSaveAndClose();
+ presenter.onSavedSuccessful();
+ assertTrue(saveListener.isCalledOnce());
+ Mockito.verify(stateManager, Mockito.times(1)).resumeTokenChange();
+ }
+
+ @Test
+ public void initialEditWithCancel() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ presenter.onCancel();
+ assertTrue(saveListener.isNotCalled());
+ assertTrue(cancelListener.isCalledOnce());
+ }
+
+ @Test
+ public void initialEditWithEditionAndSave() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.when(rteEditor.getHtml()).thenReturn(textModified);
+ presenter.onEdit();
+ presenter.onDoSave();
+ checkSaveBtnDisabled();
+ assertTrue(saveListener.isCalledWithEquals(textModified));
+ assertTrue(cancelListener.isNotCalled());
+ }
+
+ @Test
+ public void initialEditWithSave() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ presenter.onDoSave();
+ checkSaveBtnDisabled();
+ assertTrue(saveListener.isCalledOnce());
+ assertTrue(cancelListener.isNotCalled());
+ }
+
+ @Test
+ public void testSavePendingAndCancel() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.when(rteEditor.getHtml()).thenReturn(textModified);
+ presenter.onEdit();
+ presenter.onCancel();
+ presenter.onCancelConfirmed();
+ assertTrue(saveListener.isNotCalled());
+ assertTrue(cancelListener.isCalledOnce());
+ }
+
+ @Test
+ public void testSavePendingAndSaveFails() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.when(rteEditor.getHtml()).thenReturn(textModified);
+ presenter.onEdit();
+ presenter.onDoSave();
+ presenter.onSaveFailed();
+ presenter.onDoSave();
+ Mockito.verify(timer, Mockito.times(1)).schedule(RTESavingEditorPresenter.AUTOSAVE_IN_MILLISECONDS);
+ Mockito.verify(timer, Mockito.times(1)).schedule(RTESavingEditorPresenter.AUTOSAVE_AFTER_FAILS_IN_MILLISECONS);
+ assertTrue(saveListener.isCalled(2));
+ }
+
+ @SuppressWarnings("unchecked")
+ private void checkSaveBtnDisabled() {
+ Mockito.verify(sndbar, Mockito.times(1)).setButtonEnable(presenter.saveBtn, false);
+ }
+
+ private String editAndChangeHistoryToken() {
+ presenter.edit("Text to edit", saveListener, cancelListener);
+ presenter.onEdit();
+ String newToken = "somegroup";
+ boolean change = presenter.beforeTokenChange();
+ assertFalse(change);
+ verifyAskConfirmationCalled(Mockito.times(1));
+ return newToken;
+ }
+
+ private void verifyAskConfirmationCalled(VerificationMode mode) {
+ Mockito.verify(view, mode).askConfirmation(Mockito.anyString(), Mockito.anyString(),
+ (Listener0) Mockito.anyObject(), (Listener0) Mockito.anyObject());
+ }
+
+}
Deleted: 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-10 03:17:33 UTC (rev 1065)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2009-03-10 13:43:43 UTC (rev 1066)
@@ -1,134 +0,0 @@
-package org.ourproject.kune.workspace.client.editor;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-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;
-
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.testing.events.MockedListener;
-import com.calclab.suco.testing.events.MockedListener0;
-
-public class TextEditorPresenterTest {
- private TextEditorPresenter presenter;
- private TextEditorView view;
- private MockedListener<String> saveListener;
- private MockedListener0 cancelListener;
- @SuppressWarnings("unchecked")
- private ActionToolbar toolbar;
- private StateManager stateManager;
- private SiteSignOutLink signOutLink;
- private DeferredCommandWrapper deferredCommandWrapper;
-
- @SuppressWarnings("unchecked")
- @Before
- public void createObjects() {
- I18nUITranslationService i18n = Mockito.mock(I18nUITranslationService.class);
- stateManager = Mockito.mock(StateManager.class);
- toolbar = Mockito.mock(ActionToolbar.class);
- signOutLink = Mockito.mock(SiteSignOutLink.class);
- deferredCommandWrapper = Mockito.mock(DeferredCommandWrapper.class);
- presenter = new TextEditorPresenter(true, toolbar, i18n, stateManager, signOutLink, deferredCommandWrapper);
- view = Mockito.mock(TextEditorView.class);
- presenter.init(view);
- saveListener = new MockedListener<String>();
- cancelListener = new MockedListener0();
- }
-
- @Test
- public void historyChangeWithoutPendingMustAccept() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- boolean change = presenter.beforeTokenChange();
- assertTrue(change);
- Mockito.verify(view, Mockito.never()).showSaveBeforeDialog();
- Mockito.verify(deferredCommandWrapper, Mockito.times(1)).addCommand((Listener0) Mockito.anyObject());
- }
-
- @Test
- public void historyChangeWithPendingSaveAndCancelMustPosponeIt() {
- editAndChangeHistoryToken();
- presenter.onCancelConfirmed();
- assertTrue(saveListener.isNotCalled());
- Mockito.verify(stateManager, Mockito.times(1)).resumeTokenChange();
- }
-
- @Test
- public void historyChangeWithPendingSaveMustPosponeIt() {
- editAndChangeHistoryToken();
- presenter.onSaveAndClose();
- presenter.onSavedSuccessful();
- assertTrue(saveListener.isCalledOnce());
- Mockito.verify(stateManager, Mockito.times(1)).resumeTokenChange();
- }
-
- @Test
- public void initialEditWithCancel() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- presenter.onCancel();
- assertTrue(saveListener.isNotCalled());
- assertTrue(cancelListener.isCalledOnce());
- }
-
- @Test
- public void initialEditWithEditionAndSave() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- String textModified = "Text modified";
- Mockito.when(view.getHTML()).thenReturn(textModified);
- presenter.onEdit();
- presenter.onSave();
- assertTrue(saveListener.isCalledWithEquals(textModified));
- assertTrue(cancelListener.isNotCalled());
- }
-
- @Test
- public void initialEditWithSave() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- presenter.onSave();
- assertTrue(saveListener.isCalledOnce());
- assertTrue(cancelListener.isNotCalled());
- }
-
- @Test
- public void testSavePendingAndCancel() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- String textModified = "Text modified";
- Mockito.when(view.getHTML()).thenReturn(textModified);
- presenter.onEdit();
- presenter.onCancel();
- presenter.onCancelConfirmed();
- assertTrue(saveListener.isNotCalled());
- assertTrue(cancelListener.isCalledOnce());
- }
-
- @Test
- public void testSavePendingAndSaveFails() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- String textModified = "Text modified";
- Mockito.when(view.getHTML()).thenReturn(textModified);
- presenter.onEdit();
- presenter.onSave();
- presenter.onSaveFailed();
- presenter.onSave();
- Mockito.verify(view, Mockito.times(1)).scheduleSave(TextEditorPresenter.AUTOSAVE_IN_MILLISECONDS);
- Mockito.verify(view, Mockito.times(1)).scheduleSave(TextEditorPresenter.AUTOSAVE_AFTER_FAILS_IN_MILLISECONS);
- assertTrue(saveListener.isCalled(2));
- }
-
- private String editAndChangeHistoryToken() {
- presenter.editContent("Text to edit", saveListener, cancelListener);
- presenter.onEdit();
- String newToken = "somegroup";
- boolean change = presenter.beforeTokenChange();
- assertFalse(change);
- Mockito.verify(view, Mockito.times(1)).showSaveBeforeDialog();
- return newToken;
- }
-
-}
1
0
Author: vjrj
Date: 2009-03-10 04:17:33 +0100 (Tue, 10 Mar 2009)
New Revision: 1065
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolbar.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.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/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.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/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -30,6 +30,8 @@
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.ui.AbstractToolbar;
+import org.ourproject.kune.platf.client.ui.FlowToolbar;
import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import com.allen_sauer.gwt.log.client.Log;
@@ -52,11 +54,19 @@
private final HashMap<String, Item> menuItems;
private final HashMap<String, ToolbarButton> buttons;
private final Provider<ActionManager> actionManagerProvider;
- protected final SimpleToolbar toolbar;
+ protected final AbstractToolbar toolbar;
public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider) {
- toolbar = new SimpleToolbar();
- toolbar.setWidth("100%");
+ this(actionManagerProvider, false);
+ }
+
+ public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, boolean flow) {
+ if (flow) {
+ toolbar = new FlowToolbar();
+ } else {
+ toolbar = new SimpleToolbar();
+ }
+ // toolbar.setWidth("100%");
this.actionManagerProvider = actionManagerProvider;
menus = new HashMap<String, Menu>();
@@ -77,6 +87,7 @@
if (action.hasLeftSeparator()) {
add(toolbar, action.getLeftSeparator());
}
+ addFloatStyle(button);
toolbar.add(button);
if (action.hasRightSeparator()) {
add(toolbar, action.getRightSeparator());
@@ -121,7 +132,7 @@
return 0;
}
- public SimpleToolbar getToolbar() {
+ public AbstractToolbar getToolbar() {
return toolbar;
}
@@ -181,7 +192,7 @@
}
}
- private Widget add(final SimpleToolbar toolbar, final ActionToolbarButtonSeparator separator) {
+ private Widget add(final AbstractToolbar toolbar, final ActionToolbarButtonSeparator separator) {
switch (separator) {
case fill:
return toolbar.addFill();
@@ -194,9 +205,16 @@
}
private void add(final Widget widget) {
+ addFloatStyle(widget);
toolbar.add(widget);
}
+ private void addFloatStyle(Widget widget) {
+ if (toolbar instanceof FlowToolbar) {
+ widget.addStyleName("kune-floatleft");
+ }
+ }
+
private void addSeparator(Menu menu, boolean separator) {
if (separator) {
menu.addSeparator();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -234,7 +234,7 @@
}, new Factory<RTEActionSndToolbar>(RTEActionSndToolbar.class) {
@Override
public RTEActionSndToolbar create() {
- final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class));
+ final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class), true);
final RTEActionSndToolbarPresenter toolbar = new RTEActionSndToolbarPresenter(panel);
return toolbar;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -0,0 +1,34 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
+
+public interface AbstractToolbar {
+
+ void add(final Widget widget);
+
+ void add(final Widget widget, VerticalAlignmentConstant valign);
+
+ Widget addFill();
+
+ Widget addSeparator();
+
+ Widget addSpacer();
+
+ int getOffsetHeight();
+
+ void insert(final Widget widget, int position);
+
+ boolean isAttached();
+
+ void remove(final Widget widget);
+
+ void removeAll();
+
+ void setCleanStyle();
+
+ void setHeight(String height);
+
+ void setNormalStyle();
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -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.platf.client.ui;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
+
+public class FlowToolbar extends Composite implements AbstractToolbar {
+
+ private final HorizontalPanel mainPanel;
+ private final FlowPanel childPanel;
+
+ public FlowToolbar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new FlowPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ }
+
+ public void add(final Widget widget, VerticalAlignmentConstant valign) {
+ childPanel.add(widget);
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ 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 insert(final Widget widget, int position) {
+ childPanel.insert(widget, position);
+ }
+
+ public void remove(final Widget widget) {
+ childPanel.remove(widget);
+ }
+
+ public void removeAll() {
+ childPanel.clear();
+ }
+
+ public void setCleanStyle() {
+ setBasicStyle();
+ addStyleName("k-blank-toolbar");
+ }
+
+ @Override
+ public void setHeight(String height) {
+ mainPanel.setHeight(height);
+ childPanel.setHeight(height);
+ }
+
+ public void setNormalStyle() {
+ setBasicStyle();
+ addStyleName("k-toolbar-bottom-line");
+ }
+
+ private void setBasicStyle() {
+ setStyleName("x-toolbar");
+ addStyleName("x-panel");
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -26,7 +26,7 @@
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-public class SimpleToolbar extends Composite {
+public class SimpleToolbar extends Composite implements AbstractToolbar {
private final HorizontalPanel childPanel;
private final HorizontalPanel mainPanel;
@@ -49,11 +49,6 @@
childPanel.setCellVerticalAlignment(widget, valign);
}
- public void add(final Widget widget, VerticalAlignmentConstant valign, int position) {
- childPanel.insert(widget, position);
- childPanel.setCellVerticalAlignment(widget, valign);
- }
-
public Widget addFill() {
final Label emptyLabel = new Label("");
this.add(emptyLabel);
@@ -89,10 +84,6 @@
childPanel.clear();
}
- public void setCellWidth(Widget widget, String width) {
- childPanel.setCellWidth(widget, width);
- }
-
public void setCleanStyle() {
setBasicStyle();
addStyleName("k-blank-toolbar");
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -4,6 +4,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.WindowListenerAdapter;
@@ -18,8 +19,8 @@
final VerticalPanel vp = new VerticalPanel();
RTEditor basicEditor = editor.getBasicEditor();
- vp.add(((ActionToolbarPanel<Object>) basicEditor.getTopBar().getView()).getToolbar());
- vp.add(((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
+ vp.add((Widget) ((ActionToolbarPanel<Object>) basicEditor.getTopBar().getView()).getToolbar());
+ vp.add((Widget) ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
final RTEditorPanel editorPanel = (RTEditorPanel) basicEditor.getEditorArea();
vp.add(editorPanel.getRTE());
basicEditor.setExtended(true);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -57,7 +57,7 @@
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPresenter;
import org.ourproject.kune.workspace.client.cxt.ActionContextBottomToolbar;
-import org.ourproject.kune.workspace.client.cxt.ActionContextTopToolBar;
+import org.ourproject.kune.workspace.client.cxt.ActionContextTopToolbar;
import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorPanel;
@@ -915,13 +915,13 @@
$(RTEImgResources.class), $(WorkspaceSkeleton.class));
}
});
- register(NoDecoration.class, new Factory<ActionContextTopToolBar>(ActionContextTopToolBar.class) {
+ register(NoDecoration.class, new Factory<ActionContextTopToolbar>(ActionContextTopToolbar.class) {
@Override
- public ActionContextTopToolBar create() {
+ public ActionContextTopToolbar create() {
final ActionCntCtxToolbarPanel<StateToken> panel = new ActionCntCtxToolbarPanel<StateToken>(
AbstractFoldableContentActions.CONTEXT_TOPBAR, $$(ActionManager.class),
$(WorkspaceSkeleton.class));
- final ActionContextTopToolBar toolbar = new ActionContextTopToolBar(panel);
+ final ActionContextTopToolbar toolbar = new ActionContextTopToolbar(panel);
return toolbar;
}
});
@@ -942,7 +942,7 @@
public ContextNavigator create() {
final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
$(Session.class), $(I18nTranslationService.class), $(ContentIconsRegistry.class),
- $(ContentCapabilitiesRegistry.class), $(ActionContextTopToolBar.class),
+ $(ContentCapabilitiesRegistry.class), $(ActionContextTopToolbar.class),
$(ActionContextBottomToolbar.class), $(ContextActionRegistry.class),
$$(FileDownloadUtils.class), true, $(RenameAction.class));
final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter,
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -1,33 +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.cxt;
-
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-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 ActionContextTopToolBar extends ActionToolbarPresenter<StateToken> implements ActionToolbar<StateToken> {
-
- public ActionContextTopToolBar(ActionToolbarView<StateToken> toolbar) {
- super(toolbar);
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolbar.java (from rev 1064, trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolbar.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -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.cxt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+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 ActionContextTopToolbar extends ActionToolbarPresenter<StateToken> implements ActionToolbar<StateToken> {
+
+ public ActionContextTopToolbar(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -3,7 +3,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPresenter;
import org.ourproject.kune.platf.client.ui.rte.RTEditor;
import org.ourproject.kune.platf.client.ui.rte.RTEditorPanel;
@@ -16,6 +16,7 @@
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
@@ -25,7 +26,7 @@
private final VerticalPanel vp;
private final RTEditor basicEditor;
private final RTEditorPanel editorPanel;
- private final SimpleToolbar topbar;
+ private final AbstractToolbar topbar;
public ContentEditor(RTEditor editor, boolean autoSave, I18nTranslationService i18n, StateManager stateManager,
SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
@@ -35,12 +36,11 @@
vp = new VerticalPanel();
basicEditor = super.getBasicEditor();
- vp.add(((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
+ vp.add((Widget) ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
editorPanel = (RTEditorPanel) basicEditor.getEditorArea();
vp.add(editorPanel.getRTE());
basicEditor.setExtended(true);
vp.setWidth("100%");
- adjHeight(ws.getEntityWorkspace().getContentHeight());
ws.getEntityWorkspace().addContentListener(new ContainerListenerAdapter() {
@Override
public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
@@ -55,9 +55,10 @@
public void edit(String html, Listener<String> onSave, Listener0 onEditCancelled) {
Toolbar contentTopBar = ws.getEntityWorkspace().getContentTopBar();
contentTopBar.removeAll();
- contentTopBar.add(topbar);
+ contentTopBar.add((Widget) topbar);
ws.getEntityWorkspace().setContent(vp);
super.edit(html, onSave, onEditCancelled);
+ adjHeight(ws.getEntityWorkspace().getContentHeight());
}
@Override
@@ -67,7 +68,11 @@
}
private void adjHeight(final int height) {
- int newHeight = height - WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 27;
+ AbstractToolbar sndbar = ((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar();
+ int barHeight = sndbar.getOffsetHeight();
+ int newHeight = height - 20 - barHeight;
+ // Log.debug("Sndbar height: " + barHeight + " new height: " +
+ // newHeight);
editorPanel.adjustSize(newHeight);
vp.setCellHeight(editorPanel.getRTE(), "" + newHeight);
}
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -21,8 +21,8 @@
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.Window;
@@ -49,7 +49,7 @@
contentNoPublic.ensureDebugId(SITE_CONTENT_NO_PUBLIC);
publicHP.add(gotoPublic);
publicHP.add(contentNoPublic);
- final SimpleToolbar siteBar = ws.getSiteBar();
+ final AbstractToolbar siteBar = ws.getSiteBar();
siteBar.add(publicHP);
siteBar.addFill();
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -20,7 +20,7 @@
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.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -40,7 +40,7 @@
private final PushButton searchButton;
private final TextBox searchTextBox;
- private final SimpleToolbar siteBar;
+ private final AbstractToolbar siteBar;
public SiteSearchPanel(final SiteSearchPresenter presenter, final WorkspaceSkeleton ws, Images img) {
siteBar = ws.getSiteBar();
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -22,8 +22,8 @@
import org.ourproject.kune.platf.client.PlatfMessages;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
@@ -52,7 +52,7 @@
loggedUserMenu = new PushButton("");
loggedUserMenu.ensureDebugId(LOGGED_USER_MENU);
loggedUserMenu.setStyleName("k-sitebar-labellink");
- SimpleToolbar siteBar = ws.getSiteBar();
+ AbstractToolbar siteBar = ws.getSiteBar();
siteBar.add(loggedUserMenu);
separator = siteBar.addSeparator();
userMenu = new Menu();
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -25,6 +25,7 @@
import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.user.client.ui.Widget;
public class ActionCntCtxToolbarPanel<T> extends ActionToolbarPanel<T> {
@@ -50,14 +51,14 @@
public void attach() {
if (!toolbar.isAttached()) {
wsToolbar.removeAll();
- wsToolbar.add(toolbar);
+ wsToolbar.add((Widget) toolbar);
}
}
@Override
public void detach() {
if (toolbar.isAttached()) {
- wsToolbar.remove(toolbar);
+ wsToolbar.remove((Widget) toolbar);
}
}
}
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -19,6 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.skel;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.RoundedPanel;
import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
@@ -165,7 +166,7 @@
content.clear();
}
- public SimpleToolbar getBottomTitle() {
+ public AbstractToolbar getBottomTitle() {
return bottom;
}
@@ -197,11 +198,11 @@
return mainFitPanel;
}
- public SimpleToolbar getSubTitle() {
+ public AbstractToolbar getSubTitle() {
return subTitle;
}
- public SimpleToolbar getTitleComponent() {
+ public AbstractToolbar getTitleComponent() {
return title;
}
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -19,6 +19,7 @@
\*/
package org.ourproject.kune.workspace.client.skel;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.themes.WsTheme;
@@ -106,7 +107,7 @@
return entity.getEntityWorkspace();
}
- public SimpleToolbar getSiteBar() {
+ public AbstractToolbar getSiteBar() {
return sitebar;
}
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -28,8 +28,8 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.BasicThumb;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.SummaryPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -48,7 +48,7 @@
private final Label otherBuddiesLabel;
private final I18nTranslationService i18n;
private final ActionManager actionManager;
- private final SimpleToolbar toolbar;
+ private final AbstractToolbar toolbar;
private final Label noBuddiesPublic;
public BuddiesSummaryPanel(final BuddiesSummaryPresenter presenter, final WorkspaceSkeleton ws,
@@ -65,7 +65,7 @@
vp.add(otherBuddiesLabel);
toolbar = ((ActionToolbarPanel<UserSimpleDTO>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
- vp.add(toolbar);
+ vp.add((Widget) toolbar);
super.add(vp);
addInSummary();
noBuddiesPublic = new Label(i18n.t(PlatfMessages.BUDDIES_NOT_PUBLIC));
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -25,7 +25,7 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
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;
@@ -38,6 +38,7 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
@@ -47,7 +48,7 @@
private final GridMenuPanel<GroupDTO> gridMenuPanel;
private final I18nUITranslationService i18n;
private final GroupMembersSummaryPresenter presenter;
- private final SimpleToolbar toolbar;
+ private final AbstractToolbar toolbar;
private final Label noMembersPublic;
public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter presenter, final I18nUITranslationService i18n,
@@ -79,7 +80,7 @@
toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
- super.add(toolbar);
+ super.add((Widget) toolbar);
super.addInSummary();
ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
@Override
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -24,7 +24,7 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
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.SummaryPanel;
@@ -32,13 +32,14 @@
import org.ourproject.kune.workspace.client.themes.WsTheme;
import com.calclab.suco.client.events.Listener;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
public class ParticipationSummaryPanel extends SummaryPanel implements ParticipationSummaryView {
private final GridMenuPanel<GroupDTO> gridMenuPanel;
- private final SimpleToolbar toolbar;
+ private final AbstractToolbar toolbar;
public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws, ActionToolbarView<StateToken> actionToolbarView) {
@@ -55,7 +56,7 @@
super.add(gridMenuPanel);
toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
- super.add(toolbar);
+ super.add((Widget) toolbar);
addInSummary();
ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
@Override
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.workspace.client.title;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Label;
@@ -32,7 +32,7 @@
subTitleLeftLabel = new Label();
subTitleRightLabel = new Label();
- final SimpleToolbar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
+ final AbstractToolbar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
wsSubTitle.add(subTitleLeftLabel);
wsSubTitle.addFill();
wsSubTitle.add(subTitleRightLabel);
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-10 00:05:50 UTC (rev 1064)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2009-03-10 03:17:33 UTC (rev 1065)
@@ -19,8 +19,8 @@
*/
package org.ourproject.kune.workspace.client.title;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
import org.ourproject.kune.platf.client.ui.IconLabelEditable;
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.events.Listener2;
@@ -40,7 +40,7 @@
}
});
- final SimpleToolbar wsTitle = ws.getEntityWorkspace().getTitleComponent();
+ final AbstractToolbar wsTitle = ws.getEntityWorkspace().getTitleComponent();
wsTitle.add(icon);
wsTitle.add(titleLabel);
wsTitle.addFill();
1
0
Author: vjrj
Date: 2009-03-10 01:05:50 +0100 (Tue, 10 Mar 2009)
New Revision: 1064
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/Resources.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEcanBeBasic.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java
trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextBottomToolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
Removed:
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/editor/WrappedRichTextAreaImplIE6.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
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/chat/client/ChatClientActions.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/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.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/actions/toolbar/ActionToolbarView.java
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.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/SimpleToolbar.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/platf/client/ui/rte/img/RTEImgResources.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/workspace/Kune-Workspace.gwt.xml
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/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/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummary.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/SocialNetworkPresenter.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionRegistryTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support
Incomplete - task ContextNav refactoring (less bussiness logic in view) and tests
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-10 00:05:50 UTC (rev 1064)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:3px;background-color:#D7FFD7;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2009-03-10 00:05:50 UTC (rev 1064)
@@ -872,3 +872,11 @@
.k-eil-edit {
border: thin solid black;
}
+
+/* duplicated in rte.css */
+.k-rte-comment {
+ border:1px dashed #C0C0C0;
+ line-height:1.4;
+ padding:3px;
+ background-color:#D7FFD7;
+}
\ No newline at end of file
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -38,7 +38,7 @@
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.editor.ContentEditor;
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;
@@ -53,7 +53,7 @@
final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
+ final Provider<ContentEditor> textEditorProvider, final KuneErrorHandler errorHandler,
final BlogViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -45,7 +45,7 @@
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.editor.ContentEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -78,7 +78,7 @@
$(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
- $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class),
+ $(EntityHeader.class), $$(ContentEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class),
$$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -26,13 +26,13 @@
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
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.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.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
@@ -62,7 +62,7 @@
private void createActions() {
final ActionToolbarButtonDescriptor<StateToken> chatAbout = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, AbstractFoldableContentActions.CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
chatEngineProvider.get().joinRoom(token.toString().replaceAll("\\.", "-"),
session.getCurrentUserInfo().getShortName());
@@ -76,7 +76,7 @@
chatAbout.setEnableCondition(notDeleted());
ActionToolbarButtonDescriptor<StateToken> joinRoom = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, AbstractFoldableContentActions.CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(StateToken token) {
ChatEngine chatEngine = chatEngineProvider.get();
chatEngine.joinRoom(session.getContainerState().getContainer().getName(),
@@ -89,7 +89,7 @@
joinRoom.setMustBeAuthenticated(true);
ActionToolbarButtonDescriptor<StateToken> addRoom = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, AbstractFoldableContentActions.CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(StateToken token) {
addRoomProvider.get().show();
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -38,7 +38,7 @@
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.editor.ContentEditor;
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;
@@ -53,7 +53,7 @@
final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
+ final Provider<ContentEditor> textEditorProvider, final KuneErrorHandler errorHandler,
final DocumentViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -45,7 +45,7 @@
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.editor.ContentEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -78,7 +78,7 @@
$(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
- $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class),
+ $(EntityHeader.class), $$(ContentEditor.class), $(KuneErrorHandler.class),
$(DocumentViewer.class), $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -37,7 +37,7 @@
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.editor.ContentEditor;
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;
@@ -52,7 +52,7 @@
final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
+ final Provider<ContentEditor> textEditorProvider, final KuneErrorHandler errorHandler,
final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -45,7 +45,7 @@
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.editor.ContentEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -78,8 +78,8 @@
$(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
- $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(GalleryViewer.class),
- $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
+ $(EntityHeader.class), $$(ContentEditor.class), $(KuneErrorHandler.class),
+ $(GalleryViewer.class), $$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/Kune-Platform.gwt.xml 2009-03-10 00:05:50 UTC (rev 1064)
@@ -11,4 +11,48 @@
<public path="public" />
+ <inherits name="com.google.gwt.user.UserAgent" />
+ <!-- RTE css inject -->
+ <!-- See gwt-user: com/google/gwt/user/RichText.gwt.xml -->
+
+ <!-- IE-specific implementation -->
+ <replace-with
+ class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplIE6">
+ <when-type-is
+ class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
+ <when-property-is name="user.agent" value="ie6" />
+ </replace-with>
+
+ <!-- Mozilla-specific implementation -->
+ <replace-with
+ class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplMozilla">
+ <when-type-is
+ class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
+ <any>
+ <when-property-is name="user.agent" value="gecko1_8" />
+ <when-property-is name="user.agent" value="gecko" />
+ </any>
+ </replace-with>
+
+ <!-- Safari-specific implementation -->
+ <replace-with
+ class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplSafari">
+ <when-type-is
+ class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
+ <any>
+ <when-property-is name="user.agent" value="safari" />
+ </any>
+ </replace-with>
+
+ <!-- Opera-specific implementation -->
+ <replace-with
+ class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplOpera">
+ <when-type-is
+ class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
+ <any>
+ <when-property-is name="user.agent" value="opera" />
+ </any>
+ </replace-with>
+
+
</module>
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -20,7 +20,6 @@
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;
@@ -31,6 +30,8 @@
*/
public abstract class ActionDescriptor<T> {
+ public static final int NO_POSITION = -1;
+
/** The icon url. */
private String iconUrl;
@@ -78,6 +79,8 @@
private ActionShortcut shortcut;
+ private int position = NO_POSITION;
+
public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
this.accessRol = accessRolDTO;
this.onPerformCall = onPerformCall;
@@ -219,12 +222,21 @@
return id;
}
+ /**
+ * Get the index position where this action will be inserted
+ *
+ * @param position
+ */
+ public int getPosition() {
+ return position;
+ }
+
public ActionShortcut getShortcut() {
return shortcut;
}
- public String getShortcutToS(I18nTranslationService i18n) {
- return shortcut == null ? "" : shortcut.toString(i18n);
+ public String getShortcutToS() {
+ return shortcut == null ? "" : shortcut.toString();
}
/**
@@ -379,6 +391,15 @@
this.mustBeConfirmed = mustBeConfirmed;
}
+ /**
+ * Index position where this action will be inserted
+ *
+ * @param position
+ */
+ public void setPosition(int position) {
+ this.position = position;
+ }
+
public void setShortcut(ActionShortcut shortcut) {
this.shortcut = shortcut;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -19,6 +19,8 @@
\*/
package org.ourproject.kune.platf.client.actions;
+import com.allen_sauer.gwt.log.client.Log;
+
/**
* And action description and a item (for instance a StateToken, a XmmpURI) over
* the action takes place
@@ -50,4 +52,14 @@
public boolean mustBeEnabled() {
return action.mustBeEnabled(getItem());
}
+
+ public boolean mustBePressed() {
+ if (!(action instanceof ActionToolbarPushButtonDescriptor)) {
+ Log.error("This action is not a push button");
+ return false;
+ } else {
+ ActionPressedCondition<T> mustInitialyPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
+ return mustInitialyPressed != null ? mustInitialyPressed.mustBePressed(getItem()) : false;
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -20,9 +20,37 @@
package org.ourproject.kune.platf.client.actions;
import java.util.ArrayList;
+import java.util.Collection;
+import com.allen_sauer.gwt.log.client.Log;
+
public class ActionItemCollection<T> extends ArrayList<ActionItem<T>> {
private static final long serialVersionUID = 1L;
+ @Override
+ public boolean add(ActionItem<T> actionItem) {
+ ActionDescriptor<T> action = actionItem.getAction();
+ int position = action.getPosition();
+ if (position == ActionDescriptor.NO_POSITION) {
+ super.add(actionItem);
+ } else {
+ try {
+ super.add(position, actionItem);
+ return true;
+ } catch (IndexOutOfBoundsException e) {
+ Log.error("Trying to add an action in a position out of bounds");
+ super.add(actionItem);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addAll(Collection<? extends ActionItem<T>> actionItems) {
+ for (ActionItem<T> actionItem : actionItems) {
+ add(actionItem);
+ }
+ return true;
+ }
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionShortcut.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,6 +1,6 @@
package org.ourproject.kune.platf.client.actions;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.i18n.Resources;
import com.google.gwt.user.client.ui.KeyboardListener;
@@ -98,21 +98,22 @@
return (has(modifiers, modifier) == keyValue);
}
- public String toString(I18nTranslationService i18n) {
+ @Override
+ public String toString() {
String s = " (";
- s += sKey(alt, "Alt", i18n);
- s += sKey(ctrl, "Ctrl", i18n);
- s += sKey(shift, "Shift", i18n);
- s += keyName != null ? translateKey(keyName, i18n) + ")" : String.valueOf(key).toUpperCase() + ")";
+ s += sKey(alt, "Alt");
+ s += sKey(ctrl, "Ctrl");
+ s += sKey(shift, "Shift");
+ s += keyName != null ? translateKey(keyName) + ")" : String.valueOf(key).toUpperCase() + ")";
return s;
}
- private String sKey(boolean key, String specialKeyName, I18nTranslationService i18n) {
- return key ? translateKey(specialKeyName, i18n) + "+" : "";
+ private String sKey(boolean key, String specialKeyName) {
+ return key ? translateKey(specialKeyName) + "+" : "";
}
- private String translateKey(String keyNameToTranslate, I18nTranslationService i18n) {
- return i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
+ private String translateKey(String keyNameToTranslate) {
+ return Resources.i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -26,11 +26,8 @@
public abstract class ActionToolbarDescriptor<T> extends ActionDescriptor<T> {
- public static final int NO_POSITION = -1;
private ActionToolbarPosition actionToolbarPosition;
- private int position = NO_POSITION;
-
public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
final Listener<T> onPerformCall) {
super(accessRolDTO, onPerformCall);
@@ -71,26 +68,8 @@
return actionToolbarPosition;
}
- /**
- * Get the index position where this action will be inserted
- *
- * @param position
- */
- public int getPosition() {
- return position;
- }
-
public void setActionPosition(final ActionToolbarPosition actionToolbarPosition) {
this.actionToolbarPosition = actionToolbarPosition;
}
- /**
- * Index position where this action will be inserted
- *
- * @param position
- */
- public void setPosition(int position) {
- this.position = position;
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,24 +1,41 @@
-/*
- *
- * 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 enum ActionToolbarPosition {
- topbar, bottombar
+public class ActionToolbarPosition {
+
+ private final String id;
+
+ public ActionToolbarPosition(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ ActionToolbarPosition other = (ActionToolbarPosition) obj;
+ if (id == null) {
+ if (other.id != null) {
+ return false;
+ }
+ } else if (!id.equals(other.id)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -22,11 +22,14 @@
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
public interface ActionToolbar<T> {
- void addActions(ActionItemCollection<T> actionItemCollection);
+ ActionToolbarPosition IN_ANY = new ActionToolbarPosition("in-all");
+ void addActions(ActionItemCollection<T> actionItemCollection, ActionToolbarPosition actionToolbarPosition);
+
void attach();
void clear();
@@ -45,6 +48,10 @@
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setCleanStyle();
+
+ void setNormalStyle();
+
void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarButton.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,55 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.actions.ActionShortcut;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
+
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class ActionToolbarButton<T> extends ToolbarButton {
+
+ public ActionToolbarButton(ActionToolbarDescriptor<T> action, final String id, boolean enabled,
+ boolean isPushButton, boolean pressed, final Listener0 onclick) {
+ final String text = action.getText();
+ final String iconUrl = action.getIconUrl();
+ final String iconCls = action.getIconCls();
+ if (text != null) {
+ super.setText(text);
+ }
+ if (isPushButton) {
+ super.setEnableToggle(true);
+ super.setPressed(pressed);
+ }
+ super.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ e.stopEvent();
+ onclick.onEvent();
+ }
+ });
+ if (iconUrl != null) {
+ super.setIcon(iconUrl);
+ }
+ if (iconCls != null) {
+ super.setIconCls(iconCls);
+ }
+ String toolTip = action.getToolTip();
+ ActionShortcut shortcut = action.getShortcut();
+ super.setTooltip((toolTip == null ? "" : toolTip) + (shortcut != null ? shortcut.toString() : ""));
+ setEnableButton(enabled);
+ // Waring: If you put set Id above click listener fires twice
+ super.setId(id);
+ }
+
+ private void setEnableButton(final boolean enabled) {
+ if (enabled) {
+ super.enable();
+ } else {
+ super.disable();
+ }
+ }
+
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -24,27 +24,21 @@
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;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPushButtonDescriptor;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.SimpleToolbar;
import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
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;
import com.gwtext.client.widgets.menu.BaseItem;
import com.gwtext.client.widgets.menu.CheckItem;
import com.gwtext.client.widgets.menu.Item;
@@ -54,76 +48,41 @@
public class ActionToolbarPanel<T> implements ActionToolbarView<T> {
- private final HashMap<String, Menu> toolbarMenus;
- private final HashMap<String, ToolbarButton> toolbarButtons;
+ private final HashMap<String, Menu> menus;
private final HashMap<String, Item> menuItems;
+ private final HashMap<String, ToolbarButton> buttons;
private final Provider<ActionManager> actionManagerProvider;
- protected final SimpleToolbar topbar;
- protected final SimpleToolbar bottombar;
- private final I18nTranslationService i18n;
+ protected final SimpleToolbar toolbar;
- public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, I18nTranslationService i18n) {
- this.i18n = i18n;
- topbar = new SimpleToolbar();
- bottombar = new SimpleToolbar();
- topbar.setWidth("100%");
- bottombar.setWidth("100%");
+ public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider) {
+ toolbar = new SimpleToolbar();
+ toolbar.setWidth("100%");
this.actionManagerProvider = actionManagerProvider;
- toolbarMenus = new HashMap<String, Menu>();
- toolbarButtons = new HashMap<String, ToolbarButton>();
+ menus = new HashMap<String, Menu>();
menuItems = new HashMap<String, Item>();
+ buttons = new HashMap<String, ToolbarButton>();
}
- public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
- final ToolbarButton button = new ToolbarButton();
+ public ActionToolbarButton<T> addButtonAction(final ActionItem<T> actionItem, final boolean enable,
+ final boolean isPushButton, final boolean pressed) {
final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
- T item = actionItem.getItem();
- final ActionToolbarPosition pos = action.getActionPosition();
- final String text = action.getText();
- final String iconUrl = action.getIconUrl();
- final String iconCls = action.getIconCls();
- if (text != null) {
- button.setText(text);
- }
- String id = generateIdIfEmpty(action);
- button.setId(id);
- if (action instanceof ActionToolbarPushButtonDescriptor) {
- button.setEnableToggle(true);
- ActionPressedCondition<T> mustInitialyPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
- button.setPressed(mustInitialyPressed != null && mustInitialyPressed.mustBePressed(item));
- }
- button.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- actionManagerProvider.get().doAction(actionItem);
- }
- });
- if (iconUrl != null) {
- button.setIcon(iconUrl);
- }
- if (iconCls != null) {
- button.setIconCls(iconCls);
- }
- 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);
+ String id = generateId(action);
+ ActionToolbarButton<T> button = new ActionToolbarButton<T>(action, id, enable, isPushButton, pressed,
+ new Listener0() {
+ public void onEvent() {
+ actionManagerProvider.get().doAction(actionItem);
+ }
+ });
if (action.hasLeftSeparator()) {
add(toolbar, action.getLeftSeparator());
}
- int position = action.getPosition();
- if (position != ActionToolbarDescriptor.NO_POSITION) {
- toolbar.insert(button, position);
- } else {
- toolbar.add(button);
- }
+ toolbar.add(button);
if (action.hasRightSeparator()) {
add(toolbar, action.getRightSeparator());
}
- toolbarButtons.put(genButtonKey(pos, id), button);
+ buttons.put(genButtonKey(id), button);
+ return button;
}
public void addMenuAction(final ActionItem<T> actionItem, final boolean enable) {
@@ -135,7 +94,7 @@
final String itemKey = genMenuKey(pos, menuTitle, action.getParentMenuTooltip(), menuSubTitle, action.getText());
Item item = menuItems.get(itemKey);
if (item == null) {
- item = createToolbarMenu(pos, menuTitle, menuTooltip, menuSubTitle, actionItem, generateIdIfEmpty(action));
+ item = createToolbarMenu(pos, menuTitle, menuTooltip, menuSubTitle, actionItem, generateId(action));
menuItems.put(itemKey, item);
}
setEnableMenuItem(item, enable);
@@ -145,24 +104,15 @@
}
public void clear() {
- toolbarMenus.clear();
+ menus.clear();
menuItems.clear();
- toolbarButtons.clear();
- topbar.removeAll();
- bottombar.removeAll();
- getToolbar(ActionToolbarPosition.topbar).removeAll();
- getToolbar(ActionToolbarPosition.bottombar).removeAll();
+ buttons.clear();
+ toolbar.removeAll();
}
public void detach() {
}
- public void disableAllMenuItems() {
- for (final Item item : menuItems.values()) {
- item.disable();
- }
- }
-
public int getLeftPosition(ActionDescriptor<T> action) {
final ToolbarButton button = findButton(action);
if (button != null) {
@@ -171,14 +121,8 @@
return 0;
}
- public SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
- switch (pos) {
- case bottombar:
- return bottombar;
- case topbar:
- default:
- return topbar;
- }
+ public SimpleToolbar getToolbar() {
+ return toolbar;
}
public int getTopPosition(ActionDescriptor<T> action) {
@@ -190,7 +134,7 @@
}
public void hideAllMenus() {
- for (Menu menu : toolbarMenus.values()) {
+ for (Menu menu : menus.values()) {
menu.hide(true);
}
}
@@ -204,10 +148,18 @@
}
}
+ public void setCleanStyle() {
+ toolbar.setCleanStyle();
+ }
+
+ public void setNormalStyle() {
+ toolbar.setNormalStyle();
+ }
+
public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
String newTitle) {
final String menuKey = genMenuKey(action.getActionPosition(), origTitle, origTooltip, null, null);
- Menu menu = toolbarMenus.get(menuKey);
+ Menu menu = menus.get(menuKey);
if (menu != null) {
menu.setTitle(newTitle);
} else {
@@ -217,18 +169,18 @@
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);
+ if (button != null) {
+ if (button.isEnableToggle()) {
+ // Log.debug("Setting button pressed: " + pressed);
+ button.toggle(pressed);
+ } else {
+ Log.error("Tryng to set pressed a toolbar button not of type push button");
+ }
} 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);
- }
-
private Widget add(final SimpleToolbar toolbar, final ActionToolbarButtonSeparator separator) {
switch (separator) {
case fill:
@@ -241,6 +193,10 @@
}
}
+ private void add(final Widget widget) {
+ toolbar.add(widget);
+ }
+
private void addSeparator(Menu menu, boolean separator) {
if (separator) {
menu.addSeparator();
@@ -291,18 +247,18 @@
final String menuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, null, null);
final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, menuSubTitle, null);
- Menu menu = toolbarMenus.get(menuKey);
- Menu subMenu = toolbarMenus.get(subMenuKey);
+ Menu menu = menus.get(menuKey);
+ Menu subMenu = menus.get(subMenuKey);
if (menuSubTitle != null) {
if (subMenu == null) {
subMenu = new Menu();
final MenuItem subMenuItem = new MenuItem(menuSubTitle, subMenu);
if (menu == null) {
menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
- menuTitle, menuKey, "");
+ menuTitle, menuKey, "", action.getPosition());
}
menu.addItem(subMenuItem);
- toolbarMenus.put(subMenuKey, subMenu);
+ menus.put(subMenuKey, subMenu);
}
addSeparator(subMenu, action.hasTopSeparator());
subMenu.addItem(item);
@@ -311,7 +267,7 @@
// Menu action without submenu
if (menu == null) {
menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
- menuTitle, menuKey, action.getParentMenuTooltip());
+ menuTitle, menuKey, action.getParentMenuTooltip(), action.getPosition());
}
addSeparator(menu, action.hasTopSeparator());
menu.addItem(item);
@@ -321,7 +277,7 @@
}
private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl, final String iconCls,
- final String menuTitle, final String menuKey, final String menuTooltip) {
+ final String menuTitle, final String menuKey, final String menuTooltip, int position) {
final Menu menu = new Menu();
menu.setShadow(true);
final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
@@ -335,28 +291,24 @@
if (menuTooltip != null) {
toolbarMenu.setTooltip(menuTooltip);
}
- toolbarMenus.put(menuKey, menu);
- add(barPosition, toolbarMenu);
+ menus.put(menuKey, menu);
+ add(toolbarMenu);
return menu;
}
private ToolbarButton findButton(final ActionDescriptor<T> action) {
- final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
- final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getId()));
+ final ToolbarButton button = buttons.get(genButtonKey(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;
+ private String genButtonKey(final String id) {
+ final String basePart = "km-act-btn-" + id;
return basePart;
}
- private String generateIdIfEmpty(final ActionDescriptor<T> action) {
- String id = action.getId();
- if (id == null) {
- id = Ext.generateId();
- action.setId(id);
- }
+ private String generateId(final ActionDescriptor<T> action) {
+ String id = Ext.generateId();
+ action.setId(id);
return id;
}
@@ -365,9 +317,9 @@
// Label title = new Label(action.getText());
// hp.add(title);
// hp.setCellWidth(title, "100%");
- // hp.add(new Label(action.getShortcutToS(i18n)));
+ // hp.add(new Label(action.getShortcutToS(i 18n)));
// return hp.getElement().getInnerHTML();
- return action.getText() + action.getShortcutToS(i18n);
+ return action.getText() + action.getShortcutToS();
}
private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuTooltip,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -24,8 +24,11 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarMenuAndItemDescriptor;
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 com.allen_sauer.gwt.log.client.Log;
@@ -36,15 +39,24 @@
this.view = toolbar;
}
- public void addActions(final ActionItemCollection<T> actions) {
+ public void addActions(final ActionItemCollection<T> actions, ActionToolbarPosition position) {
for (final ActionItem<T> actionItem : actions) {
final ActionDescriptor<T> action = actionItem.getAction();
if (actionItem.mustBeAdded()) {
if (isToolbarMenu(action)) {
- view.addMenuAction(actionItem, actionItem.mustBeEnabled());
+ if (addInPosition(action, position)) {
+ view.addMenuAction(actionItem, actionItem.mustBeEnabled());
+ }
} else {
- if (isToolbarButton(action)) {
- view.addButtonAction(actionItem, actionItem.mustBeEnabled());
+ if (isToolbarPushButton(action)) {
+ if (addInPosition(action, position)) {
+ view.addButtonAction(actionItem, actionItem.mustBeEnabled(), true,
+ actionItem.mustBePressed());
+ }
+ } else if (isToolbarButton(action)) {
+ if (addInPosition(action, position)) {
+ view.addButtonAction(actionItem, actionItem.mustBeEnabled(), false, false);
+ }
} else {
Log.error("Code error: Not an ActionMenuDescriptor or ActionButtonDescriptor: "
+ action.getText());
@@ -90,6 +102,14 @@
view.setButtonEnable(action, enable);
}
+ public void setCleanStyle() {
+ view.setCleanStyle();
+ }
+
+ public void setNormalStyle() {
+ view.setNormalStyle();
+ }
+
public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
String newTitle) {
view.setParentMenuTitle(action, origTitle, origTooltip, newTitle);
@@ -99,6 +119,13 @@
view.setPushButtonPressed(action, pressed);
}
+ private boolean addInPosition(ActionDescriptor<T> action, ActionToolbarPosition position) {
+ if (position.equals(IN_ANY) || ((ActionToolbarDescriptor<T>) action).getActionPosition().equals(position)) {
+ return true;
+ }
+ return false;
+ }
+
private boolean isToolbarButton(final ActionDescriptor<T> action) {
return action instanceof ActionToolbarButtonDescriptor
|| action instanceof ActionToolbarButtonAndItemDescriptor;
@@ -107,4 +134,8 @@
private boolean isToolbarMenu(final ActionDescriptor<T> action) {
return action instanceof ActionToolbarMenuDescriptor || action instanceof ActionToolbarMenuAndItemDescriptor;
}
+
+ private boolean isToolbarPushButton(ActionDescriptor<T> action) {
+ return action instanceof ActionToolbarPushButtonDescriptor;
+ }
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -26,7 +26,8 @@
public interface ActionToolbarView<T> extends View {
- void addButtonAction(ActionItem<T> actionItem, boolean enable);
+ ActionToolbarButton<T> addButtonAction(ActionItem<T> actionItem, boolean enabled, boolean isPushButton,
+ boolean pressed);
void addMenuAction(ActionItem<T> actionItem, boolean enable);
@@ -36,8 +37,6 @@
void detach();
- void disableAllMenuItems();
-
int getLeftPosition(ActionDescriptor<T> action);
int getTopPosition(ActionDescriptor<T> action);
@@ -46,6 +45,10 @@
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setCleanStyle();
+
+ void setNormalStyle();
+
void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/I18nTranslationService.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -19,7 +19,6 @@
*/
package org.ourproject.kune.platf.client.i18n;
-import java.util.Date;
public abstract class I18nTranslationService {
protected static final String TRANSLATION_NOTE_REGEXP = " (\\[)%NT (.*)(\\])$";
@@ -34,31 +33,6 @@
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, "");
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/i18n/Resources.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/i18n/Resources.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/i18n/Resources.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.i18n;
+
+public class Resources {
+
+ public static I18nTranslationService i18n;
+
+ public Resources(I18nTranslationService i18n) {
+ Resources.i18n = i18n;
+ }
+
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -124,7 +124,7 @@
if (showException) {
Log.debug("Exception in KuneErrorHandler", e);
} else {
- Log.debug(e.getMessage());
+ Log.debug("Exception in KuneErrorHandler: " + e.getMessage());
}
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -29,6 +29,7 @@
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.i18n.Resources;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.I18nService;
@@ -51,6 +52,8 @@
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.RTESavingEditor;
+import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPresenter;
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;
@@ -58,6 +61,7 @@
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 org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.ioc.decorator.NoDecoration;
@@ -155,6 +159,15 @@
container.removeProvider(I18nTranslationService.class);
}
+ register(Singleton.class, new Factory<Resources>(Resources.class) {
+ @Override
+ public Resources create() {
+ return new Resources(i18n);
+ }
+ });
+
+ $(Resources.class);
+
register(Singleton.class, new Factory<I18nTranslationService>(I18nTranslationService.class) {
@Override
public I18nTranslationService create() {
@@ -214,14 +227,14 @@
register(NoDecoration.class, new Factory<RTEActionTopToolbar>(RTEActionTopToolbar.class) {
@Override
public RTEActionTopToolbar create() {
- final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class), i18n);
+ final ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class));
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 ActionToolbarPanel<Object> panel = new ActionToolbarPanel<Object>($$(ActionManager.class));
final RTEActionSndToolbarPresenter toolbar = new RTEActionSndToolbarPresenter(panel);
return toolbar;
}
@@ -240,11 +253,19 @@
presenter.init(panel);
return presenter;
}
+ }, new Factory<RTESavingEditor>(RTESavingEditor.class) {
+ @Override
+ public RTESavingEditor create() {
+ return new RTESavingEditorPresenter($(RTEditor.class), true, $(I18nTranslationService.class),
+ $(StateManager.class), $(SiteSignOutLink.class), $(DeferredCommandWrapper.class),
+ $(RTEImgResources.class));
+ }
});
+
register(NoDecoration.class, new Factory<TestRTEDialog>(TestRTEDialog.class) {
@Override
public TestRTEDialog create() {
- return new TestRTEDialog($(RTEditor.class));
+ return new TestRTEDialog($(RTESavingEditor.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -94,8 +94,7 @@
}
public void setCleanStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
+ setBasicStyle();
addStyleName("k-blank-toolbar");
}
@@ -104,4 +103,14 @@
mainPanel.setHeight(height);
mainPanel.setCellHeight(childPanel, height);
}
+
+ public void setNormalStyle() {
+ setBasicStyle();
+ addStyleName("k-toolbar-bottom-line");
+ }
+
+ private void setBasicStyle() {
+ setStyleName("x-toolbar");
+ addStyleName("x-panel");
+ }
}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditor.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public interface RTESavingEditor {
+
+ void edit(String html, Listener<String> onSave, Listener0 onEditCancelled);
+
+ RTEditor getBasicEditor();
+
+ void onSavedSuccessful();
+
+ void onSaveFailed();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTESavingEditorPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,234 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+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.BeforeActionListener;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
+import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.platf.client.utils.TimerWrapper;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class RTESavingEditorPresenter implements RTESavingEditor {
+
+ @Deprecated
+ private static final String FILE_MENU_OPTION = "File";
+ public static final int AUTOSAVE_AFTER_FAILS_IN_MILLISECONS = 20000;
+ public static final int AUTOSAVE_IN_MILLISECONDS = 10000;
+
+ private final RTEditor editor;
+ private final boolean autoSave;
+ private boolean savePending;
+ private boolean saveAndCloseConfirmed;
+ private Listener<String> onSave;
+ private Listener0 onEditCancelled;
+ private final RTEImgResources imgResources;
+ private final TimerWrapper timer;
+ private final DeferredCommandWrapper deferredCommandWrapper;
+ private final I18nTranslationService i18n;
+ private final StateManager stateManager;
+ private final BeforeActionListener beforeStateChangeListener;
+ @Deprecated
+ private final SiteSignOutLink siteSignOutLink;
+ private ActionToolbarButtonDescriptor<Object> saveBtn;
+
+ public RTESavingEditorPresenter(RTEditor editor, final boolean autoSave, final I18nTranslationService i18n,
+ StateManager stateManager, SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
+ RTEImgResources imgResources) {
+ this.editor = editor;
+ this.autoSave = autoSave;
+ this.i18n = i18n;
+ this.stateManager = stateManager;
+ this.siteSignOutLink = siteSignOutLink;
+ this.deferredCommandWrapper = deferredCommandWrapper;
+ this.imgResources = imgResources;
+ this.savePending = false;
+ this.saveAndCloseConfirmed = false;
+ createActions();
+ this.timer = new TimerWrapper(new Listener0() {
+ public void onEvent() {
+ onAutoSave();
+ }
+ });
+ editor.addOnEditListener(new Listener0() {
+ public void onEvent() {
+ onEdit();
+ }
+ });
+ beforeStateChangeListener = new BeforeActionListener() {
+ public boolean beforeAction() {
+ return beforeTokenChange();
+ }
+ };
+ }
+
+ public void edit(String html, Listener<String> onSave, Listener0 onEditCancelled) {
+ this.onSave = onSave;
+ this.onEditCancelled = onEditCancelled;
+ editor.setHtml(html);
+ editor.attach();
+ stateManager.addBeforeStateChangeListener(beforeStateChangeListener);
+ siteSignOutLink.addBeforeSignOut(beforeStateChangeListener);
+ enableSaveBtn(false);
+ }
+
+ public RTEditor getBasicEditor() {
+ return editor;
+ }
+
+ public void onDoSaveAndClose() {
+ saveAndCloseConfirmed = true;
+ onDoSave();
+ }
+
+ public void onSavedSuccessful() {
+ if (saveAndCloseConfirmed) {
+ onCancelConfirmed();
+ } else {
+ reset();
+ }
+ }
+
+ public void onSaveFailed() {
+ timer.schedule(AUTOSAVE_AFTER_FAILS_IN_MILLISECONS);
+ if (saveAndCloseConfirmed) {
+ saveAndCloseConfirmed = false;
+ }
+ }
+
+ protected void onAutoSave() {
+ onDoSave();
+ }
+
+ protected void onCancel() {
+ if (savePending) {
+ timer.cancel();
+ Listener0 onYes = new Listener0() {
+ public void onEvent() {
+ onDoSaveAndClose();
+ }
+ };
+ Listener0 onCancel = new Listener0() {
+ public void onEvent() {
+ onCancelConfirmed();
+ }
+ };
+ NotifyUser.askConfirmation(i18n.t("Save confirmation"),
+ i18n.t("Do you want to save before closing the editor?"), onYes, onCancel);
+ } else {
+ onCancelConfirmed();
+ }
+ }
+
+ protected void onCancelConfirmed() {
+ stateManager.removeBeforeStateChangeListener(beforeStateChangeListener);
+ siteSignOutLink.removeBeforeSignOut(beforeStateChangeListener);
+ stateManager.resumeTokenChange();
+ reset();
+ editor.reset();
+ onDoEditCancelled();
+ }
+
+ protected void onDoSave() {
+ onSave.onEvent(editor.getHtml());
+ }
+
+ boolean beforeTokenChange() {
+ if (savePending) {
+ onCancel();
+ return false;
+ } else {
+ deferredCommandWrapper.addCommand(new Listener0() {
+ public void onEvent() {
+ onCancelConfirmed();
+ }
+ });
+ return true;
+ }
+ }
+
+ private void createActions() {
+ Listener0 onPerformSaveCall = new Listener0() {
+ public void onEvent() {
+ onDoSave();
+ }
+ };
+ saveBtn = new ActionToolbarButtonDescriptor<Object>(AccessRolDTO.Editor, RTEditor.topbar, onPerformSaveCall);
+ saveBtn.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
+ saveBtn.setToolTip(i18n.t("Save"));
+ saveBtn.setShortcut(new ActionShortcut(true, 'S'));
+ saveBtn.setPosition(20);
+
+ ActionToolbarMenuDescriptor<Object> save = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
+ RTEditor.topbar, onPerformSaveCall);
+ save.setIconCls(RTEImgResources.SUFFIX + imgResources.save().getName());
+ save.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ save.setTextDescription(i18n.t("Save"));
+ save.setPosition(0);
+
+ ActionToolbarMenuDescriptor<Object> close = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
+ RTEditor.topbar, new Listener<Object>() {
+ public void onEvent(Object parameter) {
+ onCancel();
+ }
+ });
+ close.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ close.setTextDescription(i18n.t("Close"));
+
+ Listener0 onPerformSaveAndCloseCall = new Listener0() {
+ public void onEvent() {
+ onDoSaveAndClose();
+ }
+ };
+ ActionToolbarMenuDescriptor<Object> saveclose = new ActionToolbarMenuDescriptor<Object>(AccessRolDTO.Editor,
+ RTEditor.topbar, onPerformSaveAndCloseCall);
+ saveclose.setParentMenuTitle(i18n.t(FILE_MENU_OPTION));
+ saveclose.setTextDescription(i18n.t("Save & Close"));
+
+ ActionToolbarButtonDescriptor<Object> saveCloseBtn = new ActionToolbarButtonDescriptor<Object>(
+ AccessRolDTO.Editor, RTEditor.topbar, onPerformSaveAndCloseCall);
+ // saveCloseBtn.setIconCls(RTEImgResources.SUFFIX +
+ // imgResources.save().getName());
+ saveCloseBtn.setTextDescription(i18n.t("Save & Close"));
+ saveCloseBtn.setLeftSeparator(ActionToolbarButtonSeparator.fill);
+
+ editor.addAction(save);
+ editor.addAction(saveclose);
+ editor.addAction(close);
+ editor.addAction(saveBtn);
+ editor.addAction(saveCloseBtn);
+ }
+
+ private void enableSaveBtn(boolean enable) {
+ editor.getTopBar().setButtonEnable(saveBtn, enable);
+ }
+
+ private void onDoEditCancelled() {
+ onEditCancelled.onEvent();
+ }
+
+ private void onEdit() {
+ if (!savePending) {
+ savePending = true;
+ if (autoSave) {
+ timer.schedule(AUTOSAVE_IN_MILLISECONDS);
+ }
+ enableSaveBtn(true);
+ }
+ }
+
+ private void reset() {
+ timer.cancel();
+ savePending = false;
+ saveAndCloseConfirmed = false;
+ enableSaveBtn(false);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEcanBeBasic.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEcanBeBasic.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEcanBeBasic.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,10 @@
+package org.ourproject.kune.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.actions.ActionAddCondition;
+
+public class RTEcanBeBasic implements ActionAddCondition<Object> {
+ public boolean mustBeAdded(Object param) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditor.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,31 +1,46 @@
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.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-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, ActionPosition position);
+ public final ActionToolbarPosition topbar = new ActionToolbarPosition("rte-topbar");
+ public final ActionToolbarPosition sndbar = new ActionToolbarPosition("rte-sndbar");;
- void addActions(ActionCollection<Object> actions, ActionPosition position);
+ void addAction(ActionDescriptor<Object> action);
+ void addActions(ActionCollection<Object> actions);
+
void addOnEditListener(Listener0 listener);
void attach();
- void editContent(String content);
+ ActionAddCondition<Object> canBeBasic();
+ ActionAddCondition<Object> canBeExtended();
+
View getEditorArea();
+ String getHtml();
+
ActionToolbar<Object> getSndBar();
+ String getText();
+
ActionToolbar<Object> getTopBar();
+ void reset();
+
void setExtended(boolean extended);
+ void setHtml(String html);
+
+ void setText(String text);
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -17,6 +17,7 @@
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.KeyboardListener;
@@ -24,6 +25,59 @@
public class RTEditorPanel implements RTEditorView {
+ private class EventListener implements ClickListener, ChangeListener, KeyboardListener, FocusListener {
+
+ public void onChange(Widget sender) {
+ presenter.fireOnEdit();
+ }
+
+ 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 cursor using the keyboard, or uses one of the
+ // browser's built-in keyboard shortcuts.
+ updateStatus();
+ }
+ }
+
+ public void onFocus(Widget sender) {
+ presenter.onEditorFocus();
+ }
+
+ 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) {
+ Log.debug("RTE shortcut pressed (" + modifiers + ", " + keyCode + ")");
+ ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
+ if (actionItem != null) {
+ actionManager.doAction(actionItem);
+ updateStatus();
+ } else {
+ Log.debug("...but not mapped to any action");
+ }
+ }
+ }
+ }
+
+ public void onLostFocus(Widget sender) {
+
+ }
+ }
private final I18nUITranslationService i18n;
private final RichTextArea rta;
private final BasicFormatter basic;
@@ -40,7 +94,10 @@
basic = rta.getBasicFormatter();
extended = rta.getExtendedFormatter();
shortcuts = new HashMap<ActionShortcut, ActionItem<Object>>();
- createListeners();
+ EventListener listener = new EventListener();
+ rta.addClickListener(listener);
+ rta.addKeyboardListener(listener);
+ rta.addFocusListener(listener);
rta.setWidth("96%");
rta.setHeight("100%");
}
@@ -58,7 +115,7 @@
public void addComment(String userName) {
String time = i18n.formatDateWithLocale(new Date(), true);
Element span = DOM.createSpan();
- span.setInnerHTML("<em>" + i18n.t("type here") + "</em> -" + userName + " " + time);
+ span.setInnerHTML("<em>" + i18n.t("type your commment here") + "</em> -" + userName + " " + time);
DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
insertHtml(" " + span.getString() + " ");
}
@@ -95,10 +152,18 @@
rta.setFocus(true);
}
+ public String getHtml() {
+ return rta.getHTML();
+ }
+
public Widget getRTE() {
return rta;
}
+ public String getText() {
+ return rta.getText();
+ }
+
public void insertHorizontalRule() {
extended.insertHorizontalRule();
}
@@ -199,6 +264,14 @@
basic.setForeColor(color);
}
+ public void setHtml(String html) {
+ rta.setHTML(html);
+ }
+
+ public void setText(String text) {
+ rta.setText(text);
+ }
+
public void toggleBold() {
basic.toggleBold();
}
@@ -235,59 +308,6 @@
presenter.fireOnEdit();
}
- private void createListeners() {
- rta.addFocusListener(new FocusListener() {
- public void onFocus(Widget sender) {
- presenter.onEditorFocus();
- }
-
- public void onLostFocus(Widget sender) {
- }
- });
- 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 cursor 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) {
- }
-
- 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) {
- Log.debug("RTE shortcut pressed (" + modifiers + ", " + keyCode + ")");
- ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
- if (actionItem != null) {
- actionManager.doAction(actionItem);
- updateStatus();
- } else {
- Log.debug("...but not mapped to any action");
- }
- }
- }
- }
- });
- }
-
/**
* Updates the status of all the stateful buttons.
*/
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -11,14 +11,11 @@
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.palette.ColorWebSafePalette;
@@ -34,10 +31,6 @@
public class RTEditorPresenter implements RTEditor {
- public enum ActionPosition {
- top, snd
- };
-
private final String fontNames[] = { "Times New Roman", "Arial", "Courier New", "Georgia", "Trebuchet", "Verdana" };
private final String fontSizes[] = { "Extra small", "Very small", "Small", "Medium", "Large", "Very large",
"Extra large" };
@@ -54,8 +47,7 @@
private final AccessRolDTO accessRol;
private final I18nTranslationService i18n;
private final Session session;
- private final ActionItemCollection<Object> topActions;
- private final ActionItemCollection<Object> sndActions;
+ private final ActionItemCollection<Object> actions;
private final RTEImgResources imgResources;
private final RTEActionTopToolbar topBar;
private final RTEActionSndToolbar sndBar;
@@ -67,6 +59,8 @@
private final TextEditorInsertElement insertElement;
private final ColorWebSafePalette palette;
private final DeferredCommandWrapper deferred;
+ private final ActionAddCondition<Object> canBeBasic;
+ private final ActionAddCondition<Object> canBeExtended;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement,
@@ -78,37 +72,31 @@
this.insertElement = textEditorInsertElement;
this.palette = palette;
this.deferred = deferred;
- styleToolbar(topBar);
styleToolbar(sndBar);
sndBar.attach();
this.imgResources = imgResources;
extended = true;
accessRol = AccessRolDTO.Editor;
- topActions = new ActionItemCollection<Object>();
- sndActions = new ActionItemCollection<Object>();
+ actions = new ActionItemCollection<Object>();
this.onEdit = new Event0("onRTEEdit");
+ canBeBasic = new ActionAddCondition<Object>() {
+ public boolean mustBeAdded(Object param) {
+ return view.canBeBasic();
+ }
+ };
+ canBeExtended = new ActionAddCondition<Object>() {
+ public boolean mustBeAdded(Object param) {
+ return isExtended();
+ }
+ };
}
- public void addAction(ActionDescriptor<Object> action, ActionPosition position) {
- switch (position) {
- case top:
- topActions.add(withNoItem(action));
- break;
- case snd:
- sndActions.add(withNoItem(action));
- break;
- }
+ public void addAction(ActionDescriptor<Object> action) {
+ actions.add(withNoItem(action));
}
- public void addActions(ActionCollection<Object> actions, ActionPosition position) {
- switch (position) {
- case top:
- topActions.addAll(withNoItem(actions));
- break;
- case snd:
- sndActions.addAll(withNoItem(actions));
- break;
- }
+ public void addActions(ActionCollection<Object> actioncollection) {
+ actions.addAll(withNoItem(actioncollection));
}
public void addOnEditListener(final Listener0 listener) {
@@ -122,15 +110,19 @@
public void attach() {
topBar.clear();
sndBar.clear();
- view.addActions(topActions);
- view.addActions(sndActions);
- topBar.addActions(topActions);
- sndBar.addActions(sndActions);
+ topBar.addActions(actions, topbar);
+ sndBar.addActions(actions, sndbar);
+ view.addActions(actions);
}
- public void editContent(String content) {
+ public ActionAddCondition<Object> canBeBasic() {
+ return canBeBasic();
}
+ public ActionAddCondition<Object> canBeExtended() {
+ return canBeExtended();
+ }
+
public void fireOnEdit() {
onEdit.fire();
}
@@ -139,10 +131,18 @@
return view;
}
+ public String getHtml() {
+ return view.getHtml();
+ }
+
public ActionToolbar<Object> getSndBar() {
return sndBar;
}
+ public String getText() {
+ return view.getText();
+ }
+
public ActionToolbar<Object> getTopBar() {
return topBar;
}
@@ -158,10 +158,25 @@
palette.hide();
}
+ public void reset() {
+ topBar.clear();
+ sndBar.clear();
+ }
+
public void setExtended(boolean extended) {
this.extended = extended;
}
+ public void setHtml(String html) {
+ view.setHtml(html);
+ view.focus();
+ }
+
+ public void setText(String text) {
+ view.setText(text);
+ view.focus();
+ }
+
public void updateStatus() {
if (view.canBeBasic()) {
sndBar.setPushButtonPressed(bold, view.isBold());
@@ -174,19 +189,8 @@
}
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() {
+ ActionToolbarMenuDescriptor<Object> selectAll = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.selectAll();
}
@@ -199,9 +203,10 @@
selectAll.setTopSeparator(true);
selectAll.setBottomSeparator(true);
- bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar, new Listener0() {
+ bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
public void onEvent() {
view.toggleBold();
+ fireOnEdit();
}
});
bold.setIconCls(getCssName(imgResources.bold()));
@@ -209,33 +214,34 @@
bold.setShortcut(new ActionShortcut(true, 'B'));
bold.setAddCondition(canBeBasic);
- italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
- new Listener0() {
- public void onEvent() {
- view.toggleItalic();
- }
- });
+ italic = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ public void onEvent() {
+ view.toggleItalic();
+ fireOnEdit();
+ }
+ });
italic.setIconCls(getCssName(imgResources.italic()));
italic.setToolTip(i18n.t("Italic"));
italic.setShortcut(new ActionShortcut(true, 'I'));
italic.setAddCondition(canBeBasic);
italic.setAddCondition(canBeBasic);
- underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
- new Listener0() {
- public void onEvent() {
- view.toggleUnderline();
- }
- });
+ underline = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ public void onEvent() {
+ view.toggleUnderline();
+ fireOnEdit();
+ }
+ });
underline.setIconCls(getCssName(imgResources.underline()));
underline.setToolTip(i18n.t("Underline"));
underline.setShortcut(new ActionShortcut(true, 'U'));
underline.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.toggleSubscript();
+ fireOnEdit();
}
});
subscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
@@ -244,10 +250,11 @@
subscript.setShortcut(new ActionShortcut(true, '0'));
subscript.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.toggleSuperscript();
+ fireOnEdit();
}
});
superscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
@@ -257,9 +264,10 @@
superscript.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
view.justifyLeft();
+ fireOnEdit();
}
});
justifyLeft.setIconCls(getCssName(imgResources.alignleft()));
@@ -268,9 +276,10 @@
justifyLeft.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyCentre = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
view.justifyCenter();
+ fireOnEdit();
}
});
justifyCentre.setIconCls(getCssName(imgResources.centerpara()));
@@ -279,21 +288,23 @@
justifyCentre.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyRight = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
view.justifyRight();
+ fireOnEdit();
}
});
justifyRight.setIconCls(getCssName(imgResources.alignright()));
justifyRight.setToolTip(i18n.t("Right Justify"));
justifyRight.setShortcut(new ActionShortcut(true, 'R'));
- justifyRight.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ // justifyRight.setRightSeparator(ActionToolbarButtonSeparator.spacer);
justifyRight.setAddCondition(canBeBasic);
- ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> undo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.undo();
+ fireOnEdit();
}
});
undo.setShortcut(new ActionShortcut(true, 'Z'));
@@ -302,10 +313,11 @@
undo.setAddCondition(canBeExtended);
undo.setIconCls(getCssName(imgResources.undo()));
- ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.redo();
+ fireOnEdit();
}
});
redo.setShortcut(new ActionShortcut(true, 'Y'));
@@ -315,20 +327,22 @@
redo.setBottomSeparator(true);
redo.setIconCls(getCssName(imgResources.redo()));
- ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.undo();
+ fireOnEdit();
}
});
undoBtn.setToolTip(i18n.t("Undo"));
undoBtn.setAddCondition(canBeExtended);
undoBtn.setIconCls(getCssName(imgResources.undo()));
- ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.redo();
+ fireOnEdit();
}
});
redoBtn.setToolTip(i18n.t("Redo"));
@@ -336,8 +350,8 @@
redoBtn.setIconCls(getCssName(imgResources.redo()));
redoBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
- ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.copy();
}
@@ -348,10 +362,11 @@
copy.setAddCondition(canBeExtended);
copy.setIconCls(getCssName(imgResources.copy()));
- ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.cut();
+ fireOnEdit();
}
});
cut.setShortcut(new ActionShortcut(true, 'X'));
@@ -360,10 +375,11 @@
cut.setAddCondition(canBeExtended);
cut.setIconCls(getCssName(imgResources.cut()));
- ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.paste();
+ fireOnEdit();
}
});
paste.setShortcut(new ActionShortcut(true, 'V'));
@@ -372,8 +388,8 @@
paste.setAddCondition(canBeExtended);
paste.setIconCls(getCssName(imgResources.paste()));
- ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
NotifyUser.info("In dev");
}
@@ -383,11 +399,14 @@
editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
editHtml.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.focus();
- view.addComment(session.getCurrentUser().getShortName());
+ String author = session.isLogged() ? session.getCurrentUser().getShortName()
+ : i18n.t("anonymous user");
+ view.addComment(author);
+ fireOnEdit();
}
});
comment.setEnableCondition(new ActionEnableCondition<Object>() {
@@ -401,45 +420,48 @@
comment.setEnableCondition(isInsertHtmlSupported());
comment.setAddCondition(canBeExtended);
- ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol, topbar,
+ new Listener0() {
public void onEvent() {
view.focus();
view.insertHorizontalRule();
+ fireOnEdit();
}
});
hr.setTextDescription(i18n.t("Horizontal line"));
+ hr.setShortcut(new ActionShortcut(true, true, ' ', "Space"));
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() {
+ ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.focus();
view.insertHorizontalRule();
+ fireOnEdit();
}
});
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() {
- public void onEvent() {
- view.toggleStrikethrough();
- }
- });
+ strikethrough = new ActionToolbarPushButtonDescriptor<Object>(accessRol, sndbar, new Listener0() {
+ public void onEvent() {
+ view.toggleStrikethrough();
+ fireOnEdit();
+ }
+ });
strikethrough.setIconCls(getCssName(imgResources.strikeout()));
strikethrough.setToolTip(i18n.t("Strikethrough"));
- strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ // strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
strikethrough.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> decreaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
view.leftIndent();
+ fireOnEdit();
}
});
decreaseIndent.setIconCls(getCssName(imgResources.decrementindent()));
@@ -447,20 +469,22 @@
decreaseIndent.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> increaseIndent = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
view.rightIndent();
+ fireOnEdit();
}
});
increaseIndent.setIconCls(getCssName(imgResources.incrementindent()));
increaseIndent.setToolTip(i18n.t("Increase Indent"));
- increaseIndent.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ // increaseIndent.setRightSeparator(ActionToolbarButtonSeparator.spacer);
increaseIndent.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> ol = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.insertOrderedList();
+ fireOnEdit();
}
});
ol.setIconCls(getCssName(imgResources.defaultnumbering()));
@@ -468,20 +492,21 @@
ol.setShortcut(new ActionShortcut(true, '7'));
ol.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> ul = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.insertUnorderedList();
+ fireOnEdit();
}
});
ul.setIconCls(getCssName(imgResources.defaultbullet()));
ul.setToolTip(i18n.t("Bullet List"));
ul.setShortcut(new ActionShortcut(true, '8'));
- ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ // ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
NotifyUser.info(TextUtils.IN_DEVELOPMENT);
}
@@ -490,8 +515,8 @@
img.setToolTip(i18n.t("Insert Image"));
img.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
deferred.addCommand(new Listener0() {
public void onEvent() {
@@ -507,13 +532,15 @@
insertElement.addOnCreateLink(new Listener2<String, String>() {
public void onEvent(String name, String url) {
view.createLink(url);
+ fireOnEdit();
}
});
- ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.unlink();
+ fireOnEdit();
}
});
removeLink.setIconCls(getCssName(imgResources.linkbreak()));
@@ -521,41 +548,44 @@
removeLink.setShortcut(new ActionShortcut(true, true, 'K'));
removeLink.setAddCondition(canBeExtended);
- ActionToolbarButtonDescriptor<Object> removeFormat = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ final ActionToolbarButtonDescriptor<Object> removeFormat = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ sndbar, new Listener0() {
public void onEvent() {
view.removeFormat();
+ fireOnEdit();
}
});
removeFormat.setIconCls(getCssName(imgResources.removeFormat()));
removeFormat.setToolTip(i18n.t("Clear Formatting"));
removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
removeFormat.setAddCondition(canBeExtended);
- removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ // removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
- final ActionToolbarButtonDescriptor<Object> insertTable = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> insertTable = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ topbar, new Listener0() {
public void onEvent() {
view.insertHtml("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
+ "<tbody>\n" + "<tr>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
+ "<td width=\"50%\"><br>\n" + "</td>\n" + "</tr>\n" + "<tr>\n"
+ "<td width=\"50%\"><br>\n" + "</td>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
+ "</tr>\n</tbody>\n</table>");
+ fireOnEdit();
}
});
insertTable.setIconCls(getCssName(imgResources.inserttable()));
- insertTable.setToolTip(i18n.t("Insert Table ..."));
+ insertTable.setTextDescription(i18n.t("Insert Table ..."));
insertTable.setAddCondition(canBeExtended);
- insertTable.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ insertTable.setParentMenuTitle(i18n.t(INSERT_MENU));
final ActionToolbarButtonDescriptor<Object> fontColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
- palette.show(getActionLeftPosition(sndBar, insertTable), getActionTopPosition(sndBar,
- insertTable), new Listener<String>() {
+ palette.show(getActionLeftPosition(sndBar, removeFormat), getActionTopPosition(sndBar,
+ removeFormat), new Listener<String>() {
public void onEvent(String color) {
palette.hide();
view.setForeColor(color);
+ fireOnEdit();
}
});
}
@@ -565,13 +595,14 @@
fontColor.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> backgroundColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ sndbar, new Listener0() {
public void onEvent() {
palette.show(getActionLeftPosition(sndBar, fontColor), getActionTopPosition(sndBar, fontColor),
new Listener<String>() {
public void onEvent(String color) {
palette.hide();
view.setBackColor(color);
+ fireOnEdit();
}
});
}
@@ -580,56 +611,56 @@
backgroundColor.setToolTip(i18n.t("Text Background Colour"));
backgroundColor.setAddCondition(canBeBasic);
- sndActions.add(withNoItem(undoBtn));
- sndActions.add(withNoItem(redoBtn));
- sndActions.add(withNoItem(bold));
- sndActions.add(withNoItem(italic));
- sndActions.add(withNoItem(underline));
- sndActions.add(withNoItem(strikethrough));
+ actions.add(withNoItem(bold));
+ actions.add(withNoItem(italic));
+ actions.add(withNoItem(underline));
+ actions.add(withNoItem(strikethrough));
- sndActions.add(withNoItem(justifyLeft));
- sndActions.add(withNoItem(justifyCentre));
- sndActions.add(withNoItem(justifyRight));
+ actions.add(withNoItem(justifyLeft));
+ actions.add(withNoItem(justifyCentre));
+ actions.add(withNoItem(justifyRight));
- topActions.add(withNoItem(undo));
- topActions.add(withNoItem(redo));
- topActions.add(withNoItem(copy));
- topActions.add(withNoItem(cut));
- topActions.add(withNoItem(paste));
- topActions.add(withNoItem(selectAll));
- topActions.add(withNoItem(editHtml));
- topActions.add(withNoItem(hr));
- topActions.add(withNoItem(subscript));
- topActions.add(withNoItem(superscript));
- sndActions.add(withNoItem(decreaseIndent));
- sndActions.add(withNoItem(increaseIndent));
- sndActions.add(withNoItem(ol));
- sndActions.add(withNoItem(ul));
- sndActions.add(withNoItem(removeFormat));
- sndActions.add(withNoItem(hrButton));
- sndActions.add(withNoItem(img));
- sndActions.add(withNoItem(createLink));
- sndActions.add(withNoItem(removeLink));
- sndActions.add(withNoItem(insertTable));
- topActions.add(withNoItem(comment));
+ actions.add(withNoItem(undo));
+ actions.add(withNoItem(redo));
+ actions.add(withNoItem(copy));
+ actions.add(withNoItem(cut));
+ actions.add(withNoItem(paste));
+ actions.add(withNoItem(selectAll));
+ actions.add(withNoItem(editHtml));
+ actions.add(withNoItem(hr));
+ actions.add(withNoItem(subscript));
+ actions.add(withNoItem(superscript));
+ actions.add(withNoItem(decreaseIndent));
+ actions.add(withNoItem(increaseIndent));
+ actions.add(withNoItem(ol));
+ actions.add(withNoItem(ul));
+ actions.add(withNoItem(removeFormat));
+ // topActions.add(withNoItem(hrButton));
+ actions.add(withNoItem(img));
+ actions.add(withNoItem(createLink));
+ actions.add(withNoItem(removeLink));
+ actions.add(withNoItem(insertTable));
+ actions.add(withNoItem(comment));
+ actions.add(withNoItem(undoBtn));
+ actions.add(withNoItem(redoBtn));
for (String fontName : this.fontNames) {
ActionToolbarMenuDescriptor<Object> fontNameAction = createFontNameAction(canBeBasic, fontName);
- sndActions.add(withNoItem(fontNameAction));
+ actions.add(withNoItem(fontNameAction));
}
for (int fontSize = 0; fontSize < fontSizes.length; fontSize++) {
ActionToolbarMenuDescriptor<Object> fontSizeAction = createFontSizeAction(canBeBasic, fontSize,
fontSizes[fontSize]);
- sndActions.add(withNoItem(fontSizeAction));
+ actions.add(withNoItem(fontSizeAction));
}
- sndActions.add(withNoItem(fontColor));
- sndActions.add(withNoItem(backgroundColor));
+ actions.add(withNoItem(fontColor));
+ actions.add(withNoItem(backgroundColor));
}
private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
final String fontName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.setFontName(fontName);
fireOnEdit();
@@ -644,8 +675,8 @@
private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
final int fontSize, String fontSizeName) {
- final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
- ActionToolbarPosition.topbar, new Listener0() {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol, sndbar,
+ new Listener0() {
public void onEvent() {
view.setFontSize(fontSizesConstants[fontSize]);
fireOnEdit();
@@ -667,7 +698,7 @@
}
private String getCssName(ImageResource imageResource) {
- return "k-rte-" + imageResource.getName();
+ return RTEImgResources.SUFFIX + imageResource.getName();
}
private boolean isExtended() {
@@ -682,11 +713,8 @@
};
}
- 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 void styleToolbar(ActionToolbar<Object> bar) {
+ bar.setNormalStyle();
}
private ActionItemCollection<Object> withNoItem(ActionCollection<Object> 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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -6,7 +6,7 @@
public interface RTEditorView extends View {
- void addActions(ActionItemCollection<Object> extendedTopActions);
+ void addActions(ActionItemCollection<Object> actions);
void addComment(String userName);
@@ -26,6 +26,10 @@
void focus();
+ String getHtml();
+
+ String getText();
+
void insertHorizontalRule();
void insertHtml(String html);
@@ -76,6 +80,10 @@
void setForeColor(String color);
+ void setHtml(String html);
+
+ void setText(String text);
+
void toggleBold();
void toggleItalic();
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,6 +1,5 @@
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;
@@ -10,19 +9,20 @@
public class TestRTEDialog {
- private final RTEditor editor;
+ private final RTESavingEditor editor;
private final BasicDialog dialog;
- public TestRTEDialog(RTEditor editor) {
+ public TestRTEDialog(RTESavingEditor editor) {
this.editor = editor;
dialog = new BasicDialog("Testing RTE", false, false, 650, 200);
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));
- final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
+ RTEditor basicEditor = editor.getBasicEditor();
+ vp.add(((ActionToolbarPanel<Object>) basicEditor.getTopBar().getView()).getToolbar());
+ vp.add(((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
+ final RTEditorPanel editorPanel = (RTEditorPanel) basicEditor.getEditorArea();
vp.add(editorPanel.getRTE());
- editor.setExtended(true);
+ basicEditor.setExtended(true);
vp.setWidth("100%");
dialog.add(vp);
dialog.addListener(new WindowListenerAdapter() {
@@ -36,11 +36,11 @@
}
public void setExtended(boolean extended) {
- editor.setExtended(extended);
+ editor.getBasicEditor().setExtended(extended);
}
public void show() {
- editor.attach();
+ editor.getBasicEditor().attach();
dialog.show();
}
}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java (from rev 1054, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplIE6.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplIE6.java 2009-03-02 19:32:02 UTC (rev 1054)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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.rte;
+
+import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6;
+
+/**
+ * A wrapper used to inject css into RTA. As published in:
+ *
+ * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
+ * f64c0024d8676a66
+ * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
+ *
+ * FIXME: Only for IE and Mozilla
+ *
+ */
+public class WrappedRichTextAreaImplIE6 extends RichTextAreaImplIE6 {
+
+ @Override
+ public native void initElement() /*-{
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+
+ setTimeout(function() {
+ if (_this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing == false) {
+ return;
+ }
+
+ // Attempt to set the iframe document's body to 'contentEditable' mode.
+ // There's no way to know when the body will actually be available, so
+ // keep trying every so often until it is.
+ // Note: The body seems to be missing only rarely, so please don't remove
+ // this retry loop just because it's hard to reproduce.
+ var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var doc = elem.contentWindow.document;
+ if (!doc.body) {
+ // Retry in 50 ms. Faster would run the risk of pegging the CPU. Slower
+ // would increase the probability of a user-visible delay.
+ setTimeout(arguments.callee, 50);
+ return;
+ }
+ var ct = "<html><head><style>@import url('" + $wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
+ doc.write( ct );
+ doc.body.contentEditable = true;
+
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java (from rev 1060, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java 2009-03-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -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.platf.client.ui.rte;
+
+import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla;
+
+/**
+ * A wrapper used to inject css into RTA. As published in:
+ *
+ * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
+ * f64c0024d8676a66
+ * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
+ *
+ * FIXME: Only for IE and Mozilla
+ *
+ */
+public class WrappedRichTextAreaImplMozilla extends RichTextAreaImplMozilla {
+
+ @Override
+ public native void initElement() /*-{
+ // Mozilla doesn't allow designMode to be set reliably until the iframe is
+ // fully loaded.
+ var _this = this;
+ var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+
+ iframe.onload = function() {
+ // Some Mozillae have the nasty habit of calling onload again when you set
+ // designMode, so let's avoid doing it more than once.
+ iframe.onload = null;
+
+ // patch ccs inject:
+
+ var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
+ head=doc.getElementsByTagName('head')[0];
+ link=document.createElement('link');
+ link.setAttribute('rel',"stylesheet");
+ link.setAttribute('type',"text/css");
+ link.setAttribute('href',$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" );
+ head.appendChild(link);
+
+ // -- patch
+
+ // Send notification that the iframe has finished loading.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+
+ // Don't set designMode until the RTA actually gets focused. This is
+ // necessary because editing won't work on Mozilla if the iframe is
+ // *hidden, but attached*. Waiting for focus gets around this issue.
+ //
+ // Note: This onfocus will not conflict with the addEventListener('focus',
+ // ...) // in RichTextAreaImplStandard.
+ iframe.contentWindow.onfocus = function() {
+ iframe.contentWindow.onfocus = null;
+ iframe.contentWindow.document.designMode = 'On';
+ };
+ };
+ }-*/;
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java (from rev 1060, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java 2009-03-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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.rte;
+
+import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera;
+
+public class WrappedRichTextAreaImplOpera extends RichTextAreaImplOpera {
+
+ @Override
+ public native void initElement() /*-{
+ // Most browsers don't like setting designMode until slightly _after_
+ // the iframe becomes attached to the DOM. Any non-zero timeout will do
+ // just fine.
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ setTimeout(function() {
+ // Turn on design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+ // patch css inject:
+ var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var doc = elem.contentWindow.document;
+ var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
+ doc.write( ct );
+ // -- patch
+
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java (from rev 1060, trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java 2009-03-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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.rte;
+
+import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari;
+
+public class WrappedRichTextAreaImplSafari extends RichTextAreaImplSafari {
+
+ @Override
+ public native void initElement() /*-{
+ // Most browsers don't like setting designMode until slightly _after_
+ // the iframe becomes attached to the DOM. Any non-zero timeout will do
+ // just fine.
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ setTimeout(function() {
+ // Turn on design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+
+ // patch css inject:
+ var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var doc = elem.contentWindow.document;
+ var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
+ doc.write( ct );
+ // -- patch
+
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
+
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -6,6 +6,8 @@
public interface RTEImgResources extends ImmutableResourceBundle {
+ String SUFFIX = "k-rte-";
+
@Resource("alignleft.png")
public ImageResource alignleft();
Added: trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.platf.client.utils;
+
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.user.client.Timer;
+
+public class TimerWrapper {
+ private final Timer timer;
+
+ public TimerWrapper(final Listener0 onTime) {
+ timer = new Timer() {
+ @Override
+ public void run() {
+ onTime.onEvent();
+ }
+ };
+ }
+
+ public void cancel() {
+ timer.cancel();
+ }
+
+ public void run() {
+ timer.run();
+ }
+
+ public void schedule(final int delayMillis) {
+ timer.schedule(delayMillis);
+ }
+
+ public void scheduleRepeating(final int delayMillis) {
+ timer.scheduleRepeating(delayMillis);
+ }
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -38,7 +38,7 @@
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.editor.ContentEditor;
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;
@@ -53,7 +53,7 @@
final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
+ final Provider<ContentEditor> textEditorProvider, final KuneErrorHandler errorHandler,
final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
final SitePublicSpaceLink publicLink) {
super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -45,7 +45,7 @@
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.editor.ContentEditor;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -78,7 +78,7 @@
$(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
$$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
$(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
- $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(WikiViewer.class),
+ $(EntityHeader.class), $$(ContentEditor.class), $(KuneErrorHandler.class), $(WikiViewer.class),
$$(ContextPropEditor.class), $(SitePublicSpaceLink.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/Kune-Workspace.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/Kune-Workspace.gwt.xml 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/Kune-Workspace.gwt.xml 2009-03-10 00:05:50 UTC (rev 1064)
@@ -2,47 +2,5 @@
<module>
<inherits name='org.ourproject.kune.platf.Kune-Platform' />
<inherits name="com.google.gwt.core.Core" />
- <inherits name="com.google.gwt.user.UserAgent" />
- <!-- RTE css inject -->
- <!-- See gwt-user: com/google/gwt/user/RichText.gwt.xml -->
- <!-- IE-specific implementation -->
- <replace-with
- class="org.ourproject.kune.workspace.client.editor.WrappedRichTextAreaImplIE6">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="ie6" />
- </replace-with>
-
- <!-- Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.workspace.client.editor.WrappedRichTextAreaImplMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="gecko1_8" />
- <when-property-is name="user.agent" value="gecko" />
- </any>
- </replace-with>
-
- <!-- Safari-specific implementation -->
- <replace-with
- class="org.ourproject.kune.workspace.client.editor.WrappedRichTextAreaImplSafari">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="safari" />
- </any>
- </replace-with>
-
- <!-- Opera-specific implementation -->
- <replace-with
- class="org.ourproject.kune.workspace.client.editor.WrappedRichTextAreaImplOpera">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="opera" />
- </any>
- </replace-with>
-
</module>
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -57,7 +57,7 @@
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.editor.ContentEditor;
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;
@@ -75,6 +75,11 @@
private static final String PUBLICATION_MENU = "Publication";
+ public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
+ public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition("afca-ctn-bottom");
+ public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
+ public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition("afca-ctx-bottom");
+
protected final Session session;
protected final StateManager stateManager;
protected final I18nUITranslationService i18n;
@@ -86,7 +91,7 @@
protected final ContentActionRegistry contentActionRegistry;
protected final ContextActionRegistry contextActionRegistry;
protected final Provider<FileDownloadUtils> fileDownloadProvider;
- protected final Provider<TextEditor> textEditorProvider;
+ protected final Provider<ContentEditor> textEditorProvider;
protected final Provider<ContextPropEditor> contextPropEditorProvider;
protected final FoldableContent foldableContent;
protected final DeferredCommandWrapper deferredCommandWrapper;
@@ -98,7 +103,7 @@
Provider<GroupServiceAsync> groupServiceProvider, Provider<ContentServiceAsync> contentServiceProvider,
Provider<FileUploader> fileUploaderProvider, ContextNavigator contextNavigator,
ContentActionRegistry contentActionRegistry, ContextActionRegistry contextActionRegistry,
- Provider<FileDownloadUtils> fileDownloadProvider, Provider<TextEditor> textEditorProvider,
+ Provider<FileDownloadUtils> fileDownloadProvider, Provider<ContentEditor> textEditorProvider,
Provider<ContextPropEditor> contextPropEditorProvider, FoldableContent foldableContent,
EntityHeader entityLogo, SitePublicSpaceLink publicLink) {
this.session = session;
@@ -144,7 +149,7 @@
protected void createContentRenameAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
contextNavigator.editItem(stateToken);
}
@@ -157,7 +162,7 @@
protected void createDelContainerAction(String text, String parentMenuTitle, String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
NotifyUser.info("Sorry, in development");
}
@@ -172,7 +177,7 @@
protected void createDelContentAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
contentServiceProvider.get().delContent(session.getUserHash(), token,
new AsyncCallbackSimple<StateContentDTO>() {
@@ -197,7 +202,7 @@
protected void createDownloadActions(String typeUploadedfile) {
ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
downloadContent(token);
}
@@ -223,15 +228,16 @@
protected ActionToolbarButtonDescriptor<StateToken> createEditAction(String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
+ NotifyUser.showProgressProcessing();
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- final TextEditor editor = textEditorProvider.get();
+ final ContentEditor editor = textEditorProvider.get();
foldableContent.detach();
contextNavigator.detach();
contextPropEditorProvider.get().attach();
- editor.editContent(session.getContentState().getContent(), new Listener<String>() {
+ editor.edit(session.getContentState().getContent(), new Listener<String>() {
public void onEvent(final String html) {
NotifyUser.showProgressSaving();
contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
@@ -272,6 +278,7 @@
});
}
});
+ NotifyUser.hideProgress();
}
});
}
@@ -300,7 +307,7 @@
protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
stateManager.gotoToken(token.getGroup());
}
@@ -322,8 +329,8 @@
final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
final String defaultName, Position position, String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
- addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTENT_TOPBAR,
+ new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
NotifyUser.showProgressProcessing();
contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
@@ -346,7 +353,7 @@
String iconUrl, final String description, final String parentMenuTitle, Position position,
String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener0() {
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
public void onEvent() {
NotifyUser.showProgressProcessing();
contentServiceProvider.get().addContent(session.getUserHash(),
@@ -373,7 +380,7 @@
protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(String parentMenuTitle,
String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
stateManager.reload();
contextNavigator.selectItem(stateToken);
@@ -390,7 +397,7 @@
protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(String parentMenuTitleCtx,
String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
stateManager.reload();
contextNavigator.selectItem(stateToken);
@@ -407,7 +414,7 @@
protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(String parentMenuTitleCtx,
String textDescription, String... registerInTypes) {
final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
contextNavigator.editItem(stateToken);
}
@@ -421,8 +428,8 @@
protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(String parentMenuTitle,
String... registerInTypes) {
final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
- setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator,
- ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator, CONTENT_TOPBAR,
+ new Listener<StateToken>() {
public void onEvent(final StateToken token) {
NotifyUser.showProgressProcessing();
contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
@@ -446,7 +453,7 @@
protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
final ContentStatusDTO status, String[] contentsModerated) {
final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
- rol, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ rol, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
setContentStatus(status, stateToken);
}
@@ -467,7 +474,7 @@
protected void createShowDeletedItems(String parentMenuTitle, String... registerInTypes) {
ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener0() {
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
public void onEvent() {
boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
session.getCurrentUserInfo().setShowDeletedContent(mustShow);
@@ -491,7 +498,7 @@
protected ActionToolbarButtonDescriptor<StateToken> createTranslateAction(String... registerInTypes) {
ActionToolbarButtonDescriptor<StateToken> translateContent = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
NotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
}
@@ -508,8 +515,8 @@
protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(final String textDescription,
final String iconUrl, final String toolTip, final String permitedExtensions, String... registerInTypes) {
final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
- uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- ActionToolbarPosition.bottombar, new Listener0() {
+ uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_BOTTOMBAR,
+ new Listener0() {
public void onEvent() {
if (permitedExtensions != null) {
// FIXME: can't be reset ...
@@ -547,7 +554,7 @@
@SuppressWarnings("unused")
private ActionToolbarMenuAndItemDescriptor<StateToken> createSetGroupLogoAction(String parentMenuTitle) {
final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupLogo = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
groupServiceProvider.get().setGroupFullLogo(session.getUserHash(), token,
new AsyncCallbackSimple<GroupDTO>() {
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -21,9 +21,7 @@
import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -48,8 +46,9 @@
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.palette.ColorWebSafePalette;
+import org.ourproject.kune.platf.client.ui.rte.RTEditor;
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.cnt.ActionContentToolbar;
import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
@@ -57,16 +56,14 @@
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.ActionContextBottomToolbar;
+import org.ourproject.kune.workspace.client.cxt.ActionContextTopToolBar;
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;
import org.ourproject.kune.workspace.client.cxt.ContextPropEditorView;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
-import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
+import org.ourproject.kune.workspace.client.editor.ContentEditor;
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;
@@ -481,16 +478,14 @@
register(Singleton.class, new Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
@Override
public ActionGroupSummaryToolbar create() {
- final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>(
- $$(ActionManager.class), $(I18nTranslationService.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), $(I18nTranslationService.class));
+ final ActionToolbarPanel<StateToken> panel = new ActionToolbarPanel<StateToken>($$(ActionManager.class));
final ActionParticipationSummaryToolbarPresenter toolbar = new ActionParticipationSummaryToolbarPresenter(
panel);
return toolbar;
@@ -499,7 +494,7 @@
@Override
public ActionBuddiesSummaryToolbar create() {
final ActionToolbarPanel<UserSimpleDTO> panel = new ActionToolbarPanel<UserSimpleDTO>(
- $$(ActionManager.class), $(I18nTranslationService.class));
+ $$(ActionManager.class));
final ActionBuddiesSummaryToolbarPresenter toolbar = new ActionBuddiesSummaryToolbarPresenter(panel);
return toolbar;
}
@@ -866,26 +861,6 @@
}
});
- register(Singleton.class, new Factory<TextEditor>(TextEditor.class) {
- @Override
- public TextEditor create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
- contentNavigatorToolbar);
-
- final TextEditorPresenter presenter = new TextEditorPresenter(true, toolbar,
- $(I18nUITranslationService.class), $(StateManager.class), $(SiteSignOutLink.class),
- $(DeferredCommandWrapper.class));
- final TextEditorPanel panel = new TextEditorPanel(presenter, $(I18nTranslationService.class),
- $(WorkspaceSkeleton.class), $(ColorWebSafePalette.class), $(TextEditorInsertElement.class),
- false);
- presenter.init(panel);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<LanguageSelector>(LanguageSelector.class) {
@Override
public LanguageSelector create() {
@@ -924,32 +899,52 @@
register(NoDecoration.class, new Factory<ActionContentToolbar>(ActionContentToolbar.class) {
@Override
public ActionContentToolbar create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(contentNavigatorToolbar);
+ final ActionCntCtxToolbarPanel<StateToken> tbar = new ActionCntCtxToolbarPanel<StateToken>(
+ AbstractFoldableContentActions.CONTENT_TOPBAR, $$(ActionManager.class),
+ $(WorkspaceSkeleton.class));
+ final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(tbar);
return toolbar;
}
});
- register(NoDecoration.class, new Factory<ActionContextToolbar>(ActionContextToolbar.class) {
+ register(Singleton.class, new Factory<ContentEditor>(ContentEditor.class) {
@Override
- public ActionContextToolbar create() {
- final ActionCntCtxToolbarPanel<StateToken> contentNavigatorToolbar = new ActionCntCtxToolbarPanel<StateToken>(
- ActionCntCtxToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class),
- $(I18nTranslationService.class));
- final ActionContextToolbar toolbar = new ActionContextToolbarPresenter(contentNavigatorToolbar);
+ public ContentEditor create() {
+ return new ContentEditor($(RTEditor.class), true, $(I18nTranslationService.class),
+ $(StateManager.class), $(SiteSignOutLink.class), $(DeferredCommandWrapper.class),
+ $(RTEImgResources.class), $(WorkspaceSkeleton.class));
+ }
+ });
+ register(NoDecoration.class, new Factory<ActionContextTopToolBar>(ActionContextTopToolBar.class) {
+ @Override
+ public ActionContextTopToolBar create() {
+ final ActionCntCtxToolbarPanel<StateToken> panel = new ActionCntCtxToolbarPanel<StateToken>(
+ AbstractFoldableContentActions.CONTEXT_TOPBAR, $$(ActionManager.class),
+ $(WorkspaceSkeleton.class));
+ final ActionContextTopToolBar toolbar = new ActionContextTopToolBar(panel);
return toolbar;
}
});
+ register(NoDecoration.class, new Factory<ActionContextBottomToolbar>(ActionContextBottomToolbar.class) {
+ @Override
+ public ActionContextBottomToolbar create() {
+ final ActionCntCtxToolbarPanel<StateToken> panel = new ActionCntCtxToolbarPanel<StateToken>(
+ AbstractFoldableContentActions.CONTEXT_BOTTOMBAR, $$(ActionManager.class),
+ $(WorkspaceSkeleton.class));
+ final ActionContextBottomToolbar toolbar = new ActionContextBottomToolbar(panel);
+ return toolbar;
+ }
+ });
+
register(Singleton.class, new Factory<ContextNavigator>(ContextNavigator.class) {
@Override
public ContextNavigator create() {
final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
$(Session.class), $(I18nTranslationService.class), $(ContentIconsRegistry.class),
- $(ContentCapabilitiesRegistry.class), $(ActionContextToolbar.class),
- $(ContextActionRegistry.class), $$(FileDownloadUtils.class), true, $(RenameAction.class));
+ $(ContentCapabilitiesRegistry.class), $(ActionContextTopToolBar.class),
+ $(ActionContextBottomToolbar.class), $(ContextActionRegistry.class),
+ $$(FileDownloadUtils.class), true, $(RenameAction.class));
final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter,
$(I18nTranslationService.class), $(WorkspaceSkeleton.class), $(ActionManager.class));
presenter.init(panel);
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -32,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.download.ImageSize;
+import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.ioc.Provider;
@@ -138,7 +139,8 @@
private void setToolbar(ActionItemCollection<StateToken> collection) {
toolbar.disableMenusAndClearButtons();
- toolbar.addActions(collection);
+ toolbar.addActions(collection, AbstractFoldableContentActions.CONTENT_TOPBAR);
+ ;
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -44,7 +44,9 @@
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.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
+import org.ourproject.kune.workspace.client.cxt.ActionContextBottomToolbar;
import org.ourproject.kune.workspace.client.title.RenameAction;
import org.ourproject.kune.workspace.client.upload.FileUploader;
@@ -63,24 +65,26 @@
private boolean editOnNextStateChange;
private final ContentIconsRegistry contentIconsRegistry;
private final ActionRegistry<StateToken> actionRegistry;
- private final ActionToolbar<StateToken> toolbar;
+ private final ActionToolbar<StateToken> topToolbar;
private final Provider<FileDownloadUtils> downloadUtilsProvider;
private final boolean useGenericImageIcon;
private final ContentCapabilitiesRegistry capabilitiesRegistry;
private final RenameAction renameAction;
+ private final ActionContextBottomToolbar bottomToolbar;
public ContextNavigatorPresenter(final StateManager stateManager, final Session session,
final I18nTranslationService i18n, final ContentIconsRegistry contentIconsRegistry,
ContentCapabilitiesRegistry capabilitiesRegistry, final ActionToolbar<StateToken> toolbar,
- final ActionRegistry<StateToken> actionRegistry, Provider<FileDownloadUtils> downloadUtilsProvider,
- boolean useGenericImageIcon, RenameAction renameAction) {
+ ActionContextBottomToolbar bottomToolbar, final ActionRegistry<StateToken> actionRegistry,
+ Provider<FileDownloadUtils> downloadUtilsProvider, boolean useGenericImageIcon, RenameAction renameAction) {
this.stateManager = stateManager;
this.session = session;
this.i18n = i18n;
this.contentIconsRegistry = contentIconsRegistry;
this.capabilitiesRegistry = capabilitiesRegistry;
+ this.topToolbar = toolbar;
+ this.bottomToolbar = bottomToolbar;
this.actionRegistry = actionRegistry;
- this.toolbar = toolbar;
this.downloadUtilsProvider = downloadUtilsProvider;
this.useGenericImageIcon = useGenericImageIcon;
this.renameAction = renameAction;
@@ -103,18 +107,21 @@
// FIXME At the moment detach (removeFromParent) destroy the gwt-ext
// TreePanel and the widget must be recreated (cannot be attached again
// like in gwt)
- toolbar.attach();
+ topToolbar.attach();
+ bottomToolbar.attach();
}
public void clear() {
- toolbar.clear();
+ topToolbar.clear();
+ bottomToolbar.clear();
view.clear();
actionsByItem.clear();
}
public void detach() {
view.detach();
- toolbar.detach();
+ topToolbar.detach();
+ bottomToolbar.detach();
}
public void editItem(final StateToken stateToken) {
@@ -139,8 +146,11 @@
public void selectItem(final StateToken stateToken) {
view.selectItem(genId(stateToken));
- toolbar.disableMenusAndClearButtons();
- toolbar.addActions(actionsByItem.get(stateToken));
+ topToolbar.disableMenusAndClearButtons();
+ bottomToolbar.disableMenusAndClearButtons();
+ ActionItemCollection<StateToken> itemCollection = actionsByItem.get(stateToken);
+ topToolbar.addActions(itemCollection, AbstractFoldableContentActions.CONTEXT_TOPBAR);
+ bottomToolbar.addActions(itemCollection, AbstractFoldableContentActions.CONTEXT_BOTTOMBAR);
}
public void setEditOnNextStateChange(final boolean edit) {
@@ -324,7 +334,8 @@
selectOrEditNode(select, stateToken);
- toolbar.attach();
+ topToolbar.attach();
+ bottomToolbar.attach();
}
private void showRootFolder(final StateContainerDTO state, final AccessRightsDTO containerRights) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextBottomToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextBottomToolbar.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextBottomToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -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.ActionToolbar;
+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 ActionContextBottomToolbar extends ActionToolbarPresenter<StateToken> implements ActionToolbar<StateToken> {
+
+ public ActionContextBottomToolbar(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbar.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.cxt;
-
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface ActionContextToolbar extends ActionToolbar<StateToken> {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -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.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/ActionContextTopToolBar.java (from rev 1055, trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextToolbarPresenter.java 2009-03-03 01:35:36 UTC (rev 1055)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ActionContextTopToolBar.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -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.cxt;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+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 ActionContextTopToolBar extends ActionToolbarPresenter<StateToken> implements ActionToolbar<StateToken> {
+
+ public ActionContextTopToolBar(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -0,0 +1,74 @@
+package org.ourproject.kune.workspace.client.editor;
+
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.SimpleToolbar;
+import org.ourproject.kune.platf.client.ui.rte.RTESavingEditorPresenter;
+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.img.RTEImgResources;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
+import org.ourproject.kune.workspace.client.skel.Toolbar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.gwtext.client.widgets.BoxComponent;
+import com.gwtext.client.widgets.event.ContainerListenerAdapter;
+
+public class ContentEditor extends RTESavingEditorPresenter {
+
+ private final WorkspaceSkeleton ws;
+ private final VerticalPanel vp;
+ private final RTEditor basicEditor;
+ private final RTEditorPanel editorPanel;
+ private final SimpleToolbar topbar;
+
+ public ContentEditor(RTEditor editor, boolean autoSave, I18nTranslationService i18n, StateManager stateManager,
+ SiteSignOutLink siteSignOutLink, DeferredCommandWrapper deferredCommandWrapper,
+ RTEImgResources imgResources, WorkspaceSkeleton ws) {
+ super(editor, autoSave, i18n, stateManager, siteSignOutLink, deferredCommandWrapper, imgResources);
+ this.ws = ws;
+
+ vp = new VerticalPanel();
+ basicEditor = super.getBasicEditor();
+ vp.add(((ActionToolbarPanel<Object>) basicEditor.getSndBar().getView()).getToolbar());
+ editorPanel = (RTEditorPanel) basicEditor.getEditorArea();
+ vp.add(editorPanel.getRTE());
+ basicEditor.setExtended(true);
+ vp.setWidth("100%");
+ adjHeight(ws.getEntityWorkspace().getContentHeight());
+ ws.getEntityWorkspace().addContentListener(new ContainerListenerAdapter() {
+ @Override
+ public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
+ final int rawWidth, final int rawHeight) {
+ adjHeight(adjHeight);
+ }
+ });
+ topbar = ((ActionToolbarPanel<Object>) basicEditor.getTopBar().getView()).getToolbar();
+ }
+
+ @Override
+ public void edit(String html, Listener<String> onSave, Listener0 onEditCancelled) {
+ Toolbar contentTopBar = ws.getEntityWorkspace().getContentTopBar();
+ contentTopBar.removeAll();
+ contentTopBar.add(topbar);
+ ws.getEntityWorkspace().setContent(vp);
+ super.edit(html, onSave, onEditCancelled);
+ }
+
+ @Override
+ protected void onCancelConfirmed() {
+ ws.getEntityWorkspace().clearContent();
+ super.onCancelConfirmed();
+ }
+
+ private void adjHeight(final int height) {
+ int newHeight = height - WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 27;
+ editorPanel.adjustSize(newHeight);
+ vp.setCellHeight(editorPanel.getRTE(), "" + newHeight);
+ }
+}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -23,7 +23,6 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
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.BeforeActionListener;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
@@ -48,7 +47,7 @@
private boolean saveAndCloseConfirmed;
private Listener<String> onSave;
private Listener0 onEditCancelled;
- private final ActionToolbar<StateToken> toolbar;
+ private final ActionToolbar<StateToken> topToolbar;
private ActionToolbarMenuDescriptor<StateToken> save;
private ActionToolbarButtonDescriptor<StateToken> close;
private final I18nUITranslationService i18n;
@@ -57,10 +56,10 @@
private final SiteSignOutLink siteSignOutLink;
private final DeferredCommandWrapper deferredCommandWrapper;
- public TextEditorPresenter(final boolean isAutoSave, final ActionToolbar<StateToken> toolbar,
+ public TextEditorPresenter(final boolean isAutoSave, final ActionToolbar<StateToken> topToolbar,
final I18nUITranslationService i18n, StateManager stateManager, SiteSignOutLink siteSignOutLink,
DeferredCommandWrapper deferredCommandWrapper) {
- this.toolbar = toolbar;
+ this.topToolbar = topToolbar;
this.autoSave = isAutoSave;
this.i18n = i18n;
this.stateManager = stateManager;
@@ -81,7 +80,7 @@
public void editContent(final String content, final Listener<String> onSave, final Listener0 onEditCancelled) {
this.onSave = onSave;
this.onEditCancelled = onEditCancelled;
- toolbar.attach();
+ topToolbar.attach();
view.attach();
setContent(content);
stateManager.addBeforeStateChangeListener(beforeStateChangeListener);
@@ -137,7 +136,7 @@
stateManager.resumeTokenChange();
reset();
view.detach();
- toolbar.detach();
+ topToolbar.detach();
onEditCancelled.onEvent();
}
@@ -176,23 +175,21 @@
}
private void createActions() {
- save = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
- new Listener<StateToken>() {
- public void onEvent(final StateToken token) {
- onSave();
- }
- });
+ save = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Viewer, null, new Listener<StateToken>() {
+ public void onEvent(final StateToken token) {
+ onSave();
+ }
+ });
save.setTextDescription(i18n.tWithNT("Save", "used in button"));
save.setParentMenuTitle(i18n.t("File"));
save.setId(SAVE_ID);
// save.setIconUrl("images/");
- close = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
- new Listener<StateToken>() {
- public void onEvent(final StateToken token) {
- onCancel();
- }
- });
+ close = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, null, new Listener<StateToken>() {
+ public void onEvent(final StateToken token) {
+ onCancel();
+ }
+ });
close.setTextDescription(i18n.tWithNT("Close", "used in button"));
close.setId(CLOSE_ID);
// close.setIconUrl("images/");
@@ -200,7 +197,7 @@
final ActionItemCollection<StateToken> collection = new ActionItemCollection<StateToken>();
collection.add(new ActionItem<StateToken>(save, null));
collection.add(new ActionItem<StateToken>(close, null));
- toolbar.addActions(collection);
+ topToolbar.addActions(collection, null);
}
private void reset() {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplIE6.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplIE6.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplIE6.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,67 +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.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplIE6 extends RichTextAreaImplIE6 {
-
- @Override
- public native void initElement() /*-{
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
-
- setTimeout(function() {
- if (_this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing == false) {
- return;
- }
-
- // Attempt to set the iframe document's body to 'contentEditable' mode.
- // There's no way to know when the body will actually be available, so
- // keep trying every so often until it is.
- // Note: The body seems to be missing only rarely, so please don't remove
- // this retry loop just because it's hard to reproduce.
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- if (!doc.body) {
- // Retry in 50 ms. Faster would run the risk of pegging the CPU. Slower
- // would increase the probability of a user-visible delay.
- setTimeout(arguments.callee, 50);
- return;
- }
- var ct = "<html><head><style>@import url('" + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- doc.body.contentEditable = true;
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,76 +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.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplMozilla extends RichTextAreaImplMozilla {
-
- @Override
- public native void initElement() /*-{
- // Mozilla doesn't allow designMode to be set reliably until the iframe is
- // fully loaded.
- var _this = this;
- var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
-
- iframe.onload = function() {
- // Some Mozillae have the nasty habit of calling onload again when you set
- // designMode, so let's avoid doing it more than once.
- iframe.onload = null;
-
- // patch ccs inject:
-
- var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
- head=doc.getElementsByTagName('head')[0];
- link=document.createElement('link');
- link.setAttribute('rel',"stylesheet");
- link.setAttribute('type',"text/css");
- link.setAttribute('href',$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" );
- head.appendChild(link);
-
- // -- patch
-
- // Send notification that the iframe has finished loading.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
-
- // Don't set designMode until the RTA actually gets focused. This is
- // necessary because editing won't work on Mozilla if the iframe is
- // *hidden, but attached*. Waiting for focus gets around this issue.
- //
- // Note: This onfocus will not conflict with the addEventListener('focus',
- // ...) // in RichTextAreaImplStandard.
- iframe.contentWindow.onfocus = function() {
- iframe.contentWindow.onfocus = null;
- iframe.contentWindow.document.designMode = 'On';
- };
- };
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,48 +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.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera;
-
-public class WrappedRichTextAreaImplOpera extends RichTextAreaImplOpera {
-
- @Override
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- setTimeout(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -1,49 +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.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari;
-
-public class WrappedRichTextAreaImplSafari extends RichTextAreaImplSafari {
-
- @Override
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- setTimeout(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
-
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
-
-}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -21,12 +21,12 @@
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.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.AbstractFoldableContentActions;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.UserActionRegistry;
@@ -108,7 +108,7 @@
**/
private void createActions() {
ActionToolbarMenuDescriptor<UserSimpleDTO> helloWorldBuddiesAction = new ActionToolbarMenuDescriptor<UserSimpleDTO>(
- AccessRolDTO.Viewer, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
+ AccessRolDTO.Viewer, AbstractFoldableContentActions.CONTENT_TOPBAR, new Listener<UserSimpleDTO>() {
public void onEvent(UserSimpleDTO parameter) {
// We clicked:
view.showMessage();
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/ActionCntCtxToolbarPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -20,58 +20,44 @@
package org.ourproject.kune.workspace.client.skel;
import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
import com.calclab.suco.client.ioc.Provider;
public class ActionCntCtxToolbarPanel<T> extends ActionToolbarPanel<T> {
- public enum Position {
- content, context
- }
+ Toolbar wsToolbar;
- private final Position position;
- private final WorkspaceSkeleton ws;
+ public ActionCntCtxToolbarPanel(ActionToolbarPosition position,
+ final Provider<ActionManager> actionManagerProvider, final WorkspaceSkeleton ws) {
+ super(actionManagerProvider);
+ EntityWorkspace entityWorkspace = ws.getEntityWorkspace();
+ if (position.equals(AbstractFoldableContentActions.CONTENT_TOPBAR)) {
+ wsToolbar = entityWorkspace.getContentTopBar();
+ } else if (position.equals(AbstractFoldableContentActions.CONTENT_BOTTOMBAR)) {
+ wsToolbar = entityWorkspace.getContentBottomBar();
+ } else if (position.equals(AbstractFoldableContentActions.CONTEXT_TOPBAR)) {
+ wsToolbar = entityWorkspace.getContextTopBar();
+ } else if (position.equals(AbstractFoldableContentActions.CONTEXT_BOTTOMBAR)) {
+ wsToolbar = entityWorkspace.getContextBottomBar();
+ }
- public ActionCntCtxToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
- final WorkspaceSkeleton ws, I18nTranslationService i18n) {
- super(actionManagerProvider, i18n);
- 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);
- }
+ if (!toolbar.isAttached()) {
+ wsToolbar.removeAll();
+ wsToolbar.add(toolbar);
}
}
@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);
- }
+ if (toolbar.isAttached()) {
+ wsToolbar.remove(toolbar);
}
}
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -157,6 +157,14 @@
cntCtxBorderLayout.addListener(containerListenerAdapter);
}
+ public void clearContent() {
+ content.clear();
+ }
+
+ public void clearContext() {
+ content.clear();
+ }
+
public SimpleToolbar getBottomTitle() {
return bottom;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummary.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummary.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -19,6 +19,6 @@
\*/
package org.ourproject.kune.workspace.client.socialnet;
+
public interface BuddiesSummary {
-
}
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -23,7 +23,6 @@
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.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.MenuItemsContainer;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
@@ -64,7 +63,7 @@
otherBuddiesLabel.addStyleName("kune-Margin-Small-trbl");
vp.add(flowPanel);
vp.add(otherBuddiesLabel);
- toolbar = ((ActionToolbarPanel<UserSimpleDTO>) actionToolbarView).getToolbar(ActionToolbarPosition.bottombar);
+ toolbar = ((ActionToolbarPanel<UserSimpleDTO>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
vp.add(toolbar);
super.add(vp);
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -27,8 +27,8 @@
import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
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.RadioMustBeChecked;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkDataDTO;
@@ -134,7 +134,7 @@
}
toolbar.disableMenusAndClearButtons();
toolbar.addActions(actionRegistry.getCurrentActions(session.getCurrentUser(), session.isLogged(),
- state.getGroupRights(), true));
+ state.getGroupRights(), true), ActionToolbar.IN_ANY);
toolbar.attach();
view.show();
} else {
@@ -148,7 +148,7 @@
private void createAddNewBuddiesAction() {
ActionToolbarMenuDescriptor<UserSimpleDTO> addNewBuddiesAction = new ActionToolbarMenuDescriptor<UserSimpleDTO>(
- AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
+ AccessRolDTO.Administrator, buddiesBottom, new Listener<UserSimpleDTO>() {
public void onEvent(UserSimpleDTO parameter) {
NotifyUser.info("In development");
}
@@ -161,7 +161,7 @@
private void createSetBuddiesVisibilityAction(String textDescription, final UserBuddiesVisibilityDTO visibility) {
ActionToolbarMenuRadioDescriptor<UserSimpleDTO> buddiesVisibilityAction = new ActionToolbarMenuRadioDescriptor<UserSimpleDTO>(
- AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
+ AccessRolDTO.Administrator, buddiesBottom, new Listener<UserSimpleDTO>() {
public void onEvent(UserSimpleDTO parameter) {
userServiceAsync.get().setBuddiesVisibility(session.getUserHash(),
session.getCurrentState().getGroup().getStateToken(), visibility,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -20,7 +20,6 @@
package org.ourproject.kune.workspace.client.socialnet;
import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
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.GroupDTO;
@@ -78,7 +77,7 @@
noMembersPublic.setVisible(false);
super.add(noMembersPublic);
- toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar(ActionToolbarPosition.bottombar);
+ toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
super.add(toolbar);
super.addInSummary();
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -24,8 +24,8 @@
import org.ourproject.kune.chat.client.ChatEngine;
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.RadioMustBeChecked;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
@@ -97,7 +97,7 @@
setState(state);
toolbar.disableMenusAndClearButtons();
toolbar.addActions(groupActionRegistry.getCurrentActions(state.getGroup().getStateToken(),
- session.isLogged(), state.getGroupRights(), true));
+ session.isLogged(), state.getGroupRights(), true), ActionToolbar.IN_ANY);
toolbar.attach();
}
};
@@ -157,7 +157,7 @@
private void createActions() {
ActionToolbarMenuDescriptor<StateToken> addMember = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
liveSearcherProvider.get().onSelection(new Listener<LinkDTO>() {
public void onEvent(final LinkDTO link) {
@@ -185,7 +185,7 @@
private void createNewMembersPolicyAction(String textDescription, final AdmissionTypeDTO admissionPolicy) {
ActionToolbarMenuRadioDescriptor<StateToken> newMembersPolicy = new ActionToolbarMenuRadioDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
groupServiceProvider.get().setGroupNewMembersJoiningPolicy(session.getUserHash(),
session.getCurrentState().getGroup().getStateToken(), admissionPolicy,
@@ -209,7 +209,7 @@
private void createSetMembersVisibilityAction(String textDescription, final SocialNetworkVisibilityDTO visibility) {
ActionToolbarMenuRadioDescriptor<StateToken> showMembers = new ActionToolbarMenuRadioDescriptor<StateToken>(
- AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+ AccessRolDTO.Administrator, membersBottom, new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
groupServiceProvider.get().setSocialNetworkVisibility(session.getUserHash(),
session.getCurrentState().getGroup().getStateToken(), visibility,
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -19,7 +19,6 @@
*/
package org.ourproject.kune.workspace.client.socialnet;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
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.GroupDTO;
@@ -54,7 +53,7 @@
// gridMenuPanel.onClick(go);
gridMenuPanel.onDoubleClick(go);
super.add(gridMenuPanel);
- toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar(ActionToolbarPosition.bottombar);
+ toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar();
toolbar.setCleanStyle();
super.add(toolbar);
addInSummary();
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -48,6 +48,9 @@
public class SocialNetworkPresenter {
+ protected final ActionToolbarPosition membersBottom = new ActionToolbarPosition("sn-bottomtoolbar");
+ protected final ActionToolbarPosition buddiesBottom = new ActionToolbarPosition("sn-bottomtoolbar");
+
protected MenuItem<GroupDTO> changeToCollabMenuItem;
protected MenuItem<GroupDTO> removeMemberMenuItem;
protected MenuItem<GroupDTO> changeToAdminMenuItem;
@@ -139,8 +142,8 @@
}
private void createButtons() {
- participate = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer,
- ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+ participate = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, membersBottom,
+ new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
NotifyUser.showProgressProcessing();
snServiceProvider.get().requestJoinGroup(session.getUserHash(),
@@ -174,7 +177,7 @@
}
});
- unJoin = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Editor, ActionToolbarPosition.bottombar,
+ unJoin = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Editor, membersBottom,
new Listener<StateToken>() {
public void onEvent(StateToken parameter) {
removeMemberAction();
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionRegistryTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionRegistryTest.java 2009-03-09 23:32:38 UTC (rev 1063)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionRegistryTest.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -15,6 +15,7 @@
public class ActionRegistryTest {
private static final String DEF_CONTENT_TYPE_ID = "test";
+ private static final ActionToolbarPosition SOME_ID = new ActionToolbarPosition("some-id");
private ActionRegistry<StateToken> registry;
private ActionToolbarMenuAndItemDescriptor<StateToken> adminAction;
private ActionToolbarMenuAndItemDescriptor<StateToken> editorAction;
@@ -36,13 +37,13 @@
public void before() {
session = Mockito.mock(Session.class);
registry = new ActionRegistry<StateToken>();
- adminAction = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Administrator,
- ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ adminAction = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Administrator, SOME_ID,
+ new Listener<StateToken>() {
public void onEvent(final StateToken parameter) {
}
});
- editorAction = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ editorAction = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, SOME_ID,
+ new Listener<StateToken>() {
public void onEvent(final StateToken parameter) {
}
});
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-09 23:32:38 UTC (rev 1063)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-10 00:05:50 UTC (rev 1064)
@@ -5,18 +5,15 @@
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationServiceMocked;
import com.google.gwt.user.client.ui.KeyboardListener;
public class ActionShortcutTest {
- private I18nTranslationServiceMocked i18n;
-
@Test
public void altS() {
ActionShortcut shortcut = new ActionShortcut(true, false, false, 'S', null);
- assertEquals(" (Alt+S)", shortcut.toString(i18n));
+ assertEquals(" (Alt+S)", shortcut.toString());
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_SHIFT));
@@ -24,13 +21,12 @@
@Before
public void before() {
- i18n = new I18nTranslationServiceMocked();
}
@Test
public void ctrl_coma() {
ActionShortcut shortcut = new ActionShortcut(true, ',');
- assertEquals(" (Ctrl+,)", shortcut.toString(i18n));
+ assertEquals(" (Ctrl+,)", shortcut.toString());
assertTrue(shortcut.is(',', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is(',', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is(',', KeyboardListener.MODIFIER_SHIFT));
@@ -39,7 +35,7 @@
@Test
public void ctrl_s() {
ActionShortcut shortcut = new ActionShortcut(true, 's');
- assertEquals(" (Ctrl+S)", shortcut.toString(i18n));
+ assertEquals(" (Ctrl+S)", shortcut.toString());
assertTrue(shortcut.is('s', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is('s', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is('s', KeyboardListener.MODIFIER_SHIFT));
@@ -48,7 +44,7 @@
@Test
public void ctrlS() {
ActionShortcut shortcut = new ActionShortcut(true, 'S');
- assertEquals(" (Ctrl+S)", shortcut.toString(i18n));
+ assertEquals(" (Ctrl+S)", shortcut.toString());
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_CTRL));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_SHIFT));
@@ -57,7 +53,7 @@
@Test
public void ctrlShiftS() {
ActionShortcut shortcut = new ActionShortcut(false, true, true, 'S', null);
- assertEquals(" (Ctrl+Shift+S)", shortcut.toString(i18n));
+ assertEquals(" (Ctrl+Shift+S)", shortcut.toString());
assertTrue(!shortcut.is('S', KeyboardListener.MODIFIER_ALT));
assertTrue(shortcut.is('S', KeyboardListener.MODIFIER_SHIFT | KeyboardListener.MODIFIER_CTRL));
}
1
0
Author: vjrj
Date: 2009-03-10 00:32:38 +0100 (Tue, 10 Mar 2009)
New Revision: 1063
Modified:
trunk/DEV-GUIDE
Log:
dev-guide updated
Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE 2009-03-06 13:10:36 UTC (rev 1062)
+++ trunk/DEV-GUIDE 2009-03-09 23:32:38 UTC (rev 1063)
@@ -2,8 +2,26 @@
''This is the trunk/DEV-GUIDE file (must have the same content as the [http://kune.ourproject.org/wiki/index.php?title=Kune_developer's_guide wiki page])''
+==How to checkout the code of kune==
+
+Our code is in the svn of ourproject.
+
+===Anonymous Subversion Access===
+
+This project's SVN repository can be checked out through anonymous access with the following command(s).
+
+ svn checkout svn://scm.ourproject.org/svnroot/kune/trunk
+
+===Developer Subversion Access via SSH===
+
+Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Substitute colaborator with the proper values. Enter your ourproject web password when prompted.
+
+ svn checkout svn+ssh://[email protected]/svnroot/kune/trunk
+
==Some relevant docs for kune development==
+See this files in trunk directory:
+
* trunk/img/kune-arch.png # architecture diagram
* trunk/INSTALL
* trunk/TROUBLESHOOT
1
0
06 Mar '09
Author: vjrj
Date: 2009-03-06 14:10:36 +0100 (Fri, 06 Mar 2009)
New Revision: 1062
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.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/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/KuneUiUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/ColorWebSafePalettePanel.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/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2009-03-06 13:10:36 UTC (rev 1062)
@@ -35,7 +35,7 @@
}
*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;overflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
- padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:1px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-bottom-color:#FFF;border-bottom-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{/* line-height: 24px; */color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
+ padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette-popup{z-index:9999!important;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:1px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-bottom-color:#FFF;border-bottom-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{/* line-height: 24px; */color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
.x-tree-node a span, .x-dd-drag-ghost a span {
color:#000000;
padding: 1px 0px 1px 1px;
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2009-03-06 13:10:36 UTC (rev 1062)
@@ -141,6 +141,10 @@
margin: 1px;
}
+.kune-WebSafePalette-popup {
+ z-index: 9999 !important;
+}
+
.kune-WebSafePalette td {
width: 12px;
height: 10px;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -26,8 +26,11 @@
public abstract class ActionToolbarDescriptor<T> extends ActionDescriptor<T> {
+ public static final int NO_POSITION = -1;
private ActionToolbarPosition actionToolbarPosition;
+ private int position = NO_POSITION;
+
public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
final Listener<T> onPerformCall) {
super(accessRolDTO, onPerformCall);
@@ -68,8 +71,26 @@
return actionToolbarPosition;
}
+ /**
+ * Get the index position where this action will be inserted
+ *
+ * @param position
+ */
+ public int getPosition() {
+ return position;
+ }
+
public void setActionPosition(final ActionToolbarPosition actionToolbarPosition) {
this.actionToolbarPosition = actionToolbarPosition;
}
+ /**
+ * Index position where this action will be inserted
+ *
+ * @param position
+ */
+ public void setPosition(int position) {
+ this.position = position;
+ }
+
}
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -32,6 +32,8 @@
private String parentMenuIconCls;
private String parentSubMenuTitle;
private String parentMenuTooltip;
+ private boolean topSeparator = false;
+ private boolean bottomSeparator = false;
public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
@@ -87,6 +89,18 @@
return parentSubMenuTitle;
}
+ public boolean hasBottomSeparator() {
+ return bottomSeparator;
+ }
+
+ public boolean hasTopSeparator() {
+ return topSeparator;
+ }
+
+ public void setBottomSeparator(boolean bottomSeparator) {
+ this.bottomSeparator = bottomSeparator;
+ }
+
public void setParentMenuIconCls(String parentMenuIconCls) {
this.parentMenuIconCls = parentMenuIconCls;
}
@@ -109,4 +123,8 @@
}
this.parentSubMenuTitle = parentSubMenuTitle;
}
+
+ public void setTopSeparator(boolean topSeparator) {
+ this.topSeparator = topSeparator;
+ }
}
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -35,6 +35,10 @@
void disableMenusAndClearButtons();
+ int getLeftPosition(ActionDescriptor<T> action);
+
+ int getTopPosition(ActionDescriptor<T> action);
+
ActionToolbarView<T> getView();
void hideAllMenus();
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -114,7 +114,12 @@
if (action.hasLeftSeparator()) {
add(toolbar, action.getLeftSeparator());
}
- toolbar.add(button);
+ int position = action.getPosition();
+ if (position != ActionToolbarDescriptor.NO_POSITION) {
+ toolbar.insert(button, position);
+ } else {
+ toolbar.add(button);
+ }
if (action.hasRightSeparator()) {
add(toolbar, action.getRightSeparator());
}
@@ -158,6 +163,14 @@
}
}
+ public int getLeftPosition(ActionDescriptor<T> action) {
+ final ToolbarButton button = findButton(action);
+ if (button != null) {
+ return button.getAbsoluteLeft();
+ }
+ return 0;
+ }
+
public SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
switch (pos) {
case bottombar:
@@ -168,6 +181,14 @@
}
}
+ public int getTopPosition(ActionDescriptor<T> action) {
+ final ToolbarButton button = findButton(action);
+ if (button != null) {
+ return button.getAbsoluteTop();
+ }
+ return 0;
+ }
+
public void hideAllMenus() {
for (Menu menu : toolbarMenus.values()) {
menu.hide(true);
@@ -220,6 +241,12 @@
}
}
+ private void addSeparator(Menu menu, boolean separator) {
+ if (separator) {
+ menu.addSeparator();
+ }
+ }
+
private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, String id) {
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
@@ -277,15 +304,18 @@
menu.addItem(subMenuItem);
toolbarMenus.put(subMenuKey, subMenu);
}
+ addSeparator(subMenu, action.hasTopSeparator());
subMenu.addItem(item);
-
+ addSeparator(subMenu, action.hasBottomSeparator());
} else {
// Menu action without submenu
if (menu == null) {
menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
menuTitle, menuKey, action.getParentMenuTooltip());
}
+ addSeparator(menu, action.hasTopSeparator());
menu.addItem(item);
+ addSeparator(menu, action.hasBottomSeparator());
}
return item;
}
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -70,6 +70,14 @@
view.clear();
}
+ public int getLeftPosition(ActionDescriptor<T> action) {
+ return view.getLeftPosition(action);
+ }
+
+ public int getTopPosition(ActionDescriptor<T> action) {
+ return view.getTopPosition(action);
+ }
+
public ActionToolbarView<T> getView() {
return view;
}
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -38,6 +38,10 @@
void disableAllMenuItems();
+ int getLeftPosition(ActionDescriptor<T> action);
+
+ int getTopPosition(ActionDescriptor<T> action);
+
void hideAllMenus();
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -233,7 +233,8 @@
RTEActionTopToolbar topBar = $(RTEActionTopToolbar.class);
RTEActionSndToolbar sndBar = $(RTEActionSndToolbar.class);
final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
- $(Session.class), topBar, sndBar, $(RTEImgResources.class), $(TextEditorInsertElement.class));
+ $(Session.class), topBar, sndBar, $(RTEImgResources.class), $(TextEditorInsertElement.class),
+ $(ColorWebSafePalette.class), $(DeferredCommandWrapper.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/KuneUiUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -131,5 +131,4 @@
public static void setQuickTip(final Widget widget, final String tip, final String tipTitle) {
setQuickTip(widget.getElement(), tip, tipTitle);
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -49,6 +49,11 @@
childPanel.setCellVerticalAlignment(widget, valign);
}
+ public void add(final Widget widget, VerticalAlignmentConstant valign, int position) {
+ childPanel.insert(widget, position);
+ childPanel.setCellVerticalAlignment(widget, valign);
+ }
+
public Widget addFill() {
final Label emptyLabel = new Label("");
this.add(emptyLabel);
@@ -71,6 +76,11 @@
return emptyLabel;
}
+ public void insert(final Widget widget, int position) {
+ childPanel.insert(widget, position);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
public void remove(final Widget widget) {
childPanel.remove(widget);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/ColorWebSafePalettePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/ColorWebSafePalettePanel.java 2009-03-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/ColorWebSafePalettePanel.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -52,6 +52,7 @@
createPalette();
}
popupPalette = new PopupPanel(true, true);
+ popupPalette.addStyleName("kune-WebSafePalette-popup");
popupPalette.setVisible(false);
popupPalette.show();
popupPalette.setPopupPosition(left, top);
@@ -68,12 +69,12 @@
int row;
int col;
int n = 0;
- for (int a = 0; a < COLORS.length; a++) {
- for (int b = 0; b < COLORS.length; b++) {
- for (int c = 0; c < COLORS.length; c++) {
+ for (String element : COLORS) {
+ for (String element2 : COLORS) {
+ for (String element3 : COLORS) {
row = n / COLS;
col = n % COLS;
- final String currentColor = "#" + COLORS[c] + COLORS[a] + COLORS[b];
+ final String currentColor = "#" + element3 + element + element2;
paletteGrid.setText(row, col, " ");
DOM.setStyleAttribute(paletteGrid.getCellFormatter().getElement(row, col), "backgroundColor",
currentColor);
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -60,7 +60,7 @@
Element span = DOM.createSpan();
span.setInnerHTML("<em>" + i18n.t("type here") + "</em> -" + userName + " " + time);
DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
- insertHtml(span.getString() + " ");
+ insertHtml(" " + span.getString() + " ");
}
public void adjustSize(int height) {
@@ -91,6 +91,10 @@
extended.delete();
}
+ public void focus() {
+ rta.setFocus(true);
+ }
+
public Widget getRTE() {
return rta;
}
@@ -179,6 +183,10 @@
basic.selectAll();
}
+ public void setBackColor(String color) {
+ basic.setBackColor(color);
+ }
+
public void setFontName(String name) {
basic.setFontName(name);
}
@@ -270,8 +278,9 @@
ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
if (actionItem != null) {
actionManager.doAction(actionItem);
+ updateStatus();
} else {
- Log.debug("...but not mapped to any command");
+ Log.debug("...but not mapped to any action");
}
}
}
@@ -285,4 +294,5 @@
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -21,10 +21,13 @@
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.palette.ColorWebSafePalette;
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.Event0;
+import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
import com.calclab.suco.client.events.Listener2;
import com.google.gwt.libideas.resources.client.ImageResource;
@@ -62,14 +65,19 @@
private ActionToolbarPushButtonDescriptor<Object> strikethrough;
private final Event0 onEdit;
private final TextEditorInsertElement insertElement;
+ private final ColorWebSafePalette palette;
+ private final DeferredCommandWrapper deferred;
public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
- RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement) {
+ RTEActionSndToolbar sndBar, RTEImgResources imgResources, TextEditorInsertElement textEditorInsertElement,
+ ColorWebSafePalette palette, DeferredCommandWrapper deferred) {
this.i18n = i18n;
this.session = session;
this.topBar = topBar;
this.sndBar = sndBar;
this.insertElement = textEditorInsertElement;
+ this.palette = palette;
+ this.deferred = deferred;
styleToolbar(topBar);
styleToolbar(sndBar);
sndBar.attach();
@@ -147,6 +155,7 @@
public void onEditorFocus() {
topBar.hideAllMenus();
sndBar.hideAllMenus();
+ palette.hide();
}
public void setExtended(boolean extended) {
@@ -187,6 +196,8 @@
selectAll.setTextDescription(i18n.t("Select all"));
selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
selectAll.setAddCondition(canBeBasic);
+ selectAll.setTopSeparator(true);
+ selectAll.setBottomSeparator(true);
bold = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -301,6 +312,7 @@
redo.setTextDescription(i18n.t("Redo"));
redo.setParentMenuTitle(i18n.t(EDIT_MENU));
redo.setAddCondition(canBeExtended);
+ redo.setBottomSeparator(true);
redo.setIconCls(getCssName(imgResources.redo()));
ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -374,6 +386,7 @@
ActionToolbarMenuDescriptor<Object> comment = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
+ view.focus();
view.addComment(session.getCurrentUser().getShortName());
}
});
@@ -391,6 +404,7 @@
ActionToolbarMenuDescriptor<Object> hr = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
+ view.focus();
view.insertHorizontalRule();
}
});
@@ -402,6 +416,7 @@
ActionToolbarButtonDescriptor<Object> hrButton = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
+ view.focus();
view.insertHorizontalRule();
}
});
@@ -478,7 +493,11 @@
ActionToolbarButtonDescriptor<Object> createLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
- insertElement.show();
+ deferred.addCommand(new Listener0() {
+ public void onEvent() {
+ insertElement.show();
+ }
+ });
}
});
createLink.setIconCls(getCssName(imgResources.link()));
@@ -514,22 +533,13 @@
removeFormat.setAddCondition(canBeExtended);
removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
- ActionToolbarButtonDescriptor<Object> insertTable = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ final ActionToolbarButtonDescriptor<Object> insertTable = new ActionToolbarButtonDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
- view.insertHtml("<table id=\"iorh\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
- + "<tbody>\n"
- + "<tr>\n"
- + "<td width=\"50%\"><br>\n"
- + "</td>\n"
- + "<td width=\"50%\"><br>\n"
- + "</td>\n"
- + "</tr>\n"
- + "<tr>\n"
- + "<td width=\"50%\"><br>\n"
- + "</td>\n"
- + "<td width=\"50%\"><br>\n"
- + "</td>\n"
+ view.insertHtml("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
+ + "<tbody>\n" + "<tr>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
+ + "<td width=\"50%\"><br>\n" + "</td>\n" + "</tr>\n" + "<tr>\n"
+ + "<td width=\"50%\"><br>\n" + "</td>\n" + "<td width=\"50%\"><br>\n" + "</td>\n"
+ "</tr>\n</tbody>\n</table>");
}
});
@@ -538,7 +548,38 @@
insertTable.setAddCondition(canBeExtended);
insertTable.setRightSeparator(ActionToolbarButtonSeparator.separator);
- topActions.add(withNoItem(selectAll));
+ final ActionToolbarButtonDescriptor<Object> fontColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ palette.show(getActionLeftPosition(sndBar, insertTable), getActionTopPosition(sndBar,
+ insertTable), new Listener<String>() {
+ public void onEvent(String color) {
+ palette.hide();
+ view.setForeColor(color);
+ }
+ });
+ }
+ });
+ fontColor.setIconCls(getCssName(imgResources.fontcolor()));
+ fontColor.setToolTip(i18n.t("Text Colour"));
+ fontColor.setAddCondition(canBeBasic);
+
+ ActionToolbarButtonDescriptor<Object> backgroundColor = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ palette.show(getActionLeftPosition(sndBar, fontColor), getActionTopPosition(sndBar, fontColor),
+ new Listener<String>() {
+ public void onEvent(String color) {
+ palette.hide();
+ view.setBackColor(color);
+ }
+ });
+ }
+ });
+ backgroundColor.setIconCls(getCssName(imgResources.backcolor()));
+ backgroundColor.setToolTip(i18n.t("Text Background Colour"));
+ backgroundColor.setAddCondition(canBeBasic);
+
sndActions.add(withNoItem(undoBtn));
sndActions.add(withNoItem(redoBtn));
sndActions.add(withNoItem(bold));
@@ -555,6 +596,7 @@
topActions.add(withNoItem(copy));
topActions.add(withNoItem(cut));
topActions.add(withNoItem(paste));
+ topActions.add(withNoItem(selectAll));
topActions.add(withNoItem(editHtml));
topActions.add(withNoItem(hr));
topActions.add(withNoItem(subscript));
@@ -576,10 +618,12 @@
sndActions.add(withNoItem(fontNameAction));
}
for (int fontSize = 0; fontSize < fontSizes.length; fontSize++) {
- ActionToolbarMenuDescriptor<Object> fontSizeAction = createFontSizeAction(canBeBasic, fontSize, fontSizes[fontSize]);
+ ActionToolbarMenuDescriptor<Object> fontSizeAction = createFontSizeAction(canBeBasic, fontSize,
+ fontSizes[fontSize]);
sndActions.add(withNoItem(fontSizeAction));
}
-
+ sndActions.add(withNoItem(fontColor));
+ sndActions.add(withNoItem(backgroundColor));
}
private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
@@ -614,6 +658,14 @@
return font;
}
+ private int getActionLeftPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+ return bar.getLeftPosition(action);
+ }
+
+ private int getActionTopPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+ return bar.getTopPosition(action);
+ }
+
private String getCssName(ImageResource imageResource) {
return "k-rte-" + imageResource.getName();
}
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -24,6 +24,8 @@
void delete();
+ void focus();
+
void insertHorizontalRule();
void insertHtml(String html);
@@ -66,6 +68,8 @@
void selectAll();
+ void setBackColor(String color);
+
void setFontName(String name);
void setFontSize(FontSize fontSize);
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-06 03:09:10 UTC (rev 1061)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2009-03-06 13:10:36 UTC (rev 1062)
@@ -15,7 +15,7 @@
public TestRTEDialog(RTEditor editor) {
this.editor = editor;
- dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
+ dialog = new BasicDialog("Testing RTE", false, false, 650, 200);
final VerticalPanel vp = new VerticalPanel();
vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
1
0
r1061 - in trunk/src/main/java/org/ourproject/kune/platf/client: actions actions/toolbar ui/rte ui/rte/img
by vjrj 06 Mar '09
by vjrj 06 Mar '09
06 Mar '09
Author: vjrj
Date: 2009-03-06 04:09:10 +0100 (Fri, 06 Mar 2009)
New Revision: 1061
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/copy.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/cut.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertspreadsheet.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertsymbol.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/inserttable.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/paste.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/redo.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/save.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/selectall.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/specialchars.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/undo.png
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.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/actions/toolbar/ActionToolbarView.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/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -31,6 +31,7 @@
private String parentMenuIconUrl;
private String parentMenuIconCls;
private String parentSubMenuTitle;
+ private String parentMenuTooltip;
public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
@@ -78,6 +79,10 @@
return parentMenuTitle;
}
+ public String getParentMenuTooltip() {
+ return parentMenuTooltip;
+ }
+
public String getParentSubMenuTitle() {
return parentSubMenuTitle;
}
@@ -94,6 +99,10 @@
this.parentMenuTitle = parentMenuTitle;
}
+ public void setParentMenuTooltip(String parentMenuTooltip) {
+ this.parentMenuTooltip = parentMenuTooltip;
+ }
+
public void setParentSubMenuTitle(final String parentSubMenuTitle) {
if (parentMenuTitle == null) {
Log.warn("Please set parentMenuTitle before");
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
public interface ActionToolbar<T> {
@@ -36,8 +37,12 @@
ActionToolbarView<T> getView();
+ void hideAllMenus();
+
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
+
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -125,11 +125,12 @@
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
final String menuTitle = action.getParentMenuTitle();
final String menuSubTitle = action.getParentSubMenuTitle();
+ final String menuTooltip = action.getParentMenuTooltip();
final ActionToolbarPosition pos = action.getActionPosition();
- final String itemKey = genMenuKey(pos, menuTitle, menuSubTitle, action.getText());
+ final String itemKey = genMenuKey(pos, menuTitle, action.getParentMenuTooltip(), menuSubTitle, action.getText());
Item item = menuItems.get(itemKey);
if (item == null) {
- item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem, generateIdIfEmpty(action));
+ item = createToolbarMenu(pos, menuTitle, menuTooltip, menuSubTitle, actionItem, generateIdIfEmpty(action));
menuItems.put(itemKey, item);
}
setEnableMenuItem(item, enable);
@@ -167,6 +168,12 @@
}
}
+ public void hideAllMenus() {
+ for (Menu menu : toolbarMenus.values()) {
+ menu.hide(true);
+ }
+ }
+
public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
final ToolbarButton button = findButton(action);
if (button != null) {
@@ -176,6 +183,17 @@
}
}
+ public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
+ String newTitle) {
+ final String menuKey = genMenuKey(action.getActionPosition(), origTitle, origTooltip, null, null);
+ Menu menu = toolbarMenus.get(menuKey);
+ if (menu != null) {
+ menu.setTitle(newTitle);
+ } else {
+ Log.error("Tryng to rename a non existent menu");
+ }
+ }
+
public void setPushButtonPressed(final ActionDescriptor<T> action, final boolean pressed) {
final ToolbarButton button = findButton(action);
if (button != null && button.isEnableToggle()) {
@@ -203,7 +221,7 @@
}
private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
- final String menuSubTitle, final ActionItem<T> actionItem, String id) {
+ final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, String id) {
final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
final Item item;
if (action instanceof ActionToolbarMenuRadioDescriptor) {
@@ -244,8 +262,8 @@
item.setId(id);
}
- final String menuKey = genMenuKey(toolBarPos, menuTitle, null, null);
- final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuSubTitle, null);
+ final String menuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, null, null);
+ final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, menuSubTitle, null);
Menu menu = toolbarMenus.get(menuKey);
Menu subMenu = toolbarMenus.get(subMenuKey);
if (menuSubTitle != null) {
@@ -254,7 +272,7 @@
final MenuItem subMenuItem = new MenuItem(menuSubTitle, subMenu);
if (menu == null) {
menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
- menuTitle, menuKey);
+ menuTitle, menuKey, "");
}
menu.addItem(subMenuItem);
toolbarMenus.put(subMenuKey, subMenu);
@@ -264,7 +282,8 @@
} else {
// Menu action without submenu
if (menu == null) {
- menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), null, menuTitle, menuKey);
+ menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), action.getParentMenuIconCls(),
+ menuTitle, menuKey, action.getParentMenuTooltip());
}
menu.addItem(item);
}
@@ -272,8 +291,9 @@
}
private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl, final String iconCls,
- final String menuTitle, final String menuKey) {
+ final String menuTitle, final String menuKey, final String menuTooltip) {
final Menu menu = new Menu();
+ menu.setShadow(true);
final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
toolbarMenu.setMenu(menu);
if (iconUrl != null) {
@@ -282,6 +302,9 @@
if (iconCls != null) {
toolbarMenu.setIconCls(iconCls);
}
+ if (menuTooltip != null) {
+ toolbarMenu.setTooltip(menuTooltip);
+ }
toolbarMenus.put(menuKey, menu);
add(barPosition, toolbarMenu);
return menu;
@@ -317,10 +340,10 @@
return action.getText() + action.getShortcutToS(i18n);
}
- private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
- final String actionText) {
+ private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuTooltip,
+ final String menuSubTitle, final String actionText) {
- final String basePart = "km-atp-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle;
+ final String basePart = "km-atp-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle + "-" + menuTooltip;
final String subMenuPart = menuSubTitle != null ? "-subm-" + menuSubTitle : "";
final String itemPart = actionText != null ? "-item-" + actionText : "";
return basePart + subMenuPart + itemPart;
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -74,10 +74,19 @@
return view;
}
+ public void hideAllMenus() {
+ view.hideAllMenus();
+ }
+
public void setButtonEnable(ActionDescriptor<T> action, boolean enable) {
view.setButtonEnable(action, enable);
}
+ public void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip,
+ String newTitle) {
+ view.setParentMenuTitle(action, origTitle, origTooltip, newTitle);
+ }
+
public void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed) {
view.setPushButtonPressed(action, pressed);
}
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -22,6 +22,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
public interface ActionToolbarView<T> extends View {
@@ -37,8 +38,12 @@
void disableAllMenuItems();
+ void hideAllMenus();
+
void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+ void setParentMenuTitle(ActionToolbarMenuDescriptor<T> action, String origTitle, String origTooltip, String newTitle);
+
void setPushButtonPressed(ActionDescriptor<T> action, boolean pressed);
}
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -18,6 +18,7 @@
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.KeyboardListener;
import com.google.gwt.user.client.ui.Widget;
@@ -182,30 +183,8 @@
basic.setFontName(name);
}
- public void setFontSize(int size) {
- switch (size) {
- case 1:
- basic.setFontSize(FontSize.XX_SMALL);
- break;
- case 2:
- basic.setFontSize(FontSize.X_SMALL);
- break;
- case 3:
- basic.setFontSize(FontSize.SMALL);
- break;
- case 4:
- basic.setFontSize(FontSize.MEDIUM);
- break;
- case 5:
- basic.setFontSize(FontSize.LARGE);
- break;
- case 6:
- basic.setFontSize(FontSize.X_LARGE);
- break;
- case 7:
- basic.setFontSize(FontSize.XX_LARGE);
- break;
- }
+ public void setFontSize(FontSize size) {
+ basic.setFontSize(size);
}
public void setForeColor(String color) {
@@ -249,6 +228,14 @@
}
private void createListeners() {
+ rta.addFocusListener(new FocusListener() {
+ public void onFocus(Widget sender) {
+ presenter.onEditorFocus();
+ }
+
+ public void onLostFocus(Widget sender) {
+ }
+ });
rta.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (sender == rta) {
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -35,6 +35,14 @@
top, snd
};
+ private final String fontNames[] = { "Times New Roman", "Arial", "Courier New", "Georgia", "Trebuchet", "Verdana" };
+ private final String fontSizes[] = { "Extra small", "Very small", "Small", "Medium", "Large", "Very large",
+ "Extra large" };
+ private static final RichTextArea.FontSize[] fontSizesConstants = new RichTextArea.FontSize[] {
+ RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL, RichTextArea.FontSize.SMALL,
+ RichTextArea.FontSize.MEDIUM, RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
+ RichTextArea.FontSize.XX_LARGE };
+
private static final String EDIT_MENU = "Edit";
private static final String INSERT_MENU = "Insert";
private static final String FORMAT_MENU = "Format";
@@ -136,6 +144,11 @@
createBasicActions();
}
+ public void onEditorFocus() {
+ topBar.hideAllMenus();
+ sndBar.hideAllMenus();
+ }
+
public void setExtended(boolean extended) {
this.extended = extended;
}
@@ -169,6 +182,7 @@
view.selectAll();
}
});
+ selectAll.setIconCls(getCssName(imgResources.selectall()));
selectAll.setShortcut(new ActionShortcut(true, 'A'));
selectAll.setTextDescription(i18n.t("Select all"));
selectAll.setParentMenuTitle(i18n.t(EDIT_MENU));
@@ -275,6 +289,7 @@
undo.setTextDescription(i18n.t("Undo"));
undo.setParentMenuTitle(i18n.t(EDIT_MENU));
undo.setAddCondition(canBeExtended);
+ undo.setIconCls(getCssName(imgResources.undo()));
ActionToolbarMenuDescriptor<Object> redo = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -286,7 +301,29 @@
redo.setTextDescription(i18n.t("Redo"));
redo.setParentMenuTitle(i18n.t(EDIT_MENU));
redo.setAddCondition(canBeExtended);
+ redo.setIconCls(getCssName(imgResources.redo()));
+ ActionToolbarButtonDescriptor<Object> undoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.undo();
+ }
+ });
+ undoBtn.setToolTip(i18n.t("Undo"));
+ undoBtn.setAddCondition(canBeExtended);
+ undoBtn.setIconCls(getCssName(imgResources.undo()));
+
+ ActionToolbarButtonDescriptor<Object> redoBtn = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.redo();
+ }
+ });
+ redoBtn.setToolTip(i18n.t("Redo"));
+ redoBtn.setAddCondition(canBeExtended);
+ redoBtn.setIconCls(getCssName(imgResources.redo()));
+ redoBtn.setRightSeparator(ActionToolbarButtonSeparator.separator);
+
ActionToolbarMenuDescriptor<Object> copy = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
public void onEvent() {
@@ -297,6 +334,7 @@
copy.setTextDescription(i18n.t("Copy"));
copy.setParentMenuTitle(i18n.t(EDIT_MENU));
copy.setAddCondition(canBeExtended);
+ copy.setIconCls(getCssName(imgResources.copy()));
ActionToolbarMenuDescriptor<Object> cut = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -308,6 +346,7 @@
cut.setTextDescription(i18n.t("Cut"));
cut.setParentMenuTitle(i18n.t(EDIT_MENU));
cut.setAddCondition(canBeExtended);
+ cut.setIconCls(getCssName(imgResources.cut()));
ActionToolbarMenuDescriptor<Object> paste = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -319,6 +358,7 @@
paste.setTextDescription(i18n.t("Paste"));
paste.setParentMenuTitle(i18n.t(EDIT_MENU));
paste.setAddCondition(canBeExtended);
+ paste.setIconCls(getCssName(imgResources.paste()));
ActionToolbarMenuDescriptor<Object> editHtml = new ActionToolbarMenuDescriptor<Object>(accessRol,
ActionToolbarPosition.topbar, new Listener0() {
@@ -326,6 +366,7 @@
NotifyUser.info("In dev");
}
});
+ editHtml.setIconCls(getCssName(imgResources.edithtml()));
editHtml.setTextDescription(i18n.t("Edit HTML"));
editHtml.setParentMenuTitle(i18n.t(EDIT_MENU));
editHtml.setAddCondition(canBeExtended);
@@ -471,12 +512,40 @@
removeFormat.setToolTip(i18n.t("Clear Formatting"));
removeFormat.setShortcut(new ActionShortcut(true, ' ', "Space"));
removeFormat.setAddCondition(canBeExtended);
+ removeFormat.setRightSeparator(ActionToolbarButtonSeparator.separator);
+ ActionToolbarButtonDescriptor<Object> insertTable = new ActionToolbarButtonDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.insertHtml("<table id=\"iorh\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n"
+ + "<tbody>\n"
+ + "<tr>\n"
+ + "<td width=\"50%\"><br>\n"
+ + "</td>\n"
+ + "<td width=\"50%\"><br>\n"
+ + "</td>\n"
+ + "</tr>\n"
+ + "<tr>\n"
+ + "<td width=\"50%\"><br>\n"
+ + "</td>\n"
+ + "<td width=\"50%\"><br>\n"
+ + "</td>\n"
+ + "</tr>\n</tbody>\n</table>");
+ }
+ });
+ insertTable.setIconCls(getCssName(imgResources.inserttable()));
+ insertTable.setToolTip(i18n.t("Insert Table ..."));
+ insertTable.setAddCondition(canBeExtended);
+ insertTable.setRightSeparator(ActionToolbarButtonSeparator.separator);
+
topActions.add(withNoItem(selectAll));
+ sndActions.add(withNoItem(undoBtn));
+ sndActions.add(withNoItem(redoBtn));
sndActions.add(withNoItem(bold));
sndActions.add(withNoItem(italic));
sndActions.add(withNoItem(underline));
sndActions.add(withNoItem(strikethrough));
+
sndActions.add(withNoItem(justifyLeft));
sndActions.add(withNoItem(justifyCentre));
sndActions.add(withNoItem(justifyRight));
@@ -494,14 +563,57 @@
sndActions.add(withNoItem(increaseIndent));
sndActions.add(withNoItem(ol));
sndActions.add(withNoItem(ul));
+ sndActions.add(withNoItem(removeFormat));
sndActions.add(withNoItem(hrButton));
sndActions.add(withNoItem(img));
sndActions.add(withNoItem(createLink));
sndActions.add(withNoItem(removeLink));
- sndActions.add(withNoItem(removeFormat));
+ sndActions.add(withNoItem(insertTable));
topActions.add(withNoItem(comment));
+
+ for (String fontName : this.fontNames) {
+ ActionToolbarMenuDescriptor<Object> fontNameAction = createFontNameAction(canBeBasic, fontName);
+ sndActions.add(withNoItem(fontNameAction));
+ }
+ for (int fontSize = 0; fontSize < fontSizes.length; fontSize++) {
+ ActionToolbarMenuDescriptor<Object> fontSizeAction = createFontSizeAction(canBeBasic, fontSize, fontSizes[fontSize]);
+ sndActions.add(withNoItem(fontSizeAction));
+ }
+
}
+ private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
+ final String fontName) {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.setFontName(fontName);
+ fireOnEdit();
+ }
+ });
+ font.setTextDescription("<span style=\"font-family: " + fontName + "\">" + fontName + "</span>");
+ font.setParentMenuTooltip(i18n.t("Font"));
+ font.setParentMenuIconCls(getCssName(imgResources.charfontname()));
+ font.setAddCondition(canBeBasic);
+ return font;
+ }
+
+ private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
+ final int fontSize, String fontSizeName) {
+ final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
+ ActionToolbarPosition.topbar, new Listener0() {
+ public void onEvent() {
+ view.setFontSize(fontSizesConstants[fontSize]);
+ fireOnEdit();
+ }
+ });
+ font.setTextDescription("<font size=\"" + (fontSize + 1) + "\">" + i18n.t(fontSizeName) + "</font>");
+ font.setParentMenuTooltip(i18n.t("Font size"));
+ font.setParentMenuIconCls(getCssName(imgResources.fontheight()));
+ font.setAddCondition(canBeBasic);
+ return font;
+ }
+
private String getCssName(ImageResource imageResource) {
return "k-rte-" + imageResource.getName();
}
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorView.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -2,6 +2,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
+import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
public interface RTEditorView extends View {
@@ -67,7 +68,7 @@
void setFontName(String name);
- void setFontSize(int size);
+ void setFontSize(FontSize fontSize);
void setForeColor(String color);
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/RTEImgResources.java 2009-03-06 03:09:10 UTC (rev 1061)
@@ -24,9 +24,15 @@
@Resource("charfontname.png")
public ImageResource charfontname();
+ @Resource("copy.png")
+ public ImageResource copy();
+
@Resource("rteimg.css")
public CssResource css();
+ @Resource("cut.png")
+ public ImageResource cut();
+
@Resource("decrementindent.png")
public ImageResource decrementindent();
@@ -54,6 +60,15 @@
@Resource("incrementindent.png")
public ImageResource incrementindent();
+ @Resource("insertspreadsheet.png")
+ public ImageResource insertspreadsheet();
+
+ @Resource("insertsymbol.png")
+ public ImageResource insertsymbol();
+
+ @Resource("inserttable.png")
+ public ImageResource inserttable();
+
@Resource("italic.png")
public ImageResource italic();
@@ -63,9 +78,24 @@
@Resource("linkbreak.png")
public ImageResource linkbreak();
+ @Resource("paste.png")
+ public ImageResource paste();
+
+ @Resource("redo.png")
+ public ImageResource redo();
+
@Resource("removeFormat.png")
public ImageResource removeFormat();
+ @Resource("save.png")
+ public ImageResource save();
+
+ @Resource("selectall.png")
+ public ImageResource selectall();
+
+ @Resource("specialchars.png")
+ public ImageResource specialchars();
+
@Resource("strikeout.png")
public ImageResource strikeout();
@@ -78,4 +108,7 @@
@Resource("underline.png")
public ImageResource underline();
+ @Resource("undo.png")
+ public ImageResource undo();
+
}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/copy.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/copy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/cut.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/cut.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertspreadsheet.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertspreadsheet.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertsymbol.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/insertsymbol.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/inserttable.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/inserttable.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/paste.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/paste.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/redo.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/redo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css 2009-03-06 03:09:10 UTC (rev 1061)
@@ -88,4 +88,48 @@
@sprite div .k-rte-alignleft {
gwt-image: 'alignleft';
-}
\ No newline at end of file
+}
+
+@sprite div .k-rte-specialchars {
+ gwt-image: 'specialchars';
+}
+
+@sprite div .k-rte-copy {
+ gwt-image: 'copy';
+}
+
+@sprite div .k-rte-cut {
+ gwt-image: 'cut';
+}
+
+@sprite div .k-rte-insertspreadsheet {
+ gwt-image: 'insertspreadsheet';
+}
+
+@sprite div .k-rte-insertsymbol {
+ gwt-image: 'insertsymbol';
+}
+
+@sprite div .k-rte-inserttable {
+ gwt-image: 'inserttable';
+}
+
+@sprite div .k-rte-paste {
+ gwt-image: 'paste';
+}
+
+@sprite div .k-rte-redo {
+ gwt-image: 'redo';
+}
+
+@sprite div .k-rte-save {
+ gwt-image: 'save';
+}
+
+@sprite div .k-rte-selectall {
+ gwt-image: 'selectall';
+}
+
+@sprite div .k-rte-undo {
+ gwt-image: 'undo';
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/save.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/save.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/selectall.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/selectall.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/specialchars.png
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/specialchars.png 2009-03-06 01:07:03 UTC (rev 1060)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/specialchars.png 2009-03-06 03:09:10 UTC (rev 1061)
@@ -0,0 +1,5 @@
+�PNG
+
+
IHDR��a
IDATx^���J�@�3�ll̦���XJ�Z���x
+|�y�=�c�$���l\��ً�i?����n����.���
bA��z�օ��в?{�+�@n���\Z����^�=D�B%�v[���w��(��70"�E:���L:5�����������k5�ϵ dy93T�\����
����&PTG�O@qQ�i���8nخ����|B'͵[ Nu�#�=�0
+I�'��ڀ���� ����c�9��g��oP�7��r�IEND�B`�
\ No newline at end of file
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/specialchars.png
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/undo.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/undo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
06 Mar '09
Author: vjrj
Date: 2009-03-06 02:07:03 +0100 (Fri, 06 Mar 2009)
New Revision: 1060
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/ui/Location.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/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.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/app/public/css/richtext.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css 2009-03-06 01:07:03 UTC (rev 1060)
@@ -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 span{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{border:1px dashed silver;line-height:1.4;padding:3px;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-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/rte.css 2009-03-06 01:07:03 UTC (rev 1060)
@@ -3,10 +3,9 @@
margin: 5px;
}
-.k-rte-comment span {
+.k-rte-comment {
border:1px dashed #C0C0C0;
- font-size:85%;
line-height:1.4;
- padding:1px;
+ padding:3px;
background-color:#D7FFD7;
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/Location.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/Location.java 2009-03-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/Location.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
*
@@ -30,22 +29,52 @@
private String queryString;
private HashMap<String, String> paramMap;
+ /**
+ * sample: #site.docs.3.1
+ **/
public String getHash() {
return hash;
}
+ /**
+ * sample: locahost:8080
+ *
+ * @return
+ */
public String getHost() {
return host;
}
+ /**
+ * sample: locahost
+ *
+ * @return
+ */
public String getHostName() {
return hostName;
}
+ /**
+ * sample:
+ * http://localhost:8080/kune/#site.docs.3.1?locale=en&log_level=INFO
+ **/
public String getHref() {
return href;
}
+ public String getParameter(final String name) {
+ return paramMap.get(name);
+ }
+
+ public Map<String, String> getParameterMap() {
+ return paramMap;
+ }
+
+ /**
+ * sample: /kune/
+ *
+ * @return
+ */
public String getPath() {
return path;
}
@@ -58,6 +87,11 @@
return protocol;
}
+ /**
+ * sample: ?locale=en&log_level=INFO
+ *
+ * @return
+ */
public String getQueryString() {
return queryString;
}
@@ -97,8 +131,8 @@
if (queryString != null && queryString.length() > 1) {
String qs = queryString.substring(1);
String[] kvPairs = qs.split("&");
- for (int i = 0; i < kvPairs.length; i++) {
- String[] kv = kvPairs[i].split("=");
+ for (String kvPair : kvPairs) {
+ String[] kv = kvPair.split("=");
if (kv.length > 1) {
paramMap.put(kv[0], unescape(kv[1]));
} else {
@@ -109,15 +143,7 @@
}
private native String unescape(String val) /*-{
- return unescape(val);
- }-*/;
+ return unescape(val);
+ }-*/;
- public String getParameter(final String name) {
- return paramMap.get(name);
- }
-
- public Map<String, String> getParameterMap() {
- return paramMap;
- }
-
}
\ 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-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPanel.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -57,9 +57,9 @@
public void addComment(String userName) {
String time = i18n.formatDateWithLocale(new Date(), true);
Element span = DOM.createSpan();
- span.setInnerText(i18n.t("type here") + " -" + userName + " " + time);
+ span.setInnerHTML("<em>" + i18n.t("type here") + "</em> -" + userName + " " + time);
DOM.setElementProperty(span.<com.google.gwt.user.client.Element> cast(), "className", "k-rte-comment");
- insertHtml(span.getString());
+ insertHtml(span.getString() + " ");
}
public void adjustSize(int height) {
@@ -279,10 +279,12 @@
updateStatus();
fireEdit();
if (modifiers != 0) {
+ Log.debug("RTE shortcut pressed (" + modifiers + ", " + keyCode + ")");
ActionItem<Object> actionItem = shortcuts.get(new ActionShortcut(keyCode, modifiers));
if (actionItem != null) {
- Log.debug("RTE shortcut pressed (" + modifiers + ", " + keyCode + ")");
actionManager.doAction(actionItem);
+ } else {
+ Log.debug("...but not mapped to any command");
}
}
}
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-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -216,7 +216,7 @@
subscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
subscript.setTextDescription(i18n.t("Subscript"));
subscript.setIconCls(getCssName(imgResources.subscript()));
- subscript.setShortcut(new ActionShortcut(true, ','));
+ subscript.setShortcut(new ActionShortcut(true, '0'));
subscript.setAddCondition(canBeBasic);
ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
@@ -228,7 +228,7 @@
superscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
superscript.setTextDescription(i18n.t("Superscript"));
superscript.setIconCls(getCssName(imgResources.superscript()));
- superscript.setShortcut(new ActionShortcut(true, '.'));
+ superscript.setShortcut(new ActionShortcut(true, '9'));
superscript.setAddCondition(canBeBasic);
ActionToolbarButtonDescriptor<Object> justifyLeft = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -421,7 +421,7 @@
ul.setIconCls(getCssName(imgResources.defaultbullet()));
ul.setToolTip(i18n.t("Bullet List"));
ul.setShortcut(new ActionShortcut(true, '8'));
- ul.setRightSeparator(ActionToolbarButtonSeparator.spacer);
+ ul.setRightSeparator(ActionToolbarButtonSeparator.separator);
ul.setAddCondition(canBeExtended);
ActionToolbarButtonDescriptor<Object> img = new ActionToolbarButtonDescriptor<Object>(accessRol,
@@ -490,11 +490,11 @@
topActions.add(withNoItem(hr));
topActions.add(withNoItem(subscript));
topActions.add(withNoItem(superscript));
- sndActions.add(withNoItem(hrButton));
sndActions.add(withNoItem(decreaseIndent));
sndActions.add(withNoItem(increaseIndent));
sndActions.add(withNoItem(ol));
sndActions.add(withNoItem(ul));
+ sndActions.add(withNoItem(hrButton));
sndActions.add(withNoItem(img));
sndActions.add(withNoItem(createLink));
sndActions.add(withNoItem(removeLink));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java 2009-03-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -35,48 +35,42 @@
@Override
public native void initElement() /*-{
- // Mozilla doesn't allow designMode to be set reliably until the iframe is
- // fully loaded.
- var _this = this;
- var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ // Mozilla doesn't allow designMode to be set reliably until the iframe is
+ // fully loaded.
+ var _this = this;
+ var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- iframe.onload = function() {
- // Some Mozillae have the nasty habit of calling onload again when you set
- // designMode, so let's avoid doing it more than once.
- iframe.onload = null;
+ iframe.onload = function() {
+ // Some Mozillae have the nasty habit of calling onload again when you set
+ // designMode, so let's avoid doing it more than once.
+ iframe.onload = null;
- // patch ccs inject:
+ // patch ccs inject:
- var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
- head=doc.getElementsByTagName('head')[0];
- link=document.createElement('link');
- link.setAttribute('rel',"stylesheet");
- link.setAttribute('type',"text/css");
- link.setAttribute('href',"css/richtext.css" );
- head.appendChild(link);
+ var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
+ head=doc.getElementsByTagName('head')[0];
+ link=document.createElement('link');
+ link.setAttribute('rel',"stylesheet");
+ link.setAttribute('type',"text/css");
+ link.setAttribute('href',$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" );
+ head.appendChild(link);
- var styles = document.createElement('style');
- styles.setAttribute('type', 'text/css');
- var newStyle = document.createTextNode('\n<!--\nbody{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400;}q:before,q:after{content:\'\';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}body{font:13px/1.22 arial,helvetica,clean,sans-serif;font-size:small;font:x-small;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;font-size:108%;line-height:99%;}h1{font-size:138.5%;}h2{font-size:123.1%;}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}\n-->\n');
- styles.appendChild(newStyle);
- head.appendChild(styles);
+ // -- patch
- // -- patch
+ // Send notification that the iframe has finished loading.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- // Send notification that the iframe has finished loading.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
-
- // Don't set designMode until the RTA actually gets focused. This is
- // necessary because editing won't work on Mozilla if the iframe is
- // *hidden, but attached*. Waiting for focus gets around this issue.
- //
- // Note: This onfocus will not conflict with the addEventListener('focus',
- // ...) // in RichTextAreaImplStandard.
- iframe.contentWindow.onfocus = function() {
- iframe.contentWindow.onfocus = null;
- iframe.contentWindow.document.designMode = 'On';
- };
- };
- }-*/;
+ // Don't set designMode until the RTA actually gets focused. This is
+ // necessary because editing won't work on Mozilla if the iframe is
+ // *hidden, but attached*. Waiting for focus gets around this issue.
+ //
+ // Note: This onfocus will not conflict with the addEventListener('focus',
+ // ...) // in RichTextAreaImplStandard.
+ iframe.contentWindow.onfocus = function() {
+ iframe.contentWindow.onfocus = null;
+ iframe.contentWindow.document.designMode = 'On';
+ };
+ };
+ }-*/;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java 2009-03-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplOpera.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -25,24 +25,24 @@
@Override
public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- setTimeout(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
+ // Most browsers don't like setting designMode until slightly _after_
+ // the iframe becomes attached to the DOM. Any non-zero timeout will do
+ // just fine.
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ setTimeout(function() {
+ // Turn on design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+ // patch css inject:
+ var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var doc = elem.contentWindow.document;
+ var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
+ doc.write( ct );
+ // -- patch
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java 2009-03-05 13:57:02 UTC (rev 1059)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplSafari.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -25,25 +25,25 @@
@Override
public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
- setTimeout(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
+ // Most browsers don't like setting designMode until slightly _after_
+ // the iframe becomes attached to the DOM. Any non-zero timeout will do
+ // just fine.
+ var _this = this;
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
+ setTimeout(function() {
+ // Turn on design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
+ // patch css inject:
+ var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
+ var doc = elem.contentWindow.document;
+ var ct = "<html><head><style>@import url('" +$wnd.location.protocol + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
+ doc.write( ct );
+ // -- patch
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1);
- }-*/;
+ // Send notification that the iframe has reached design mode.
+ _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
+ }, 1);
+ }-*/;
}
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-05 13:57:02 UTC (rev 1059)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/actions/ActionShortcutTest.java 2009-03-06 01:07:03 UTC (rev 1060)
@@ -28,6 +28,15 @@
}
@Test
+ public void ctrl_coma() {
+ ActionShortcut shortcut = new ActionShortcut(true, ',');
+ assertEquals(" (Ctrl+,)", shortcut.toString(i18n));
+ assertTrue(shortcut.is(',', KeyboardListener.MODIFIER_CTRL));
+ assertTrue(!shortcut.is(',', KeyboardListener.MODIFIER_ALT));
+ assertTrue(!shortcut.is(',', KeyboardListener.MODIFIER_SHIFT));
+ }
+
+ @Test
public void ctrl_s() {
ActionShortcut shortcut = new ActionShortcut(true, 's');
assertEquals(" (Ctrl+S)", shortcut.toString(i18n));
1
0