[kune-commits] r1468 - in trunk: script src/main/java/cc/kune src/main/java/cc/kune/barters/server src/main/java/cc/kune/core/client/dnd src/main/java/cc/kune/gspace/client src/main/java/cc/kune/gspace/client/resources src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/wave/client src/main/java/org/waveprotocol src/main/java/org/waveprotocol/wave src/main/java/org/waveprotocol/wave/client src/main/java/org/waveprotocol/wave/client/wavepanel src/main/java/org/waveprotocol/wave/client/wavepanel/view src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full src/main/resources

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Thu Jul 28 16:07:44 CEST 2011


Author: vjrj_
Date: 2011-07-28 16:07:43 +0200 (Thu, 28 Jul 2011)
New Revision: 1468

Added:
   trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
   trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
   trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
   trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
   trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java
   trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png
   trunk/src/main/java/org/waveprotocol/wave/
   trunk/src/main/java/org/waveprotocol/wave/client/
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java
Modified:
   trunk/script/kune client  -no-server.launch
   trunk/src/main/java/cc/kune/Kune.gwt.xml
   trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java
   trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java
   trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
   trunk/src/main/java/cc/kune/wave/client/WebClient.java
   trunk/src/main/resources/wave-server.properties
Log:
CLOSED - # 69: Toolbar scroll also in Wave Panel 
http://kune.ourproject.org/issues/ticket/69

Modified: trunk/script/kune client  -no-server.launch
===================================================================
--- trunk/script/kune client  -no-server.launch	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/script/kune client  -no-server.launch	2011-07-28 14:07:43 UTC (rev 1468)
@@ -20,7 +20,7 @@
 </listAttribute>
 <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war /home/vjrj/proyectos/dev/kune/trunk/target/kune-0.0.8 -startupUrl /ws/?locale=en&amp;log_level=INFO -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 cc.kune.Kune"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war /home/vjrj/proyectos/dev/kune/trunk/target/kune-0.1.0-SNAPSHOT -startupUrl /ws/?locale=en&amp;log_level=INFO -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 cc.kune.Kune"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="kune"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
 </launchConfiguration>

Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-07-28 14:07:43 UTC (rev 1468)
@@ -1,36 +1,36 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
 <module rename-to="ws">
-  <inherits name="com.google.gwt.user.User" />
-  <inherits name='com.google.gwt.logging.Logging' />
-  <inherits name="cc.kune.core.KuneCore" />
-  <inherits name="cc.kune.wave.KuneWave" />
-  <inherits name="cc.kune.barters.KuneBarters" />
-  <inherits name="cc.kune.blogs.KuneBlogs" />
-  <inherits name="cc.kune.chat.KuneChat" />
-  <inherits name="cc.kune.docs.KuneDocs" />
-  <inherits name="cc.kune.wiki.KuneWiki" />
-  <inherits name="cc.kune.meets.KuneMeets" />
-  <inherits name="cc.kune.pspace.PSpace" />
-  <inherits name="com.calclab.suco.Suco" />
+  <inherits name="com.google.gwt.user.User"/>
+  <inherits name='com.google.gwt.logging.Logging'/>
+  <inherits name="cc.kune.core.KuneCore"/>
+  <inherits name="cc.kune.wave.KuneWave"/>
+  <inherits name="cc.kune.barters.KuneBarters"/>
+  <inherits name="cc.kune.blogs.KuneBlogs"/>
+  <inherits name="cc.kune.chat.KuneChat"/>
+  <inherits name="cc.kune.docs.KuneDocs"/>
+  <inherits name="cc.kune.wiki.KuneWiki"/>
+  <inherits name="cc.kune.meets.KuneMeets"/>
+  <inherits name="cc.kune.pspace.PSpace"/>
+  <inherits name="com.calclab.suco.Suco"/>
   <inherits name="org.adamtacy.GWTEffects"></inherits>
   <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
   <source path='client'
-    excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
+    excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java"/>
   <!-- <source path='shared'/> -->
   <!-- <public path="public"/> -->
   <!-- Logging Configuration -->
-  <set-property name="gwt.logging.enabled" value="TRUE" />
-  <set-property name="gwt.logging.logLevel" value="INFO" />
-  <set-property name="gwt.logging.consoleHandler" value="ENABLED" />
+  <set-property name="gwt.logging.enabled" value="TRUE"/>
+  <set-property name="gwt.logging.logLevel" value="INFO"/>
+  <set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
   <set-property name="gwt.logging.developmentModeHandler"
-    value="ENABLED" />
-  <set-property name="gwt.logging.firebugHandler" value="ENABLED" />
-  <set-property name="gwt.logging.hasWidgetsHandler" value="DISABLED" />
-  <set-property name="gwt.logging.popupHandler" value="DISABLED" />
-  <set-property name="gwt.logging.systemHandler" value="ENABLED" />
+    value="ENABLED"/>
+  <set-property name="gwt.logging.firebugHandler" value="ENABLED"/>
+  <set-property name="gwt.logging.hasWidgetsHandler" value="DISABLED"/>
+  <set-property name="gwt.logging.popupHandler" value="DISABLED"/>
+  <set-property name="gwt.logging.systemHandler" value="ENABLED"/>
   <set-property name="gwt.logging.simpleRemoteHandler"
-    value="DISABLED" />
+    value="DISABLED"/>
   <!-- Uncomment if you are enabling server side deobfuscation of StackTraces
     <set-property name="compiler.emulatedStack" value="true" /> <set-configuration-property
     name="compiler.emulatedStack.recordLineNumbers" value="true" /> <set-configuration-property
@@ -38,25 +38,28 @@
   <!-- NOTE: this only compiles for chromium/safari ============= -->
   <!--http://code.google.com/p/google-web-toolkit/issues/detail?id=42 -->
   <!-- <set-property name="user.agent" value="gecko1_8" /> -->
-  <set-property name="user.agent" value="safari,gecko1_8,ie6" />
+  <set-property name="user.agent" value="safari,gecko1_8,ie6"/>
   <!-- gwt-platform ============================================= -->
-  <inherits name='com.gwtplatform.mvp.Mvp' />
+  <inherits name='com.gwtplatform.mvp.Mvp'/>
   <define-configuration-property name="gin.ginjector"
-    is-multi-valued="false" />
+    is-multi-valued="false"/>
   <set-configuration-property name="gin.ginjector"
-    value="cc.kune.client.KuneGinjector" />
+    value="cc.kune.client.KuneGinjector"/>
   <!-- Debugging ================================================ -->
   <!-- for add ensureDebugIds (debugId in UIBinder), remove/comment in production
     see UIObject.ensureDebugId()) -->
-  <inherits name="com.google.gwt.user.Debug" />
+  <inherits name="com.google.gwt.user.Debug"/>
+  <!--  For make CSS obfuscation more pretty -->
+  <set-configuration-property name="CssResource.style"
+    value="pretty"/>
   <!-- Hardcoded locale (to override emite italian support) ===== -->
-  <extend-property name="locale" values="en" />
-  <set-property name="locale" value="en" />
+  <extend-property name="locale" values="en"/>
+  <set-property name="locale" value="en"/>
   <!-- Hardcoded log level ====================================== -->
   <!-- Turn off logging in wave -->
-  <set-property name="loglevel" value="none" />
+  <set-property name="loglevel" value="none"/>
   <!-- <set-property name="loglevel" value="debug" /> -->
   <!-- Entrypoint =============================================== -->
-  <entry-point class="cc.kune.client.KuneEntryPoint" />
+  <entry-point class="cc.kune.client.KuneEntryPoint"/>
   <!-- <entry-point class="cc.kune.common.client.SampleEntryPoint" /> -->
 </module>

Modified: trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/barters/server/BarterServerTool.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -51,7 +51,7 @@
 
 public class BarterServerTool implements ServerWaveTool {
 
-  private static final String BARTER_GADGET = "http://op-org.appspot.com/troco_wave_gadget/org.ourproject.troco.client.TrocoWaveGadget.gadget.xml";
+  private static final String BARTER_GADGET = "http://troco.ourproject.org/gadget/org.ourproject.troco.client.TrocoWaveGadget.gadget.xml";
   private final ToolConfigurationManager configurationManager;
   private final ContainerManager containerManager;
   private final ContentManager contentManager;

Modified: trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -14,6 +14,7 @@
     super(RootPanel.get(), false);
     setBehaviorDragProxy(true);
     setBehaviorMultipleSelection(false);
+    setBehaviorScrollIntoView(false);
     setBehaviorDragStartSensitivity(5);
     Window.addResizeHandler(new ResizeHandler() {
 

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -28,6 +28,8 @@
 
   void clearBackImage();
 
+  void enableCenterScroll(boolean enable);
+
   ForIsWidget getDocContainer();
 
   ForIsWidget getDocFooter();

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -25,6 +25,7 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Overflow;
 import com.google.gwt.dom.client.Style.Position;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
@@ -35,6 +36,7 @@
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.SplitLayoutPanel;
 import com.google.gwt.user.client.ui.TabLayoutPanel;
@@ -51,8 +53,10 @@
   private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
 
   @UiField
-  VerticalPanel docContainer;
+  ScrollPanel centerScroll;
   @UiField
+  FlowPanel docContainer;
+  @UiField
   DockLayoutPanel docContainerParent;
   @UiField
   FlowPanel docFooter;
@@ -112,6 +116,7 @@
     entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
     // entityToolsSouth.setVisible(false);
     mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
+    enableCenterScroll(true);
   }
 
   @Override
@@ -120,6 +125,20 @@
   }
 
   @Override
+  public void enableCenterScroll(final boolean enable) {
+    if (enable) {
+      centerScroll.setAlwaysShowScrollBars(false);
+      DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
+      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
+          "relative");
+    } else {
+      centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
+      DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
+      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
+    }
+  }
+
+  @Override
   public ForIsWidget getDocContainer() {
     return docContainer;
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2011-07-28 14:07:43 UTC (rev 1468)
@@ -65,9 +65,8 @@
                       <g:SimplePanel />
                     </g:east>
                     <g:center>
-                      <g:ScrollPanel styleName="{res.style.docEditor}">
-                        <g:VerticalPanel width="100%"
-                          height="100%" ui:field="docContainer"></g:VerticalPanel>
+                      <g:ScrollPanel ui:field="centerScroll" styleName="{res.style.docEditor}">
+                        <g:FlowPanel width="auto" height="auto" styleName="{res.style.docEditorContainer}" ui:field="docContainer" />
                       </g:ScrollPanel>
                     </g:center>
                     <g:south size="33.0">

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -28,6 +28,8 @@
 
     String docEditor();
 
+    String docEditorContainer();
+
     String docEditorMargin();
 
     String docFooter();

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css	2011-07-28 14:07:43 UTC (rev 1468)
@@ -7,7 +7,7 @@
 
 .mainPanel {
   border-top: 2px solid white;
-/*  border-bottom: 7px solid transparent;
+  /*  border-bottom: 7px solid transparent;
   border-right: 17px solid transparent;
   border-left: 17px solid transparent; */
 }
@@ -18,6 +18,7 @@
 }
 
 .k-space {
+
 }
 
 .floatRight {
@@ -37,6 +38,7 @@
 .entityCentralContainer {
 
 }
+
 .entityHeader {
   -webkit-border-top-right-radius: 7px;
   -moz-border-radius-topright: 7px;
@@ -137,12 +139,36 @@
   -webkit-border-top-right-radius: 7px;
   -moz-border-radius-topright: 7px;
   border-top-right-radius: 7px;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
 }
 
+.docEditorContainer {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  -webkit-border-top-left-radius: 7px;
+  -moz-border-radius-topleft: 7px;
+  border-top-left-radius: 7px;
+  -webkit-border-top-right-radius: 7px;
+  -moz-border-radius-topright: 7px;
+  border-top-right-radius: 7px;
+}
+
+/* Fix wave scroll problem
 .docEditor div {
   overflow-y: visible;
 }
 
+div.docEditor div {
+  position: static;
+}
+*/
 .docFooter {
   border-left: 1px solid #959595;
   border-right: 1px solid #959595;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -75,6 +75,7 @@
   public void attach() {
     final ForIsWidget docContainer = gsArmor.getDocContainer();
     docContainer.add(widget);
+    gsArmor.enableCenterScroll(true);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -22,7 +22,6 @@
 import org.waveprotocol.box.webclient.client.ClientIdGenerator;
 import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
 import org.waveprotocol.box.webclient.client.SimpleWaveStore;
-import org.waveprotocol.box.webclient.client.StagesProvider;
 import org.waveprotocol.box.webclient.search.WaveStore;
 import org.waveprotocol.wave.client.account.ProfileManager;
 import org.waveprotocol.wave.client.widget.common.ImplPanel;
@@ -40,6 +39,7 @@
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.viewers.ContentViewerPresenter.ContentViewerView;
+import cc.kune.wave.client.KuneStagesProvider;
 import cc.kune.wave.client.WaveClientClearEvent;
 import cc.kune.wave.client.WaveClientManager;
 import cc.kune.wave.client.WebClient;
@@ -56,18 +56,17 @@
 import com.google.gwt.user.client.ui.DeckPanel;
 import com.google.gwt.user.client.ui.InlineHTML;
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
 import com.gwtplatform.mvp.client.ViewImpl;
 
 public class ContentViewerPanel extends ViewImpl implements ContentViewerView {
-  interface DocsViewerPanelUiBinder extends UiBinder<Widget, ContentViewerPanel> {
+  interface ContentViewerPanelUiBinder extends UiBinder<Widget, ContentViewerPanel> {
   }
 
   private static final RemoteViewServiceMultiplexer NO_CHANNEL = null;
 
-  private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
+  private static ContentViewerPanelUiBinder uiBinder = GWT.create(ContentViewerPanelUiBinder.class);
 
   private final ContentCapabilitiesRegistry capabilitiesRegistry;
   private RemoteViewServiceMultiplexer channel;
@@ -81,12 +80,12 @@
   InlineHTML onlyViewPanel;
   private ProfileManager profiles;
   /** The wave panel, if a wave is open. */
-  private StagesProvider wave;
+  private KuneStagesProvider wave;
   private final WaveClientManager waveClient;
   private ImplPanel waveHolder;
 
   @UiField
-  VerticalPanel waveHolderParent;
+  ImplPanel waveHolderParent;
 
   private final WaveStore waveStore = new SimpleWaveStore();
 
@@ -176,6 +175,7 @@
   @Override
   public void setContent(final StateContentDTO state) {
     final boolean editable = state.getContentRights().isEditable();
+    gsArmor.enableCenterScroll(true);
     setTitle(state, editable);
     onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
     deck.showWidget(1);
@@ -183,6 +183,7 @@
 
   @Override
   public void setEditableContent(final StateContentDTO state) {
+    gsArmor.enableCenterScroll(false);
     setTitle(state, true);
     setEditableWaveContent(state.getWaveRef(), false);
     deck.showWidget(0);
@@ -211,8 +212,9 @@
     // UIObject.setVisible(waveFrame.getElement(), true);
     waveHolder.getElement().appendChild(loading);
     final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
-    final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator,
-        profiles, waveStore, isNewWave, org.waveprotocol.box.webclient.client.Session.get().getDomain());
+    final KuneStagesProvider wave = new KuneStagesProvider(holder, waveHolder, waveRef, channel,
+        idGenerator, profiles, waveStore, isNewWave,
+        org.waveprotocol.box.webclient.client.Session.get().getDomain(), true);
     this.wave = wave;
     wave.load(new Command() {
       @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.ui.xml	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.ui.xml	2011-07-28 14:07:43 UTC (rev 1468)
@@ -25,14 +25,12 @@
 
     }
   </ui:style>
-  <g:HTMLPanel>
-    <g:DeckPanel ui:field="deck" addStyleNames="k-doc-content-deck">
-      <!-- <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}"
-        /> -->
-      <g:VerticalPanel ui:field="waveHolderParent" />
-      <g:FlowPanel ui:field="onlyViewParent" height="auto" width="auto" addStyleNames="{style.onlyparent}">
-        <g:InlineHTML ui:field="onlyViewPanel" styleName="{style.viewonly}" />
-      </g:FlowPanel>
-    </g:DeckPanel>
-  </g:HTMLPanel>
+  <g:DeckPanel ui:field="deck"
+    addStyleNames="{style.waveHolder}  k-doc-content-deck">
+    <w:ImplPanel ui:field="waveHolderParent" addStyleNames="{style.waveHolder}"/>
+    <!-- <g:VerticalPanel ui:field="waveHolderParent" /> -->
+    <g:FlowPanel ui:field="onlyViewParent" height="auto" width="auto" addStyleNames="{style.onlyparent}">
+      <g:InlineHTML ui:field="onlyViewPanel" styleName="{style.viewonly}"/>
+    </g:FlowPanel>
+  </g:DeckPanel>
 </ui:UiBinder>
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -112,30 +112,30 @@
         // menu.hide();
       }
     });
+    final MenuDescriptor menu = new MenuDescriptor(i18n.t("Actions"));
+    menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
+    menu.setStandalone(false);
+    toolbar.add(menu);
+    final GuiActionDescCollection actions = item.getActionCollection();
+    toolbar.setVisible(actions.size() > 0);
+    itemWidget.setMenuVisible(false);
+
     itemWidget.getRowMouse().addMouseOverHandler(new MouseOverHandler() {
-      MenuDescriptor menu;
+      boolean initialized = false;
 
-      private MenuDescriptor createMenu(final FolderItemDescriptor item,
-          final FolderItemWidget itemWidget, final ActionSimplePanel toolbar) {
-        MenuDescriptor menu;
-        menu = new MenuDescriptor(i18n.t("Actions"));
-        menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
-        menu.setStandalone(false);
-        itemWidget.setMenuVisible(false);
-        toolbar.add(menu);
-        final GuiActionDescCollection actions = item.getActionCollection();
-        toolbar.setVisible(actions.size() > 0);
+      private void init(final FolderItemDescriptor item, final FolderItemWidget itemWidget,
+          final ActionSimplePanel toolbar) {
         for (final GuiActionDescrip menuItem : actions) {
           menuItem.setParent(menu);
           toolbar.add(menuItem);
         }
-        return menu;
       }
 
       @Override
       public void onMouseOver(final MouseOverEvent event) {
-        if (menu == null) {
-          menu = createMenu(item, itemWidget, toolbar);
+        if (!initialized) {
+          init(item, itemWidget, toolbar);
+          initialized = true;
         }
         // menu.setVisible(true);
         itemWidget.setMenuVisible(true);

Added: trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneConversation.css	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneConversation.css	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,30 @@
+/*
+ * CSS for conversations.
+ *
+ * Author: reuben at google.com (Reuben Kan)
+ */
+.fixedSelf {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  z-index: 0;
+}
+
+ at sprite .toolbar {
+  gwt-image: 'emptyToolbar';
+}
+
+.fixedThread { /*
+   * Allow scrolling.  Also, keep the scrollbar there permanently, so that content does not get
+   * horizontally resized by the addition and removal of a scrollbar.
+   */
+  overflow-y: scroll;
+  /* position: absolute; */ /*   position: relative; */
+  /*   top: 24px; */
+  top: 0;
+  /*   left: 0; */ /*   right: 0; */ /*   bottom: 0; */
+  /* Layout under siblings (participant panel etc). */
+  z-index: -1;
+}
\ No newline at end of file

Added: trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,253 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.wave.client;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.waveprotocol.wave.client.account.Profile;
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.common.safehtml.EscapeUtils;
+import org.waveprotocol.wave.client.common.safehtml.SafeHtmlBuilder;
+import org.waveprotocol.wave.client.render.RenderingRules;
+import org.waveprotocol.wave.client.state.ThreadReadStateMonitor;
+import org.waveprotocol.wave.client.uibuilder.HtmlClosure;
+import org.waveprotocol.wave.client.uibuilder.HtmlClosureCollection;
+import org.waveprotocol.wave.client.uibuilder.UiBuilder;
+import org.waveprotocol.wave.client.wavepanel.render.ShallowBlipRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.ViewIdMapper;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.AnchorViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipMetaViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ContinuationIndicatorViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.InlineThreadViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ParticipantAvatarViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ParticipantsViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ReplyBoxViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.RootThreadViewBuilder;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ViewFactory;
+import org.waveprotocol.wave.model.conversation.Conversation;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
+import org.waveprotocol.wave.model.conversation.ConversationThread;
+import org.waveprotocol.wave.model.conversation.ConversationView;
+import org.waveprotocol.wave.model.util.CollectionUtils;
+import org.waveprotocol.wave.model.util.IdentityMap;
+import org.waveprotocol.wave.model.util.IdentityMap.ProcV;
+import org.waveprotocol.wave.model.util.IdentityMap.Reduce;
+import org.waveprotocol.wave.model.util.StringMap;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+
+/**
+ * Renders conversational objects with UiBuilders.
+ *
+ */
+public final class KuneFullDomRenderer implements RenderingRules<UiBuilder> {
+
+  public interface DocRefRenderer {
+    DocRefRenderer EMPTY = new DocRefRenderer() {
+      @Override
+      public UiBuilder render(final ConversationBlip blip,
+          final IdentityMap<ConversationThread, UiBuilder> replies) {
+        return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
+      }
+    };
+
+    UiBuilder render(ConversationBlip blip,
+        IdentityMap<ConversationThread, UiBuilder> replies);
+  }
+
+  public interface ParticipantsRenderer {
+    ParticipantsRenderer EMPTY = new ParticipantsRenderer() {
+      @Override
+      public UiBuilder render(final Conversation c) {
+        return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
+      }
+    };
+
+    UiBuilder render(Conversation c);
+  }
+
+  private final ShallowBlipRenderer blipPopulator;
+  private final DocRefRenderer docRenderer;
+  private final ProfileManager profileManager;
+  private final ThreadReadStateMonitor readMonitor;
+  private final ViewFactory viewFactory;
+  private final ViewIdMapper viewIdMapper;
+  private final boolean showParticipantsPanel;
+
+  public KuneFullDomRenderer(final ShallowBlipRenderer blipPopulator, final DocRefRenderer docRenderer,
+      final ProfileManager profileManager, final ViewIdMapper viewIdMapper, final ViewFactory viewFactory,
+      final ThreadReadStateMonitor readMonitor, boolean showParticipantsPanel) {
+    this.blipPopulator = blipPopulator;
+    this.docRenderer = docRenderer;
+    this.profileManager = profileManager;
+    this.viewIdMapper = viewIdMapper;
+    this.viewFactory = viewFactory;
+    this.readMonitor = readMonitor;
+    this.showParticipantsPanel = showParticipantsPanel;
+  }
+
+  public UiBuilder getFirstConversation(final IdentityMap<Conversation, UiBuilder> conversations) {
+    return conversations.reduce(null, new Reduce<Conversation, UiBuilder, UiBuilder>() {
+      @Override
+      public UiBuilder apply(final UiBuilder soFar, final Conversation key, final UiBuilder item) {
+        // Pick the first rendering (any will do).
+        return soFar == null ? item : soFar;
+      }
+    });
+  }
+
+  @Override
+  public UiBuilder render(final Conversation conversation, final ParticipantId participant) {
+    final Profile profile = profileManager.getProfile(participant);
+    final String id = viewIdMapper.participantOf(conversation, participant);
+    // Use ParticipantAvatarViewBuilder for avatars.
+    // Kune patch
+    // final ParticipantNameViewBuilder participantUi = ParticipantNameViewBuilder.create(id);
+    final ParticipantAvatarViewBuilder participantUi = ParticipantAvatarViewBuilder.create(id);
+    participantUi.setAvatar(profile.getImageUrl());
+    participantUi.setName(profile.getFullName());
+    return participantUi;
+  }
+
+  @Override
+  public UiBuilder render(final Conversation conversation, final StringMap<UiBuilder> participantUis) {
+    final HtmlClosureCollection participantsUi = new HtmlClosureCollection();
+    for (final ParticipantId participant : conversation.getParticipantIds()) {
+      participantsUi.add(participantUis.get(participant.getAddress()));
+    }
+    final String id = viewIdMapper.participantsOf(conversation);
+    // Kune patch (but not used)
+    return showParticipantsPanel? ParticipantsViewBuilder.create(id, participantsUi): new UiBuilder() {
+      @Override
+      public void outputHtml(SafeHtmlBuilder arg0) {
+        // Don't show nothing
+      }};
+  }
+
+  @Override
+  public UiBuilder render(final Conversation conversation, final UiBuilder participantsUi, final UiBuilder threadUi) {
+    final String id = viewIdMapper.conversationOf(conversation);
+    final boolean isTop = !conversation.hasAnchor();
+    return isTop ? viewFactory.createTopConversationView(id, threadUi, participantsUi)
+        : viewFactory.createInlineConversationView(id, threadUi, participantsUi);
+  }
+
+  /**
+   */
+  @Override
+  public UiBuilder render(
+      final ConversationBlip blip, final IdentityMap<ConversationThread, UiBuilder> replies) {
+    return docRenderer.render(blip, replies);
+  }
+
+  @Override
+  public UiBuilder render(final ConversationBlip blip, final UiBuilder document,
+      final IdentityMap<ConversationThread, UiBuilder> anchorUis,
+      final IdentityMap<Conversation, UiBuilder> nestedConversations) {
+    final UiBuilder threadsUi = new UiBuilder() {
+      @Override
+      public void outputHtml(final SafeHtmlBuilder out) {
+        for (final ConversationThread thread : blip.getReplyThreads()) {
+          anchorUis.get(thread).outputHtml(out);
+        }
+      }
+    };
+
+    final UiBuilder convsUi = new UiBuilder() {
+      @Override
+      public void outputHtml(final SafeHtmlBuilder out) {
+        // Order by conversation id. Ideally, the sort key would be creation
+        // time, but that is not exposed in the conversation API.
+        final List<Conversation> ordered = CollectionUtils.newArrayList();
+        nestedConversations.each(new ProcV<Conversation, UiBuilder>() {
+          @Override
+          public void apply(final Conversation conv, final UiBuilder ui) {
+            ordered.add(conv);
+          }
+        });
+        Collections.sort(ordered, new Comparator<Conversation>() {
+          @Override
+          public int compare(final Conversation o1, final Conversation o2) {
+            return o1.getId().compareTo(o2.getId());
+          }
+        });
+        final List<UiBuilder> orderedUis = CollectionUtils.newArrayList();
+        for (final Conversation conv : ordered) {
+          nestedConversations.get(conv).outputHtml(out);
+        }
+      }
+    };
+
+    final BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
+    blipPopulator.render(blip, metaUi);
+
+    return BlipViewBuilder.create(viewIdMapper.blipOf(blip), metaUi, threadsUi, convsUi);
+  }
+
+  @Override
+  public UiBuilder render(final ConversationThread thread,
+      final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
+    final HtmlClosure blipsUi = new HtmlClosure() {
+      @Override
+      public void outputHtml(final SafeHtmlBuilder out) {
+        for (final ConversationBlip blip : thread.getBlips()) {
+          final UiBuilder blipUi = blipUis.get(blip);
+          // Not all blips are rendered.
+          if (blipUi != null) {
+            blipUi.outputHtml(out);
+          }
+        }
+      }
+    };
+    final String threadId = viewIdMapper.threadOf(thread);
+    final String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
+    UiBuilder builder = null;
+    if (thread.getConversation().getRootThread() == thread) {
+      final ReplyBoxViewBuilder replyBoxBuilder =
+          ReplyBoxViewBuilder.create(replyIndicatorId);
+      builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
+    } else {
+      final ContinuationIndicatorViewBuilder indicatorBuilder = ContinuationIndicatorViewBuilder.create(
+          replyIndicatorId);
+      final InlineThreadViewBuilder inlineBuilder =
+          InlineThreadViewBuilder.create(threadId, blipsUi, indicatorBuilder);
+      final int read = readMonitor.getReadCount(thread);
+      final int unread = readMonitor.getUnreadCount(thread);
+      inlineBuilder.setTotalBlipCount(read + unread);
+      inlineBuilder.setUnreadBlipCount(unread);
+      builder = inlineBuilder;
+    }
+    return builder;
+  }
+
+  @Override
+  public UiBuilder render(final ConversationThread thread, final UiBuilder threadR) {
+    final String id = EscapeUtils.htmlEscape(viewIdMapper.defaultAnchorOf(thread));
+    return AnchorViewBuilder.create(id, threadR);
+  }
+
+  @Override
+  public UiBuilder render(final ConversationView wave,
+      final IdentityMap<Conversation, UiBuilder> conversations) {
+    // return the first conversation in the view.
+    // TODO(hearnden): select the 'best' conversation.
+    return conversations.isEmpty() ? null : getFirstConversation(conversations);
+  }
+}

Added: trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,118 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package cc.kune.wave.client;
+
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.common.safehtml.SafeHtmlBuilder;
+import org.waveprotocol.wave.client.render.ReductionBasedRenderer;
+import org.waveprotocol.wave.client.render.RenderingRules;
+import org.waveprotocol.wave.client.render.WaveRenderer;
+import org.waveprotocol.wave.client.state.ThreadReadStateMonitor;
+import org.waveprotocol.wave.client.uibuilder.UiBuilder;
+import org.waveprotocol.wave.client.wavepanel.render.ShallowBlipRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.ViewIdMapper;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipQueueRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.DomRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.ViewFactory;
+import org.waveprotocol.wave.model.conversation.Conversation;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
+import org.waveprotocol.wave.model.conversation.ConversationThread;
+import org.waveprotocol.wave.model.conversation.ConversationView;
+import org.waveprotocol.wave.model.util.IdentityMap;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+import com.google.gwt.dom.client.Element;
+
+/**
+ * Renders waves into HTML DOM, given a renderer that renders waves as HTML
+ * closures.
+ *
+ */
+public final class KuneFullDomWaveRendererImpl implements DomRenderer {
+
+  public static DomRenderer create(final ConversationView wave, final ProfileManager profileManager,
+      final ShallowBlipRenderer shallowRenderer, final ViewIdMapper idMapper, final BlipQueueRenderer pager,
+      final ThreadReadStateMonitor readMonitor, final ViewFactory views, final boolean showParticipantsPanel) {
+    // Kune patch
+    final KuneFullDomRenderer.DocRefRenderer docRenderer = new KuneFullDomRenderer.DocRefRenderer() {
+
+      @Override
+      public UiBuilder render(
+        final ConversationBlip blip, final IdentityMap<ConversationThread, UiBuilder> replies) {
+         // Documents are rendered blank, and filled in later when they get paged
+          // in.
+          pager.add(blip);
+          return KuneFullDomRenderer.DocRefRenderer.EMPTY.render(blip, replies);
+      }
+    };
+    // Kune patch
+    final RenderingRules<UiBuilder> rules = new KuneFullDomRenderer(
+        shallowRenderer, docRenderer, profileManager, idMapper, views, readMonitor, showParticipantsPanel);
+    return new KuneFullDomWaveRendererImpl(ReductionBasedRenderer.of(rules, wave));
+  }
+
+  private final WaveRenderer<UiBuilder> driver;
+
+  private KuneFullDomWaveRendererImpl(final WaveRenderer<UiBuilder> driver) {
+    this.driver = driver;
+  }
+
+  //
+  // Temporary invokers. Anti-parser API will remove these methods.
+  //
+
+  /** Turns a UiBuilder rendering into a DOM element. */
+  private Element parseHtml(final UiBuilder ui) {
+    if (ui == null) {
+      return null;
+    }
+    final SafeHtmlBuilder html = new SafeHtmlBuilder();
+    ui.outputHtml(html);
+    final Element div = com.google.gwt.dom.client.Document.get().createDivElement();
+    div.setInnerHTML(html.toSafeHtml().asString());
+    final Element ret = div.getFirstChildElement();
+    // Detach, in order that this element looks free-floating (required by some
+    // preconditions).
+    ret.removeFromParent();
+    return ret;
+  }
+
+  @Override
+  public Element render(final Conversation conversation) {
+    return parseHtml(driver.render(conversation));
+  }
+
+  @Override
+  public Element render(final Conversation conversation, final ParticipantId participant) {
+    return parseHtml(driver.render(conversation, participant));
+  }
+
+  @Override
+  public Element render(final ConversationBlip blip) {
+    return parseHtml(driver.render(blip));
+  }
+
+  @Override
+  public Element render(final ConversationThread thread) {
+    return parseHtml(driver.render(thread));
+  }
+
+  @Override
+  public Element render(final ConversationView wave) {
+    return parseHtml(driver.render(wave));
+  }
+}

Added: trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,253 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+package cc.kune.wave.client;
+
+import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
+import org.waveprotocol.box.webclient.client.StageTwoProvider;
+import org.waveprotocol.box.webclient.search.WaveContext;
+import org.waveprotocol.box.webclient.search.WaveStore;
+import org.waveprotocol.wave.client.StageOne;
+import org.waveprotocol.wave.client.StageThree;
+import org.waveprotocol.wave.client.StageTwo;
+import org.waveprotocol.wave.client.StageZero;
+import org.waveprotocol.wave.client.Stages;
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.common.util.AsyncHolder;
+import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
+import org.waveprotocol.wave.client.common.util.LogicalPanel;
+import org.waveprotocol.wave.client.wavepanel.view.BlipView;
+import org.waveprotocol.wave.client.wavepanel.view.dom.ModelAsViewProvider;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipQueueRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.DomRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.WavePanelResourceLoader;
+import org.waveprotocol.wave.model.conversation.Conversation;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
+import org.waveprotocol.wave.model.conversation.ConversationView;
+import org.waveprotocol.wave.model.id.IdGenerator;
+import org.waveprotocol.wave.model.id.ModernIdSerialiser;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import com.google.gwt.dom.client.Element;
+
+/**
+ * Stages for loading the undercurrent Wave Panel
+ *
+ * @author zdwang at google.com (David Wang)
+ */
+public class KuneStagesProvider extends Stages {
+
+  private final static AsyncHolder<Object> HALT = new AsyncHolder<Object>() {
+    @Override
+    public void call(final Accessor<Object> accessor) {
+      // Never ready, so never notify the accessor.
+    }
+  };
+
+  private final RemoteViewServiceMultiplexer channel;
+  private boolean closed;
+  private final IdGenerator idGenerator;
+  private final boolean isNewWave;
+  private final String localDomain;
+  private StageOne one;
+  private final ProfileManager profiles;
+  private final LogicalPanel rootPanel;
+
+  private final boolean showParticipantsPanel;
+  private StageThree three;
+  private StageTwo two;
+  private WaveContext wave;
+  private final Element wavePanelElement;
+  private final WaveRef waveRef;
+  private final WaveStore waveStore;
+
+  /**
+   * @param wavePanelElement The dom element to become the wave panel
+   * @param rootPanel A panel that this an ancestor of wavePanelElement. This is
+   *        used for adopting to the GWT widget tree.
+   * @param waveRef the id of the wave to open. If null, it means, create a new
+   *        wave.
+   * @param channel communication channel.
+   * @param isNewWave true if the wave is a new client-created wave
+   * @param idGenerator
+   */
+  public KuneStagesProvider(final Element wavePanelElement, final LogicalPanel rootPanel, final WaveRef waveRef,
+      final RemoteViewServiceMultiplexer channel, final IdGenerator idGenerator, final ProfileManager profiles,
+      final WaveStore store, final boolean isNewWave, final String localDomain, final boolean showParticipantsPanel) {
+    this.wavePanelElement = wavePanelElement;
+    this.rootPanel = rootPanel;
+    this.waveRef = waveRef;
+    this.channel = channel;
+    this.idGenerator = idGenerator;
+    this.profiles = profiles;
+    this.waveStore = store;
+    this.isNewWave = isNewWave;
+    this.localDomain = localDomain;
+    this.showParticipantsPanel = showParticipantsPanel;
+  }
+
+  @Override
+  protected AsyncHolder<StageOne> createStageOneLoader(final StageZero zero) {
+    return haltIfClosed(new StageOne.DefaultProvider(zero) {
+      @Override
+      protected LogicalPanel createWaveContainer() {
+        return rootPanel;
+      }
+
+      @Override
+      protected Element createWaveHolder() {
+        return wavePanelElement;
+      }
+    });
+  }
+
+  @Override
+  protected AsyncHolder<StageThree> createStageThreeLoader(final StageTwo two) {
+    return haltIfClosed(new StageThree.DefaultProvider(this.two = two) {
+      @Override
+      protected void create(final Accessor<StageThree> whenReady) {
+        // Prepend an init wave flow onto the stage continuation.
+        super.create(new Accessor<StageThree>() {
+          @Override
+          public void use(final StageThree x) {
+            onStageThreeLoaded(x, whenReady);
+          }
+        });
+      }
+
+      @Override
+      protected String getLocalDomain() {
+        return localDomain;
+      }
+    });
+  }
+
+  @Override
+  // Kune patch
+  protected AsyncHolder<StageTwo> createStageTwoLoader(final StageOne one) {
+    return haltIfClosed(new StageTwoProvider(
+        this.one = one, waveRef.getWaveId(), channel, isNewWave, idGenerator, profiles) {
+      @Override
+      protected DomRenderer createRenderer() {
+        return KuneFullDomWaveRendererImpl.create(getConversations(), getProfileManager(),
+            getBlipDetailer(), getViewIdMapper(), getBlipQueue(), getThreadReadStateMonitor(),
+            createViewFactories(), showParticipantsPanel);
+      }
+
+      @Override
+      protected void installFeatures() {
+        WavePanelResourceLoader.loadCss();
+        // KuneWavePanelResourceLoader.loadCss();
+      }
+    });
+  }
+
+  @Override
+  protected AsyncHolder<StageZero> createStageZeroLoader() {
+    return haltIfClosed(super.createStageZeroLoader());
+  }
+
+  public void destroy() {
+    if (wave != null) {
+      waveStore.remove(wave);
+      wave = null;
+    }
+    if (three != null) {
+      three.getEditActions().stopEditing();
+      three = null;
+    }
+    if (two != null) {
+      two.getConnector().close();
+      two = null;
+    }
+    if (one != null) {
+      one.getWavePanel().destroy();
+      one = null;
+    }
+    closed = true;
+  }
+
+  /**
+   * @return a halting provider if this stage is closed. Otherwise, returns the
+   *         given provider.
+   */
+  @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
+  private <T> AsyncHolder<T> haltIfClosed(final AsyncHolder<T> provider) {
+    return closed ? (AsyncHolder<T>) HALT : provider;
+  }
+
+  private void handleExistingWave(final StageThree three) {
+    // If there's blip reference then focus on that blip.
+    final String documentId = waveRef.getDocumentId();
+    if (documentId != null) {
+      final ModelAsViewProvider views = two.getModelAsViewProvider();
+      final BlipQueueRenderer blipQueue = two.getBlipQueue();
+      final ConversationView wave = two.getConversations();
+      blipQueue.flush();
+      // Find conversation
+      Conversation conversation;
+      if (waveRef.hasWaveletId()) {
+        final String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
+        conversation = wave.getConversation(id);
+      } else {
+        // Unspecified wavelet means root.
+        conversation = wave.getRoot();
+      }
+      if (conversation != null) {
+        // Find selected blip.
+        final ConversationBlip blip = wave.getRoot().getBlip(documentId);
+        if (blip != null) {
+          final BlipView blipUi = views.getBlipView(blip);
+          if (blipUi != null) {
+            two.getStageOne().getFocusFrame().focus(blipUi);
+          }
+        }
+      }
+    }
+  }
+
+  private void initNewWave(final StageThree three) {
+    // Do the new-wave flow.
+    final ModelAsViewProvider views = two.getModelAsViewProvider();
+    final BlipQueueRenderer blipQueue = two.getBlipQueue();
+    final ConversationView wave = two.getConversations();
+
+    // Force rendering to finish.
+    blipQueue.flush();
+    final BlipView blipUi = views.getBlipView(wave.getRoot().getRootThread().getFirstBlip());
+    three.getEditActions().startEditing(blipUi);
+  }
+
+  private void onStageThreeLoaded(final StageThree x, final Accessor<StageThree> whenReady) {
+    if (closed) {
+      // Stop the loading process.
+      return;
+    }
+    three = x;
+    if (isNewWave) {
+      initNewWave(x);
+    } else {
+      handleExistingWave(x);
+    }
+    wave = new WaveContext(
+        two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
+    waveStore.add(wave);
+    whenReady.use(x);
+  }
+}

Added: trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,22 @@
+package cc.kune.wave.client;
+
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.TopConversationViewBuilder;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.ImageResource.ImageOptions;
+import com.google.gwt.resources.client.ImageResource.RepeatStyle;
+
+public class KuneWaveResources {
+  // Not used now
+  public interface Conversation extends ClientBundle {
+    // Note: the CSS file contains a gwt-image reference, so must be defined
+    // after the referenced images in this interface.
+    @Source("KuneConversation.css")
+    TopConversationViewBuilder.Css css();
+
+    @ImageOptions(repeatStyle = RepeatStyle.Horizontal)
+    @Source("toolbar_empty.png")
+    ImageResource emptyToolbar();
+  }
+}

Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -222,7 +222,7 @@
   DebugMessagePanel logPanel;
 
   /** The wave panel, if a wave is open. */
-  private StagesProvider wave;
+  private KuneStagesProvider wave;
 
   private final WaveStore waveStore = new SimpleWaveStore();
 
@@ -373,8 +373,8 @@
     UIObject.setVisible(waveFrame.getElement(), true);
     waveHolder.getElement().appendChild(loading);
     final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
-    final StagesProvider wave = new StagesProvider(
-        holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave, Session.get().getDomain());
+    final KuneStagesProvider wave = new KuneStagesProvider(
+        holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave, Session.get().getDomain(), true);
     this.wave = wave;
     wave.load(new Command() {
       @Override

Added: trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java	                        (rev 0)
+++ trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java	2011-07-28 14:07:43 UTC (rev 1468)
@@ -0,0 +1,104 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.waveprotocol.wave.client.wavepanel.view.dom.full;
+
+import org.waveprotocol.wave.client.editor.EditorImpl;
+
+import cc.kune.wave.client.KuneWaveResources;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.StyleInjector;
+
+/**
+ * This class is responsible for loading all the Css resources needed by the
+ * wave panel.
+ *
+ */
+public final class KuneWavePanelResourceLoader {
+
+  private final static BlipViewBuilder.Resources blip = GWT.create(BlipViewBuilder.Resources.class);
+  private final static CollapsibleBuilder.Resources collapsible =
+      GWT.create(CollapsibleBuilder.Resources.class);
+  // Kune patch (but not used yet)
+  private final static KuneWaveResources.Conversation conversation =
+      GWT.create(KuneWaveResources.Conversation.class);
+  private final static ContinuationIndicatorViewBuilder.Resources inlineContinuation =
+    GWT.create(ContinuationIndicatorViewBuilder.Resources.class);
+  private final static ParticipantsViewBuilder.Resources participants =
+    GWT.create(ParticipantsViewBuilder.Resources.class);
+  private final static ReplyBoxViewBuilder.Resources replyBox =
+      GWT.create(ReplyBoxViewBuilder.Resources.class);
+  private final static RootThreadViewBuilder.Resources rootThread =
+      GWT.create(RootThreadViewBuilder.Resources.class);
+
+  static {
+    // Inject all CSS synchronously. CSS must be injected synchronously, so that
+    // any layout queries, that may happen to occur in the same event cycle,
+    // operate on the correct state (GWT's default injection mode is
+    // asynchronous). CSS is injected together in one bundle to minimize layout
+    // invalidation, and to leave open the possibility of merging stylesheets
+    // together for efficiency.
+    final boolean isSynchronous = true;
+    StyleInjector.inject(blip.css().getText(), isSynchronous);
+    StyleInjector.inject(collapsible.css().getText(), isSynchronous);
+    StyleInjector.inject(rootThread.css().getText(), isSynchronous);
+    StyleInjector.inject(replyBox.css().getText(), isSynchronous);
+    StyleInjector.inject(inlineContinuation.css().getText(), isSynchronous);
+    StyleInjector.inject(conversation.css().getText(), isSynchronous);
+    StyleInjector.inject(participants.css().getText(), isSynchronous);
+  }
+
+  public static BlipViewBuilder.Resources getBlip() {
+    return blip;
+  }
+
+  public static CollapsibleBuilder.Resources getCollapsible() {
+    return collapsible;
+  }
+
+  public static ContinuationIndicatorViewBuilder.Resources getContinuationIndicator() {
+    return inlineContinuation;
+  }
+
+  public static KuneWaveResources.Conversation getConversation() {
+    return conversation;
+  }
+
+  public static ParticipantsViewBuilder.Resources getParticipants() {
+    return participants;
+  }
+
+  public static ReplyBoxViewBuilder.Resources getReplyBox() {
+    return replyBox;
+  }
+
+  public static RootThreadViewBuilder.Resources getRootThread() {
+    return rootThread;
+  }
+
+  /**
+   * Loads all the CSS required by the wave panel.
+   */
+  public static void loadCss() {
+    // Static initializer loads all the wave panel views.
+    // Need a few more:
+    EditorImpl.init();
+  }
+
+  private KuneWavePanelResourceLoader() {
+  }
+}

Modified: trunk/src/main/resources/wave-server.properties
===================================================================
--- trunk/src/main/resources/wave-server.properties	2011-07-27 14:27:34 UTC (rev 1467)
+++ trunk/src/main/resources/wave-server.properties	2011-07-28 14:07:43 UTC (rev 1468)
@@ -8,7 +8,7 @@
 # Each address is a comma separated host:port pair.
 http_frontend_public_address = localhost:8888
 http_frontend_addresses = ${http_frontend_public_address}
-resource_bases = target/kune-0.0.8/,src/main/webapp/
+resource_bases = target/kune-0.1.0-SNAPSHOT/,src/main/webapp/
 
 ### Server-specific variables
 ###




More information about the kune-commits mailing list