[kune-commits] r937 - in trunk/src:
main/java/org/ourproject/kune/app/public
main/java/org/ourproject/kune/app/public/css
main/java/org/ourproject/kune/chat/client
main/java/org/ourproject/kune/chat/client/cnt
main/java/org/ourproject/kune/chat/client/ctx
main/java/org/ourproject/kune/chat/client/ctx/rooms
main/java/org/ourproject/kune/docs/client
main/java/org/ourproject/kune/docs/client/cnt
main/java/org/ourproject/kune/docs/client/ctx
main/java/org/ourproject/kune/docs/client/ctx/admin
main/java/org/ourproject/kune/docs/client/ctx/admin/ui
main/java/org/ourproject/kune/platf/client/actions
main/java/org/ourproject/kune/platf/client/actions/toolbar
main/java/org/ourproject/kune/platf/client/dto
main/java/org/ourproject/kune/platf/client/rpc
main/java/org/ourproject/kune/platf/client/services
main/java/org/ourproject/kune/platf/client/state
main/java/org/ourproject/kune/platf/client/ui/rate
main/java/org/ourproject/kune/platf/server/content
main/java/org/ourproject/kune/platf/server/domain
main/java/org/ourproject/kune/platf/server/rpc
main/java/org/ourproject/kune/platf/server/state
main/java/org/ourproject/kune/workspace/client
main/java/org/ourproject/kune/workspace/client/ctxnav
main/java/org/ourproject/kune/workspace/client/editor
main/java/org/ourproject/kune/workspace/client/licensefoot
main/java/org/ourproject/kune/workspace/client/skel main/resources
test/java/org/ourproject/kune/platf/client/state
test/java/org/ourproject/kune/platf/integration/selenium
test/java/org/ourproject/kune/platf/server/manager/file
test/java/org/ourproject/kune/workspace/client/editor
vjrj
vjrj at ourproject.org
Thu Oct 30 18:13:25 CET 2008
Author: vjrj
Date: 2008-10-30 18:13:18 +0100 (Thu, 30 Oct 2008)
New Revision: 937
Added:
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/RateResultDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/RateResult.java
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextView.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/component/
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
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/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateContentDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Log:
Complete - task TextEditor intercepts token change and ask for save before closing the editor
Complete - task Implementation of beforeStateChange to take conditional control of stateChange
Complete - task SetRate don't Reload state ...
Incomplete - task setContext/Content
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
@@ -54,6 +55,8 @@
<body>
<script type="text/javascript" language="javascript"
src="org.ourproject.kune.app.Kune.nocache.js"></script>
+
+ <!-- Ext localization javascript -->
<script type="text/javascript" id="extlocale"></script>
<script type="text/javascript">
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 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-10-30 17:13:18 UTC (rev 937)
@@ -35,4 +35,10 @@
}
*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;overflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-TagsPanel-tag{float:left;margin-right:5px;cursor:pointer;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
- padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:3px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-down-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entitylicensepanel-licensetext{cursor:pointer;margin-left:5px;text-decoration:underline;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{line-height:2em;color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others */.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.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;}
\ No newline at end of file
+ padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;z-index:4;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;z-index:4;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;z-index:4;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px;}.kune-WebSafePalette td{width:12px;height:10px;}.k-site-traybar{background:#FFF none repeat scroll 0 50%;}.k-blank-toolbar{background:#FFF none repeat scroll 0 50%;}.k-sitebar .kune-IconHyperlink{white-space:nowrap;}.k-sitebar .kune-IconHyperlink a:link{cursor:pointer;text-decoration:underline;color:#B3B3B3;}.k-sitebar .kune-IconHyperlink a:hover{text-decoration:underline;}.k-sitebar .kune-IconHyperlink a:visited{color:#B3B3B3;}.k-sitebar-labellink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-sitebar{margin-right:10px;height:16px;background:#FFF;}.k-sitebar .gwt-TextBox{border:1px solid #E4A374;margin:0 15px 0 3px;padding-left:3px;color:#B3B3B3;}.k-sitebar .gwt-Hyperlink a{white-space:nowrap;color:#B3B3B3;text-decoration:underline;cursor:pointer;}.k-sitebar .gwt-PushButton{cursor:pointer;}.k-sitebar-LabelLink{white-space:nowrap;color:#B3B3B3;cursor:pointer;text-decoration:underline;}.k-entity-summary{border-left-color:#FFF;border-left-width:5px;border-down-width:5px;}.k-entitytextlogo-border{border:2px solid #F2F2F2;}.k-entitytextlogo-no-border{border:none;}.k-entitytextlogo{height:60px;margin:0 0 4px;overflow:hidden;width:468px;}.k-entitytextlogo table{vertical-align:middle;}.k-elogo-l-l{font-size:272%;}.k-elogo-l-m{font-size:167%;}.k-elogo-l-s{font-size:108%;}.k-entitytextlogo .gwt-Label{font-weight:700;margin:5px;height:27px;}.k-entitytextlogo-default .gwt-Label{color:#69312F;}.k-entitytextlogo-green .gwt-Label{color:#250;}.k-entitytextlogo-blue .gwt-Label{color:navy;}.k-entitytextlogo-grey .gwt-Label{color:#1A1A1A;}.k-entitytextlogo-purple .gwt-Label{color:#405;}.k-entitytextlogo-red .gwt-Label{color:maroon;}.k-elogo-plink{color:#CCC;font-size:85%;margin:5px;text-decoration:underline;white-space:nowrap;background-color:#FFF;}.k-elogop-expand{background-color:transparent;}.k-entity-default .x-layout-split,.k-entity-default .x-layout-collapsed{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-green .x-layout-split,.k-entity-green .x-layout-collapsed{background:#5FD35F none repeat scroll 0 50%;}.k-entity-blue .x-layout-split,.k-entity-blue .x-layout-collapsed{background:#06F none repeat scroll 0 50%;}.k-entity-grey .x-layout-split,.k-entity-grey .x-layout-collapsed{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-purple .x-layout-split,.k-entity-purple .x-layout-collapsed{background:#660080 none repeat scroll 0 50%;}.k-entity-red .x-layout-split,.k-entity-red .x-layout-collapsed{background:#D40000 none repeat scroll 0 50%;}.k-entityworkspace .x-layout-split,.k-entityworkspace .x-layout-collapsed{background:transparent none repeat scroll 0 50%;}.k-entityworkspace-default .x-layout-split,.k-entityworkspace-default .x-layout-collapsed{background:#DEAA87 none repeat scroll 0 50%;}.k-entityworkspace-green .x-layout-split,.k-entityworkspace-green .x-layout-collapsed{background:#DCE8AB none repeat scroll 0 50%;}.k-entityworkspace-blue .x-layout-split,.k-entityworkspace-blue .x-layout-collapsed{background:#D5D5FF none repeat scroll 0 50%;}.k-entityworkspace-grey .x-layout-split,.k-entityworkspace-grey .x-layout-collapsed{background:#999 none repeat scroll 0 50%;}.k-entityworkspace-purple .x-layout-split,.k-entityworkspace-purple .x-layout-collapsed{background:#A793AC none repeat scroll 0 50%;}.k-entityworkspace-red .x-layout-split,.k-entityworkspace-red .x-layout-collapsed{background:#F55 none repeat scroll 0 50%;}.k-entity-title{border-left-style:solid;border-left-width:2px;}.k-entity-title div{line-height:22px;white-space:nowrap;}.k-entity-subtitle{}.k-entity-subtitle div{line-height:22px;white-space:nowrap;}.k-entity-title-rd-default{background:#DD8A3D;}.k-entity-title-rd-green{background:#5FD35F;}.k-entity-title-rd-blue{background:#06F;}.k-entity-title-rd-grey{background:#4D4D4D;}.k-entity-title-rd-purple{background:#660080;}.k-entity-title-rd-red{background:#D40000;}.k-entity-title-default{background:#F1BB59 none repeat scroll 0 50%;border-left-color:#DD8A3D;}.k-entity-title-green{background:#AFA none repeat scroll 0 50%;border-left-color:#5FD35F;}.k-entity-title-blue{background:#AFDDE9 none repeat scroll 0 50%;border-left-color:#06F;}.k-entity-title-grey{background:#CCC none repeat scroll 0 50%;border-left-color:#4D4D4D;}.k-entity-title-purple{background:#DDAFE9 none repeat scroll 0 50%;border-left-color:#660080;}.k-entity-title-red{background:#FF8080 none repeat scroll 0 50%;border-left-color:#D40000;}.k-entity-title-default div{color:#69312F;}.k-entity-title-green div{color:#250;}.k-entity-title-blue div{color:navy;}.k-entity-title-grey div{color:#1A1A1A;}.k-entity-title-purple div{color:#405;}.k-entity-title-red div{color:maroon;}.k-entity-subtitle-default{background:#DD8A3D none repeat scroll 0 50%;}.k-entity-subtitle-green{background:#5FD35F none repeat scroll 0 50%;}.k-entity-subtitle-blue{background:#06F none repeat scroll 0 50%;}.k-entity-subtitle-grey{background:#4D4D4D none repeat scroll 0 50%;}.k-entity-subtitle-purple{background:#660080 none repeat scroll 0 50%;}.k-entity-subtitle-red{background:#D40000 none repeat scroll 0 50%;}.k-entity-subtitle-default div{color:#FFF;}.k-entity-subtitle-green div{color:#FFF;}.k-entity-subtitle-blue div{color:#FFF;}.k-entity-subtitle-grey div{color:#FFF;}.k-entity-subtitle-purple div{color:#FFF;}.k-entity-subtitle-red div{color:#FFF;}.k-entity-bottom-rd-default,.k-entity-bottom-default,.k-toolselectoritem-sel-default{background:#DD8A3D;}.k-entity-bottom-rd-green,.k-entity-bottom-green,.k-toolselectoritem-sel-green{background:#5FD35F;}.k-entity-bottom-rd-blue,.k-entity-bottom-blue,.k-toolselectoritem-sel-blue{background:#06F;}.k-entity-bottom-rd-grey,.k-entity-bottom-grey,.k-toolselectoritem-sel-grey{background:#4D4D4D;}.k-entity-bottom-rd-purple,.k-entity-bottom-purple,.k-toolselectoritem-sel-purple{background:#660080;}.k-entity-bottom-rd-red,.k-entity-bottom-red,.k-toolselectoritem-sel-red{background:#D40000;}.k-entitylicensepanel-licensetext{cursor:pointer;margin-left:5px;text-decoration:underline;}.k-entity-context-default div,.k-entity-context-default .x-tree .x-panel-body{background:#FFD09D none repeat scroll 0 50%;}.k-entity-context-green div,.k-entity-context-green .x-tree .x-panel-body{background:#CFA none repeat scroll 0 50%;}.k-entity-context-blue div,.k-entity-context-blue .x-tree .x-panel-body{background:#ACF none repeat scroll 0 50%;}.k-entity-context-grey div,.k-entity-context-grey .x-tree .x-panel-body{background:#B3B3B3 none repeat scroll 0 50%;}.k-entity-context-purple div,.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-context-red div,.k-entity-context-red .x-tree .x-panel-body{background:#FAA none repeat scroll 0 50%;}.k-entity-context-purple .x-tree .x-panel-body{background:#DDAFE9 none repeat scroll 0 50%;}.k-entity-bottom div{line-height:24px;color:#FFF;}.k-toolbar-top-line{border-top-color:#d0d0d0;border-top-style:solid;border-top-width:1px;}.k-toolbar-bottom-line{border-bottom-color:#d0d0d0;border-bottom-style:solid;border-bottom-width:1px;}.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 100% arial, sans;line-height:19px;}.k-toolbar-sep{padding-top:4px;padding-left:5px;}/* Custom gwt-ext styles */.ytb-sep{background-image:url(../js/ext/resources/images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px;border:0;}.ytb-spacer{width:2px;}.x-grid-group-hd{border-bottom:2px solid grey;cursor:pointer;padding-top:3px;}/* Drop down */.k-dropdownouter{background-color:grey;}.k-dropdownouter-members{}.k-dropdownouter-members-default{background-color:#DF5244;}.k-dropdownouter-members-green{background-color:green;}.k-dropdownouter-members-blue{background-color:#5500D4;}.k-dropdownouter-members-grey{background-color:#4D4D4D;}.k-dropdownouter-members-purple{background-color:#672178;}.k-dropdownouter-members-red{background-color:#A02C2C;}.k-dropdownouter-part{}.k-dropdownouter-part-default{background-color:#CA5842;}.k-dropdownouter-part-green{background-color:#0A0;}.k-dropdownouter-part-blue{background-color:#60F;}.k-dropdownouter-part-grey{background-color:#666;}.k-dropdownouter-part-purple{background-color:#892CA0;}.k-dropdownouter-part-red{background-color:#C83737;}.k-dropdownouter-tags{}.k-dropdownouter-tags-default{background-color:#87501E;}.k-dropdownouter-tags-green{background-color:#00D400;}.k-dropdownouter-tags-blue{background-color:#95F;}.k-dropdownouter-tags-grey{background-color:gray;}.k-dropdownouter-tags-purple{background-color:#AB37C8;}.k-dropdownouter-tags-red{background-color:#D35F5F;}.k-dropdownouter-summary{}.k-dropdownouter-summary-default{background-color:#9F734B;}.k-dropdownouter-summary-green{background-color:#4CE14C;}.k-dropdownouter-summary-blue{background-color:#69A5FF;}.k-dropdownouter-summary-grey{background-color:#A6A6A6;}.k-dropdownouter-summary-purple{background-color:#C473D8;}.k-dropdownouter-summary-red{background-color:#E08F8F;}.k-dropdowninner{margin:0 3px 1px;background:green;background-color:#FFF;/* padding: 3px; */}.k-dropdownlabel{color:#FFF;cursor:pointer;}.k-dropdownlabel .gwt-Label{margin:0 5px 0 0;width:100%;}.k-dropdownlabel img{margin:0 3px 0 1px;}/* WsTheme */.k-wstheme-icon-default{background:#FF8C00;}.k-wstheme-icon-green{background:green;}.k-wstheme-icon-blue{background:blue;}.k-wstheme-icon-grey{background:grey;}.k-wstheme-icon-purple{background:purple;}.k-wstheme-icon-red{background:red;}/* Tool selector items */.k-toolselectoritem{width:auto;margin-bottom:5px;cursor:pointer;}.k-toolselectoritem-sel{}.k-toolselectoritem-notsel-default{background:#FFE9A5;}.k-toolselectoritem-notsel-green{background:#D6F4D6;}.k-toolselectoritem-notsel-blue{background:#D7D7F4;}.k-toolselectoritem-notsel-grey{background:#E6E6E6;}.k-toolselectoritem-notsel-purple{background:#EED7F4;}.k-toolselectoritem-notsel-red{background:#FFD5D5;}.k-toolselectoritem-sel a{color:#FFF;padding:0 9px;text-decoration:none;}.k-toolselectoritem-sel a:hover{text-decoration:none;}.k-toolselectoritem-notsel{}.k-toolselectoritem-notsel a{color:#00F;padding:0 9px;text-decoration:none;}.k-toolselectoritem-notsel a:hover{text-decoration:underline;}/* others *//*
+.x-tree-node a span, .x-dd-drag-ghost a span {
+ color:#000000;
+ padding: 1px 0px 1px 1px;
+ text-decoration:none;
+}
+*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.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;}
\ 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 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-10-30 17:13:18 UTC (rev 937)
@@ -416,7 +416,7 @@
}
.k-entity-bottom div {
- line-height: 2em;
+ line-height: 24px;
color: #FFF;
}
@@ -693,6 +693,15 @@
}
/* others */
+
+/*
+.x-tree-node a span, .x-dd-drag-ghost a span {
+ color:#000000;
+ padding: 1px 0px 1px 1px;
+ text-decoration:none;
+}
+*/
+
.k-textlinethrough {
text-decoration: line-through;
color: red;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -40,7 +40,6 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -78,8 +77,7 @@
register(Singleton.class, new Factory<ChatContent>(ChatContent.class) {
@Override
public ChatContent create() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
+ final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class),
$$(ChatInfo.class), $$(ChatRoom.class));
return presenter;
}
@@ -88,8 +86,7 @@
register(Singleton.class, new Factory<ChatContext>(ChatContext.class) {
@Override
public ChatContext create() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContextPresenter presenter = new ChatContextPresenter(panel, $$(RoomsAdmin.class));
+ final ChatContextPresenter presenter = new ChatContextPresenter($$(RoomsAdmin.class));
return presenter;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -22,9 +22,7 @@
import org.ourproject.kune.chat.client.ChatClientTool;
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
@@ -33,24 +31,18 @@
public class ChatContentPresenter implements ChatContent {
- private final WorkspaceDeckView view;
private StateContainerDTO state;
private final EmiteUIDialog emiteUIDialog;
private final Provider<ChatInfo> chatInfoProvider;
private final Provider<ChatRoom> chatRoomProvider;
- public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view,
- final Provider<ChatInfo> chatInfoProvider, final Provider<ChatRoom> chatRoomProvider) {
+ public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final Provider<ChatInfo> chatInfoProvider,
+ final Provider<ChatRoom> chatRoomProvider) {
this.emiteUIDialog = emiteUIDialog;
- this.view = view;
this.chatInfoProvider = chatInfoProvider;
this.chatRoomProvider = chatRoomProvider;
}
- public View getView() {
- return view;
- }
-
public void onEnterRoom() {
final String roomName = state.getContainer().getName();
emiteUIDialog.joinRoom(XmppURI.uri(roomName));
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -20,29 +20,20 @@
package org.ourproject.kune.chat.client.ctx;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import com.calclab.suco.client.ioc.Provider;
public class ChatContextPresenter implements ChatContext {
- private final WorkspaceDeckView view;
private final Provider<RoomsAdmin> roomAdminsProvider;
- public ChatContextPresenter(final WorkspaceDeckView view, final Provider<RoomsAdmin> roomAdminsProvider) {
- this.view = view;
+ public ChatContextPresenter(final Provider<RoomsAdmin> roomAdminsProvider) {
this.roomAdminsProvider = roomAdminsProvider;
}
- public View getView() {
- return view;
- }
-
public void setState(final StateContainerDTO state) {
final RoomsAdmin rooms = roomAdminsProvider.get();
rooms.showRoom(state.getStateToken(), state.getContainer(), state.getContainerRights());
- view.show(rooms.getView());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,13 +19,10 @@
*/
package org.ourproject.kune.chat.client.ctx.rooms;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
public interface RoomsAdmin {
- View getView();
-
void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights);
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,7 +19,6 @@
*/
package org.ourproject.kune.chat.client.ctx.rooms;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -67,10 +66,6 @@
// });
}
- public View getView() {
- return contextNavigator.getView();
- }
-
public void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights) {
// contextNavigator.showContainer(token, container, rights);
// final String type = container.getTypeId();
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -29,6 +29,7 @@
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKIPAGE;
import org.ourproject.kune.docs.client.cnt.DocumentContent;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
@@ -66,6 +67,8 @@
import com.calclab.suco.client.ioc.Provider;
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener0;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class DocumentClientActions {
@@ -84,6 +87,7 @@
private final Provider<TextEditor> textEditorProvider;
private final KuneErrorHandler errorHandler;
private final DocumentContent documentContent;
+ private final Provider<AdminContext> adminContextProvider;
public DocumentClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
final Session session, final StateManager stateManager,
@@ -92,7 +96,7 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final DocumentContent documentContent) {
+ final DocumentContent documentContent, final Provider<AdminContext> adminContextProvider) {
this.i18n = i18n;
this.contextNavigator = contextNavigator;
this.session = session;
@@ -107,6 +111,7 @@
this.textEditorProvider = textEditorProvider;
this.errorHandler = errorHandler;
this.documentContent = documentContent;
+ this.adminContextProvider = adminContextProvider;
createActions();
}
@@ -333,6 +338,8 @@
public void onSuccess(final Object result) {
final TextEditor editor = textEditorProvider.get();
documentContent.detach();
+ contextNavigator.detach();
+ adminContextProvider.get().attach();
editor.editContent(session.getContentState().getContent(), new Listener<String>() {
public void onEvent(final String html) {
Site.showProgressSaving();
@@ -361,9 +368,16 @@
}, new Listener0() {
public void onEvent() {
// onClose
- if (session.getCurrentStateToken().equals(stateToken)) {
- documentContent.refreshState();
- }
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ documentContent.attach();
+ adminContextProvider.get().detach();
+ contextNavigator.attach();
+ if (session.getCurrentStateToken().equals(stateToken)) {
+ documentContent.refreshState();
+ }
+ }
+ });
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -30,12 +30,11 @@
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ctx.DocumentContextPanel;
import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextPanel;
import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
-import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
@@ -82,9 +81,8 @@
public DocumentClientTool create() {
$(DocumentClientActions.class);
return new DocumentClientTool($(I18nUITranslationService.class), $(ToolSelector.class),
- $(WsThemePresenter.class), $(WorkspaceSkeleton.class), $$(DocumentContext.class),
- $$(ContentServiceAsync.class), $(ContentActionRegistry.class),
- $(DragDropContentRegistry.class), $(ContentIconsRegistry.class));
+ $(WsThemePresenter.class), $(WorkspaceSkeleton.class), $(DragDropContentRegistry.class),
+ $(ContentIconsRegistry.class));
}
});
@@ -95,7 +93,8 @@
$(Session.class), $(StateManager.class), $$(ContentServiceAsync.class),
$$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class),
$(ContextActionRegistry.class), $$(FileDownloadUtils.class), $(EntityLogo.class),
- $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentContent.class));
+ $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentContent.class),
+ $$(AdminContext.class));
}
});
@@ -122,7 +121,8 @@
final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
$(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
$(EntityTitle.class), $(EntitySubTitle.class));
- final AdminContextView view = new AdminContextPanel(presenter, $(I18nUITranslationService.class));
+ final AdminContextView view = new AdminContextPanel(presenter, $(I18nUITranslationService.class),
+ $(WorkspaceSkeleton.class));
presenter.init(view);
return presenter;
}
@@ -133,8 +133,6 @@
public DocumentContext create() {
final DocumentContextPresenter presenter = new DocumentContextPresenter($(StateManager.class),
$$(ContextNavigator.class), $$(AdminContext.class));
- final DocumentContextPanel panel = new DocumentContextPanel($(WorkspaceSkeleton.class));
- presenter.init(panel);
return presenter;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,19 +19,15 @@
*/
package org.ourproject.kune.docs.client;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import com.calclab.suco.client.ioc.Provider;
public class DocumentClientTool extends AbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
@@ -46,18 +42,14 @@
public static final String NAME = "docs";
- private final Provider<DocumentContext> documentContextProvider;
private final DragDropContentRegistry dragDropContentRegistry;
private final ContentIconsRegistry contentIconsRegistry;
public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
- final Provider<DocumentContext> documentContextProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final ContentActionRegistry contentActionRegistry, final DragDropContentRegistry dragDropContentRegistry,
+ final DragDropContentRegistry dragDropContentRegistry,
final ContentIconsRegistry contentIconsRegistry) {
super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
- this.documentContextProvider = documentContextProvider;
this.dragDropContentRegistry = dragDropContentRegistry;
this.contentIconsRegistry = contentIconsRegistry;
registerDragDropTypes();
@@ -68,16 +60,6 @@
return NAME;
}
- @Deprecated
- public void onCancel() {
- documentContextProvider.get().showFolders();
- }
-
- @Deprecated
- public void onEdit() {
- documentContextProvider.get().showAdmin();
- }
-
private void registerDragDropTypes() {
dragDropContentRegistry.registerDraggableType(TYPE_DOCUMENT);
dragDropContentRegistry.registerDraggableType(TYPE_FOLDER);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -21,6 +21,8 @@
public interface DocumentContent {
+ void attach();
+
void detach();
void refreshState();
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -70,6 +70,10 @@
});
}
+ public void attach() {
+ toolbar.attach();
+ }
+
public void detach() {
toolbar.detach();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -21,7 +21,4 @@
public interface DocumentContext {
- void showAdmin();
-
- void showFolders();
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.docs.client.ctx;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-public class DocumentContextPanel implements DocumentContextView {
-
- public DocumentContextPanel(final WorkspaceSkeleton ws) {
- }
-
- @Deprecated
- public void setContainer(final View view) {
- // ws.getEntityWorkspace().setContext((Widget) view);
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -31,7 +31,6 @@
import com.calclab.suco.client.listener.Listener;
public class DocumentContextPresenter implements DocumentContext {
- private DocumentContextView view;
private final Provider<ContextNavigator> contextNavigatorProvider;
private final Provider<AdminContext> adminContextProvider;
@@ -45,9 +44,11 @@
StateContainerDTO stateCntCtx = (StateContainerDTO) state;
if (DocumentClientTool.NAME.equals(stateCntCtx.getToolName())) {
setState(stateCntCtx);
+ contextNavigatorProvider.get().attach();
}
} else {
- // TODO detach
+ contextNavigatorProvider.get().detach();
+ adminContextProvider.get().detach();
contextNavigatorProvider.get().clear();
adminContextProvider.get().clear();
}
@@ -55,24 +56,10 @@
});
}
- public void init(final DocumentContextView view) {
- this.view = view;
- }
-
- public void showAdmin() {
- final AdminContext adminContext = adminContextProvider.get();
- view.setContainer(adminContext.getView());
- }
-
- public void showFolders() {
- view.setContainer(contextNavigatorProvider.get().getView());
- }
-
private void setState(final StateContainerDTO state) {
contextNavigatorProvider.get().setState(state, true);
if (state instanceof StateContentDTO) {
adminContextProvider.get().setState((StateContentDTO) state);
}
- showFolders();
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextView.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextView.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.docs.client.ctx;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface DocumentContextView {
-
- @Deprecated
- void setContainer(View view);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContext.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,13 +19,14 @@
*/
package org.ourproject.kune.docs.client.ctx.admin;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
public interface AdminContext {
+ void attach();
+
void clear();
- View getView();
+ void detach();
void setState(StateContentDTO content);
}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,277 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class AdminContextPanel extends VerticalPanel implements AdminContextView {
+ // private static final Images IMG = Images.App.getInstance();
+
+ // private static final int FORMS_WIDTH = 145;
+
+ // private final IndexedStackPanelWithSubItems options;
+ // private final AdminContextPresenter presenter;
+ //
+ // private AccessListsPanel accessListsPanel;
+ // private DateField publishedOnField;
+ // private TextArea tagsField;
+ // private VerticalPanel tagsComponent;
+ // private VerticalPanel publishedOnComponent;
+ // private LanguageSelectorComponent langPresenter;
+ // private VerticalPanel authorsComponent;
+ // private VerticalPanel langComponent;
+ // private IconLabel addAuthorLabel;
+ // private final I18nTranslationService i18n;
+ // private final String authors_item;
+ // private final String publication_item;
+ // private final String perms_item;
+ // private final String language_item;
+ // private final String tags_item;
+
+ private final WorkspaceSkeleton ws;
+ private final Label testLabel;
+
+ public AdminContextPanel(final AdminContextPresenter presenter, final I18nTranslationService i18n,
+ WorkspaceSkeleton ws) {
+ this.ws = ws;
+ testLabel = new Label("Admin ctx");
+ // this.presenter = presenter;
+ // this.i18n = i18n;
+ // options = new IndexedStackPanelWithSubItems();
+ // //options.addStyleName("kune-AdminContextPanel");
+ //
+ // //add(options);
+ // //setCellWidth(options, "100%");
+ // setWidth("100%");
+ // authors_item = i18n.t("Authors");
+ // publication_item = i18n.t("Publication");
+ // perms_item = i18n.t("Permissions");
+ // language_item = i18n.t("Language");
+ // tags_item = i18n.t("Tags");
+ }
+
+ public void attach() {
+ if (!testLabel.isAttached()) {
+ ws.getEntityWorkspace().setContext(testLabel);
+ }
+ }
+
+ public void detach() {
+ if (testLabel.isAttached()) {
+ testLabel.removeFromParent();
+ }
+ }
+
+ public void removeAccessListComponent() {
+ // if (options.containsItem(perms_item)) {
+ // removeComponent(perms_item);
+ // }
+ }
+
+ public void removeAuthorsComponent() {
+ // if (options.containsItem(authors_item)) {
+ // removeComponent(authors_item);
+ // }
+ }
+
+ public void removeLangComponent() {
+ // if (options.containsItem(language_item)) {
+ // removeComponent(language_item);
+ // }
+ }
+
+ public void removePublishedOnComponent() {
+ // if (options.containsItem(publication_item)) {
+ // removeComponent(publication_item);
+ // }
+ }
+
+ public void removeTagsComponent() {
+ // if (options.containsItem(tags_item)) {
+ // removeComponent(tags_item);
+ // }
+ }
+
+ public void reset() {
+ // options.clear();
+ }
+
+ public void setAccessLists(final AccessListsDTO accessLists) {
+ // if (accessListsPanel == null) {
+ // accessListsPanel = new AccessListsPanel(i18n);
+ // }
+ // if (!options.containsItem(perms_item)) {
+ // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
+ // accessListsPanel);
+ // }
+ // accessListsPanel.setAccessLists(accessLists);
+ }
+
+ public void setAuthors(final List<UserSimpleDTO> authors) {
+ // if (authorsComponent == null) {
+ // authorsComponent = new VerticalPanel();
+ // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
+ // addAuthorLabel.addClickListener(new ClickListener() {
+ // public void onClick(final Widget sender) {
+ // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
+ // }
+ // });
+ // } else {
+ // if (options.containsItem(authors_item)) {
+ // options.removeStackItem(authors_item);
+ // }
+ // authorsComponent.clear();
+ // }
+ // if (!options.containsItem(authors_item)) {
+ // addComponent(authors_item, i18n.t("Authors of this work"),
+ // authorsComponent);
+ // }
+ // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
+ // iterator.hasNext();) {
+ // final UserSimpleDTO author = iterator.next();
+ // final StackSubItemAction[] authorActions = { new
+ // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
+ // DocsEvents.REMOVE_AUTHOR) };
+ // options.addStackSubItem(authors_item, IMG.personDef(),
+ // author.getShortName(), author.getName(),
+ // authorActions, presenter);
+ // }
+ // authorsComponent.add(addAuthorLabel);
+ }
+
+ public void setLanguage(final I18nLanguageDTO language) {
+ // if (langComponent == null) {
+ // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
+ // langComponent = new VerticalPanel();
+ // final LanguageSelectorPanel view = (LanguageSelectorPanel)
+ // langPresenter.getView();
+ // view.setWidth("" + FORMS_WIDTH);
+ // langComponent.add(view);
+ // view.addChangeListener(new ComboBoxListenerAdapter() {
+ // public void onSelect(final ComboBox comboBox, final Record record,
+ // final int index) {
+ // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ // }
+ // });
+ // }
+ // if (!options.containsItem(language_item)) {
+ // addComponent(language_item, i18n.t("The language of this work"),
+ // langComponent);
+ // }
+ // langPresenter.setLanguage(language);
+ }
+
+ public void setPublishedOn(final Date publishedOn) {
+ // if (publishedOnField == null) {
+ // publishedOnComponent = createPublicationComponent();
+ // }
+ // if (!options.containsItem(publication_item)) {
+ // addComponent(publication_item, i18n.t("Date of publication of this
+ // work"), publishedOnComponent);
+ // }
+ // // publishedOnField.setValue(publishedOn);
+ }
+
+ public void setTags(final String tags) {
+ // if (tagsComponent == null) {
+ // tagsComponent = createTagsComponent();
+ // }
+ // if (!options.containsItem(tags_item)) {
+ // addComponent(tags_item,
+ // i18n.t("Keywords or terms associated with this work"),
+ // tagsComponent);
+ // }
+ // tagsField.setValue(tags);
+ // }
+ //
+ // private void addComponent(final String header, final String
+ // headerTitle,
+ // final VerticalPanel panel) {
+ // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
+ // final VerticalPanel vp = options.addStackItem(header, headerTitle,
+ // false);
+ // vp.setStyleName("kune-AdminContextPanel-inner");
+ // vp.add(panel);
+ // vp.setCellWidth(panel, "100%");
+ // vp.setWidth("100%");
+ }
+
+ // private FormPanel createDefaultForm() {
+ // final FormPanel form = new FormPanel();
+ // form.setHideLabels(true);
+ // form.setWidth(FORMS_WIDTH);
+ // form.setBorder(false);
+ // return form;
+ // }
+
+ // private VerticalPanel createPublicationComponent() {
+ // // final FormPanel form = createDefaultForm();
+ // //
+ // // publishedOnField = new DateField();
+ // // publishedOnField.setWidth("140");
+ // // publishedOnField.setFormat("Y-m-d");
+ // //
+ // // publishedOnField.addListener(new FieldListenerAdapter() {
+ // // public void onChange(final Field field, final Object newVal, final
+ // // Object oldVal) {
+ // // presenter.setPublishedOn((Date) newVal);
+ // // }
+ // // });
+ // //
+ // // form.add(publishedOnField);
+ // //
+ // // final VerticalPanel vp = new VerticalPanel();
+ // // vp.add(form);
+ // // return vp;
+ // //// }
+ //
+ // private VerticalPanel createTagsComponent() {
+ // final FormPanel form = createDefaultForm();
+ // tagsField = new TextArea();
+ // tagsField.setWidth("" + FORMS_WIDTH);
+ // tagsField.setHeight("3em");
+ // tagsField.addListener(new FieldListenerAdapter() {
+ // public void onChange(final Field field, final Object newVal, final
+ // Object oldVal) {
+ // presenter.setTags((String) newVal);
+ // }
+ // });
+ //
+ // form.add(tagsField);
+ // final VerticalPanel vp = new VerticalPanel();
+ // vp.add(form);
+ // return vp;
+ // }
+
+ // private void removeComponent(final String header) {
+ // options.removeStackItem(header);
+ // }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -22,7 +22,6 @@
import java.util.Date;
import java.util.List;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
@@ -74,8 +73,12 @@
});
}
+ public void attach() {
+ view.attach();
+ }
+
public void clear() {
- // TODO Auto-generated method stub
+ view.reset();
}
public void delAuthor(final String authorShortName) {
@@ -90,6 +93,10 @@
});
}
+ public void detach() {
+ view.detach();
+ }
+
public void doChangeLanguage(final String langCode) {
Site.showProgressProcessing();
final StateContainerDTO currentState = session.getContentState();
@@ -102,10 +109,6 @@
});
}
- public View getView() {
- return view;
- }
-
public void init(final AdminContextView view) {
this.view = view;
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextView.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -29,24 +29,30 @@
public interface AdminContextView extends View {
- void setAccessLists(AccessListsDTO accessLists);
+ void attach();
- void setTags(String tags);
+ void detach();
- void setLanguage(I18nLanguageDTO language);
+ void removeAccessListComponent();
- void setAuthors(List<UserSimpleDTO> authors);
+ void removeAuthorsComponent();
- void setPublishedOn(Date publishedOn);
-
void removeLangComponent();
- void removeAccessListComponent();
-
void removePublishedOnComponent();
void removeTagsComponent();
- void removeAuthorsComponent();
+ void reset();
+ void setAccessLists(AccessListsDTO accessLists);
+
+ void setAuthors(List<UserSimpleDTO> authors);
+
+ void setLanguage(I18nLanguageDTO language);
+
+ void setPublishedOn(Date publishedOn);
+
+ void setTags(String tags);
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,257 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.ctx.admin.ui;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class AdminContextPanel extends VerticalPanel implements AdminContextView {
- // private static final Images IMG = Images.App.getInstance();
-
- // private static final int FORMS_WIDTH = 145;
-
- // private final IndexedStackPanelWithSubItems options;
- // private final AdminContextPresenter presenter;
- //
- // private AccessListsPanel accessListsPanel;
- // private DateField publishedOnField;
- // private TextArea tagsField;
- // private VerticalPanel tagsComponent;
- // private VerticalPanel publishedOnComponent;
- // private LanguageSelectorComponent langPresenter;
- // private VerticalPanel authorsComponent;
- // private VerticalPanel langComponent;
- // private IconLabel addAuthorLabel;
- // private final I18nTranslationService i18n;
- // private final String authors_item;
- // private final String publication_item;
- // private final String perms_item;
- // private final String language_item;
- // private final String tags_item;
-
- public AdminContextPanel(final AdminContextPresenter presenter, final I18nTranslationService i18n) {
- // this.presenter = presenter;
- // this.i18n = i18n;
- // //options = new IndexedStackPanelWithSubItems();
- // //options.addStyleName("kune-AdminContextPanel");
- //
- // //add(options);
- // //setCellWidth(options, "100%");
- // setWidth("100%");
- // authors_item = i18n.t("Authors");
- // publication_item = i18n.t("Publication");
- // perms_item = i18n.t("Permissions");
- // language_item = i18n.t("Language");
- // tags_item = i18n.t("Tags");
- }
-
- public void removeAccessListComponent() {
- // if (options.containsItem(perms_item)) {
- // removeComponent(perms_item);
- // }
- }
-
- public void removeAuthorsComponent() {
- // if (options.containsItem(authors_item)) {
- // removeComponent(authors_item);
- // }
- }
-
- public void removeLangComponent() {
- // if (options.containsItem(language_item)) {
- // removeComponent(language_item);
- // }
- }
-
- public void removePublishedOnComponent() {
- // if (options.containsItem(publication_item)) {
- // removeComponent(publication_item);
- // }
- }
-
- public void removeTagsComponent() {
- // if (options.containsItem(tags_item)) {
- // removeComponent(tags_item);
- // }
- }
-
- public void reset() {
- // options.clear();
- }
-
- public void setAccessLists(final AccessListsDTO accessLists) {
- // if (accessListsPanel == null) {
- // accessListsPanel = new AccessListsPanel(i18n);
- // }
- // if (!options.containsItem(perms_item)) {
- // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
- // accessListsPanel);
- // }
- // accessListsPanel.setAccessLists(accessLists);
- }
-
- public void setAuthors(final List<UserSimpleDTO> authors) {
- // if (authorsComponent == null) {
- // authorsComponent = new VerticalPanel();
- // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
- // addAuthorLabel.addClickListener(new ClickListener() {
- // public void onClick(final Widget sender) {
- // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
- // }
- // });
- // } else {
- // if (options.containsItem(authors_item)) {
- // options.removeStackItem(authors_item);
- // }
- // authorsComponent.clear();
- // }
- // if (!options.containsItem(authors_item)) {
- // addComponent(authors_item, i18n.t("Authors of this work"),
- // authorsComponent);
- // }
- // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
- // iterator.hasNext();) {
- // final UserSimpleDTO author = iterator.next();
- // final StackSubItemAction[] authorActions = { new
- // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
- // DocsEvents.REMOVE_AUTHOR) };
- // options.addStackSubItem(authors_item, IMG.personDef(),
- // author.getShortName(), author.getName(),
- // authorActions, presenter);
- // }
- // authorsComponent.add(addAuthorLabel);
- }
-
- public void setLanguage(final I18nLanguageDTO language) {
- // if (langComponent == null) {
- // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
- // langComponent = new VerticalPanel();
- // final LanguageSelectorPanel view = (LanguageSelectorPanel)
- // langPresenter.getView();
- // view.setWidth("" + FORMS_WIDTH);
- // langComponent.add(view);
- // view.addChangeListener(new ComboBoxListenerAdapter() {
- // public void onSelect(final ComboBox comboBox, final Record record,
- // final int index) {
- // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
- // }
- // });
- // }
- // if (!options.containsItem(language_item)) {
- // addComponent(language_item, i18n.t("The language of this work"),
- // langComponent);
- // }
- // langPresenter.setLanguage(language);
- }
-
- public void setPublishedOn(final Date publishedOn) {
- // if (publishedOnField == null) {
- // publishedOnComponent = createPublicationComponent();
- // }
- // if (!options.containsItem(publication_item)) {
- // addComponent(publication_item, i18n.t("Date of publication of this
- // work"), publishedOnComponent);
- // }
- // // publishedOnField.setValue(publishedOn);
- }
-
- public void setTags(final String tags) {
- // if (tagsComponent == null) {
- // tagsComponent = createTagsComponent();
- // }
- // if (!options.containsItem(tags_item)) {
- // addComponent(tags_item, i18n.t("Keywords or terms associated with
- // this work"), tagsComponent);
- // }
- // tagsField.setValue(tags);
- }
-
- // private void addComponent(final String header, final String headerTitle,
- // final VerticalPanel panel) {
- // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
- // final VerticalPanel vp = options.addStackItem(header, headerTitle,
- // false);
- // vp.setStyleName("kune-AdminContextPanel-inner");
- // vp.add(panel);
- // vp.setCellWidth(panel, "100%");
- // vp.setWidth("100%");
- // }
-
- // private FormPanel createDefaultForm() {
- // final FormPanel form = new FormPanel();
- // form.setHideLabels(true);
- // form.setWidth(FORMS_WIDTH);
- // form.setBorder(false);
- // return form;
- // }
-
- // private VerticalPanel createPublicationComponent() {
- // // final FormPanel form = createDefaultForm();
- // //
- // // publishedOnField = new DateField();
- // // publishedOnField.setWidth("140");
- // // publishedOnField.setFormat("Y-m-d");
- // //
- // // publishedOnField.addListener(new FieldListenerAdapter() {
- // // public void onChange(final Field field, final Object newVal, final
- // // Object oldVal) {
- // // presenter.setPublishedOn((Date) newVal);
- // // }
- // // });
- // //
- // // form.add(publishedOnField);
- // //
- // // final VerticalPanel vp = new VerticalPanel();
- // // vp.add(form);
- // // return vp;
- // //// }
- //
- // private VerticalPanel createTagsComponent() {
- // final FormPanel form = createDefaultForm();
- // tagsField = new TextArea();
- // tagsField.setWidth("" + FORMS_WIDTH);
- // tagsField.setHeight("3em");
- // tagsField.addListener(new FieldListenerAdapter() {
- // public void onChange(final Field field, final Object newVal, final
- // Object oldVal) {
- // presenter.setTags((String) newVal);
- // }
- // });
- //
- // form.add(tagsField);
- // final VerticalPanel vp = new VerticalPanel();
- // vp.add(form);
- // return vp;
- // }
-
- // private void removeComponent(final String header) {
- // options.removeStackItem(header);
- // }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -23,26 +23,59 @@
import com.calclab.suco.client.listener.Listener;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ActionDescriptor.
+ */
public abstract class ActionDescriptor<T> {
+ /** The icon url. */
private String iconUrl;
+
+ /** The icon descriptor. */
private ImageDescriptor iconDescriptor;
+
+ /** The text description. */
private String textDescription;
+
+ /** The tool tip. */
private String toolTip;
+ /** The must be confirmed. */
private boolean mustBeConfirmed;
+
+ /** The confirmation title. */
private String confirmationTitle;
+
+ /** The confirmation text. */
private String confirmationText;
+ /** The on perform call. */
private final Listener<T> onPerformCall;
+
+ /** The on not confirmed. */
private final Listener<T> onNotConfirmed;
+ /** The must be authenticated. */
private boolean mustBeAuthenticated;
+ /** The access rol. */
private AccessRolDTO accessRol;
+ /** The enable condition. */
private ActionEnableCondition<T> enableCondition;
+ /** The id. */
+ private String id;
+
+ /**
+ * Instantiates a new action descriptor.
+ *
+ * @param accessRolDTO
+ * the access rol dto
+ * @param onPerformCall
+ * the on perform call
+ */
public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
this.accessRol = accessRolDTO;
this.onPerformCall = onPerformCall;
@@ -51,12 +84,28 @@
this.mustBeAuthenticated = true;
}
+ /**
+ * Instantiates a new action descriptor.
+ *
+ * @param accessRolDTO
+ * the access rol dto
+ * @param onPerformCall
+ * the on perform call
+ * @param enableCondition
+ * the enable condition
+ */
public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall,
final ActionEnableCondition<T> enableCondition) {
this(accessRolDTO, onPerformCall);
this.enableCondition = enableCondition;
}
+ /**
+ * Fire on not confirmed.
+ *
+ * @param parameter
+ * the parameter
+ */
@SuppressWarnings("unchecked")
public void fireOnNotConfirmed(final Object parameter) {
if (onNotConfirmed != null) {
@@ -64,87 +113,222 @@
}
}
+ /**
+ * Fire on perform call.
+ *
+ * @param parameter
+ * the parameter
+ */
@SuppressWarnings("unchecked")
public void fireOnPerformCall(final Object parameter) {
onPerformCall.onEvent((T) parameter);
}
+ /**
+ * Gets the access rol.
+ *
+ * @return the access rol
+ */
public AccessRolDTO getAccessRol() {
return accessRol;
}
+ /**
+ * Gets the confirmation text.
+ *
+ * @return the confirmation text
+ */
public String getConfirmationText() {
return confirmationText;
}
+ /**
+ * Gets the confirmation title.
+ *
+ * @return the confirmation title
+ */
public String getConfirmationTitle() {
return confirmationTitle;
}
+ /**
+ * Gets the enable condition.
+ *
+ * @return the enable condition
+ */
public ActionEnableCondition<T> getEnableCondition() {
return enableCondition;
}
+ /**
+ * Gets the icon descriptor.
+ *
+ * @return the icon descriptor
+ */
public ImageDescriptor getIconDescriptor() {
return iconDescriptor;
}
+ /**
+ * Gets the icon url.
+ *
+ * @return the icon url
+ */
public String getIconUrl() {
return iconUrl;
}
+ /**
+ * Gets the DOM unique id (used for debug)
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Gets the text.
+ *
+ * @return the text
+ */
public String getText() {
return textDescription;
}
+ /**
+ * Gets the tool tip.
+ *
+ * @return the tool tip
+ */
public String getToolTip() {
return toolTip;
}
+ /**
+ * Checks if is must be confirmed.
+ *
+ * @return true, if is must be confirmed
+ */
public boolean isMustBeConfirmed() {
return mustBeConfirmed;
}
+ /**
+ * Must be authenticated.
+ *
+ * @return true, if successful
+ */
public boolean mustBeAuthenticated() {
return mustBeAuthenticated;
}
+ /**
+ * Sets the access rol.
+ *
+ * @param accessRol
+ * the new access rol
+ */
public void setAccessRol(final AccessRolDTO accessRol) {
this.accessRol = accessRol;
}
+ /**
+ * Sets the confirmation text.
+ *
+ * @param confirmationText
+ * the new confirmation text
+ */
public void setConfirmationText(final String confirmationText) {
this.confirmationText = confirmationText;
}
+ /**
+ * Sets the confirmation title.
+ *
+ * @param confirmationTitle
+ * the new confirmation title
+ */
public void setConfirmationTitle(final String confirmationTitle) {
this.confirmationTitle = confirmationTitle;
}
+ /**
+ * Sets the enable condition.
+ *
+ * @param enableCondition
+ * the new enable condition
+ */
public void setEnableCondition(final ActionEnableCondition<T> enableCondition) {
this.enableCondition = enableCondition;
}
+ /**
+ * Sets the icon descriptor.
+ *
+ * @param iconDescriptor
+ * the new icon descriptor
+ */
public void setIconDescriptor(final ImageDescriptor iconDescriptor) {
this.iconDescriptor = iconDescriptor;
}
+ /**
+ * Sets the icon url.
+ *
+ * @param iconUrl
+ * the new icon url
+ */
public void setIconUrl(final String iconUrl) {
this.iconUrl = iconUrl;
}
+ /**
+ * Sets the DOM unique id (used for debug)
+ *
+ * @param id
+ * the new id
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Sets the must be authenticated.
+ *
+ * @param mustBeAuthenticated
+ * the new must be authenticated
+ */
public void setMustBeAuthenticated(final boolean mustBeAuthenticated) {
this.mustBeAuthenticated = mustBeAuthenticated;
}
+ /**
+ * Sets the must be confirmed.
+ *
+ * @param mustBeConfirmed
+ * the new must be confirmed
+ */
public void setMustBeConfirmed(final boolean mustBeConfirmed) {
this.mustBeConfirmed = mustBeConfirmed;
}
+ /**
+ * Sets the text description.
+ *
+ * @param textDescription
+ * the new text description
+ */
public void setTextDescription(final String textDescription) {
this.textDescription = textDescription;
}
+ /**
+ * Sets the tool tip.
+ *
+ * @param toolTip
+ * the new tool tip
+ */
public void setToolTip(final String toolTip) {
this.toolTip = toolTip;
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,296 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.platf.client.actions.toolbar;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.actions.ActionDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionItem;
-import org.ourproject.kune.platf.client.actions.ActionManager;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.Item;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.menu.MenuItem;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
-
-public class ActionToolbarPanel<T> implements ActionToolbarView<T> {
-
- public enum Position {
- content, context
- }
-
- private final HashMap<String, Menu> toolbarMenus;
- private final HashMap<String, ToolbarButton> toolbarButtons;
- private final HashMap<String, Item> menuItems;
- private final Provider<ActionManager> actionManagerProvider;
- private final Position position;
- private final SimpleToolbar topbar;
- private final SimpleToolbar bottombar;
- private final WorkspaceSkeleton ws;
-
- public ActionToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
- final WorkspaceSkeleton ws) {
- this.ws = ws;
- topbar = new SimpleToolbar();
- bottombar = new SimpleToolbar();
- this.position = position;
- this.actionManagerProvider = actionManagerProvider;
-
- toolbarMenus = new HashMap<String, Menu>();
- toolbarButtons = new HashMap<String, ToolbarButton>();
- menuItems = new HashMap<String, Item>();
- }
-
- public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
- final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
- final ActionToolbarPosition pos = action.getActionPosition();
- final ToolbarButton button = new ToolbarButton();
- final String text = action.getText();
- final String iconUrl = action.getIconUrl();
- if (text != null) {
- button.setText(text);
- }
- button.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- actionManagerProvider.get().doAction(actionItem);
- }
- });
- if (iconUrl != null) {
- button.setIcon(iconUrl);
- }
- button.setTooltip(action.getToolTip());
-
- setEnableButton(button, enable);
- final SimpleToolbar toolbar = getToolbar(pos);
- if (action.hasLeftSeparator()) {
- add(toolbar, action.getLeftSeparator());
- }
- toolbar.add(button);
- if (action.hasRightSeparator()) {
- add(toolbar, action.getRightSeparator());
- }
- toolbarButtons.put(genButtonKey(pos, text), button);
- }
-
- public void addMenuAction(final ActionItem<T> actionItem, final boolean enable) {
- final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
- final String menuTitle = action.getParentMenuTitle();
- final String menuSubTitle = action.getParentSubMenuTitle();
- final ActionToolbarPosition pos = action.getActionPosition();
- final String itemKey = genMenuKey(pos, menuTitle, menuSubTitle, action.getText());
- Item item = menuItems.get(itemKey);
- if (item == null) {
- item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem);
- menuItems.put(itemKey, item);
- }
- setEnableMenuItem(item, enable);
- }
-
- public void attach() {
- if (!topbar.isAttached()) {
- switch (position) {
- case content:
- ws.getEntityWorkspace().getContentTopBar().add(topbar);
- ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
- break;
- case context:
- default:
- ws.getEntityWorkspace().getContextTopBar().add(topbar);
- ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
- }
- }
- }
-
- public void clear() {
- toolbarMenus.clear();
- menuItems.clear();
- toolbarButtons.clear();
- topbar.removeAll();
- bottombar.removeAll();
- getToolbar(ActionToolbarPosition.topbar).removeAll();
- getToolbar(ActionToolbarPosition.bottombar).removeAll();
- }
-
- public void detach() {
- if (topbar.isAttached()) {
- switch (position) {
- case content:
- ws.getEntityWorkspace().getContentTopBar().remove(topbar);
- ws.getEntityWorkspace().getContentBottomBar().remove(bottombar);
- break;
- case context:
- default:
- ws.getEntityWorkspace().getContextTopBar().remove(topbar);
- ws.getEntityWorkspace().getContextBottomBar().remove(bottombar);
- }
- }
- }
-
- public void disableAllMenuItems() {
- for (final Item item : menuItems.values()) {
- item.disable();
- }
- }
-
- public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
- final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
- final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getText()));
- if (button != null) {
- setEnableButton(button, enable);
- } else {
- Log.error("Tryng to enable/disable a non existent toolbar button");
- }
- }
-
- public void setMenuEnable(final ActionDescriptor<T> action, final boolean enable) {
- final Item item = menuItems.get(genMenuKey((ActionToolbarMenuDescriptor<T>) action));
- if (item != null) {
- setEnableMenuItem(item, enable);
- } else {
- Log.error("Tryng to enable/disable a non existent toolbar menu item");
- }
- }
-
- private void add(final ActionToolbarPosition toolbar, final Widget widget) {
- getToolbar(toolbar).add(widget);
- }
-
- private Widget add(final SimpleToolbar toolbar, final ActionToolbarButtonSeparator separator) {
- switch (separator) {
- case fill:
- return toolbar.addFill();
- case separator:
- return toolbar.addSeparator();
- case spacer:
- default:
- return toolbar.addSpacer();
- }
- }
-
- private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
- final String menuSubTitle, final ActionItem<T> actionItem) {
- final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
- final Item item = new Item(action.getText(), new BaseItemListenerAdapter() {
- @Override
- public void onClick(BaseItem item, EventObject e) {
- actionManagerProvider.get().doAction(actionItem);
- }
- });
- item.setIcon(action.getIconUrl());
-
- final String menuKey = genMenuKey(toolBarPos, menuTitle, null, null);
- final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuSubTitle, null);
- Menu menu = toolbarMenus.get(menuKey);
- Menu subMenu = toolbarMenus.get(subMenuKey);
- if (menuSubTitle != null) {
- if (subMenu == null) {
- subMenu = new Menu();
- final MenuItem subMenuItem = new MenuItem(menuSubTitle, subMenu);
- if (menu == null) {
- menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
- }
- menu.addItem(subMenuItem);
- toolbarMenus.put(subMenuKey, subMenu);
- }
- subMenu.addItem(item);
-
- } else {
- // Menu action without submenu
- if (menu == null) {
- menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
- }
- menu.addItem(item);
- }
- return item;
- }
-
- private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl,
- final String menuTitle, final String menuKey) {
- final Menu menu = new Menu();
- final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
- toolbarMenu.setMenu(menu);
- if (iconUrl != null) {
- toolbarMenu.setIcon(iconUrl);
- }
- toolbarMenus.put(menuKey, menu);
- add(barPosition, toolbarMenu);
- return menu;
- }
-
- private String genButtonKey(final ActionToolbarPosition pos, final String actionText) {
- final String basePart = "km-ctx-btn-" + pos.toString().substring(0, 2) + "-" + actionText;
- return basePart;
- }
-
- private String genMenuKey(final ActionToolbarMenuDescriptor<T> action) {
- return genMenuKey(action.getActionPosition(), action.getParentMenuTitle(), action.getParentSubMenuTitle(),
- action.getText());
- }
-
- private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
- final String actionText) {
-
- final String basePart = "km-ctx-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle;
- final String subMenuPart = menuSubTitle != null ? "-subm-" + menuSubTitle : "";
- final String itemPart = actionText != null ? "-item-" + actionText : "";
- return basePart + subMenuPart + itemPart;
- }
-
- private SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
- switch (pos) {
- case bottombar:
- return bottombar;
- case topbar:
- default:
- return topbar;
- }
- }
-
- private void setEnableButton(final ToolbarButton button, final boolean enable) {
- if (enable) {
- button.enable();
- } else {
- button.disable();
- }
- }
-
- private void setEnableMenuItem(final Item item, final boolean enable) {
- if (enable) {
- item.enable();
- } else {
- item.disable();
- }
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java (from rev 934, trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,303 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */package org.ourproject.kune.platf.client.actions.toolbar;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionManager;
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.MenuItem;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class ActionToolbarPanel<T> implements ActionToolbarView<T> {
+
+ public enum Position {
+ content, context
+ }
+
+ private final HashMap<String, Menu> toolbarMenus;
+ private final HashMap<String, ToolbarButton> toolbarButtons;
+ private final HashMap<String, Item> menuItems;
+ private final Provider<ActionManager> actionManagerProvider;
+ private final Position position;
+ private final SimpleToolbar topbar;
+ private final SimpleToolbar bottombar;
+ private final WorkspaceSkeleton ws;
+
+ public ActionToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
+ final WorkspaceSkeleton ws) {
+ this.ws = ws;
+ topbar = new SimpleToolbar();
+ bottombar = new SimpleToolbar();
+ this.position = position;
+ this.actionManagerProvider = actionManagerProvider;
+
+ toolbarMenus = new HashMap<String, Menu>();
+ toolbarButtons = new HashMap<String, ToolbarButton>();
+ menuItems = new HashMap<String, Item>();
+ }
+
+ public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
+ final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
+ final ActionToolbarPosition pos = action.getActionPosition();
+ final ToolbarButton button = new ToolbarButton();
+ final String text = action.getText();
+ final String iconUrl = action.getIconUrl();
+ if (text != null) {
+ button.setText(text);
+ }
+ final String id = action.getId();
+ if (id != null) {
+ button.setId(id);
+ }
+ button.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ actionManagerProvider.get().doAction(actionItem);
+ }
+ });
+ if (iconUrl != null) {
+ button.setIcon(iconUrl);
+ }
+ button.setTooltip(action.getToolTip());
+
+ setEnableButton(button, enable);
+ final SimpleToolbar toolbar = getToolbar(pos);
+ if (action.hasLeftSeparator()) {
+ add(toolbar, action.getLeftSeparator());
+ }
+ toolbar.add(button);
+ if (action.hasRightSeparator()) {
+ add(toolbar, action.getRightSeparator());
+ }
+ toolbarButtons.put(genButtonKey(pos, text), button);
+ }
+
+ public void addMenuAction(final ActionItem<T> actionItem, final boolean enable) {
+ final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
+ final String menuTitle = action.getParentMenuTitle();
+ final String menuSubTitle = action.getParentSubMenuTitle();
+ final ActionToolbarPosition pos = action.getActionPosition();
+ final String itemKey = genMenuKey(pos, menuTitle, menuSubTitle, action.getText());
+ Item item = menuItems.get(itemKey);
+ if (item == null) {
+ item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem, action.getId());
+ menuItems.put(itemKey, item);
+ }
+ setEnableMenuItem(item, enable);
+ }
+
+ public void attach() {
+ if (!topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().add(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().add(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
+ }
+ }
+ }
+
+ public void clear() {
+ toolbarMenus.clear();
+ menuItems.clear();
+ toolbarButtons.clear();
+ topbar.removeAll();
+ bottombar.removeAll();
+ getToolbar(ActionToolbarPosition.topbar).removeAll();
+ getToolbar(ActionToolbarPosition.bottombar).removeAll();
+ }
+
+ public void detach() {
+ if (topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().remove(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().remove(bottombar);
+ }
+ }
+ }
+
+ public void disableAllMenuItems() {
+ for (final Item item : menuItems.values()) {
+ item.disable();
+ }
+ }
+
+ public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
+ final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
+ final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getText()));
+ if (button != null) {
+ setEnableButton(button, enable);
+ } else {
+ Log.error("Tryng to enable/disable a non existent toolbar button");
+ }
+ }
+
+ public void setMenuEnable(final ActionDescriptor<T> action, final boolean enable) {
+ final Item item = menuItems.get(genMenuKey((ActionToolbarMenuDescriptor<T>) action));
+ if (item != null) {
+ setEnableMenuItem(item, enable);
+ } else {
+ Log.error("Tryng to enable/disable a non existent toolbar menu item");
+ }
+ }
+
+ private void add(final ActionToolbarPosition toolbar, final Widget widget) {
+ getToolbar(toolbar).add(widget);
+ }
+
+ private Widget add(final SimpleToolbar toolbar, final ActionToolbarButtonSeparator separator) {
+ switch (separator) {
+ case fill:
+ return toolbar.addFill();
+ case separator:
+ return toolbar.addSeparator();
+ case spacer:
+ default:
+ return toolbar.addSpacer();
+ }
+ }
+
+ private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
+ final String menuSubTitle, final ActionItem<T> actionItem, String id) {
+ final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
+ final Item item = new Item(action.getText(), new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+ actionManagerProvider.get().doAction(actionItem);
+ }
+ });
+ item.setIcon(action.getIconUrl());
+ if (id != null) {
+ item.setId(id);
+ }
+
+ final String menuKey = genMenuKey(toolBarPos, menuTitle, null, null);
+ final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuSubTitle, null);
+ Menu menu = toolbarMenus.get(menuKey);
+ Menu subMenu = toolbarMenus.get(subMenuKey);
+ if (menuSubTitle != null) {
+ if (subMenu == null) {
+ subMenu = new Menu();
+ final MenuItem subMenuItem = new MenuItem(menuSubTitle, subMenu);
+ if (menu == null) {
+ menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
+ }
+ menu.addItem(subMenuItem);
+ toolbarMenus.put(subMenuKey, subMenu);
+ }
+ subMenu.addItem(item);
+
+ } else {
+ // Menu action without submenu
+ if (menu == null) {
+ menu = createToolbarMenu(toolBarPos, action.getParentMenuIconUrl(), menuTitle, menuKey);
+ }
+ menu.addItem(item);
+ }
+ return item;
+ }
+
+ private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl,
+ final String menuTitle, final String menuKey) {
+ final Menu menu = new Menu();
+ final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
+ toolbarMenu.setMenu(menu);
+ if (iconUrl != null) {
+ toolbarMenu.setIcon(iconUrl);
+ }
+ toolbarMenus.put(menuKey, menu);
+ add(barPosition, toolbarMenu);
+ return menu;
+ }
+
+ private String genButtonKey(final ActionToolbarPosition pos, final String actionText) {
+ final String basePart = "km-ctx-btn-" + pos.toString().substring(0, 2) + "-" + actionText;
+ return basePart;
+ }
+
+ private String genMenuKey(final ActionToolbarMenuDescriptor<T> action) {
+ return genMenuKey(action.getActionPosition(), action.getParentMenuTitle(), action.getParentSubMenuTitle(),
+ action.getText());
+ }
+
+ private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
+ final String actionText) {
+
+ final String basePart = "km-ctx-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle;
+ final String subMenuPart = menuSubTitle != null ? "-subm-" + menuSubTitle : "";
+ final String itemPart = actionText != null ? "-item-" + actionText : "";
+ return basePart + subMenuPart + itemPart;
+ }
+
+ private SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
+ switch (pos) {
+ case bottombar:
+ return bottombar;
+ case topbar:
+ default:
+ return topbar;
+ }
+ }
+
+ private void setEnableButton(final ToolbarButton button, final boolean enable) {
+ if (enable) {
+ button.enable();
+ } else {
+ button.disable();
+ }
+ }
+
+ private void setEnableMenuItem(final Item item, final boolean enable) {
+ if (enable) {
+ item.enable();
+ } else {
+ item.disable();
+ }
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/RateResultDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/RateResultDTO.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/RateResultDTO.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,43 @@
+package org.ourproject.kune.platf.client.dto;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public class RateResultDTO implements IsSerializable {
+ private Double rate;
+ private Integer rateByUsers;
+ private Double currentUserRate;
+
+ public RateResultDTO() {
+ this(null, null, null);
+ }
+
+ public RateResultDTO(Double rate, Integer rateByUsers, Double currentUserRate) {
+ this.rate = rate;
+ this.rateByUsers = rateByUsers;
+ this.currentUserRate = currentUserRate;
+ }
+
+ public Double getCurrentUserRate() {
+ return currentUserRate;
+ }
+
+ public Double getRate() {
+ return rate;
+ }
+
+ public Integer getRateByUsers() {
+ return rateByUsers;
+ }
+
+ public void setCurrentUserRate(Double currentUserRate) {
+ this.currentUserRate = currentUserRate;
+ }
+
+ public void setRate(Double rate) {
+ this.rate = rate;
+ }
+
+ public void setRateByUsers(Integer rateByUsers) {
+ this.rateByUsers = rateByUsers;
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateContentDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateContentDTO.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateContentDTO.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -127,6 +127,12 @@
this.rate = rate;
}
+ public void setRate(RateResultDTO result) {
+ setRate(result.getRate());
+ setRateByUsers(result.getRateByUsers());
+ setCurrentUserRate(result.getCurrentUserRate());
+ }
+
public void setRateable(boolean isRateable) {
this.isRateable = isRateable;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -26,6 +26,7 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -59,7 +60,7 @@
CommentDTO markCommentAsAbuse(String userHash, StateToken token, Long commentId) throws DefaultException;
- void rateContent(String userHash, StateToken token, Double value) throws DefaultException;
+ RateResultDTO rateContent(String userHash, StateToken token, Double value) throws DefaultException;
void removeAuthor(String userHash, StateToken token, String authorShortName) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -26,6 +26,7 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -59,7 +60,7 @@
void markCommentAsAbuse(String userHash, StateToken token, Long commentId, AsyncCallback<CommentDTO> asyncCallback);
- void rateContent(String userHash, StateToken token, Double value, AsyncCallback<?> asyncCallback);
+ void rateContent(String userHash, StateToken token, Double value, AsyncCallback<RateResultDTO> asyncCallback);
void removeAuthor(String userHash, StateToken token, String authorShortName, AsyncCallback<?> asyncCallback);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -349,7 +349,7 @@
contentNavigatorToolbar);
final TextEditorPresenter presenter = new TextEditorPresenter(true, toolbar,
- $(I18nUITranslationService.class));
+ $(I18nUITranslationService.class), $(StateManager.class));
final TextEditorPanel panel = new TextEditorPanel(presenter, $(I18nTranslationService.class),
$(WorkspaceSkeleton.class), $(ColorWebSafePalette.class));
presenter.init(panel);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -309,7 +309,7 @@
@Override
public RateIt create() {
final RateItPresenter presenter = new RateItPresenter($(I18nUITranslationService.class),
- $(Session.class), $$(ContentServiceAsync.class), $(StateManager.class));
+ $(Session.class), $$(ContentServiceAsync.class), $(StateManager.class), $$(RatePresenter.class));
final RateItPanel panel = new RateItPanel(presenter, $(I18nUITranslationService.class),
$(WorkspaceSkeleton.class), $(Images.class));
presenter.init(panel);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.state;
+
+import java.util.ArrayList;
+
+public class BeforeStateChangeCollection extends ArrayList<BeforeStateChangeListener> {
+
+ private static final long serialVersionUID = 1L;
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeListener.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.state;
+
+
+public interface BeforeStateChangeListener {
+
+ boolean beforeChange(String newToken);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -30,11 +30,13 @@
public interface StateManager extends HistoryListener {
+ void addBeforeStateChangeListener(BeforeStateChangeListener listener);
+
void addSiteToken(String token, Listener<StateToken> whenToken);
- void gotoToken(StateToken state);
+ void gotoToken(StateToken newToken);
- void gotoToken(String token);
+ void gotoToken(String newToken);
void onGroupChanged(Listener2<GroupDTO, GroupDTO> listener);
@@ -46,6 +48,8 @@
void reload();
+ void removeBeforeStateChangeListener(BeforeStateChangeListener listener);
+
void removeSiteToken(String token);
void restorePreviousState();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -51,6 +51,7 @@
private final Event<StateAbstractDTO> onSocialNetworkChanged;
private final Event2<String, String> onToolChanged;
private final Event2<GroupDTO, GroupDTO> onGroupChanged;
+ private final BeforeStateChangeCollection beforeStateChangeCollection;
public StateManagerDefault(final ContentProvider contentProvider, final Session session,
final HistoryWrapper history) {
@@ -77,15 +78,21 @@
}
});
siteTokens = new HashMap<String, Listener<StateToken>>();
+ beforeStateChangeCollection = new BeforeStateChangeCollection();
}
+ public void addBeforeStateChangeListener(BeforeStateChangeListener listener) {
+ beforeStateChangeCollection.add(listener);
+ }
+
public void addSiteToken(final String token, final Listener<StateToken> listener) {
siteTokens.put(token, listener);
}
- public void gotoToken(final StateToken state) {
- Log.debug("StateManager: history goto-token newItem (" + state + ")");
- history.newItem(state.getEncoded());
+ public void gotoToken(final StateToken newToken) {
+ Log.debug("StateManager: history goto-token newItem (" + newToken + ")");
+
+ history.newItem(newToken.getEncoded());
}
public void gotoToken(final String token) {
@@ -97,20 +104,23 @@
}
public void onHistoryChanged(final String historyToken) {
- final Listener<StateToken> tokenListener = siteTokens.get(historyToken);
- Log.debug("StateManager: history token changed (" + historyToken + ")");
- if (tokenListener == null) {
- onHistoryChanged(new StateToken(historyToken));
- } else {
- StateToken stateToken;
- if (oldState == null) {
- // Starting with some token like "signin": load defContent also
- stateToken = new StateToken();
- onHistoryChanged(stateToken);
+ if (beforeStateListenersAllowChange(historyToken)) {
+ final Listener<StateToken> tokenListener = siteTokens.get(historyToken);
+ Log.debug("StateManager: history token changed (" + historyToken + ")");
+ if (tokenListener == null) {
+ onHistoryChanged(new StateToken(historyToken));
} else {
- stateToken = oldState.getStateToken();
+ StateToken stateToken;
+ if (oldState == null) {
+ // Starting with some token like "signin": load defContent
+ // also
+ stateToken = new StateToken();
+ onHistoryChanged(stateToken);
+ } else {
+ stateToken = oldState.getStateToken();
+ }
+ tokenListener.onEvent(stateToken);
}
- tokenListener.onEvent(stateToken);
}
}
@@ -135,6 +145,10 @@
onHistoryChanged(history.getToken());
}
+ public void removeBeforeStateChangeListener(BeforeStateChangeListener listener) {
+ beforeStateChangeCollection.remove(listener);
+ }
+
public void removeSiteToken(final String token) {
siteTokens.remove(token);
}
@@ -170,6 +184,15 @@
}
}
+ private boolean beforeStateListenersAllowChange(String newToken) {
+ for (BeforeStateChangeListener listener : beforeStateChangeCollection) {
+ if (!listener.beforeChange(newToken)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
private void checkGroupAndToolChange(final StateAbstractDTO oldState, final StateAbstractDTO newState) {
final GroupDTO oldGroup = oldState != null ? oldState.getGroup() : null;
final GroupDTO newGroup = newState.getGroup();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.platf.client.ui.rate;
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
@@ -40,18 +41,20 @@
private final I18nTranslationService i18n;
private final Provider<ContentServiceAsync> contentServiceProvider;
private final Session session;
- private final StateManager stateManager;
+ private final Provider<RatePresenter> ratePresenterProv;
public RateItPresenter(final I18nTranslationService i18n, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider, final StateManager stateManager) {
+ final Provider<ContentServiceAsync> contentServiceProvider, final StateManager stateManager,
+ Provider<RatePresenter> ratePresenterProvider) {
this.i18n = i18n;
this.session = session;
this.contentServiceProvider = contentServiceProvider;
- this.stateManager = stateManager;
+ this.ratePresenterProv = ratePresenterProvider;
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
public void onEvent(final StateAbstractDTO state) {
if (state instanceof StateContentDTO) {
- setState((StateContentDTO) state);
+ StateContentDTO stateContentDTO = (StateContentDTO) state;
+ setState(stateContentDTO.isRateable(), stateContentDTO.getCurrentUserRate());
} else {
view.setVisible(false);
}
@@ -91,11 +94,15 @@
Site.showProgressProcessing();
final StateAbstractDTO currentState = session.getCurrentState();
contentServiceProvider.get().rateContent(session.getUserHash(), currentState.getStateToken(), newValue,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
+ new AsyncCallbackSimple<RateResultDTO>() {
+ public void onSuccess(final RateResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Content rated"));
- stateManager.reload();
+ if (currentState.getStateToken().equals(session.getCurrentStateToken())) {
+ session.getContentState().setRate(result);
+ setState(true, result.getCurrentUserRate());
+ ratePresenterProv.get().setRate(result);
+ }
}
});
}
@@ -138,14 +145,16 @@
}
}
- private void setState(final StateContentDTO state) {
- if (state.isRateable()) {
+ private void setState(boolean isRateable, Double currentUserRate) {
+ if (isRateable) {
if (session.isLogged()) {
- setRate(state.getCurrentUserRate());
+ setRate(currentUserRate);
view.setVisible(true);
} else {
view.setVisible(false);
}
+ } else {
+ view.setVisible(false);
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -18,6 +18,7 @@
*
*/package org.ourproject.kune.platf.client.ui.rate;
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -44,15 +45,25 @@
this.view = view;
}
+ public void setRate(RateResultDTO result) {
+ setRate(result.getRateByUsers(), result.getRate());
+ }
+
public void setVisible(final boolean visible) {
view.setVisible(visible);
}
+ private void setRate(Integer rateByUsers, Double rate) {
+ view.setVisible(true);
+ view.setRate(rate);
+ view.setByUsers(rateByUsers);
+ }
+
private void setState(final StateContentDTO state) {
+ Integer rateByUsers = state.getRateByUsers();
+ Double rate = state.getRate();
if (state.isRateable()) {
- view.setVisible(true);
- view.setRate(state.getRate());
- view.setByUsers(state.getRateByUsers());
+ setRate(rateByUsers, rate);
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -26,6 +26,7 @@
import org.ourproject.kune.platf.server.domain.Content;
import org.ourproject.kune.platf.server.domain.ContentStatus;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
+import org.ourproject.kune.platf.server.domain.RateResult;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.Manager;
import org.ourproject.kune.platf.server.manager.impl.SearchResult;
@@ -44,7 +45,7 @@
Double getRateContent(User user, Content content);
- void rateContent(User rater, Long contentId, Double value) throws DefaultException;
+ RateResult rateContent(User rater, Long contentId, Double value) throws DefaultException;
void removeAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -41,6 +41,7 @@
import org.ourproject.kune.platf.server.domain.ContentStatus;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.Rate;
+import org.ourproject.kune.platf.server.domain.RateResult;
import org.ourproject.kune.platf.server.domain.Revision;
import org.ourproject.kune.platf.server.domain.Tag;
import org.ourproject.kune.platf.server.domain.User;
@@ -121,7 +122,7 @@
}
}
- public void rateContent(final User rater, final Long contentId, final Double value) throws DefaultException {
+ public RateResult rateContent(final User rater, final Long contentId, final Double value) throws DefaultException {
final Content content = finder.getContent(contentId);
final Rate oldRate = finder.getRate(rater, content);
if (oldRate == null) {
@@ -131,6 +132,9 @@
oldRate.setValue(value);
super.persist(oldRate, Rate.class);
}
+ Double rateAvg = getRateAvg(content);
+ Long rateByUsers = getRateByUsers(content);
+ return new RateResult(rateAvg != null ? rateAvg : 0D, rateByUsers != null ? rateByUsers.intValue() : 0, value);
}
public void removeAuthor(final User user, final Long contentId, final String authorShortName)
Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/RateResult.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/RateResult.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/RateResult.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -0,0 +1,42 @@
+package org.ourproject.kune.platf.server.domain;
+
+public class RateResult {
+ private Double rate;
+ private Integer rateByUsers;
+ private Double currentUserRate;
+
+ public RateResult() {
+ this(null, null, null);
+ }
+
+ public RateResult(Double rate, Integer rateByUsers, Double currentUserRate) {
+ this.rate = rate;
+ this.rateByUsers = rateByUsers;
+ this.currentUserRate = currentUserRate;
+ }
+
+ public Double getCurrentUserRate() {
+ return currentUserRate;
+ }
+
+ public Double getRate() {
+ return rate;
+ }
+
+ public Integer getRateByUsers() {
+ return rateByUsers;
+ }
+
+ public void setCurrentUserRate(Double currentUserRate) {
+ this.currentUserRate = currentUserRate;
+ }
+
+ public void setRate(Double rate) {
+ this.rate = rate;
+ }
+
+ public void setRateByUsers(Integer rateByUsers) {
+ this.rateByUsers = rateByUsers;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -32,6 +32,7 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.RateResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -64,6 +65,7 @@
import org.ourproject.kune.platf.server.domain.Content;
import org.ourproject.kune.platf.server.domain.ContentStatus;
import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.RateResult;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.manager.TagManager;
@@ -272,13 +274,15 @@
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer)
@Transactional(type = TransactionType.READ_WRITE)
- public void rateContent(final String userHash, final StateToken token, final Double value) throws DefaultException {
+ public RateResultDTO rateContent(final String userHash, final StateToken token, final Double value)
+ throws DefaultException {
final UserSession userSession = getUserSession();
final User rater = userSession.getUser();
final Long contentId = ContentUtils.parseId(token.getDocument());
if (userSession.isUserLoggedIn()) {
- contentManager.rateContent(rater, contentId, value);
+ RateResult result = contentManager.rateContent(rater, contentId, value);
+ return mapper.map(result, RateResultDTO.class);
} else {
throw new AccessViolationException();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -103,6 +103,7 @@
if (userLogged != User.UNKNOWN_USER) {
state.setCurrentUserRate(contentManager.getRateContent(userLogged, content));
}
+ // FIXME: user RateResult
Double rateAvg = contentManager.getRateAvg(content);
state.setRate(rateAvg != null ? rateAvg : 0D);
Long rateByUsers = contentManager.getRateByUsers(content);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -19,19 +19,20 @@
*/
package org.ourproject.kune.workspace.client.ctxnav;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
public interface ContextNavigator {
+ void attach();
+
void clear();
+ void detach();
+
void editItem(StateToken stateToken);
- View getView();
-
boolean isSelected(StateToken stateToken);
void refresh(StateToken stateToken);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -60,6 +60,8 @@
private final ContextNavigatorPresenter presenter;
private final MenuItemsContainer<StateToken> menuItemsContainer;
+ // private final Panel generalPanel;
+
public ContextNavigatorPanel(final ContextNavigatorPresenter presenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws, final ActionManager actionManager) {
this.presenter = presenter;
@@ -69,6 +71,10 @@
fireOnTextChange = true;
isEditable = false;
menuItemsContainer = new MenuItemsContainer<StateToken>();
+ // generalPanel = new Panel();
+ // generalPanel.setLayout(new FitLayout());
+ // generalPanel.setAutoScroll(false);
+ // generalPanel.setBorder(false);
}
public void addItem(final ContextNavigatorItem item) {
@@ -144,6 +150,31 @@
menuItemsContainer.clear();
}
+ // public void attach() {
+ // if (!generalPanel.isRendered()) {
+ // Site.info("attach");
+ // ws.getEntityWorkspace().setContext(generalPanel);
+ // generalPanel.doLayout();
+ // }
+ // if (!treePanel.isRendered()) {
+ // Site.info("added");
+ // generalPanel.add(treePanel);
+ // generalPanel.doLayout();
+ // treePanel.doLayout();
+ // }
+ // }
+
+ public void detach() {
+ clear();
+ }
+
+ // public void detach() {
+ // if (generalPanel.isRendered()) {
+ // Site.info("detach");
+ // generalPanel.removeFromParent();
+ // }
+ // }
+
public void editItem(final String id) {
treeEditor.startEdit(getNode(id));
}
@@ -261,16 +292,16 @@
treePanel.doLayout(false);
}
});
-
- ws.getEntityWorkspace().addContextListener(new ContainerListenerAdapter() {
- @Override
- public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
- final int rawWidth, final int rawHeight) {
- // Log.debug("-------w: " + adjWidth + " h: " + adjHeight);
- // Log.debug("---r---w: " + rawWidth + " h: " + rawHeight);
- }
- });
-
+ // ws.getEntityWorkspace().addContextListener(new
+ // ContainerListenerAdapter() {
+ // @Override
+ // public void onResize(final BoxComponent component, final int
+ // adjWidth, final int adjHeight,
+ // final int rawWidth, final int rawHeight) {
+ // // Log.debug("-------w: " + adjWidth + " h: " + adjHeight);
+ // // Log.debug("---r---w: " + rawWidth + " h: " + rawHeight);
+ // }
+ // });
ws.getEntityWorkspace().setContext(treePanel);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -23,7 +23,6 @@
import java.util.HashMap;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
@@ -94,20 +93,29 @@
editOnNextStateChange = false;
}
+ public void attach() {
+ // FIXME At the moment detach (removeFromParent) destroy the gwt-eext
+ // TreePanel and the widget must be recreated (cannot be attached again
+ // like in gwt)
+ setState(session.getCurrentState(), true);
+ toolbar.attach();
+ }
+
public void clear() {
toolbar.clear();
view.clear();
actionsByItem.clear();
}
+ public void detach() {
+ view.detach();
+ toolbar.detach();
+ }
+
public void editItem(final StateToken stateToken) {
view.editItem(genId(stateToken));
}
- public View getView() {
- return view;
- }
-
public void gotoToken(final String token) {
stateManager.gotoToken(token);
}
@@ -167,9 +175,7 @@
contentServiceProvider.get().getContent(session.getUserHash(), stateToken,
new AsyncCallbackSimple<StateAbstractDTO>() {
public void onSuccess(final StateAbstractDTO state) {
- if (state instanceof StateContainerDTO) {
- setState((StateContainerDTO) state, false);
- }
+ setState(state, false);
}
});
}
@@ -334,4 +340,10 @@
}
}
+ private void setState(final StateAbstractDTO state, boolean select) {
+ if (state instanceof StateContainerDTO) {
+ setState((StateContainerDTO) state, select);
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -29,6 +29,8 @@
void clear();
+ void detach();
+
void editItem(String id);
boolean isSelected(String id);
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 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -127,15 +127,16 @@
}
public void showSaveBeforeDialog() {
- MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
- public void execute(final String btnID) {
- if (btnID.equals("yes")) {
- presenter.onSaveAndClose();
- } else {
- presenter.onCancelConfirmed();
- }
- }
- });
+ MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before closing the editor?"),
+ new MessageBox.ConfirmCallback() {
+ public void execute(final String btnID) {
+ if (btnID.equals("yes")) {
+ presenter.onSaveAndClose();
+ } else {
+ presenter.onCancelConfirmed();
+ }
+ }
+ });
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -27,12 +27,18 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.BeforeStateChangeListener;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener0;
public class TextEditorPresenter implements TextEditor {
+ public static final int AUTOSAVE_AFTER_FAILS_IN_MILLISECONS = 20000;
+ public static final int AUTOSAVE_IN_MILLISECONDS = 10000;
+ public static final String CLOSE_ID = "k-teditc-close";
+ public static final String SAVE_ID = "k-teditp-save";
private boolean editingHtml;
private TextEditorView view;
private boolean savePending;
@@ -44,16 +50,26 @@
private ActionToolbarButtonDescriptor<StateToken> save;
private ActionToolbarButtonDescriptor<StateToken> close;
private final I18nUITranslationService i18n;
+ private final BeforeStateChangeListener beforeStateChangeListener;
+ private String newTokenAfterSave;
+ private final StateManager stateManager;
public TextEditorPresenter(final boolean isAutoSave, final ActionToolbar<StateToken> toolbar,
- final I18nUITranslationService i18n) {
+ final I18nUITranslationService i18n, StateManager stateManager) {
this.toolbar = toolbar;
autoSave = isAutoSave;
this.i18n = i18n;
+ this.stateManager = stateManager;
savePending = false;
editingHtml = false;
saveAndCloseConfirmed = false;
createActions();
+
+ beforeStateChangeListener = new BeforeStateChangeListener() {
+ public boolean beforeChange(String newToken) {
+ return beforeTokenChange(newToken);
+ }
+ };
}
public void editContent(final String content, final Listener<String> onSave, final Listener0 onEditCancelled) {
@@ -62,6 +78,8 @@
toolbar.attach();
view.attach();
setContent(content);
+ stateManager.addBeforeStateChangeListener(beforeStateChangeListener);
+ newTokenAfterSave = null;
}
public String getContent() {
@@ -83,7 +101,7 @@
savePending = true;
toolbar.setEnableAction(save, true);
if (autoSave) {
- view.scheduleSave(10000);
+ view.scheduleSave(AUTOSAVE_IN_MILLISECONDS);
}
}
}
@@ -102,7 +120,7 @@
}
public void onSaveFailed() {
- view.scheduleSave(20000);
+ view.scheduleSave(AUTOSAVE_AFTER_FAILS_IN_MILLISECONS);
if (saveAndCloseConfirmed) {
saveAndCloseConfirmed = false;
}
@@ -113,6 +131,7 @@
savePending = false;
saveAndCloseConfirmed = false;
toolbar.setEnableAction(save, false);
+ newTokenAfterSave = null;
}
protected void onCancel() {
@@ -125,6 +144,8 @@
}
protected void onCancelConfirmed() {
+ stateManager.removeBeforeStateChangeListener(beforeStateChangeListener);
+ gotoNewTokenIfNecessary();
reset();
view.detach();
toolbar.detach();
@@ -151,6 +172,17 @@
onSave.onEvent(view.getHTML());
}
+ boolean beforeTokenChange(String newToken) {
+ if (savePending) {
+ newTokenAfterSave = newToken;
+ onCancel();
+ return false;
+ } else {
+ onCancelConfirmed();
+ return true;
+ }
+ }
+
private void createActions() {
save = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
new Listener<StateToken>() {
@@ -159,6 +191,7 @@
}
});
save.setTextDescription(i18n.tWithNT("Save", "used in button"));
+ save.setId(SAVE_ID);
// save.setIconUrl("images/");
close = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
@@ -168,6 +201,7 @@
}
});
close.setTextDescription(i18n.tWithNT("Close", "used in button"));
+ close.setId(CLOSE_ID);
// close.setIconUrl("images/");
final ActionItemCollection<StateToken> collection = new ActionItemCollection<StateToken>();
@@ -176,6 +210,13 @@
toolbar.setActions(collection);
}
+ private void gotoNewTokenIfNecessary() {
+ if (newTokenAfterSave != null) {
+ stateManager.reload();
+ stateManager.gotoToken(newTokenAfterSave);
+ }
+ }
+
private void setContent(final String html) {
this.view.setHTML(html);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -32,8 +32,8 @@
public class EntityLicensePanel implements EntityLicenseView {
private final Label copyright;
- private final Image image;
- private final Label license;
+ private final Image licenseImage;
+ private final Label licenseLabel;
private final I18nTranslationService i18n;
private final SimpleToolbar licenseBar;
private final WorkspaceSkeleton ws;
@@ -43,15 +43,15 @@
this.i18n = i18n;
this.ws = ws;
copyright = new Label();
- image = new Image();
- license = new Label();
+ licenseImage = new Image();
+ licenseLabel = new Label();
licenseBar = new SimpleToolbar();
licenseBar.add(copyright);
- licenseBar.add(license);
+ licenseBar.add(licenseLabel);
licenseBar.addSpacer();
licenseBar.addSpacer();
- licenseBar.add(image);
+ licenseBar.add(licenseImage);
final ClickListener clickListener = new ClickListener() {
public void onClick(Widget arg0) {
@@ -59,14 +59,14 @@
}
};
- license.addClickListener(clickListener);
- image.addClickListener(clickListener);
+ licenseLabel.addClickListener(clickListener);
+ licenseImage.addClickListener(clickListener);
copyright.setVisible(false);
- license.setVisible(false);
- image.setVisible(false);
+ licenseLabel.setVisible(false);
+ licenseImage.setVisible(false);
copyright.addStyleName("kune-Margin-Large-l");
- license.setStyleName("k-entitylicensepanel-licensetext");
+ licenseLabel.setStyleName("k-entitylicensepanel-licensetext");
}
public void attach() {
@@ -87,10 +87,10 @@
public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
copyright.setText(i18n.t("© [%s], under license: ", groupName));
- license.setText(licenseDTO.getLongName());
+ licenseLabel.setText(licenseDTO.getLongName());
copyright.setVisible(true);
- license.setVisible(true);
- image.setVisible(true);
- image.setUrl(licenseDTO.getImageUrl());
+ licenseLabel.setVisible(true);
+ licenseImage.setVisible(true);
+ licenseImage.setUrl(licenseDTO.getImageUrl());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -32,11 +32,11 @@
import com.gwtext.client.widgets.layout.FitLayout;
public class EntityWorkspace {
- private static final String ENTITY_TITLE = "k-entity-title";
- private static final String ENTITY_SUBTITLE = "k-entity-subtitle";
- private static final String ENTITY_BOTTOM = "k-entity-bottom";
- private static final String ENTITY_CONTENT = "k-entity-content";
- private static final String ENTITY_CONTEXT = "k-entity-context";
+ public static final String ENTITY_TITLE = "k-entity-title";
+ public static final String ENTITY_SUBTITLE = "k-entity-subtitle";
+ public static final String ENTITY_BOTTOM = "k-entity-bottom";
+ public static final String ENTITY_CONTENT = "k-entity-content";
+ public static final String ENTITY_CONTEXT = "k-entity-context";
private final Panel content;
private final Panel context;
private final SimpleToolbar title;
@@ -71,14 +71,14 @@
bottomPanel.setLayout(new AnchorLayout());
title = new SimpleToolbar();
- title.setHeight("" + (WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2));
+ title.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2);
title.setStylePrimaryName(ENTITY_TITLE);
// title.ensureDebugId(ENTITY_TITLE);
subTitle = new SimpleToolbar();
subTitle.setStylePrimaryName(ENTITY_SUBTITLE);
// subTitle.ensureDebugId(ENTITY_SUBTITLE);
bottom = new SimpleToolbar();
- bottom.setHeight("" + (WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2));
+ bottom.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2);
bottom.setStylePrimaryName(ENTITY_BOTTOM);
bottom.ensureDebugId(ENTITY_BOTTOM);
@@ -89,7 +89,6 @@
titles.add(subTitle, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT));
bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT));
titles.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 2);
- bottomPanel.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT + 2);
final Panel contentWrap = new Panel();
final Panel contextWrap = new Panel();
@@ -136,7 +135,7 @@
mainAnchorLayout.add(titles, new AnchorLayoutData("100%"));
mainAnchorLayout.add(cntCtxBorderLayout, new AnchorLayoutData("100% -"
- + ((WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 3) + 2)));
+ + ((WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 3))));
mainAnchorLayout.add(bottomPanel, new AnchorLayoutData("100%"));
mainFitPanel.add(mainAnchorLayout);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -71,4 +71,9 @@
public void removeAll() {
childPanel.clear();
}
+
+ public void setHeight(int height) {
+ mainPanel.setHeight("" + height);
+ mainPanel.setCellHeight(childPanel, "" + height);
+ }
}
\ No newline at end of file
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-10-30 17:13:18 UTC (rev 937)
@@ -366,6 +366,15 @@
<mapping>
<class-a>
+ org.ourproject.kune.platf.client.dto.RateResultDTO
+ </class-a>
+ <class-b>
+ org.ourproject.kune.platf.server.domain.RateResult
+ </class-b>
+ </mapping>
+
+ <mapping>
+ <class-a>
org.ourproject.kune.platf.server.domain.Comment
</class-a>
<class-b>
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -73,6 +73,54 @@
@SuppressWarnings("unchecked")
@Test
+ public void oneBeforeStateChangeListenerAddAndRemove() {
+ BeforeStateChangeListener listener1 = Mockito.mock(BeforeStateChangeListener.class);
+ BeforeStateChangeListener listener2 = Mockito.mock(BeforeStateChangeListener.class);
+ String newToken = "something";
+ Mockito.stub(listener1.beforeChange(newToken)).toReturn(false);
+ Mockito.stub(listener2.beforeChange(newToken)).toReturn(false);
+ stateManager.addBeforeStateChangeListener(listener1);
+ stateManager.addBeforeStateChangeListener(listener2);
+ stateManager.removeBeforeStateChangeListener(listener1);
+ stateManager.removeBeforeStateChangeListener(listener2);
+ stateManager.onHistoryChanged(newToken);
+ Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerReturnFalse() {
+ BeforeStateChangeListener listener1 = Mockito.mock(BeforeStateChangeListener.class);
+ BeforeStateChangeListener listener2 = Mockito.mock(BeforeStateChangeListener.class);
+ String newToken = "something";
+ Mockito.stub(listener1.beforeChange(newToken)).toReturn(true);
+ Mockito.stub(listener2.beforeChange(newToken)).toReturn(false);
+ stateManager.addBeforeStateChangeListener(listener1);
+ stateManager.addBeforeStateChangeListener(listener2);
+ stateManager.onHistoryChanged(newToken);
+ Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void oneBeforeStateChangeListenerReturnTrue() {
+ BeforeStateChangeListener listener1 = Mockito.mock(BeforeStateChangeListener.class);
+ BeforeStateChangeListener listener2 = Mockito.mock(BeforeStateChangeListener.class);
+ String newToken = "something";
+ Mockito.stub(listener1.beforeChange(newToken)).toReturn(true);
+ Mockito.stub(listener2.beforeChange(newToken)).toReturn(true);
+ stateManager.addBeforeStateChangeListener(listener1);
+ stateManager.addBeforeStateChangeListener(listener2);
+ stateManager.onHistoryChanged(newToken);
+ Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
+ (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
public void siteTokenFirstLoadDefContentAndFireListener() {
final Listener listener = Mockito.mock(Listener.class);
final String token = SiteToken.signin.toString();
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -12,7 +12,6 @@
@Test
public void testEntityLogoUpload() throws Exception {
- setMustStopFinally(false);
openDefPage();
signIn();
setLogo("kune-logo-400px.png");
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManagerTest.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -4,8 +4,6 @@
import java.io.File;
-import net.sf.json.JSONObject;
-
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -14,7 +12,6 @@
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.integration.IntegrationTestHelper;
import org.ourproject.kune.platf.integration.content.ContentServiceIntegrationTest;
-import org.ourproject.kune.workspace.client.entitylogo.EntityLogoView;
import com.google.inject.Inject;
@@ -38,8 +35,9 @@
@Ignore
public void testErrorResponse() {
- JSONObject expected = JSONObject.fromObject("{\"success\":false,\"errors\":[{\"id\":\""
- + EntityLogoView.LOGO_FORM_FIELD + "\",\"msg\":\"Some message\"}]}");
+ // JSONObject expected =
+ // JSONObject.fromObject("{\"success\":false,\"errors\":[{\"id\":\""
+ // + EntityLogoView.LOGO_FORM_FIELD + "\",\"msg\":\"Some message\"}]}");
// assertEquals(expected, manager.createJsonResponse(false,
// "Some message"));
}
@@ -51,7 +49,8 @@
@Ignore
public void testSuccessResponse() {
- JSONObject expected = JSONObject.fromObject("{\"success\":true,\"errors\":[{}]}");
+ // JSONObject expected =
+ // JSONObject.fromObject("{\"success\":true,\"errors\":[{}]}");
// assertEquals(expected, manager.createJsonResponse(true, null));
}
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2008-10-30 01:18:32 UTC (rev 936)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2008-10-30 17:13:18 UTC (rev 937)
@@ -1,110 +1,127 @@
package org.ourproject.kune.workspace.client.editor;
-import org.easymock.EasyMock;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Before;
-import org.junit.Ignore;
+import org.junit.Test;
import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import com.calclab.suco.testing.listener.MockListener;
+import com.calclab.suco.testing.listener.MockListener0;
+
public class TextEditorPresenterTest {
private TextEditorPresenter presenter;
private TextEditorView view;
+ private MockListener<String> saveListener;
+ private MockListener0 cancelListener;
+ @SuppressWarnings("unchecked")
+ private ActionToolbar toolbar;
+ private StateManager stateManager;
+ @SuppressWarnings("unchecked")
@Before
public void createObjects() {
I18nUITranslationService i18n = Mockito.mock(I18nUITranslationService.class);
- // ActionToolbar toolbar = Mockito.mock(ActionToolbar.class);
- presenter = new TextEditorPresenter(true, null, i18n);
- view = EasyMock.createStrictMock(TextEditorView.class);
+ stateManager = Mockito.mock(StateManager.class);
+ toolbar = Mockito.mock(ActionToolbar.class);
+ presenter = new TextEditorPresenter(true, toolbar, i18n, stateManager);
+ view = Mockito.mock(TextEditorView.class);
+ presenter.init(view);
+ saveListener = new MockListener<String>();
+ cancelListener = new MockListener0();
}
- @Ignore
- public void testSave() {
- viewInit();
- // view.setEnabledSaveButton(true);
- view.scheduleSave(10000);
- EasyMock.expect(view.getHTML()).andReturn("foo");
- viewReset();
- EasyMock.replay(view);
- // listener.onSave("foo");
- // EasyMock.replay(listener);
- presenter.init(view);
- presenter.onEdit();
- presenter.onSave();
+ @Test
+ public void historyChangeWithoutPendingMustAccept() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ boolean change = presenter.beforeTokenChange("somegroup");
+ assertTrue(change);
+ Mockito.verify(view, Mockito.never()).showSaveBeforeDialog();
+ Mockito.verify(toolbar, Mockito.times(1)).detach();
+ }
+
+ @Test
+ public void historyChangeWithPendingSaveAndCancelMustPosponeIt() {
+ String newToken = editAndChangeHistoryToken();
+ presenter.onCancelConfirmed();
+ assertTrue(saveListener.isNotCalled());
+ Mockito.verify(stateManager, Mockito.times(1)).gotoToken(newToken);
+ }
+
+ @Test
+ public void historyChangeWithPendingSaveMustPosponeIt() {
+ String newToken = editAndChangeHistoryToken();
+ presenter.onSaveAndClose();
presenter.onSaved();
- EasyMock.verify(view);
- // EasyMock.verify(listener);
+ assertTrue(saveListener.isCalledOnce());
+ Mockito.verify(stateManager, Mockito.times(1)).gotoToken(newToken);
}
- @Ignore
- public void testSavePending() {
- viewInit();
- // view.setEnabledSaveButton(true);
- view.scheduleSave(10000);
- EasyMock.replay(view);
- presenter.init(view);
+ @Test
+ public void initialEditWithCancel() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ presenter.onCancel();
+ assertTrue(saveListener.isNotCalled());
+ assertTrue(cancelListener.isCalledOnce());
+ }
+
+ @Test
+ public void initialEditWithEditionAndSave() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.stub(view.getHTML()).toReturn(textModified);
presenter.onEdit();
- EasyMock.verify(view);
+ presenter.onSave();
+ assertTrue(saveListener.isCalledWithEquals(textModified));
+ assertTrue(cancelListener.isNotCalled());
}
- @Ignore
- public void testSavePendingCancel() {
- viewInit();
- // view.setEnabledSaveButton(true);
- view.scheduleSave(10000);
- view.saveTimerCancel();
- view.showSaveBeforeDialog();
- EasyMock.expect(view.getHTML()).andReturn("foo");
- viewReset();
- EasyMock.replay(view);
- // listener.onSave("foo");
- // listener.onEditCancelled();
- // EasyMock.replay(listener);
- presenter.init(view);
+ @Test
+ public void initialEditWithSave() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ presenter.onSave();
+ assertTrue(saveListener.isCalledOnce());
+ assertTrue(cancelListener.isNotCalled());
+ }
+
+ @Test
+ public void testSavePendingAndCancel() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.stub(view.getHTML()).toReturn(textModified);
presenter.onEdit();
presenter.onCancel();
- presenter.onSaveAndClose();
- presenter.onSaved();
- EasyMock.verify(view);
- // EasyMock.verify(listener);
+ presenter.onCancelConfirmed();
+ assertTrue(saveListener.isNotCalled());
+ assertTrue(cancelListener.isCalledOnce());
}
- @Ignore
- public void testSavePendingCancelSaveFails() {
- viewInit();
- // view.setEnabledSaveButton(true);
- view.scheduleSave(10000);
- view.saveTimerCancel();
- view.showSaveBeforeDialog();
- EasyMock.expect(view.getHTML()).andReturn("foo");
- view.scheduleSave(20000);
- EasyMock.replay(view);
- // listener.onSave("foo");
- // EasyMock.replay(listener);
- presenter.init(view);
+ @Test
+ public void testSavePendingAndSaveFails() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ String textModified = "Text modified";
+ Mockito.stub(view.getHTML()).toReturn(textModified);
presenter.onEdit();
- presenter.onCancel();
- presenter.onSaveAndClose();
+ presenter.onSave();
presenter.onSaveFailed();
- EasyMock.verify(view);
- // EasyMock.verify(listener);
+ presenter.onSave();
+ Mockito.verify(view, Mockito.times(1)).scheduleSave(TextEditorPresenter.AUTOSAVE_IN_MILLISECONDS);
+ Mockito.verify(view, Mockito.times(1)).scheduleSave(TextEditorPresenter.AUTOSAVE_AFTER_FAILS_IN_MILLISECONS);
+ assertTrue(saveListener.isCalled(2));
}
- @Ignore
- public void testViewInitialization() {
- viewInit();
- EasyMock.replay(view);
- presenter.init(view);
- EasyMock.verify(view);
+ private String editAndChangeHistoryToken() {
+ presenter.editContent("Text to edit", saveListener, cancelListener);
+ presenter.onEdit();
+ String newToken = "somegroup";
+ boolean change = presenter.beforeTokenChange(newToken);
+ assertFalse(change);
+ Mockito.verify(view, Mockito.times(1)).showSaveBeforeDialog();
+ return newToken;
}
- private void viewInit() {
- // view.setEnabledSaveButton(false);
- view.setEnabled(true);
- }
-
- private void viewReset() {
- view.saveTimerCancel();
- // view.setEnabledSaveButton(false);
- }
}
More information about the kune-commits
mailing list