r1069 - in trunk: . script src/main/java/org/ourproject/kune/app/public/css src/main/java/org/ourproject/kune/platf/client/actions src/main/java/org/ourproject/kune/platf/client/services src/main/java/org/ourproject/kune/platf/client/ui/rte src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimgext src/main/java/org/ourproject/kune/platf/client/ui/rte/insertli
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/xwik... + other links: + http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c0... + http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/c... *** 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/int... @@ -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/xwik... - other links: - http://groups.google.com/group/rocket-gwt/browse_frm/thread/e56540d4168479c0... - http://code.google.com/p/gwt-html-editor/source/browse/branches/gwt1.4/src/c... ** <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/5d01cd80... * 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();
participants (1)
-
vjrj