[kune-commits] r1806 - in trunk/src: main/java/cc/kune/chat/client main/java/cc/kune/core/client/sitebar main/java/cc/kune/core/public main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/armor main/java/cc/kune/gspace/client/armor/impl main/java/cc/kune/gspace/client/maxmin main/java/cc/kune/gspace/client/viewers main/java/cc/kune/wave/client main/java/com/example/client main/webapp test/java/cc/kune/gspace/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Thu Mar 29 03:36:04 CEST 2012


Author: vjrj_
Date: 2012-03-29 03:36:02 +0200 (Thu, 29 Mar 2012)
New Revision: 1806

Added:
   trunk/src/main/java/cc/kune/gspace/client/maxmin/
   trunk/src/main/java/cc/kune/gspace/client/maxmin/IsMaximizable.java
   trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspace.java
   trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePanel.java
   trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePresenter.java
   trunk/src/test/java/cc/kune/gspace/client/maxmin/
Modified:
   trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
   trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActions.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
   trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java
   trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
   trunk/src/main/java/cc/kune/wave/client/WaveClientView.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
   trunk/src/main/java/cc/kune/wave/client/WebClient.java
   trunk/src/main/java/cc/kune/wave/client/WebClientMock.java
   trunk/src/main/java/com/example/client/HelloWorldActions.java
   trunk/src/main/webapp/ws.html
Log:
CLOSED - # 212: Maximize/minimize action for small screen PCs 
http://kune.ourproject.org/issues/ticket/212

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -249,7 +249,7 @@
   private void createActionIfNeeded() {
     if (chatIcon == null) {
       chatIcon = new IconLabelDescriptor(action);
-      chatIcon.setParent(siteActions.getLeftToolbar());
+      chatIcon.setParent(SitebarActions.LEFT_TOOLBAR);
       chatIcon.setId(CHAT_CLIENT_ICON_ID);
       chatIcon.setStyles("k-no-backimage, k-btn-sitebar, k-chat-icon");
       chatIcon.putValue(Action.NAME, i18n.t(CHAT_TITLE));
@@ -259,9 +259,9 @@
       shorcutRegister.put(shortcut, action);
       action.setShortcut(shortcut);
       chatIcon.setVisible(session.isLogged());
-      ToolbarSeparatorDescriptor.build(Type.spacer, siteActions.getLeftToolbar());
-      ToolbarSeparatorDescriptor.build(Type.spacer, siteActions.getLeftToolbar());
-      ToolbarSeparatorDescriptor.build(Type.spacer, siteActions.getLeftToolbar());
+      ToolbarSeparatorDescriptor.build(Type.spacer, SitebarActions.LEFT_TOOLBAR);
+      ToolbarSeparatorDescriptor.build(Type.spacer, SitebarActions.LEFT_TOOLBAR);
+      ToolbarSeparatorDescriptor.build(Type.spacer, SitebarActions.LEFT_TOOLBAR);
     }
   }
 

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/MyGroupsMenu.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -63,7 +63,7 @@
     this.siteOptions = siteOptions;
     menuShowAction.setMenu(this);
     setId(MENU_ID);
-    setParent(siteOptions.getRightToolbar());
+    setParent(SitebarActions.RIGHT_TOOLBAR);
     setStyles("k-no-backimage, k-btn-sitebar");
     this.downloadProvider = downloadProvider;
     this.gotoGroupAction = gotoGroupAction;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -97,10 +97,10 @@
 
   private void createActions() {
     LOGGED_USER_MENU.setId(LOGGED_USER_MENU_ID);
-    LOGGED_USER_MENU.setParent(siteOptions.getRightToolbar());
+    LOGGED_USER_MENU.setParent(SitebarActions.RIGHT_TOOLBAR);
     LOGGED_USER_MENU.setStyles("k-no-backimage, k-btn-sitebar");
     LOGGED_USER_MENU.setRightIcon(res.arrowdownsitebar());
-    separator = new ToolbarSeparatorDescriptor(Type.separator, siteOptions.getRightToolbar());
+    separator = new ToolbarSeparatorDescriptor(Type.separator, SitebarActions.RIGHT_TOOLBAR);
 
     final AbstractExtendedAction userHomeAction = new AbstractExtendedAction() {
       @Override

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActions.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActions.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -19,13 +19,15 @@
  */
 package cc.kune.core.client.sitebar;
 
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
 import cc.kune.common.client.actions.ui.descrip.ToolbarDescriptor;
 
 public interface SitebarActions {
 
-  ToolbarDescriptor getLeftToolbar();
+  static final ToolbarDescriptor LEFT_TOOLBAR = new ToolbarDescriptor();
+  static final MenuDescriptor MORE_MENU = new MenuDescriptor();
 
-  ToolbarDescriptor getRightToolbar();
+  static final ToolbarDescriptor RIGHT_TOOLBAR = new ToolbarDescriptor();
 
   void refreshActions();
 

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -27,7 +27,6 @@
 import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuSeparatorDescriptor;
-import cc.kune.common.client.actions.ui.descrip.ToolbarDescriptor;
 import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor;
 import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor.Type;
 import cc.kune.common.client.resources.CommonResources;
@@ -64,9 +63,7 @@
 
     void showErrorDialog();
   }
-  private static final ToolbarDescriptor LEFT_TOOLBAR = new ToolbarDescriptor();
-  private static final MenuDescriptor MORE_MENU = new MenuDescriptor();
-  private static final ToolbarDescriptor RIGHT_TOOLBAR = new ToolbarDescriptor();
+
   public static final String SITE_OPTIONS_MENU = "kune-sop-om";
   private final CommonResources commonRes;
   private final I18nTranslationService i18n;
@@ -105,20 +102,10 @@
     return gotoKuneDevSite;
   }
 
-  @Override
-  public ToolbarDescriptor getLeftToolbar() {
-    return LEFT_TOOLBAR;
-  }
-
   public MenuDescriptor getOptionsMenu() {
     return MORE_MENU;
   }
 
-  @Override
-  public ToolbarDescriptor getRightToolbar() {
-    return RIGHT_TOOLBAR;
-  }
-
   private void init() {
     MORE_MENU.withId(SITE_OPTIONS_MENU);
   }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -65,7 +65,7 @@
     super(newGroupAction);
     this.session = session;
     withId(NEW_GROUP_BTN_ID).withStyles("k-no-backimage, k-btn-sitebar, k-fl, k-noborder, k-nobackcolor");
-    withParent(sitebarActions.getRightToolbar());
+    withParent(SitebarActions.RIGHT_TOOLBAR);
     eventBus.addHandler(MyGroupsChangedEvent.getType(),
         new MyGroupsChangedEvent.MyGroupsChangedHandler() {
           @Override

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -65,15 +65,15 @@
 
   @Inject
   public SitebarSignInLink(final SitebarSignInAction action, final EventBus eventBus,
-      final Session session, final SitebarActions sitebarActions) {
+      final Session session) {
     super(action);
     // setParent(SitebarActionsPresenter.RIGHT_TOOLBAR);
     setId(SITE_SIGN_IN);
     setVisible(!session.isLogged());
     setStyles("k-no-backimage, k-btn-sitebar, k-fl, k-noborder, k-nobackcolor");
-    setParent(sitebarActions.getRightToolbar());
+    setParent(SitebarActions.RIGHT_TOOLBAR);
     final ToolbarSeparatorDescriptor separator = new ToolbarSeparatorDescriptor(Type.separator,
-        sitebarActions.getRightToolbar());
+        SitebarActions.RIGHT_TOOLBAR);
     session.onUserSignInOrSignOut(true, new UserSignInOrSignOutHandler() {
       @Override
       public void onUserSignInOrSignOut(final UserSignInOrSignOutEvent event) {

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -123,8 +123,8 @@
     super(action);
     setId(SITE_SIGN_OUT);
     final ToolbarSeparatorDescriptor separator = new ToolbarSeparatorDescriptor(Type.separator,
-        sitebarActions.getRightToolbar());
-    setParent(sitebarActions.getRightToolbar());
+        SitebarActions.RIGHT_TOOLBAR);
+    setParent(SitebarActions.RIGHT_TOOLBAR);
     setVisible(session.isLogged());
     setStyles("k-no-backimage, k-btn-sitebar, k-fl, k-noborder, k-nobackcolor");
     session.onUserSignInOrSignOut(true, new UserSignInOrSignOutHandler() {

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2012-03-29 01:36:02 UTC (rev 1806)
@@ -867,7 +867,7 @@
 .k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button,.gwt-FileUpload,button.gwt-Button
   {
   font: 14px 'Ubuntu', arial;
-  border: 2px solid #CCCCCC;
+  border: 1px solid #ACACAC;
   cursor: pointer;
   margin: 0;
   text-decoration: none;
@@ -892,7 +892,7 @@
 
 .k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover,button.gwt-Button:hover
   {
-  border: 2px orange solid;
+  border: 1px orange solid;
   outline: 0 none;
   /* background: #f0f0f0; */
 }
@@ -962,14 +962,14 @@
   border-color: #CCCCCC !important;
   background: inherits !important;
   kfilter: alpha(opacity =
-              60) !important;
-  -moz-opacity: 0.60 !important;
-  -khtml-opacity: 0.60 !important;
-  opacity: 0.60 !important;
+              50) !important;
+  -moz-opacity: 0.50 !important;
+  -khtml-opacity: 0.50 !important;
+  opacity: 0.50 !important;
 }
 
 button.k-optionsborder img.k-iconlabel-left {
-  border: 2px solid #CCCCCC;
+  border: 1px solid #ACACAC;
   -webkit-border-radius: 3px;
   -moz-border-radius: 3px;
   border-radius: 3px;

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -52,6 +52,9 @@
 import cc.kune.gspace.client.licensewizard.pages.LicenseWizardSndFormView;
 import cc.kune.gspace.client.licensewizard.pages.LicenseWizardTrdForm;
 import cc.kune.gspace.client.licensewizard.pages.LicenseWizardTrdFormView;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspace;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspacePanel;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspacePresenter;
 import cc.kune.gspace.client.options.GroupOptions;
 import cc.kune.gspace.client.options.GroupOptionsCollection;
 import cc.kune.gspace.client.options.GroupOptionsPanel;
@@ -160,6 +163,9 @@
         FolderViewerAsTablePanel.class, FolderViewerPresenter.FolderViewerProxy.class);
     bindPresenter(SitebarSearchPresenter.class, SitebarSearchPresenter.SitebarSearchView.class,
         SitebarSearchPanel.class, SitebarSearchPresenter.SitebarSearchProxy.class);
+    bindPresenter(MaxMinWorkspacePresenter.class, MaxMinWorkspacePresenter.MaxMinWorkspaceView.class,
+        MaxMinWorkspacePanel.class, MaxMinWorkspacePresenter.MaxMinWorkspaceProxy.class);
+    bind(MaxMinWorkspace.class).to(MaxMinWorkspacePresenter.class).in(Singleton.class);
 
     s(NoHomePageViewer.class);
     s(TutorialViewer.class);

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -22,6 +22,7 @@
 import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
 import cc.kune.gspace.client.i18n.I18nTranslatorPresenter;
 import cc.kune.gspace.client.licensewizard.LicenseWizardPresenter;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspacePresenter;
 import cc.kune.gspace.client.options.GroupOptionsPresenter;
 import cc.kune.gspace.client.options.UserOptionsPresenter;
 import cc.kune.gspace.client.tags.TagsSummaryPresenter;
@@ -52,6 +53,8 @@
 
   AsyncProvider<LicenseWizardPresenter> getLicenseWizardPresenter();
 
+  AsyncProvider<MaxMinWorkspacePresenter> getMaxMinWorkspacePresenter();
+
   AsyncProvider<SitebarSearchPresenter> getSitebarSearchPresenter();
 
   AsyncProvider<TagsSummaryPresenter> getTagsSummaryPresenter();

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -32,6 +32,7 @@
 import cc.kune.gspace.client.i18n.I18nTranslator;
 import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
 import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspace;
 import cc.kune.gspace.client.options.GroupOptions;
 import cc.kune.gspace.client.options.UserOptions;
 import cc.kune.gspace.client.tags.TagsSummaryPresenter;
@@ -48,23 +49,14 @@
 public class GSpaceParts {
 
   @Inject
-  public GSpaceParts(
-      final Session session,
-      final GSpaceThemeManager themeManager,
+  public GSpaceParts(final Session session, final GSpaceThemeManager themeManager,
       final Provider<EntityLicensePresenter> licenseFooter,
-      final Provider<TagsSummaryPresenter> tagsPresenter,
-      final Provider<ToolSelector> toolSelector,
-      final Provider<NoHomePageViewer> noHome,
-      final Provider<ContentViewerPresenter> docsViewer,
-      final Provider<FolderViewerPresenter> folderViewer,
-      final Provider<GroupOptions> go,
-      final Provider<UserOptions> uo, // final Provider<GroupOptionsCollection>
-                                      // gocProv,
-      // final Provider<UserOptionsCollection> uocProv,
-
-      final Provider<SitebarSearchPresenter> siteSearch,
+      final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector,
+      final Provider<NoHomePageViewer> noHome, final Provider<ContentViewerPresenter> docsViewer,
+      final Provider<FolderViewerPresenter> folderViewer, final Provider<GroupOptions> go,
+      final Provider<UserOptions> uo, final Provider<SitebarSearchPresenter> siteSearch,
       final Provider<SiteOptionsI18nTranslatorAction> transAction,
-      final Provider<GiveUsFeedbackBtn> giveUsFeedback,
+      final Provider<MaxMinWorkspace> maxMinWorkspace, final Provider<GiveUsFeedbackBtn> giveUsFeedback,
       final Provider<I18nToTranslateGridPanel> toTrans,
       final Provider<I18nTranslatorTabsCollection> gtranslator,
       final Provider<I18nTranslator> translator, final Provider<WriteToBuddyHeaderButton> writeToBuddie,
@@ -79,7 +71,7 @@
         folderViewer.get();
         siteSearch.get();
         noHome.get();
-
+        maxMinWorkspace.get();
         // // Add User & Groups Options
         // final GroupOptionsCollection goc = gocProv.get();
         // final UserOptionsCollection uoc = uocProv.get();

Modified: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -21,12 +21,13 @@
 
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.shared.utils.Pair;
+import cc.kune.gspace.client.maxmin.IsMaximizable;
 
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.IsWidget;
 import com.google.gwt.user.client.ui.SimplePanel;
 
-public interface GSpaceArmor {
+public interface GSpaceArmor extends IsMaximizable {
 
   void clearBackImage();
 
@@ -81,6 +82,4 @@
   void selectUserSpace();
 
   void setBackImage(String url);
-
-  void setContentVisible(boolean visible);
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -42,6 +42,7 @@
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.SplitLayoutPanel;
 import com.google.gwt.user.client.ui.TabLayoutPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -50,10 +51,15 @@
 
   interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
   }
+  private static final int CENTER_NORTH_HEIGHT = 153;
+  private static final int CENTER_SOUTH_HEIGHT = 36;
+  private static final int EAST_WIDTH = 220;
 
   private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
 
   @UiField
+  VerticalPanel centerNorth;
+  @UiField
   ScrollPanel centerScroll;
   @UiField
   FlowPanel docContainer;
@@ -275,10 +281,35 @@
   }
 
   @Override
-  public void setContentVisible(final boolean visible) {
-    // FIXME: remove this?
-    // NotifyUser.info("Visible: " + visible);
-    // docContainer.getElement().getStyle().setOpacity(visible ? 1d : .0d);
-    // docFooter.getElement().getStyle().setOpacity(visible ? 1d : .0d);
+  public void setMaximized(final boolean maximized) {
+    // setMaximized(docFooter.getParent(), maximized);
+    // setMaximized(entityFooter.getParent(), maximized);
+    // setMaximized(entityHeader.getParent(), maximized);
+    // setMaximized(entityToolsContainer, maximized);
+    // splitCenter.setWidgetSize(centerScroll, getAbsoluteLeft())
+    // setMaximized(splitCenter.getWidget(0), maximized);
+    // setMaximized(splitCenter.getWidget(2), maximized);
+    // setMaximized(splitEast, maximized);
+    groupSpace.setWidgetSize(splitEast, maximized ? 0 : EAST_WIDTH);
+    splitCenter.setWidgetSize(centerNorth, maximized ? 7 : CENTER_NORTH_HEIGHT);
+    splitCenter.setWidgetSize(entityFooter, maximized ? 7 : CENTER_SOUTH_HEIGHT);
   }
+
+  private void setMaximized(final Widget widget, final boolean maximized) {
+    widget.setVisible(!maximized);
+    if (maximized) {
+      // // $((Widget) gsArmor.getHeaderToolbar()).as(Effects).
+      // $(widget).as(Effects).slideDown(new Function() {
+      // @Override
+      // public void f() {
+      // }
+      // });
+    } else {
+      // $(widget).parent().as(Effects).slideUp(new Function() {
+      // @Override
+      // public void f() {
+      // }
+      // });
+    }
+  }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml	2012-03-29 01:36:02 UTC (rev 1806)
@@ -43,7 +43,7 @@
                 <g:DockLayoutPanel unit="PX" ui:field="splitCenter"
                   styleName="{res.style.entityCentralContainer}">
                   <g:north size="153">
-                    <g:VerticalPanel width="100%"
+                    <g:VerticalPanel width="100%" ui:field="centerNorth"
                       height="153px">
                       <g:FlowPanel height="70px" width="100%"
                         styleName="{res.style.entityHeader}" ui:field="entityHeader">

Added: trunk/src/main/java/cc/kune/gspace/client/maxmin/IsMaximizable.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/maxmin/IsMaximizable.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/maxmin/IsMaximizable.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2012 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 cc.kune.gspace.client.maxmin;
+
+public interface IsMaximizable {
+  void setMaximized(boolean maximized);
+}

Added: trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspace.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspace.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspace.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -0,0 +1,9 @@
+package cc.kune.gspace.client.maxmin;
+
+public interface MaxMinWorkspace {
+
+  void maximize();
+
+  void minimize();
+
+}

Added: trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePanel.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -0,0 +1,43 @@
+package cc.kune.gspace.client.maxmin;
+
+import cc.kune.gspace.client.armor.GSpaceArmor;
+import cc.kune.gspace.client.maxmin.MaxMinWorkspacePresenter.MaxMinWorkspaceView;
+import cc.kune.wave.client.WaveClientProvider;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+
+public class MaxMinWorkspacePanel implements MaxMinWorkspaceView {
+
+  private final GSpaceArmor gsArmor;
+  private final WaveClientProvider waveClient;
+
+  @Inject
+  public MaxMinWorkspacePanel(final GSpaceArmor gsArmor, final WaveClientProvider waveClient) {
+    this.gsArmor = gsArmor;
+    this.waveClient = waveClient;
+  }
+
+  @Override
+  public void addToSlot(final Object slot, final Widget content) {
+  }
+
+  @Override
+  public Widget asWidget() {
+    return null;
+  }
+
+  @Override
+  public void removeFromSlot(final Object slot, final Widget content) {
+  }
+
+  @Override
+  public void setInSlot(final Object slot, final Widget content) {
+  }
+
+  @Override
+  public void setMaximized(final boolean maximized) {
+    gsArmor.setMaximized(maximized);
+    waveClient.get().setMaximized(maximized);
+  }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePresenter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/maxmin/MaxMinWorkspacePresenter.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -0,0 +1,137 @@
+package cc.kune.gspace.client.maxmin;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.Action;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.KeyStroke;
+import cc.kune.common.client.actions.Shortcut;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.i18n.I18n;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.sitebar.SitebarActions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class MaxMinWorkspacePresenter
+    extends
+    Presenter<MaxMinWorkspacePresenter.MaxMinWorkspaceView, MaxMinWorkspacePresenter.MaxMinWorkspaceProxy>
+
+implements MaxMinWorkspace {
+
+  public class MaximizeAction extends AbstractExtendedAction {
+    public MaximizeAction(final String name, final ImageResource img) {
+      super();
+      putValue(Action.NAME, name);
+      putValue(Action.SMALL_ICON, img);
+    }
+
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      showMaximized(true);
+    }
+  }
+  @ProxyCodeSplit
+  public interface MaxMinWorkspaceProxy extends Proxy<MaxMinWorkspacePresenter> {
+  }
+
+  public interface MaxMinWorkspaceView extends View, IsMaximizable {
+
+  }
+  public class MinimizeAction extends AbstractExtendedAction {
+    public MinimizeAction(final String name, final ImageResource img) {
+      super();
+      putValue(Action.NAME, name);
+      putValue(Action.SMALL_ICON, img);
+    }
+
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      showMaximized(false);
+    }
+  }
+  public static final String MAX_ICON = "mmwp-max_bt";
+
+  public static final String MIN_ICON = "mmwp-min_bt";
+
+  private final CoreResources images;
+
+  private MenuItemDescriptor maximizeButton;
+
+  private boolean maximized;
+
+  private MenuItemDescriptor minimizeButton;
+
+  private final GlobalShortcutRegister shortcutReg;
+
+  @Inject
+  public MaxMinWorkspacePresenter(final EventBus eventBus, final MaxMinWorkspaceView view,
+      final MaxMinWorkspaceProxy proxy, final GlobalShortcutRegister shortcutReg,
+      final CoreResources images) {
+    super(eventBus, view, proxy);
+    this.shortcutReg = shortcutReg;
+    this.images = images;
+    maximized = false;
+  }
+
+  private void createActions() {
+    final KeyStroke shortcut = Shortcut.getShortcut(true, true, false, false, Character.valueOf('F'));
+
+    final MaximizeAction maximizeAction = new MaximizeAction(I18n.t("Maximize the workspace"),
+        images.maximize());
+    maximizeAction.setShortcut(shortcut);
+    maximizeButton = new MenuItemDescriptor(SitebarActions.MORE_MENU, maximizeAction);
+    maximizeButton.setPosition(0);
+    maximizeButton.setId(MAX_ICON);
+
+    final MinimizeAction minimizeAction = new MinimizeAction(I18n.t("Minimize the workspace"),
+        images.minimize());
+    minimizeAction.setShortcut(shortcut);
+    minimizeButton = new MenuItemDescriptor(SitebarActions.MORE_MENU, minimizeAction);
+    minimizeButton.setPosition(1);
+    minimizeButton.setVisible(false);
+    minimizeButton.setId(MIN_ICON);
+
+    shortcutReg.put(shortcut, new AbstractExtendedAction() {
+      @Override
+      public void actionPerformed(final ActionEvent event) {
+        showMaximized(!maximized);
+      }
+    });
+  }
+
+  @Override
+  public void maximize() {
+    showMaximized(true);
+  }
+
+  @Override
+  public void minimize() {
+    showMaximized(false);
+  }
+
+  @Override
+  protected void onBind() {
+    super.onBind();
+    createActions();
+  }
+
+  @Override
+  protected void revealInParent() {
+    RevealRootContentEvent.fire(this, this);
+  }
+
+  private void showMaximized(final boolean maximized) {
+    maximizeButton.setVisible(!maximized);
+    minimizeButton.setVisible(maximized);
+    this.maximized = maximized;
+    getView().setMaximized(maximized);
+  }
+}

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -45,13 +45,11 @@
 
   @Override
   public void attach() {
-    gsArmor.setContentVisible(false);
   }
 
   @Override
   public void detach() {
     UiUtils.clear(gsArmor.getDocHeader());
-    gsArmor.setContentVisible(true);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientView.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientView.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientView.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -26,10 +26,12 @@
 import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
 import org.waveprotocol.wave.client.widget.common.ImplPanel;
 
+import cc.kune.gspace.client.maxmin.IsMaximizable;
+
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.user.client.ui.IsWidget;
 
-public interface WaveClientView extends IsWidget {
+public interface WaveClientView extends IsWidget, IsMaximizable {
 
   void clear();
 

Modified: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -30,7 +30,7 @@
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.sitebar.SitebarActionsPresenter;
+import cc.kune.core.client.sitebar.SitebarActions;
 import cc.kune.core.client.sn.actions.SessionAction;
 import cc.kune.core.client.state.Session;
 
@@ -84,9 +84,9 @@
   }
 
   @Inject
-  public WaveStatusIndicator(final SitebarActionsPresenter sitebar, final WaveStatusAction action) {
+  public WaveStatusIndicator(final WaveStatusAction action) {
     final IconLabelDescriptor status = new IconLabelDescriptor(action);
     status.setPosition(0);
-    sitebar.getRightToolbar().add(status);
+    SitebarActions.RIGHT_TOOLBAR.add(status);
   }
 }

Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -464,6 +464,11 @@
     History.newItem(tokenFromWaveref, false);
   }
 
+  @Override
+  public void setMaximized(final boolean maximized) {
+    splitPanel.setWidgetSize(searchPanel, maximized ? 0 : 400);    
+  }
+
   private void setupConnectionIndicator() {
     ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
 
@@ -498,49 +503,49 @@
       }
     });
   }
+private void setupSearchPanel() {
+  // On wave action fire an event.
+  final SearchPresenter.WaveActionHandler actionHandler =
+      new SearchPresenter.WaveActionHandler() {
+        @Override
+        public void onCreateWave() {
+          ClientEvents.get().fireEvent(WaveCreationEvent.CREATE_NEW_WAVE);
+        }
 
-  private void setupSearchPanel() {
-    // On wave action fire an event.
-    final SearchPresenter.WaveActionHandler actionHandler =
-        new SearchPresenter.WaveActionHandler() {
-          @Override
-          public void onCreateWave() {
-            ClientEvents.get().fireEvent(WaveCreationEvent.CREATE_NEW_WAVE);
-          }
-
-          @Override
-          public void onWaveSelected(final WaveId id) {
-            ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id)));
-          }
-        };
-    final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
-    search.addListener(inboxCount.getSearchListener());
-    SearchPresenter.create(search, searchPanel, actionHandler, profiles);
+        @Override
+        public void onWaveSelected(final WaveId id) {
+          ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id)));
+        }
+      };
+  final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
+  search.addListener(inboxCount.getSearchListener());
+  SearchPresenter.create(search, searchPanel, actionHandler, profiles);
+}
+  private void setupUi() {
+    // Set up UI
+    final DockLayoutPanel self = BINDER.createAndBindUi(this);
+    // kune-patch
+    // RootPanel.get("app").add(self);
+    initWidget(self);
+    waveHolder = new ImplPanel("");
+    waveHolder.addStyleName("k-waveHolder");
+    waveFrame.add(waveHolder);
+    // DockLayoutPanel forcibly conflicts with sensible layout control, and
+    // sticks inline styles on elements without permission. They must be
+    // cleared.
+    self.getElement().getStyle().clearPosition();
+    splitPanel.setWidgetMinSize(searchPanel, 300);
+  
+    if (LogLevel.showDebug()) {
+      logPanel.enable();
+    } else {
+      logPanel.removeFromParent();
+    }
+  
+    setupSearchPanel();
+    setupWavePanel();
   }
-private void setupUi() {
-  // Set up UI
-  final DockLayoutPanel self = BINDER.createAndBindUi(this);
-  // kune-patch
-  // RootPanel.get("app").add(self);
-  initWidget(self);
-  waveHolder = new ImplPanel("");
-  waveHolder.addStyleName("k-waveHolder");
-  waveFrame.add(waveHolder);
-  // DockLayoutPanel forcibly conflicts with sensible layout control, and
-  // sticks inline styles on elements without permission. They must be
-  // cleared.
-  self.getElement().getStyle().clearPosition();
-  splitPanel.setWidgetMinSize(searchPanel, 300);
 
-  if (LogLevel.showDebug()) {
-    logPanel.enable();
-  } else {
-    logPanel.removeFromParent();
-  }
-
-  setupSearchPanel();
-  setupWavePanel();
-}
   private void setupWavePanel() {
     // Hide the frame until waves start getting opened.
     UIObject.setVisible(waveFrame.getElement(), false);

Modified: trunk/src/main/java/cc/kune/wave/client/WebClientMock.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClientMock.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/cc/kune/wave/client/WebClientMock.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -83,4 +83,8 @@
   public void logout() {
   }
 
+  @Override
+  public void setMaximized(final boolean maximized) {
+  }
+
 }

Modified: trunk/src/main/java/com/example/client/HelloWorldActions.java
===================================================================
--- trunk/src/main/java/com/example/client/HelloWorldActions.java	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/java/com/example/client/HelloWorldActions.java	2012-03-29 01:36:02 UTC (rev 1806)
@@ -23,8 +23,7 @@
   }
 
   @Inject
-  public HelloWorldActions(final CommonResources res, final SitebarActions sitebarActions,
-      final SiteUserOptions siteUserOptions) {
+  public HelloWorldActions(final CommonResources res, final SiteUserOptions siteUserOptions) {
 
     // We can share the action if we don't want to create several (and for
     // instance it doesn't store any value)
@@ -33,7 +32,7 @@
     // An action in the sitebar
     final ButtonDescriptor siteBarBtn = new ButtonDescriptor(sharedAction);
     siteBarBtn.withText("HWorld!").withIcon(res.info());
-    siteBarBtn.setParent(sitebarActions.getLeftToolbar());
+    siteBarBtn.setParent(SitebarActions.LEFT_TOOLBAR);
 
     // Other action in the sitebar options menu
 

Modified: trunk/src/main/webapp/ws.html
===================================================================
--- trunk/src/main/webapp/ws.html	2012-03-28 23:23:29 UTC (rev 1805)
+++ trunk/src/main/webapp/ws.html	2012-03-29 01:36:02 UTC (rev 1806)
@@ -228,7 +228,7 @@
 }
 
 .k-home-toolbar-btn {
-  font-size: 18px !important;
+  font-size: 16px !important;
   min-height: 40px;
   height: auto !important;
   max-width: 150px;




More information about the kune-commits mailing list