Author: vjrj Date: 2008-12-02 18:42:31 +0100 (Tue, 02 Dec 2008) New Revision: 978 Added: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeader.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderView.java Removed: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java Log: Complete - task NewGroup -> Close --> don't restore state and other fixes 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-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-12-02 17:42:31 UTC (rev 978) @@ -41,4 +41,4 @@ 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;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;} \ No newline at end of file +*/.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;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.x-toolbar-body table{width:100%;} \ 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-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-12-02 17:42:31 UTC (rev 978) @@ -814,3 +814,7 @@ background-image: url(img/emblem-system.gif) !important; } +.x-toolbar-body table { + width: 100%; +} + Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2008-12-02 17:42:31 UTC (rev 978) @@ -38,7 +38,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import com.calclab.suco.client.ioc.Provider; @@ -50,7 +50,7 @@ final Provider<ContentServiceAsync> contentServiceProvider, final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider, final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry, - final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo, + final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo, final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler, final BlogViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) { super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider, Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2008-12-02 17:42:31 UTC (rev 978) @@ -46,7 +46,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import org.ourproject.kune.workspace.client.themes.WsThemePresenter; @@ -76,7 +76,7 @@ $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class), $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class), - $(EntityLogo.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class), + $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class), $$(ContextPropEditor.class)); } }); Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-12-02 17:42:31 UTC (rev 978) @@ -38,7 +38,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import com.calclab.suco.client.ioc.Provider; @@ -50,7 +50,7 @@ final Provider<ContentServiceAsync> contentServiceProvider, final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider, final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry, - final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo, + final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo, final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler, final DocumentViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) { super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider, Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-12-02 17:42:31 UTC (rev 978) @@ -46,7 +46,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import org.ourproject.kune.workspace.client.themes.WsThemePresenter; @@ -76,7 +76,7 @@ $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class), $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class), - $(EntityLogo.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentViewer.class), + $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentViewer.class), $$(ContextPropEditor.class)); } }); Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2008-12-02 17:42:31 UTC (rev 978) @@ -37,7 +37,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import com.calclab.suco.client.ioc.Provider; @@ -49,7 +49,7 @@ final Provider<ContentServiceAsync> contentServiceProvider, final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider, final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry, - final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo, + final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo, final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler, final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) { super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider, Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java 2008-12-02 17:42:31 UTC (rev 978) @@ -46,7 +46,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import org.ourproject.kune.workspace.client.themes.WsThemePresenter; @@ -76,7 +76,7 @@ $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class), $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class), - $(EntityLogo.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(GalleryViewer.class), + $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(GalleryViewer.class), $$(ContextPropEditor.class)); } }); 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-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-12-02 17:42:31 UTC (rev 978) @@ -43,9 +43,9 @@ import org.ourproject.kune.platf.client.ui.rate.RatePanel; import org.ourproject.kune.platf.client.ui.rate.RatePresenter; import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogoPanel; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogoPresenter; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeaderPanel; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeaderPresenter; import org.ourproject.kune.workspace.client.i18n.I18nTranslator; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePanel; @@ -255,12 +255,12 @@ } }); - register(ApplicationComponentGroup.class, new Factory<EntityLogo>(EntityLogo.class) { + register(ApplicationComponentGroup.class, new Factory<EntityHeader>(EntityHeader.class) { @Override - public EntityLogo create() { - final EntityLogoPresenter presenter = new EntityLogoPresenter($(StateManager.class), + public EntityHeader create() { + final EntityHeaderPresenter presenter = new EntityHeaderPresenter($(StateManager.class), $(WsThemePresenter.class), $(Session.class)); - final EntityLogoPanel panel = new EntityLogoPanel($(WorkspaceSkeleton.class), + final EntityHeaderPanel panel = new EntityHeaderPanel($(WorkspaceSkeleton.class), $$(FileDownloadUtils.class), $(Images.class)); presenter.init(panel); return presenter; @@ -413,7 +413,7 @@ @Override public NoHomePage create() { final NoHomePagePresenter presenter = new NoHomePagePresenter($(StateManager.class), - $$(EntityLogo.class)); + $$(EntityHeader.class)); final NoHomePagePanel panel = new NoHomePagePanel(presenter, $(WorkspaceSkeleton.class), $(I18nTranslationService.class)); presenter.init(panel); @@ -425,7 +425,7 @@ @Override public EntityOptions create() { final EntityOptionsPresenter presenter = new EntityOptionsPresenter($(StateManager.class)); - final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, $(EntityLogo.class), + final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, $(EntityHeader.class), $(I18nTranslationService.class), $(Images.class), $(EntityOptionsGroup.class)); presenter.init(panel); return presenter; @@ -449,7 +449,7 @@ @Override public EntityOptionsLogo create() { final EntityOptionsLogoPresenter presenter = new EntityOptionsLogoPresenter($(Session.class), - $(EntityLogo.class), $(EntityOptions.class), $(StateManager.class)); + $(EntityHeader.class), $(EntityOptions.class), $(StateManager.class)); final EntityOptionsLogoPanel panel = new EntityOptionsLogoPanel(presenter, $(WorkspaceSkeleton.class), $(I18nTranslationService.class)); presenter.init(panel); Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2008-12-02 17:42:31 UTC (rev 978) @@ -37,7 +37,7 @@ import org.ourproject.kune.platf.server.domain.BasicMimeType; import org.ourproject.kune.platf.server.domain.Group; import org.ourproject.kune.platf.server.manager.GroupManager; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogoView; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeaderView; import com.google.inject.Inject; import com.wideplay.warp.persist.TransactionType; @@ -75,7 +75,7 @@ File tmpDestFile = File.createTempFile("logoDest", ""); boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(), tmpDestFile.getAbsolutePath(), - EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT); + EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT); if (result) { group.setLogo(FileUtils.getBytesFromFile(tmpDestFile)); group.setLogoMime(mimeType); @@ -125,7 +125,7 @@ protected String createXmlResponse(final boolean success, final String message) { String error = ""; if (!success) { - error = "<errors><field><id>" + EntityLogoView.LOGO_FORM_FIELD + "</id><msg><![CDATA[" + message + error = "<errors><field><id>" + EntityHeaderView.LOGO_FORM_FIELD + "</id><msg><![CDATA[" + message + "]]></msg></field></errors>"; } return "<response success=\"" + success + "\">" + error + "</response>"; Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2008-12-02 17:42:31 UTC (rev 978) @@ -38,7 +38,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import com.calclab.suco.client.ioc.Provider; @@ -50,7 +50,7 @@ final Provider<ContentServiceAsync> contentServiceProvider, final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider, final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry, - final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo, + final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo, final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler, final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) { super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider, Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java 2008-12-02 17:42:31 UTC (rev 978) @@ -46,7 +46,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import org.ourproject.kune.workspace.client.themes.WsThemePresenter; @@ -76,7 +76,7 @@ $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class), $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class), - $(EntityLogo.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(WikiViewer.class), + $(EntityHeader.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(WikiViewer.class), $$(ContextPropEditor.class)); } }); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2008-12-02 17:42:31 UTC (rev 978) @@ -33,7 +33,7 @@ import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; import org.ourproject.kune.workspace.client.editor.TextEditor; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; import org.ourproject.kune.workspace.client.site.Site; @@ -63,7 +63,7 @@ protected final Provider<ContextPropEditor> contextPropEditorProvider; protected final FoldableContent foldableContent; protected final DeferredCommandWrapper deferredCommandWrapper; - protected final EntityLogo entityLogo; + protected final EntityHeader entityLogo; public AbstractFoldableContentActions(Session session, StateManager stateManager, I18nUITranslationService i18n, KuneErrorHandler errorHandler, DeferredCommandWrapper deferredCommandWrapper, @@ -72,7 +72,7 @@ ContentActionRegistry contentActionRegistry, ContextActionRegistry contextActionRegistry, Provider<FileDownloadUtils> fileDownloadProvider, Provider<TextEditor> textEditorProvider, Provider<ContextPropEditor> contextPropEditorProvider, FoldableContent foldableContent, - EntityLogo entityLogo) { + EntityHeader entityLogo) { this.session = session; this.stateManager = stateManager; this.i18n = i18n; Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeader.java (from rev 977, trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeader.java 2008-12-02 17:42:31 UTC (rev 978) @@ -0,0 +1,37 @@ +/* + * + * 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.workspace.client.entitylogo; + +import org.ourproject.kune.platf.client.View; + +public interface EntityHeader { + + void addWidget(View widget); + + /** + * Refresh the logo from the group info in the client session + */ + void refreshGroupLogo(); + + /** + * Reload the logo from the group reloaded from the server + */ + void reloadGroupLogoImage(); + +} \ No newline at end of file Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeader.java ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPanel.java (from rev 977, trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPanel.java 2008-12-02 17:42:31 UTC (rev 978) @@ -0,0 +1,117 @@ +/* + * + * 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.workspace.client.entitylogo; + +import java.util.Date; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.dto.StateToken; +import org.ourproject.kune.platf.client.services.Images; +import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils; +import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; +import org.ourproject.kune.workspace.client.themes.WsTheme; + +import com.calclab.suco.client.ioc.Provider; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Image; +import com.google.gwt.user.client.ui.VerticalPanel; +import com.google.gwt.user.client.ui.Widget; + +public class EntityHeaderPanel extends HorizontalPanel implements EntityHeaderView { + + private final Provider<FileDownloadUtils> downloadProvider; + private final EntityTextLogo entityTextLogo; + private final Images images; + private final VerticalPanel vp; + + public EntityHeaderPanel(final WorkspaceSkeleton ws, final Provider<FileDownloadUtils> dowloadProvider, Images images) { + this.downloadProvider = dowloadProvider; + this.images = images; + vp = new VerticalPanel(); + vp.setWidth("100%"); + super.setWidth("100%"); + vp.setHorizontalAlignment(ALIGN_RIGHT); + entityTextLogo = new EntityTextLogo(); + add(entityTextLogo); + add(vp); + ws.addToEntityMainHeader(this); + } + + public void addWidget(View view) { + Widget widget = (Widget) view; + vp.add(widget); + vp.setCellWidth(widget, "100%"); + } + + public void reloadImage(GroupDTO group) { + entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache=" + + new Date().getTime()); + } + + public void setFullLogo(final StateToken stateToken, final boolean clipped) { + clear(); + final String imageUrl = downloadProvider.get().getImageUrl(stateToken); + Image logo; + if (clipped) { + logo = new Image(imageUrl, 0, 0, LOGO_ICON_DEFAULT_WIDTH, LOGO_ICON_DEFAULT_HEIGHT); + } else { + logo = new Image(imageUrl); + logo.setWidth("" + LOGO_ICON_DEFAULT_WIDTH); + logo.setHeight("" + LOGO_ICON_DEFAULT_HEIGHT); + } + add(logo); + } + + public void setLargeFont() { + entityTextLogo.setLargeFont(); + } + + public void setLogoImage(StateToken stateToken) { + entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(stateToken)); + } + + public void setLogoImageVisible(boolean visible) { + entityTextLogo.setLogoVisible(visible); + } + + public void setLogoText(final String groupName) { + entityTextLogo.setLogoText(groupName); + } + + public void setMediumFont() { + entityTextLogo.setMediumFont(); + } + + public void setSmallFont() { + entityTextLogo.setSmallFont(); + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + if (oldTheme != null) { + entityTextLogo.removeStyleDependentName(oldTheme.toString()); + } + entityTextLogo.addStyleDependentName(newTheme.toString()); + } + + public void showDefUserLogo() { + entityTextLogo.setLogoImage(images.personAvatarDef()); + } +} Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPanel.java ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPresenter.java (from rev 977, trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPresenter.java 2008-12-02 17:42:31 UTC (rev 978) @@ -0,0 +1,100 @@ +/* + * + * 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.workspace.client.entitylogo; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.ContentSimpleDTO; +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.dto.GroupType; +import org.ourproject.kune.platf.client.state.Session; +import org.ourproject.kune.platf.client.state.StateManager; +import org.ourproject.kune.workspace.client.themes.WsTheme; +import org.ourproject.kune.workspace.client.themes.WsThemePresenter; + +import com.calclab.suco.client.listener.Listener2; + +public class EntityHeaderPresenter implements EntityHeader { + int GROUP_MEDIUM_NAME_LIMIT_SIZE = 90; + int GROUP_LARGE_NAME_LIMIT_SIZE = 20; + + private EntityHeaderView view; + private final Session session; + + public EntityHeaderPresenter(final StateManager stateManager, final WsThemePresenter theme, final Session session) { + this.session = session; + + stateManager.onGroupChanged(new Listener2<String, String>() { + public void onEvent(final String oldGroup, final String newGroup) { + setGroupLogo(session.getCurrentState().getGroup()); + } + }); + theme.onThemeChanged(new Listener2<WsTheme, WsTheme>() { + public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } + }); + } + + public void addWidget(View widget) { + view.addWidget(widget); + } + + public void init(final EntityHeaderView view) { + this.view = view; + } + + public void refreshGroupLogo() { + setGroupLogo(session.getCurrentState().getGroup()); + } + + public void reloadGroupLogoImage() { + view.reloadImage(session.getCurrentState().getGroup()); + } + + void setGroupLogo(final GroupDTO group) { + final ContentSimpleDTO groupFullLogo = group.getGroupFullLogo(); + if (groupFullLogo != null) { + view.setFullLogo(groupFullLogo.getStateToken(), true); + } else if (group.hasLogo()) { + setLogoText(group.getLongName()); + view.setLogoImage(group.getStateToken()); + view.setLogoImageVisible(true); + } else { + setLogoText(group.getLongName()); + if (group.getGroupType().equals(GroupType.PERSONAL)) { + view.showDefUserLogo(); + view.setLogoImageVisible(true); + } else { + view.setLogoImageVisible(false); + } + } + } + + void setLogoText(String name) { + int length = name.length(); + if (length <= GROUP_LARGE_NAME_LIMIT_SIZE) { + view.setLargeFont(); + } else if (length <= GROUP_MEDIUM_NAME_LIMIT_SIZE) { + view.setMediumFont(); + } else { + view.setSmallFont(); + } + view.setLogoText(name); + } +} Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderPresenter.java ___________________________________________________________________ Name: svn:mergeinfo + Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderView.java (from rev 977, trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderView.java 2008-12-02 17:42:31 UTC (rev 978) @@ -0,0 +1,57 @@ +/* + * + * 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.workspace.client.entitylogo; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.GroupDTO; +import org.ourproject.kune.platf.client.dto.StateToken; +import org.ourproject.kune.workspace.client.themes.WsTheme; + +public interface EntityHeaderView { + + int LOGO_ICON_DEFAULT_HEIGHT = 60; + int LOGO_ICON_DEFAULT_WIDTH = 468; + + int LOGO_ICON_MIN_HEIGHT = 28; + int LOGO_ICON_MIN_WIDTH = 468; + + String LOGO_FORM_FIELD = "k-elogov-ff"; + + void addWidget(View view); + + void reloadImage(GroupDTO group); + + void setFullLogo(StateToken stateToken, boolean clipped); + + void setLargeFont(); + + void setLogoImage(StateToken stateToken); + + void setLogoImageVisible(boolean visible); + + void setLogoText(final String groupName); + + void setMediumFont(); + + void setSmallFont(); + + void setTheme(final WsTheme oldTheme, WsTheme newTheme); + + void showDefUserLogo(); +} Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityHeaderView.java ___________________________________________________________________ Name: svn:mergeinfo + Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java 2008-12-02 17:42:31 UTC (rev 978) @@ -1,37 +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.workspace.client.entitylogo; - -import org.ourproject.kune.platf.client.View; - -public interface EntityLogo { - - void addWidget(View widget); - - /** - * Refresh the logo from the group info in the client session - */ - void refreshGroupLogo(); - - /** - * Reload the logo from the group reloaded from the server - */ - void reloadGroupLogoImage(); - -} \ No newline at end of file Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-12-02 17:42:31 UTC (rev 978) @@ -1,117 +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.workspace.client.entitylogo; - -import java.util.Date; - -import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.dto.StateToken; -import org.ourproject.kune.platf.client.services.Images; -import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils; -import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; -import org.ourproject.kune.workspace.client.themes.WsTheme; - -import com.calclab.suco.client.ioc.Provider; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.Image; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwt.user.client.ui.Widget; - -public class EntityLogoPanel extends HorizontalPanel implements EntityLogoView { - - private final Provider<FileDownloadUtils> downloadProvider; - private final EntityTextLogo entityTextLogo; - private final Images images; - private final VerticalPanel vp; - - public EntityLogoPanel(final WorkspaceSkeleton ws, final Provider<FileDownloadUtils> dowloadProvider, Images images) { - this.downloadProvider = dowloadProvider; - this.images = images; - vp = new VerticalPanel(); - vp.setWidth("100%"); - super.setWidth("100%"); - vp.setHorizontalAlignment(ALIGN_RIGHT); - entityTextLogo = new EntityTextLogo(); - add(entityTextLogo); - add(vp); - ws.addToEntityMainHeader(this); - } - - public void addWidget(View view) { - Widget widget = (Widget) view; - vp.add(widget); - vp.setCellWidth(widget, "100%"); - } - - public void reloadImage(GroupDTO group) { - entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache=" - + new Date().getTime()); - } - - public void setFullLogo(final StateToken stateToken, final boolean clipped) { - clear(); - final String imageUrl = downloadProvider.get().getImageUrl(stateToken); - Image logo; - if (clipped) { - logo = new Image(imageUrl, 0, 0, LOGO_ICON_DEFAULT_WIDTH, LOGO_ICON_DEFAULT_HEIGHT); - } else { - logo = new Image(imageUrl); - logo.setWidth("" + LOGO_ICON_DEFAULT_WIDTH); - logo.setHeight("" + LOGO_ICON_DEFAULT_HEIGHT); - } - add(logo); - } - - public void setLargeFont() { - entityTextLogo.setLargeFont(); - } - - public void setLogoImage(StateToken stateToken) { - entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(stateToken)); - } - - public void setLogoImageVisible(boolean visible) { - entityTextLogo.setLogoVisible(visible); - } - - public void setLogoText(final String groupName) { - entityTextLogo.setLogoText(groupName); - } - - public void setMediumFont() { - entityTextLogo.setMediumFont(); - } - - public void setSmallFont() { - entityTextLogo.setSmallFont(); - } - - public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { - if (oldTheme != null) { - entityTextLogo.removeStyleDependentName(oldTheme.toString()); - } - entityTextLogo.addStyleDependentName(newTheme.toString()); - } - - public void showDefUserLogo() { - entityTextLogo.setLogoImage(images.personAvatarDef()); - } -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-12-02 17:42:31 UTC (rev 978) @@ -1,100 +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.workspace.client.entitylogo; - -import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dto.ContentSimpleDTO; -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.dto.GroupType; -import org.ourproject.kune.platf.client.state.Session; -import org.ourproject.kune.platf.client.state.StateManager; -import org.ourproject.kune.workspace.client.themes.WsTheme; -import org.ourproject.kune.workspace.client.themes.WsThemePresenter; - -import com.calclab.suco.client.listener.Listener2; - -public class EntityLogoPresenter implements EntityLogo { - int GROUP_MEDIUM_NAME_LIMIT_SIZE = 90; - int GROUP_LARGE_NAME_LIMIT_SIZE = 20; - - private EntityLogoView view; - private final Session session; - - public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme, final Session session) { - this.session = session; - - stateManager.onGroupChanged(new Listener2<String, String>() { - public void onEvent(final String oldGroup, final String newGroup) { - setGroupLogo(session.getCurrentState().getGroup()); - } - }); - theme.onThemeChanged(new Listener2<WsTheme, WsTheme>() { - public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) { - view.setTheme(oldTheme, newTheme); - } - }); - } - - public void addWidget(View widget) { - view.addWidget(widget); - } - - public void init(final EntityLogoView view) { - this.view = view; - } - - public void refreshGroupLogo() { - setGroupLogo(session.getCurrentState().getGroup()); - } - - public void reloadGroupLogoImage() { - view.reloadImage(session.getCurrentState().getGroup()); - } - - void setGroupLogo(final GroupDTO group) { - final ContentSimpleDTO groupFullLogo = group.getGroupFullLogo(); - if (groupFullLogo != null) { - view.setFullLogo(groupFullLogo.getStateToken(), true); - } else if (group.hasLogo()) { - setLogoText(group.getLongName()); - view.setLogoImage(group.getStateToken()); - view.setLogoImageVisible(true); - } else { - setLogoText(group.getLongName()); - if (group.getGroupType().equals(GroupType.PERSONAL)) { - view.showDefUserLogo(); - view.setLogoImageVisible(true); - } else { - view.setLogoImageVisible(false); - } - } - } - - void setLogoText(String name) { - int length = name.length(); - if (length <= GROUP_LARGE_NAME_LIMIT_SIZE) { - view.setLargeFont(); - } else if (length <= GROUP_MEDIUM_NAME_LIMIT_SIZE) { - view.setMediumFont(); - } else { - view.setSmallFont(); - } - view.setLogoText(name); - } -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-12-02 17:42:31 UTC (rev 978) @@ -1,57 +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.workspace.client.entitylogo; - -import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dto.GroupDTO; -import org.ourproject.kune.platf.client.dto.StateToken; -import org.ourproject.kune.workspace.client.themes.WsTheme; - -public interface EntityLogoView { - - int LOGO_ICON_DEFAULT_HEIGHT = 60; - int LOGO_ICON_DEFAULT_WIDTH = 468; - - int LOGO_ICON_MIN_HEIGHT = 28; - int LOGO_ICON_MIN_WIDTH = 468; - - String LOGO_FORM_FIELD = "k-elogov-ff"; - - void addWidget(View view); - - void reloadImage(GroupDTO group); - - void setFullLogo(StateToken stateToken, boolean clipped); - - void setLargeFont(); - - void setLogoImage(StateToken stateToken); - - void setLogoImageVisible(boolean visible); - - void setLogoText(final String groupName); - - void setMediumFont(); - - void setSmallFont(); - - void setTheme(final WsTheme oldTheme, WsTheme newTheme); - - void showDefUserLogo(); -} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePresenter.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/NoHomePagePresenter.java 2008-12-02 17:42:31 UTC (rev 978) @@ -22,7 +22,7 @@ import org.ourproject.kune.platf.client.dto.StateAbstractDTO; import org.ourproject.kune.platf.client.dto.StateNoContentDTO; import org.ourproject.kune.platf.client.state.StateManager; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import com.calclab.suco.client.ioc.Provider; import com.calclab.suco.client.listener.Listener; @@ -31,7 +31,7 @@ private NoHomePageView view; - public NoHomePagePresenter(final StateManager stateManager, final Provider<EntityLogo> entityLogoProvider) { + public NoHomePagePresenter(final StateManager stateManager, final Provider<EntityHeader> entityLogoProvider) { stateManager.onStateChanged(new Listener<StateAbstractDTO>() { public void onEvent(StateAbstractDTO state) { if (state instanceof StateNoContentDTO) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java 2008-12-02 17:42:31 UTC (rev 978) @@ -67,7 +67,7 @@ } public void setFirstTabActive() { - tabPanel.setActiveTab(1); + tabPanel.setActiveTab(0); } public void setIconCls(String iconCls) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2008-12-02 17:42:31 UTC (rev 978) @@ -7,7 +7,7 @@ import org.ourproject.kune.platf.client.services.Images; import org.ourproject.kune.platf.client.ui.IconLabel; import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.ui.AbstractImagePrototype; @@ -26,13 +26,13 @@ public static final String GROUP_OPTIONS_ID = "k-gop-panel"; public static final String GROUP_OPTIONS_ICON = "k-gop-icon"; private final I18nTranslationService i18n; - private final EntityLogo entityHeader; + private final EntityHeader entityHeader; private EntityOptionPushButton optionsButton; private final Images images; private final EntityOptionsGroup entityPreferencesGroup; - public EntityOptionsPanel(final EntityOptionsPresenter presenter, final EntityLogo entityHeader, + public EntityOptionsPanel(final EntityOptionsPresenter presenter, final EntityHeader entityHeader, I18nTranslationService i18n, Images images, EntityOptionsGroup entityOptionsGroup) { super("", 400, 250, 400, 250, images, GROUP_OPTIONS_ID, GROUP_OPTIONS_ERROR_ID); this.entityHeader = entityHeader; Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2008-12-02 17:42:31 UTC (rev 978) @@ -21,7 +21,7 @@ import org.ourproject.kune.platf.client.PlatfMessages; import org.ourproject.kune.platf.client.services.I18nTranslationService; import org.ourproject.kune.platf.client.ui.download.FileParams; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogoView; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeaderView; import org.ourproject.kune.workspace.client.site.Site; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; @@ -78,14 +78,14 @@ }); dialogInfoLabel = new Label(); super.add(dialogInfoLabel); - file = new TextField("File", EntityLogoView.LOGO_FORM_FIELD); + file = new TextField("File", EntityHeaderView.LOGO_FORM_FIELD); EventCallback keyListener = new EventCallback() { public void execute(EventObject e) { // setEnableFileField(); } }; file.addKeyPressListener(keyListener); - file.setId(EntityLogoView.LOGO_FORM_FIELD); + file.setId(EntityHeaderView.LOGO_FORM_FIELD); file.setInputType("file"); userhashField = new Hidden(FileParams.HASH, FileParams.HASH); tokenField = new Hidden(FileParams.TOKEN, FileParams.TOKEN); @@ -133,7 +133,7 @@ public void setNormalGroupsLabels() { dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as the logo for this group. " + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.", - EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT, EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT) + EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT, EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT) + "<br/><br/>"); super.setTitle(PlatfMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE); doLayoutIfNeeded(); @@ -142,7 +142,7 @@ public void setPersonalGroupsLabels() { dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as your avatar. " + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.", - EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT, EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT) + EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT, EntityHeaderView.LOGO_ICON_DEFAULT_HEIGHT) + "<br/><br/>"); super.setTitle(PlatfMessages.ENT_LOGO_SELECTOR_PERSON_TITLE); doLayoutIfNeeded(); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2008-12-02 17:42:31 UTC (rev 978) @@ -21,7 +21,7 @@ import org.ourproject.kune.platf.client.View; import org.ourproject.kune.platf.client.state.Session; import org.ourproject.kune.platf.client.state.StateManager; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogo; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeader; import org.ourproject.kune.workspace.client.options.EntityOptions; import org.ourproject.kune.workspace.client.site.Site; @@ -31,10 +31,10 @@ private EntityOptionsLogoView view; private final Session session; - private final EntityLogo entityLogo; + private final EntityHeader entityLogo; private final EntityOptions entityOptions; - public EntityOptionsLogoPresenter(Session session, EntityLogo entityLogo, EntityOptions entityOptions, + public EntityOptionsLogoPresenter(Session session, EntityHeader entityLogo, EntityOptions entityOptions, StateManager stateManager) { this.session = session; this.entityLogo = entityLogo; 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-12-02 17:08:38 UTC (rev 977) +++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2008-12-02 17:42:31 UTC (rev 978) @@ -4,7 +4,7 @@ import java.io.IOException; import org.junit.Test; -import org.ourproject.kune.workspace.client.entitylogo.EntityLogoView; +import org.ourproject.kune.workspace.client.entitylogo.EntityHeaderView; import org.ourproject.kune.workspace.client.options.EntityOptionsPanel; import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel; @@ -24,7 +24,7 @@ // PlatfMessages.ENT_OPTIONS_GROUP_TITLE); click(EntityOptionsLogoPanel.SET_LOGO_ID); File dir = new File("."); - type(EntityLogoView.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator + type(EntityHeaderView.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator + filename); click(EntityOptionsLogoPanel.SET_LOGO_ID); } Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java =================================================================== --- trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java 2008-12-02 17:08:38 UTC (rev 977) +++ trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java 2008-12-02 17:42:31 UTC (rev 978) @@ -14,16 +14,16 @@ private StateManager stateManager; private Session session; - private EntityLogoPresenter entityLogoPresenter; - private EntityLogoView view; + private EntityHeaderPresenter entityLogoPresenter; + private EntityHeaderView view; @Before public void before() { stateManager = Mockito.mock(StateManager.class); session = Mockito.mock(Session.class); WsThemePresenter theme = Mockito.mock(WsThemePresenter.class); - entityLogoPresenter = new EntityLogoPresenter(stateManager, theme, session); - view = Mockito.mock(EntityLogoView.class); + entityLogoPresenter = new EntityHeaderPresenter(stateManager, theme, session); + view = Mockito.mock(EntityHeaderView.class); entityLogoPresenter.init(view); }