[kune-commits] r1442 - in trunk/src: main/java/cc/kune/chat/client main/java/cc/kune/chat/client/actions main/java/cc/kune/chat/public main/java/cc/kune/common/client/actions/gwtui main/java/cc/kune/common/client/actions/ui main/java/cc/kune/common/client/actions/ui/descrip main/java/cc/kune/common/client/tooltip main/java/cc/kune/core/client/events main/java/cc/kune/core/client/groups/newgroup main/java/cc/kune/core/client/sitebar/spaces main/java/cc/kune/core/client/state main/java/cc/kune/core/public main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/options main/java/cc/kune/gspace/client/resources main/java/cc/kune/gspace/client/style main/java/cc/kune/wave/server main/java/com/google/wave/splash/text test/java test/java/cc/kune/wave/server test/java/com test/java/com/google test/java/com/google/wave test/java/com/google/wave/splash test/java/com/google/wave/splash/text

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sat Jul 9 18:44:34 CEST 2011


Author: vjrj_
Date: 2011-07-09 18:44:34 +0200 (Sat, 09 Jul 2011)
New Revision: 1442

Added:
   trunk/src/main/java/cc/kune/chat/client/KuneBrowserFocusManager.java
   trunk/src/main/java/cc/kune/core/client/events/WindowFocusEvent.java
   trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
   trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
   trunk/src/main/java/com/google/wave/splash/text/ContentNewUnrenderer.java
   trunk/src/main/java/com/google/wave/splash/text/HtmlRawViewImpl.java
   trunk/src/main/java/com/google/wave/splash/text/UnrenderUtils.java
   trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
   trunk/src/test/java/com/
   trunk/src/test/java/com/google/
   trunk/src/test/java/com/google/wave/
   trunk/src/test/java/com/google/wave/splash/
   trunk/src/test/java/com/google/wave/splash/text/
   trunk/src/test/java/com/google/wave/splash/text/ContentNewUnrendererTest.java
   trunk/src/test/java/com/google/wave/splash/text/ContentUnrendererTest.java
Modified:
   trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
   trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java
   trunk/src/main/java/cc/kune/chat/public/kune-hablar.css
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
   trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java
   trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
   trunk/src/main/java/cc/kune/common/client/tooltip/TooltipTimers.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
   trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/options/GroupOptions.java
   trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
   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/resources/gSpaceArmorTheme.css
   trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
   trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
   trunk/src/main/java/com/google/wave/splash/text/ContentRenderer.java
   trunk/src/main/java/com/google/wave/splash/text/ContentUnrenderer.java
   trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java
Log:
Unrender wave revisited; Tooltips show on demand; css fixes; chatroom message when not logged; On window focus tooltip; Background fix

Added: trunk/src/main/java/cc/kune/chat/client/KuneBrowserFocusManager.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneBrowserFocusManager.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/KuneBrowserFocusManager.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,58 @@
+package cc.kune.chat.client;
+
+import cc.kune.core.client.events.WindowFocusEvent;
+
+import com.calclab.hablar.chat.client.ui.ChatPresenter;
+import com.calclab.hablar.chat.client.ui.PairChatPresenter;
+import com.calclab.hablar.core.client.browser.BrowserFocusHandler;
+import com.calclab.hablar.core.client.browser.BrowserFocusHandler.BrowserFocusListener;
+import com.calclab.hablar.core.client.mvp.HablarEventBus;
+import com.calclab.hablar.core.client.page.Page;
+import com.calclab.hablar.core.client.page.PagePresenter.Visibility;
+import com.calclab.hablar.core.client.page.events.VisibilityChangedEvent;
+import com.calclab.hablar.core.client.page.events.VisibilityChangedHandler;
+import com.calclab.hablar.rooms.client.room.RoomPresenter;
+import com.calclab.hablar.signals.client.unattended.UnattendedPagesManager;
+import com.google.gwt.event.shared.EventBus;
+
+/**
+ * This class is a workaround to clear the focus on the active chat page FIXME:
+ * workaround to clear the focus <br/>
+ * 
+ * <br/>
+ * TODO: change the page/header visibility system... quite a big job
+ * 
+ * 
+ */
+public class KuneBrowserFocusManager {
+
+  protected ChatPresenter currentFocused;
+
+  public KuneBrowserFocusManager(final EventBus kuneEventBus, final HablarEventBus eventBus,
+      final UnattendedPagesManager unattendedManager, final BrowserFocusHandler handler) {
+
+    eventBus.addHandler(VisibilityChangedEvent.TYPE, new VisibilityChangedHandler() {
+      @Override
+      public void onVisibilityChanged(final VisibilityChangedEvent event) {
+        if (event.getVisibility() == Visibility.focused) {
+          final Page<?> page = event.getPage();
+          if (PairChatPresenter.TYPE.equals(page.getType()) || RoomPresenter.TYPE.equals(page.getType())) {
+            currentFocused = (ChatPresenter) page;
+          }
+        }
+      }
+    });
+
+    handler.setFocusListener(new BrowserFocusListener() {
+      @Override
+      public void onBrowserFocusChanged(final boolean hasFocus) {
+        kuneEventBus.fireEvent(new WindowFocusEvent(hasFocus));
+        if (currentFocused != null) {
+          if (hasFocus == false) {
+            currentFocused.getDisplay().setTextBoxFocus(false);
+          }
+        }
+      }
+    });
+  }
+}

Modified: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -28,7 +28,6 @@
 import com.calclab.hablar.core.client.mvp.HablarEventBus;
 import com.calclab.hablar.signals.client.SignalMessages;
 import com.calclab.hablar.signals.client.SignalPreferences;
-import com.calclab.hablar.signals.client.browserfocus.BrowserFocusManager;
 import com.calclab.hablar.signals.client.notifications.NotificationManager;
 import com.calclab.hablar.signals.client.preferences.SignalsPreferencesPresenter;
 import com.calclab.hablar.signals.client.preferences.SignalsPreferencesWidget;
@@ -46,65 +45,64 @@
  */
 public class KuneHablarSignals {
 
-    public static SignalMessages signalMessages;
+  public static SignalMessages signalMessages;
 
-    /**
-     * Gets the {@link SignalMessages} object containing the internationalised
-     * messages
-     * 
-     * @return the SignalMessages object containing the internationalised
-     *         messages
-     */
-    public static SignalMessages i18n() {
-        return signalMessages;
-    }
+  /**
+   * Gets the {@link SignalMessages} object containing the internationalised
+   * messages
+   * 
+   * @return the SignalMessages object containing the internationalised messages
+   */
+  public static SignalMessages i18n() {
+    return signalMessages;
+  }
 
-    /**
-     * Sets the {@link SignalMessages} object containing the internationalised
-     * messages
-     * 
-     * @param t
-     *            the messages object
-     */
-    public static void setMessages(final SignalMessages t) {
-        KuneHablarSignals.signalMessages = t;
-    }
+  /**
+   * Sets the {@link SignalMessages} object containing the internationalised
+   * messages
+   * 
+   * @param t
+   *          the messages object
+   */
+  public static void setMessages(final SignalMessages t) {
+    KuneHablarSignals.signalMessages = t;
+  }
 
-    // FIXME: move to gin
-    @SuppressWarnings("deprecation")
-    public KuneHablarSignals(final EventBus eventBus, final XmppSession session, final Hablar hablar,
-            final ChatClientAction action) {
-        final HablarEventBus hablarEventBus = hablar.getEventBus();
-        final PrivateStorageManager storageManager = Suco.get(PrivateStorageManager.class);
+  // FIXME: move to gin
+  @SuppressWarnings("deprecation")
+  public KuneHablarSignals(final EventBus kuneEventBus, final XmppSession session, final Hablar hablar,
+      final ChatClientAction action) {
+    final HablarEventBus hablarEventBus = hablar.getEventBus();
+    final PrivateStorageManager storageManager = Suco.get(PrivateStorageManager.class);
 
-        final HasText titleDisplay = new HasText() {
-            @Override
-            public String getText() {
-                return Window.getTitle();
-            }
+    final HasText titleDisplay = new HasText() {
+      @Override
+      public String getText() {
+        return Window.getTitle();
+      }
 
-            @Override
-            public void setText(final String text) {
-                Window.setTitle(text);
-            }
-        };
-        final SignalPreferences preferences = new SignalPreferences();
+      @Override
+      public void setText(final String text) {
+        Window.setTitle(text);
+      }
+    };
+    final SignalPreferences preferences = new SignalPreferences();
 
-        final UnattendedPagesManager manager = new UnattendedPagesManager(hablarEventBus,
-                BrowserFocusHandler.getInstance());
-        new BrowserFocusManager(hablarEventBus, manager, BrowserFocusHandler.getInstance());
-        new UnattendedPresenter(hablarEventBus, preferences, manager, titleDisplay);
-        new KuneUnattendedPresenter(eventBus, hablarEventBus, preferences, manager, action);
-        final NotificationManager notificationManager = new NotificationManager(hablarEventBus, preferences);
+    final UnattendedPagesManager manager = new UnattendedPagesManager(hablarEventBus,
+        BrowserFocusHandler.getInstance());
+    new KuneBrowserFocusManager(kuneEventBus, hablarEventBus, manager, BrowserFocusHandler.getInstance());
+    new UnattendedPresenter(hablarEventBus, preferences, manager, titleDisplay);
+    new KuneUnattendedPresenter(kuneEventBus, hablarEventBus, preferences, manager, action);
+    final NotificationManager notificationManager = new NotificationManager(hablarEventBus, preferences);
 
-        // notificationManager.addNotifier((BrowserPopupHablarNotifier)
-        // GWT.create(BrowserPopupHablarNotifier.class),
-        // true);
-        notificationManager.addNotifier((KuneChatNotifier) GWT.create(KuneChatNotifier.class), true);
+    // notificationManager.addNotifier((BrowserPopupHablarNotifier)
+    // GWT.create(BrowserPopupHablarNotifier.class),
+    // true);
+    notificationManager.addNotifier((KuneChatNotifier) GWT.create(KuneChatNotifier.class), true);
 
-        final SignalsPreferencesPresenter preferencesPage = new SignalsPreferencesPresenter(session, storageManager,
-                hablarEventBus, preferences, new SignalsPreferencesWidget(), notificationManager);
-        hablar.addPage(preferencesPage, UserContainer.ROL);
-    }
+    final SignalsPreferencesPresenter preferencesPage = new SignalsPreferencesPresenter(session,
+        storageManager, hablarEventBus, preferences, new SignalsPreferencesWidget(), notificationManager);
+    hablar.addPage(preferencesPage, UserContainer.ROL);
+  }
 
 }

Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenChatAction.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -2,11 +2,17 @@
 
 import cc.kune.chat.client.ChatClient;
 import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyLevel;
 import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.auth.SignIn;
 import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.TokenUtils;
 import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
 import cc.kune.core.shared.dto.AccessRolDTO;
 import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -14,22 +20,36 @@
 public class OpenChatAction extends RolAction {
 
   private final Provider<ChatClient> chatClient;
+  private final I18nTranslationService i18n;
   private final Session session;
+  private final Provider<SignIn> signIn;
+  private final StateManager stateManager;
 
   @Inject
-  public OpenChatAction(final Provider<ChatClient> chatClient, final Session session) {
-    super(AccessRolDTO.Viewer, true);
+  public OpenChatAction(final Provider<ChatClient> chatClient, final Session session,
+      final StateManager stateManager, final Provider<SignIn> signIn, final I18nTranslationService i18n) {
+    super(AccessRolDTO.Viewer, false);
     this.chatClient = chatClient;
     this.session = session;
+    this.stateManager = stateManager;
+    this.signIn = signIn;
+    this.i18n = i18n;
   }
 
   @Override
   public void actionPerformed(final ActionEvent event) {
-    final ChatClient chat = chatClient.get();
-    final Object target = event.getTarget();
-    final String roomName = (target instanceof AbstractContentSimpleDTO) ? ((AbstractContentSimpleDTO) target).getName()
-        : ((StateContainerDTO) session.getCurrentState()).getTitle();
-    chat.joinRoom(roomName, session.getCurrentUserInfo().getShortName());
-    chat.show();
+    if (session.isLogged()) {
+      final ChatClient chat = chatClient.get();
+      final Object target = event.getTarget();
+      final String roomName = (target instanceof AbstractContentSimpleDTO) ? ((AbstractContentSimpleDTO) target).getName()
+          : ((StateContainerDTO) session.getCurrentState()).getTitle();
+      chat.joinRoom(roomName, session.getCurrentUserInfo().getShortName());
+      chat.show();
+    } else {
+      signIn.get().setErrorMessage(i18n.t("Sign in or create an account to access to this room"),
+          NotifyLevel.info);
+      stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN,
+          session.getCurrentStateToken().toString()));
+    }
   }
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/chat/public/kune-hablar.css
===================================================================
--- trunk/src/main/java/cc/kune/chat/public/kune-hablar.css	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/chat/public/kune-hablar.css	2011-07-09 16:44:34 UTC (rev 1442)
@@ -99,7 +99,6 @@
     border-right: 1px solid #e9e9e9;
 }
 */
-
 input[disabled] {
   background-color: #e9e9e9;
   color: black;
@@ -231,8 +230,8 @@
 }
 
 /** IE6 ZINDEX BUG **/
-.hablar-HablarWidget {
-  /* z-index: 1; */
+.hablar-HablarWidget { /* z-index: 1; */
+
 }
 
 html {
@@ -599,4 +598,14 @@
 
 .gwt-TextArea {
   border: 1px solid #bbbbbb;
-}
\ No newline at end of file
+}
+
+#gwt-debug-DoubleList-selectAll,#gwt-debug-DoubleList-selectSome,#gwt-debug-DoubleList-deselectAll,#gwt-debug-DoubleList-deselectSome
+  {
+  margin-left: -6px;
+}
+
+.hablar-RosterGroupWidget {
+  -moz-user-select: none;
+  -khtml-user-select: none;
+}

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -43,6 +43,7 @@
   protected boolean enableTongle;
   private IconLabel iconLabel;
   private boolean isChild;
+  private Tooltip tooltip;
 
   public AbstractGwtButtonGui() {
     this(null, false);
@@ -154,10 +155,10 @@
   }
 
   @Override
-  public void setToolTipText(final String tooltip) {
-    if (tooltip != null && !tooltip.isEmpty()) {
+  public void setToolTipText(final String tooltipText) {
+    if (tooltipText != null && !tooltipText.isEmpty()) {
       final KeyStroke key = (KeyStroke) descriptor.getValue(Action.ACCELERATOR_KEY);
-      Tooltip.to(button, key == null ? tooltip : tooltip + key.toString());
+      tooltip = Tooltip.to(button, key == null ? tooltipText : tooltipText + key.toString());
     }
   }
 
@@ -171,4 +172,15 @@
     return !descriptor.isChild();
   }
 
+  @Override
+  protected void toogleTooltipVisible() {
+    if (tooltip != null) {
+      if (tooltip.isVisible()) {
+        tooltip.hide();
+      } else {
+        tooltip.showTemporally();
+      }
+    }
+  }
+
 }

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -56,7 +56,7 @@
     notStandAlone = !((MenuDescriptor) descriptor).isStandalone();
     if (notStandAlone) {
       button = new Button();
-      // button.setStylePrimaryName("oc-button");
+      button.removeStyleName("gwt-Button");
       iconLabel = new IconLabel("");
       final ImageResource rightIcon = ((MenuDescriptor) descriptor).getRightIcon();
       if (rightIcon != null) {

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -99,6 +99,8 @@
           setToolTipText((String) newValue);
         } else if (event.getPropertyName().equals(GuiActionDescrip.VISIBLE)) {
           setVisible((Boolean) newValue);
+        } else if (event.getPropertyName().equals(GuiActionDescrip.TOOGLE_TOOLTIP_VISIBLE)) {
+          toogleTooltipVisible();
         } else if (event.getPropertyName().equals(Action.STYLES)) {
           setStyles((String) newValue);
         }
@@ -160,6 +162,11 @@
 
   protected abstract void setText(String text);
 
+  protected void toogleTooltipVisible() {
+    // do nothing by default
+    return;
+  }
+
   protected abstract void setToolTipText(String text);
 
   private void setVisible(final Boolean visible) {

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -33,244 +33,255 @@
  */
 public abstract class AbstractGuiActionDescrip extends ChangeableObject implements GuiActionDescrip {
 
-    /** The action. */
-    private final AbstractAction action;
+  /** The action. */
+  private final AbstractAction action;
 
-    private final List<GuiAddCondition> addConditions;
+  private final List<GuiAddCondition> addConditions;
 
-    /** The item DOM id. */
-    private String id;
+  /** The item DOM id. */
+  private String id;
 
-    /** The item location. */
-    private String location;
+  /** The item location. */
+  private String location;
 
-    protected GuiActionDescrip parent = NO_PARENT;
+  protected GuiActionDescrip parent = NO_PARENT;
 
-    /** The position where the item will be inserted. */
-    private int position;
+  /** The position where the item will be inserted. */
+  private int position;
 
-    /**
-     * Instantiates a new abstract ui action descriptor. This is used for
-     * describe UI button, menus, menu items and so on
-     * 
-     * @param action
-     *            the action
-     */
-    public AbstractGuiActionDescrip(final AbstractAction action) {
-        this.action = action;
-        putValue(Action.ENABLED, Boolean.TRUE);
-        putValue(VISIBLE, Boolean.TRUE);
-        position = NO_POSITION;
-        parent = NO_PARENT;
-        addConditions = new ArrayList<GuiAddCondition>();
-    }
+  /**
+   * Instantiates a new abstract ui action descriptor. This is used for describe
+   * UI button, menus, menu items and so on
+   * 
+   * @param action
+   *          the action
+   */
+  public AbstractGuiActionDescrip(final AbstractAction action) {
+    this.action = action;
+    putValue(Action.ENABLED, Boolean.TRUE);
+    putValue(VISIBLE, Boolean.TRUE);
+    position = NO_POSITION;
+    parent = NO_PARENT;
+    addConditions = new ArrayList<GuiAddCondition>();
+  }
 
-    @Override
-    public void add(final GuiAddCondition addCondition) {
-        addConditions.add(addCondition);
-    }
+  @Override
+  public void add(final GuiAddCondition addCondition) {
+    addConditions.add(addCondition);
+  }
 
-    @Override
-    public void fire(final ActionEvent event) {
-        action.actionPerformed(event);
-    }
+  @Override
+  public void fire(final ActionEvent event) {
+    action.actionPerformed(event);
+  }
 
-    @Override
-    public AbstractAction getAction() {
-        return action;
-    }
+  @Override
+  public AbstractAction getAction() {
+    return action;
+  }
 
-    @Override
-    public String getId() {
-        return id;
-    }
+  @Override
+  public String getId() {
+    return id;
+  }
 
-    /**
-     * Gets the location, a string used to group actions with locations (top
-     * bar, bottom bar, user bar...).
-     * 
-     * @return the location
-     */
-    @Override
-    public String getLocation() {
-        return location;
-    }
+  /**
+   * Gets the location, a string used to group actions with locations (top bar,
+   * bottom bar, user bar...).
+   * 
+   * @return the location
+   */
+  @Override
+  public String getLocation() {
+    return location;
+  }
 
-    @Override
-    public GuiActionDescrip getParent() {
-        return parent;
-    }
+  @Override
+  public GuiActionDescrip getParent() {
+    return parent;
+  }
 
-    /**
-     * Gets the position.
-     * 
-     * @return the position
-     */
-    @Override
-    public int getPosition() {
-        return position;
-    }
+  /**
+   * Gets the position.
+   * 
+   * @return the position
+   */
+  @Override
+  public int getPosition() {
+    return position;
+  }
 
-    @Override
-    public Object getTarget() {
-        return getValue(TARGET);
-    }
+  @Override
+  public Object getTarget() {
+    return getValue(TARGET);
+  }
 
-    @Override
-    public abstract Class<?> getType();
+  @Override
+  public abstract Class<?> getType();
 
-    @Override
-    /**
-     * We try to get the gui property (for instance the name) and if it's empty we try to get the same property in actions. This permit to have several gui items with the same action but different gui properties (like text descriptions) if necessary.
-     */
-    public Object getValue(final String key) {
-        final Object guiValue = super.getValue(key);
-        if (guiValue == null) {
-            return action.getValue(key);
-        } else {
-            return guiValue;
-        }
+  @Override
+  /**
+   * We try to get the gui property (for instance the name) and if it's empty we try to get the same property in actions. This permit to have several gui items with the same action but different gui properties (like text descriptions) if necessary.
+   */
+  public Object getValue(final String key) {
+    final Object guiValue = super.getValue(key);
+    if (guiValue == null) {
+      return action.getValue(key);
+    } else {
+      return guiValue;
     }
+  }
 
-    @Override
-    public boolean hasTarget() {
-        return getValue(TARGET) != null;
-    }
+  @Override
+  public boolean hasTarget() {
+    return getValue(TARGET) != null;
+  }
 
-    @Override
-    public boolean isChild() {
-        return !parent.equals(NO_PARENT);
-    }
+  @Override
+  public boolean isChild() {
+    return !parent.equals(NO_PARENT);
+  }
 
-    @Override
-    public boolean isEnabled() {
-        return (Boolean) getValue(Action.ENABLED);
-    }
+  @Override
+  public boolean isEnabled() {
+    return (Boolean) getValue(Action.ENABLED);
+  }
 
-    @Override
-    public boolean isVisible() {
-        return (Boolean) getValue(VISIBLE);
-    }
+  @Override
+  public boolean isVisible() {
+    return (Boolean) getValue(VISIBLE);
+  }
 
-    @Override
-    public boolean mustBeAdded() {
-        final boolean result = true;
-        for (final GuiAddCondition addCondition : addConditions) {
-            if (!addCondition.mustBeAdded(this)) {
-                return false;
-            }
-        }
-        return result;
+  @Override
+  public boolean mustBeAdded() {
+    final boolean result = true;
+    for (final GuiAddCondition addCondition : addConditions) {
+      if (!addCondition.mustBeAdded(this)) {
+        return false;
+      }
     }
+    return result;
+  }
 
-    @Override
-    public void setEnabled(final boolean enabled) {
-        putValue(Action.ENABLED, enabled);
-    }
+  @Override
+  public void setEnabled(final boolean enabled) {
+    putValue(Action.ENABLED, enabled);
+  }
 
-    @Override
-    public void setId(final String id) {
-        this.id = id;
-    }
+  @Override
+  public void setId(final String id) {
+    this.id = id;
+  }
 
-    /**
-     * If we have several toolbars, we can group with the "location" string key
-     * actions that must be in the same location (ex: top bar, bottom bar, and
-     * so on).
-     * 
-     * @param location
-     *            the new location
-     */
-    @Override
-    public void setLocation(final String location) {
-        this.location = location;
-    }
+  /**
+   * If we have several toolbars, we can group with the "location" string key
+   * actions that must be in the same location (ex: top bar, bottom bar, and so
+   * on).
+   * 
+   * @param location
+   *          the new location
+   */
+  @Override
+  public void setLocation(final String location) {
+    this.location = location;
+  }
 
-    @Override
-    public void setParent(final GuiActionDescrip parent) {
-        this.parent = parent;
-    }
+  @Override
+  public void setParent(final GuiActionDescrip parent) {
+    this.parent = parent;
+  }
 
-    /**
-     * Sets the position (where the UI element will be positioned, for instance
-     * in a toolbar or in a menu).
-     * 
-     * @param position
-     *            the new position
-     */
-    @Override
-    public void setPosition(final int position) {
-        this.position = position;
-    }
+  /**
+   * Sets the position (where the UI element will be positioned, for instance in
+   * a toolbar or in a menu).
+   * 
+   * @param position
+   *          the new position
+   */
+  @Override
+  public void setPosition(final int position) {
+    this.position = position;
+  }
 
-    @Override
-    public void setStyles(final String styles) {
-        putValue(Action.STYLES, styles);
-    }
+  @Override
+  public void setStyles(final String styles) {
+    putValue(Action.STYLES, styles);
+  }
 
-    @Override
-    public void setTarget(final Object object) {
-        putValue(TARGET, object);
-    }
+  @Override
+  public void setTarget(final Object object) {
+    putValue(TARGET, object);
+  }
 
-    @Override
-    public void setVisible(final boolean visible) {
-        putValue(VISIBLE, visible);
-    }
+  @Override
+  public void setVisible(final boolean visible) {
+    putValue(VISIBLE, visible);
+  }
 
-    @Override
-    public String toString() {
-        final String name = (String) getValue(Action.NAME);
-        final String tooltip = (String) getValue(Action.SHORT_DESCRIPTION);
-        return "[GuiActionDescrip: " + getClass().getName() + (name == null ? "" : " " + name)
-                + (tooltip == null ? "" : " " + tooltip) + "]";
-    }
+  @Override
+  public void toggleTooltipVisible() {
+    final Object value = getValue(TOOGLE_TOOLTIP_VISIBLE);
+    putValue(TOOGLE_TOOLTIP_VISIBLE, value == null ? true : !(Boolean) value);
+  }
 
-    @Override
-    public GuiActionDescrip withIcon(final Object icon) {
-        super.putValue(Action.SMALL_ICON, icon);
-        return this;
-    }
+  @Override
+  public void toogleVisible() {
+    putValue(VISIBLE, !isVisible());
+  }
 
-    @Override
-    public GuiActionDescrip withIconCls(final String icon) {
-        putValue(Action.SMALL_ICON, icon);
-        return this;
-    }
+  @Override
+  public String toString() {
+    final String name = (String) getValue(Action.NAME);
+    final String tooltip = (String) getValue(Action.SHORT_DESCRIPTION);
+    return "[GuiActionDescrip: " + getClass().getName() + (name == null ? "" : " " + name)
+        + (tooltip == null ? "" : " " + tooltip) + "]";
+  }
 
-    @Override
-    public GuiActionDescrip withId(final String id) {
-        setId(id);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withIcon(final Object icon) {
+    super.putValue(Action.SMALL_ICON, icon);
+    return this;
+  }
 
-    @Override
-    public GuiActionDescrip withParent(final GuiActionDescrip parent) {
-        setParent(parent);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withIconCls(final String icon) {
+    putValue(Action.SMALL_ICON, icon);
+    return this;
+  }
 
-    @Override
-    public GuiActionDescrip withShortcut(final KeyStroke shortcut) {
-        putValue(Action.ACCELERATOR_KEY, shortcut);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withId(final String id) {
+    setId(id);
+    return this;
+  }
 
-    @Override
-    public GuiActionDescrip withStyles(final String styles) {
-        setStyles(styles);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withParent(final GuiActionDescrip parent) {
+    setParent(parent);
+    return this;
+  }
 
-    @Override
-    public GuiActionDescrip withText(final String text) {
-        putValue(Action.NAME, text);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withShortcut(final KeyStroke shortcut) {
+    putValue(Action.ACCELERATOR_KEY, shortcut);
+    return this;
+  }
 
-    @Override
-    public GuiActionDescrip withToolTip(final String tooltip) {
-        putValue(Action.SHORT_DESCRIPTION, tooltip);
-        return this;
-    }
+  @Override
+  public GuiActionDescrip withStyles(final String styles) {
+    setStyles(styles);
+    return this;
+  }
+
+  @Override
+  public GuiActionDescrip withText(final String text) {
+    putValue(Action.NAME, text);
+    return this;
+  }
+
+  @Override
+  public GuiActionDescrip withToolTip(final String tooltip) {
+    putValue(Action.SHORT_DESCRIPTION, tooltip);
+    return this;
+  }
 }

Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -26,88 +26,94 @@
 
 public interface GuiActionDescrip {
 
-    public static final AbstractGuiActionDescrip NO_PARENT = new NoParentGuiActionDescriptor();
+  public static final AbstractGuiActionDescrip NO_PARENT = new NoParentGuiActionDescriptor();
 
-    public static final int NO_POSITION = -1;
+  public static final int NO_POSITION = -1;
 
-    /**
-     * {@link #TARGET} is used to associate a {@link #AbstractGuiActionDescrip}
-     * with an object like groups, group names, users, and so on, and used to
-     * execute actions against these targets
-     */
-    public static final String TARGET = "target";
+  /**
+   * {@link #TARGET} is used to associate a {@link #AbstractGuiActionDescrip}
+   * with an object like groups, group names, users, and so on, and used to
+   * execute actions against these targets
+   */
+  public static final String TARGET = "target";
 
-    public static final String VISIBLE = "visibleprop";
+  public static final String TOOGLE_TOOLTIP_VISIBLE = "toogle-tooltip-visible";
 
-    void add(final GuiAddCondition addCondition);
+  public static final String VISIBLE = "visibleprop";
 
-    void addPropertyChangeListener(final PropertyChangeListener listener);
+  void add(final GuiAddCondition addCondition);
 
-    void fire(final ActionEvent event);
+  void addPropertyChangeListener(final PropertyChangeListener listener);
 
-    AbstractAction getAction();
+  void fire(final ActionEvent event);
 
-    String getId();
+  AbstractAction getAction();
 
-    Object[] getKeys();
+  String getId();
 
-    String getLocation();
+  Object[] getKeys();
 
-    GuiActionDescrip getParent();
+  String getLocation();
 
-    int getPosition();
+  GuiActionDescrip getParent();
 
-    PropertyChangeListener[] getPropertyChangeListeners();
+  int getPosition();
 
-    Object getTarget();
+  PropertyChangeListener[] getPropertyChangeListeners();
 
-    Class<?> getType();
+  Object getTarget();
 
-    Object getValue(final String key);
+  Class<?> getType();
 
-    boolean hasTarget();
+  Object getValue(final String key);
 
-    boolean isChild();
+  boolean hasTarget();
 
-    boolean isEnabled();
+  boolean isChild();
 
-    boolean isVisible();
+  boolean isEnabled();
 
-    boolean mustBeAdded();
+  boolean isVisible();
 
-    public void putValue(final String key, final Object value);
+  boolean mustBeAdded();
 
-    void removePropertyChangeListener(final PropertyChangeListener listener);
+  public void putValue(final String key, final Object value);
 
-    void setEnabled(final boolean enabled);
+  void removePropertyChangeListener(final PropertyChangeListener listener);
 
-    void setId(final String id);
+  void setEnabled(final boolean enabled);
 
-    void setLocation(final String location);
+  void setId(final String id);
 
-    void setParent(final GuiActionDescrip parent);
+  void setLocation(final String location);
 
-    void setPosition(final int position);
+  void setParent(final GuiActionDescrip parent);
 
-    void setStyles(final String styles);
+  void setPosition(final int position);
 
-    void setTarget(final Object object);
+  void setStyles(final String styles);
 
-    void setVisible(final boolean visible);
+  void setTarget(final Object object);
 
-    GuiActionDescrip withIcon(Object icon);
+  void setVisible(final boolean visible);
 
-    GuiActionDescrip withIconCls(String icon);
+  void toggleTooltipVisible();
 
-    GuiActionDescrip withId(String id);
+  void toogleVisible();
 
-    GuiActionDescrip withParent(GuiActionDescrip parent);
+  GuiActionDescrip withIcon(Object icon);
 
-    GuiActionDescrip withShortcut(KeyStroke keystroke);
+  GuiActionDescrip withIconCls(String icon);
 
-    GuiActionDescrip withStyles(String styles);
+  GuiActionDescrip withId(String id);
 
-    GuiActionDescrip withText(String text);
+  GuiActionDescrip withParent(GuiActionDescrip parent);
 
-    GuiActionDescrip withToolTip(String tooltip);
+  GuiActionDescrip withShortcut(KeyStroke keystroke);
+
+  GuiActionDescrip withStyles(String styles);
+
+  GuiActionDescrip withText(String text);
+
+  GuiActionDescrip withToolTip(String tooltip);
 }

Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -45,155 +45,165 @@
 
 public class Tooltip extends PopupPanel {
 
-    interface TooltipUiBinder extends UiBinder<Widget, Tooltip> {
-    }
+  interface TooltipUiBinder extends UiBinder<Widget, Tooltip> {
+  }
 
-    private static TooltipUiBinder uiBinder = GWT.create(TooltipUiBinder.class);
+  private static TooltipUiBinder uiBinder = GWT.create(TooltipUiBinder.class);
 
-    public static Tooltip to(final Widget widget, final String text) {
-        if (TextUtils.notEmpty(text)) {
-            final Tooltip tip = new Tooltip();
-            tip.to(widget);
-            tip.setText(text);
-            return tip;
-        }
-        return null;
+  public static Tooltip to(final Widget widget, final String text) {
+    if (TextUtils.notEmpty(text)) {
+      final Tooltip tip = new Tooltip();
+      tip.to(widget);
+      tip.setText(text);
+      return tip;
     }
+    return null;
+  }
 
-    public static Tooltip to(final Widget widget, final Widget withContent) {
-        final Tooltip tip = new Tooltip();
-        tip.to(widget);
-        tip.setContent(withContent);
-        return tip;
-    }
-    @UiField
-    HTMLPanel arrow;
-    @UiField
-    HTMLPanel arrowBorder;
-    @UiField
-    FlowPanel content;
-    @UiField
-    FlowPanel flow;
-    private Widget ofWidget;
-    private final TooltipTimers timers;
-    @UiField
-    InlineLabel title;
-    @UiField
-    HTMLPanel tooltip;
+  public static Tooltip to(final Widget widget, final Widget withContent) {
+    final Tooltip tip = new Tooltip();
+    tip.to(widget);
+    tip.setContent(withContent);
+    return tip;
+  }
+  @UiField
+  HTMLPanel arrow;
+  @UiField
+  HTMLPanel arrowBorder;
+  @UiField
+  FlowPanel content;
+  @UiField
+  FlowPanel flow;
+  private Widget ofWidget;
+  private final TooltipTimers timers;
+  @UiField
+  InlineLabel title;
+  @UiField
+  HTMLPanel tooltip;
 
-    public Tooltip() {
-        super.add(uiBinder.createAndBindUi(this));
-        super.setStyleName("k-tooltip-no-chrome");
-        super.setAutoHideEnabled(false);
-        super.setAnimationEnabled(false);
-        final TimerWrapper overTimer = new TimerWrapper();
-        overTimer.configure(new Executer() {
-            @Override
-            public void execute() {
-                show();
-            }
-        });
-        final Executer hideExecuter = new Executer() {
-            @Override
-            public void execute() {
-                hide();
-            }
-        };
-        final TimerWrapper outTimer = new TimerWrapper();
-        final TimerWrapper securityTimer = new TimerWrapper();
-        outTimer.configure(hideExecuter);
-        securityTimer.configure(hideExecuter);
-        timers = new TooltipTimers(overTimer, outTimer, securityTimer);
-    }
+  public Tooltip() {
+    super.add(uiBinder.createAndBindUi(this));
+    super.setStyleName("k-tooltip-no-chrome");
+    super.setAutoHideEnabled(false);
+    super.setAnimationEnabled(false);
+    final TimerWrapper overTimer = new TimerWrapper();
+    overTimer.configure(new Executer() {
+      @Override
+      public void execute() {
+        show();
+      }
+    });
+    final Executer hideExecuter = new Executer() {
+      @Override
+      public void execute() {
+        hide();
+      }
+    };
+    final TimerWrapper outTimer = new TimerWrapper();
+    final TimerWrapper securityTimer = new TimerWrapper();
+    outTimer.configure(hideExecuter);
+    securityTimer.configure(hideExecuter);
+    timers = new TooltipTimers(overTimer, outTimer, securityTimer);
+  }
 
-    protected int getHeight() {
-        return tooltip.getElement().getOffsetHeight();
-    }
+  protected int getHeight() {
+    return tooltip.getElement().getOffsetHeight();
+  }
 
-    protected int getWidth() {
-        return tooltip.getElement().getOffsetWidth();
-    }
+  protected int getWidth() {
+    return tooltip.getElement().getOffsetWidth();
+  }
 
-    private void setContent(final Widget widget) {
-        content.clear();
-        content.add(widget);
-    }
+  @Override
+  public boolean isVisible() {
+    return super.isShowing();
+  }
 
-    public void setText(final String text) {
-        content.clear();
-        content.add(new Label(text));
-    }
+  private void setContent(final Widget widget) {
+    content.clear();
+    content.add(widget);
+  }
 
-    @Override
-    public void show() {
-        if (!Tooltip.this.isShowing() && ofWidget.isVisible()) {
-            Tooltip.super.show();
-            Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(), Window.getClientHeight(),
-                    ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(), ofWidget.getOffsetWidth(),
-                    ofWidget.getOffsetHeight(), Tooltip.this.getWidth(), Tooltip.this.getHeight()));
-            if (tooltip.getOffsetWidth() > 430) {
-                tooltip.getElement().getStyle().setWidth(430, Unit.PX);
-            } else {
-                tooltip.getElement().getStyle().clearWidth();
-            }
-        }
+  public void setText(final String text) {
+    content.clear();
+    content.add(new Label(text));
+  }
+
+  @Override
+  public void show() {
+    if (!Tooltip.this.isShowing() && ofWidget.isVisible()) {
+      Tooltip.super.show();
+      Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(),
+          Window.getClientHeight(), ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(),
+          ofWidget.getOffsetWidth(), ofWidget.getOffsetHeight(), Tooltip.this.getWidth(),
+          Tooltip.this.getHeight()));
+      if (tooltip.getOffsetWidth() > 430) {
+        tooltip.getElement().getStyle().setWidth(430, Unit.PX);
+      } else {
+        tooltip.getElement().getStyle().clearWidth();
+      }
     }
+  }
 
-    protected void showAt(final TooltipPosition position) {
-        this.setPopupPosition(position.getLeft(), position.getTop());
-        switch (position.getArrowPosition()) {
-        case N:
-        case NW:
-        case NE:
-            arrow.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
-            arrow.getElement().getStyle().setTop(position.getArrowTop() + 3, Unit.PX);
-            arrowBorder.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
-            arrowBorder.getElement().getStyle().setTop(position.getArrowTop() + 1, Unit.PX);
-            arrow.getElement().removeClassName("k-tooltip-arrow-s");
-            arrow.getElement().addClassName("k-tooltip-arrow-n");
-            arrowBorder.getElement().removeClassName("k-tooltip-arrow-border-s");
-            arrowBorder.getElement().addClassName("k-tooltip-arrow-border-n");
-            break;
-        case S:
-        case SE:
-        case SW:
-            arrow.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
-            arrow.getElement().getStyle().setBottom(position.getArrowTop() + 2, Unit.PX);
-            arrowBorder.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
-            arrowBorder.getElement().getStyle().setBottom(position.getArrowTop(), Unit.PX);
-            arrow.getElement().addClassName("k-tooltip-arrow-s");
-            arrow.getElement().removeClassName("k-tooltip-arrow-n");
-            arrowBorder.getElement().addClassName("k-tooltip-arrow-border-s");
-            arrowBorder.getElement().removeClassName("k-tooltip-arrow-border-n");
-            break;
-        }
+  protected void showAt(final TooltipPosition position) {
+    this.setPopupPosition(position.getLeft(), position.getTop());
+    switch (position.getArrowPosition()) {
+    case N:
+    case NW:
+    case NE:
+      arrow.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
+      arrow.getElement().getStyle().setTop(position.getArrowTop() + 3, Unit.PX);
+      arrowBorder.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
+      arrowBorder.getElement().getStyle().setTop(position.getArrowTop() + 1, Unit.PX);
+      arrow.getElement().removeClassName("k-tooltip-arrow-s");
+      arrow.getElement().addClassName("k-tooltip-arrow-n");
+      arrowBorder.getElement().removeClassName("k-tooltip-arrow-border-s");
+      arrowBorder.getElement().addClassName("k-tooltip-arrow-border-n");
+      break;
+    case S:
+    case SE:
+    case SW:
+      arrow.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
+      arrow.getElement().getStyle().setBottom(position.getArrowTop() + 2, Unit.PX);
+      arrowBorder.getElement().getStyle().setLeft(position.getArrowLeft(), Unit.PX);
+      arrowBorder.getElement().getStyle().setBottom(position.getArrowTop(), Unit.PX);
+      arrow.getElement().addClassName("k-tooltip-arrow-s");
+      arrow.getElement().removeClassName("k-tooltip-arrow-n");
+      arrowBorder.getElement().addClassName("k-tooltip-arrow-border-s");
+      arrowBorder.getElement().removeClassName("k-tooltip-arrow-border-n");
+      break;
     }
+  }
 
-    private void to(final Widget ofWidget) {
-        this.ofWidget = ofWidget;
-        ofWidget.addDomHandler(new MouseOverHandler() {
-            @Override
-            public void onMouseOver(final MouseOverEvent event) {
-                timers.onOver();
-            }
-        }, MouseOverEvent.getType());
-        ofWidget.addDomHandler(new FocusHandler() {
-            @Override
-            public void onFocus(final FocusEvent event) {
-                timers.onOut();
-            }
-        }, FocusEvent.getType());
-        ofWidget.addDomHandler(new BlurHandler() {
-            @Override
-            public void onBlur(final BlurEvent event) {
-                timers.onOut();
-            }
-        }, BlurEvent.getType());
-        ofWidget.addDomHandler(new MouseOutHandler() {
-            @Override
-            public void onMouseOut(final MouseOutEvent event) {
-                timers.onOut();
-            }
-        }, MouseOutEvent.getType());
-    }
+  public void showTemporally() {
+    timers.showTemporally();
+  }
+
+  private void to(final Widget ofWidget) {
+    this.ofWidget = ofWidget;
+    ofWidget.addDomHandler(new MouseOverHandler() {
+      @Override
+      public void onMouseOver(final MouseOverEvent event) {
+        timers.onOver();
+      }
+    }, MouseOverEvent.getType());
+    ofWidget.addDomHandler(new FocusHandler() {
+      @Override
+      public void onFocus(final FocusEvent event) {
+        timers.onOut();
+      }
+    }, FocusEvent.getType());
+    ofWidget.addDomHandler(new BlurHandler() {
+      @Override
+      public void onBlur(final BlurEvent event) {
+        timers.onOut();
+      }
+    }, BlurEvent.getType());
+    ofWidget.addDomHandler(new MouseOutHandler() {
+      @Override
+      public void onMouseOut(final MouseOutEvent event) {
+        timers.onOut();
+      }
+    }, MouseOutEvent.getType());
+  }
 }

Modified: trunk/src/main/java/cc/kune/common/client/tooltip/TooltipTimers.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/TooltipTimers.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/TooltipTimers.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -23,37 +23,48 @@
 
 public class TooltipTimers {
 
-    private final TimerWrapper hideTimer;
-    private final TimerWrapper securityTimer;
-    private final TimerWrapper showTimer;
+  private final TimerWrapper hideTimer;
+  private final TimerWrapper securityTimer;
+  private final TimerWrapper showTimer;
 
-    public TooltipTimers(final TimerWrapper showTimer, final TimerWrapper hideTimer, final TimerWrapper securityTimer) {
-        this.showTimer = showTimer;
-        this.hideTimer = hideTimer;
-        this.securityTimer = securityTimer;
+  public TooltipTimers(final TimerWrapper showTimer, final TimerWrapper hideTimer,
+      final TimerWrapper securityTimer) {
+    this.showTimer = showTimer;
+    this.hideTimer = hideTimer;
+    this.securityTimer = securityTimer;
+  }
+
+  public void onOut() {
+    if (showTimer.isScheduled()) {
+      showTimer.cancel();
     }
+    if (!hideTimer.isScheduled()) {
+      hideTimer.schedule(650);
+    }
+    if (!securityTimer.isScheduled()) {
+      securityTimer.cancel();
+    }
+  }
 
-    public void onOut() {
-        if (showTimer.isScheduled()) {
-            showTimer.cancel();
-        }
-        if (!hideTimer.isScheduled()) {
-            hideTimer.schedule(650);
-        }
-        if (!securityTimer.isScheduled()) {
-            securityTimer.cancel();
-        }
+  public void onOver() {
+    if (!showTimer.isScheduled()) {
+      showTimer.schedule(700);
     }
+    if (hideTimer.isScheduled()) {
+      hideTimer.cancel();
+    }
+    if (!securityTimer.isScheduled()) {
+      securityTimer.schedule(7000);
+    }
+  }
 
-    public void onOver() {
-        if (!showTimer.isScheduled()) {
-            showTimer.schedule(700);
-        }
-        if (hideTimer.isScheduled()) {
-            hideTimer.cancel();
-        }
-        if (!securityTimer.isScheduled()) {
-            securityTimer.schedule(7000);
-        }
+  public void showTemporally() {
+    if (showTimer.isScheduled()) {
+      showTimer.cancel();
     }
+    if (hideTimer.isScheduled()) {
+      hideTimer.cancel();
+    }
+    securityTimer.schedule(5000);
+  }
 }

Added: trunk/src/main/java/cc/kune/core/client/events/WindowFocusEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/WindowFocusEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/WindowFocusEvent.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,81 @@
+package cc.kune.core.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class WindowFocusEvent extends GwtEvent<WindowFocusEvent.WindowFocusHandler> {
+
+  public interface HasWindowFocusHandlers extends HasHandlers {
+    HandlerRegistration addWindowFocusHandler(WindowFocusHandler handler);
+  }
+
+  public interface WindowFocusHandler extends EventHandler {
+    public void onWindowFocus(WindowFocusEvent event);
+  }
+
+  private static final Type<WindowFocusHandler> TYPE = new Type<WindowFocusHandler>();
+
+  public static void fire(final HasHandlers source, final boolean hasFocus) {
+    source.fireEvent(new WindowFocusEvent(hasFocus));
+  }
+
+  public static Type<WindowFocusHandler> getType() {
+    return TYPE;
+  }
+
+  boolean hasFocus;
+
+  protected WindowFocusEvent() {
+    // Possibly for serialization.
+  }
+
+  public WindowFocusEvent(final boolean hasFocus) {
+    this.hasFocus = hasFocus;
+  }
+
+  @Override
+  protected void dispatch(final WindowFocusHandler handler) {
+    handler.onWindowFocus(this);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (getClass() != obj.getClass()) {
+      return false;
+    }
+    final WindowFocusEvent other = (WindowFocusEvent) obj;
+    if (hasFocus != other.hasFocus) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public Type<WindowFocusHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + Boolean.valueOf(hasFocus).hashCode();
+    return hashCode;
+  }
+
+  public boolean isHasFocus() {
+    return hasFocus;
+  }
+
+  @Override
+  public String toString() {
+    return "WindowFocusEvent[" + hasFocus + "]";
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -36,7 +36,10 @@
 import cc.kune.core.shared.dto.GroupType;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.GroupOptions;
 
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.logical.shared.CloseEvent;
@@ -51,145 +54,156 @@
 import com.gwtplatform.mvp.client.proxy.Proxy;
 import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
 
-public class NewGroupPresenter extends Presenter<NewGroupView, NewGroupPresenter.NewGroupProxy> implements NewGroup {
+public class NewGroupPresenter extends Presenter<NewGroupView, NewGroupPresenter.NewGroupProxy>
+    implements NewGroup {
 
-    @ProxyCodeSplit
-    public interface NewGroupProxy extends Proxy<NewGroupPresenter> {
-    }
+  @ProxyCodeSplit
+  public interface NewGroupProxy extends Proxy<NewGroupPresenter> {
+  }
 
-    private final Provider<GroupServiceAsync> groupService;
+  private final GroupOptions groupOptions;
 
-    private final I18nTranslationService i18n;
-    private final Session session;
-    private final Provider<SignIn> signIn;
-    private final StateManager stateManager;
+  private final Provider<GroupServiceAsync> groupService;
+  private final I18nTranslationService i18n;
+  private final Session session;
+  private final Provider<SignIn> signIn;
 
-    @Inject
-    public NewGroupPresenter(final EventBus eventBus, final NewGroupView view, final NewGroupProxy proxy,
-            final I18nTranslationService i18n, final Session session, final StateManager stateManager,
-            final Provider<GroupServiceAsync> groupService, final Provider<SignIn> signIn) {
-        super(eventBus, view, proxy);
-        this.i18n = i18n;
-        this.session = session;
-        this.stateManager = stateManager;
-        this.groupService = groupService;
-        this.signIn = signIn;
-        stateManager.addSiteToken(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                doNewGroup();
-            }
-        });
-    }
+  private final StateManager stateManager;
 
-    @Override
-    public void doNewGroup() {
-        session.check(new AsyncCallbackSimple<Void>() {
-            @Override
-            public void onSuccess(final Void result) {
-                if (session.isLogged()) {
-                    NotifyUser.showProgressProcessing();
-                    getView().show();
-                    getView().focusOnShorName();
-                    NotifyUser.hideProgress();
-                } else {
-                    // stateManager.restorePreviousToken();
-                    NotifyUser.info(i18n.t(CoreMessages.REGISTER_TO_CREATE_A_GROUP));
-                    signIn.get().showSignInDialog();
-                }
-            }
-        });
-    }
+  @Inject
+  public NewGroupPresenter(final EventBus eventBus, final NewGroupView view, final NewGroupProxy proxy,
+      final I18nTranslationService i18n, final Session session, final StateManager stateManager,
+      final Provider<GroupServiceAsync> groupService, final Provider<SignIn> signIn,
+      final GroupOptions groupOptions) {
+    super(eventBus, view, proxy);
+    this.i18n = i18n;
+    this.session = session;
+    this.stateManager = stateManager;
+    this.groupService = groupService;
+    this.signIn = signIn;
+    this.groupOptions = groupOptions;
+    stateManager.addSiteToken(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        doNewGroup();
+      }
+    });
+  }
 
-    private GroupType getTypeOfGroup() {
-        if (getView().isProject()) {
-            return GroupType.PROJECT;
-        } else if (getView().isOrganization()) {
-            return GroupType.ORGANIZATION;
+  @Override
+  public void doNewGroup() {
+    session.check(new AsyncCallbackSimple<Void>() {
+      @Override
+      public void onSuccess(final Void result) {
+        if (session.isLogged()) {
+          NotifyUser.showProgressProcessing();
+          getView().show();
+          getView().focusOnShorName();
+          NotifyUser.hideProgress();
         } else {
-            return GroupType.COMMUNITY;
+          // stateManager.restorePreviousToken();
+          signIn.get().setErrorMessage(i18n.t(CoreMessages.REGISTER_TO_CREATE_A_GROUP), NotifyLevel.info);
+          signIn.get().showSignInDialog();
         }
+      }
+    });
+  }
+
+  private GroupType getTypeOfGroup() {
+    if (getView().isProject()) {
+      return GroupType.PROJECT;
+    } else if (getView().isOrganization()) {
+      return GroupType.ORGANIZATION;
+    } else {
+      return GroupType.COMMUNITY;
     }
+  }
 
-    @Override
-    protected void onBind() {
-        super.onBind();
-        getView().getFirstBtn().addClickHandler(new ClickHandler() {
-            @Override
-            public void onClick(final ClickEvent event) {
-                onRegister();
-            }
-        });
-        getView().getSecondBtn().addClickHandler(new ClickHandler() {
-            @Override
-            public void onClick(final ClickEvent event) {
-                onCancel();
-            }
-        });
-        getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
+  @Override
+  protected void onBind() {
+    super.onBind();
+    getView().getFirstBtn().addClickHandler(new ClickHandler() {
+      @Override
+      public void onClick(final ClickEvent event) {
+        onRegister();
+      }
+    });
+    getView().getSecondBtn().addClickHandler(new ClickHandler() {
+      @Override
+      public void onClick(final ClickEvent event) {
+        onCancel();
+      }
+    });
+    getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
 
-            @Override
-            public void onClose(final CloseEvent<PopupPanel> event) {
-                NewGroupPresenter.this.onClose();
-            }
-        });
-    }
+      @Override
+      public void onClose(final CloseEvent<PopupPanel> event) {
+        NewGroupPresenter.this.onClose();
+      }
+    });
+  }
 
-    public void onCancel() {
-        getView().hide();
-    }
+  public void onCancel() {
+    getView().hide();
+  }
 
-    public void onClose() {
-        reset();
-        stateManager.redirectOrRestorePreviousToken();
-    }
+  public void onClose() {
+    reset();
+    stateManager.redirectOrRestorePreviousToken();
+  }
 
-    public void onRegister() {
-        if (getView().isFormValid()) {
-            getView().maskProcessing();
-            final String shortName = getView().getShortName();
-            final String longName = getView().getLongName();
-            final String publicDesc = getView().getPublicDesc();
-            final LicenseDTO license = session.getDefLicense();
-            final GroupDTO group = new GroupDTO(shortName, longName, getTypeOfGroup());
-            group.setDefaultLicense(license);
+  public void onRegister() {
+    if (getView().isFormValid()) {
+      getView().maskProcessing();
+      final String shortName = getView().getShortName();
+      final String longName = getView().getLongName();
+      final String publicDesc = getView().getPublicDesc();
+      final LicenseDTO license = session.getDefLicense();
+      final GroupDTO group = new GroupDTO(shortName, longName, getTypeOfGroup());
+      group.setDefaultLicense(license);
 
-            final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
-                @Override
-                public void onFailure(final Throwable caught) {
-                    if (caught instanceof GroupNameInUseException) {
-                        getView().unMask();
-                        setMessage(i18n.t(CoreMessages.NAME_IN_ALREADY_IN_USE), NotifyLevel.error);
-                    } else {
-                        getView().unMask();
-                        setMessage(i18n.t("Error creating group"), NotifyLevel.error);
-                        throw new UIException("Other kind of exception in group registration", caught);
-                    }
-                }
+      final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
+        @Override
+        public void onFailure(final Throwable caught) {
+          if (caught instanceof GroupNameInUseException) {
+            getView().unMask();
+            setMessage(i18n.t(CoreMessages.NAME_IN_ALREADY_IN_USE), NotifyLevel.error);
+          } else {
+            getView().unMask();
+            setMessage(i18n.t("Error creating group"), NotifyLevel.error);
+            throw new UIException("Other kind of exception in group registration", caught);
+          }
+        }
 
-                @Override
-                public void onSuccess(final StateToken token) {
-                    getView().hide();
-                    stateManager.gotoStateToken(token);
-                    reset();
-                    getView().unMask();
-                }
-            };
-            groupService.get().createNewGroup(session.getUserHash(), group, publicDesc, getView().getTags(), null,
-                    callback);
+        @Override
+        public void onSuccess(final StateToken token) {
+          getView().hide();
+          Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+            @Override
+            public void execute() {
+              stateManager.gotoStateToken(token);
+              groupOptions.showTooltip();
+            }
+          });
+          reset();
+          getView().unMask();
         }
+      };
+      groupService.get().createNewGroup(session.getUserHash(), group, publicDesc, getView().getTags(),
+          null, callback);
     }
+  }
 
-    private void reset() {
-        getView().clearData();
-    }
+  private void reset() {
+    getView().clearData();
+  }
 
-    @Override
-    protected void revealInParent() {
-        RevealRootContentEvent.fire(this, this);
-    }
+  @Override
+  protected void revealInParent() {
+    RevealRootContentEvent.fire(this, this);
+  }
 
-    public void setMessage(final String message, final NotifyLevel level) {
-        getView().setMessage(message, level);
-    }
+  public void setMessage(final String message, final NotifyLevel level) {
+    getView().setMessage(message, level);
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -21,12 +21,14 @@
 
 import cc.kune.common.client.notify.NotifyLevel;
 import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.events.WindowFocusEvent;
 import cc.kune.core.client.init.AppStartEvent;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.SiteTokens;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.TokenUtils;
 import cc.kune.core.client.state.UserSignOutEvent;
+import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.GSpaceArmor;
 import cc.kune.gspace.client.style.GSpaceBackManager;
 
@@ -34,6 +36,7 @@
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.user.client.Timer;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 import com.gwtplatform.mvp.client.Presenter;
@@ -67,6 +70,14 @@
     void setPublicBtnDown(boolean down);
 
     void setUserBtnDown(boolean down);
+
+    void showGroupSpaceTooltip();
+
+    void showHomeSpaceTooltip();
+
+    void showPublicSpaceTooltip();
+
+    void showUserSpaceTooltip();
   }
 
   private final GSpaceArmor armor;
@@ -74,6 +85,7 @@
   private Space currentSpace;
   private String groupToken;
   private String homeToken;
+  private final I18nTranslationService i18n;
   private String publicToken;
   private final Session session;
   private final Provider<SignIn> signIn;
@@ -83,13 +95,15 @@
   @Inject
   public SpaceSelectorPresenter(final EventBus eventBus, final StateManager stateManager,
       final SpaceSelectorView view, final SpaceSelectorProxy proxy, final GSpaceArmor armor,
-      final Session session, final Provider<SignIn> signIn, final GSpaceBackManager backManager) {
+      final Session session, final Provider<SignIn> signIn, final GSpaceBackManager backManager,
+      final I18nTranslationService i18n) {
     super(eventBus, view, proxy);
     this.stateManager = stateManager;
     this.armor = armor;
     this.session = session;
     this.signIn = signIn;
     this.backManager = backManager;
+    this.i18n = i18n;
     currentSpace = null;
     homeToken = SiteTokens.HOME;
     userToken = SiteTokens.WAVEINBOX;
@@ -119,10 +133,19 @@
         stateManager.gotoHistoryToken(publicToken);
       }
     });
+    eventBus.addHandler(WindowFocusEvent.getType(), new WindowFocusEvent.WindowFocusHandler() {
+      @Override
+      public void onWindowFocus(final WindowFocusEvent event) {
+        if (event.isHasFocus()) {
+          showTooltipWithDelay();
+        }
+      }
+    });
   }
 
   @ProxyEvent
   public void onAppStart(final AppStartEvent event) {
+    showTooltipWithDelay();
   }
 
   private void onGroupSpaceSelect() {
@@ -195,7 +218,6 @@
       default:
         break;
       }
-      // getView().hideTooltip();
     }
   }
 
@@ -217,10 +239,10 @@
       getView().setPublicBtnDown(false);
       currentSpace = Space.userSpace;
     } else {
-      signIn.get().setErrorMessage("Sign in to access to your inbox", NotifyLevel.info);
+      signIn.get().setErrorMessage(i18n.t("Sign in or create an account to access to your inbox"),
+          NotifyLevel.info);
       stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN, userToken));
       getView().setUserBtnDown(false);
-      // NotifyUser.info("Sign in to access to your workspace");
     }
   }
 
@@ -228,4 +250,30 @@
   protected void revealInParent() {
     RevealRootContentEvent.fire(this, this);
   }
+
+  private void showTooltipNow() {
+    switch (currentSpace) {
+    case homeSpace:
+      getView().showHomeSpaceTooltip();
+      break;
+    case userSpace:
+      getView().showUserSpaceTooltip();
+      break;
+    case groupSpace:
+      getView().showGroupSpaceTooltip();
+      break;
+    case publicSpace:
+      getView().showPublicSpaceTooltip();
+      break;
+    }
+  }
+
+  protected void showTooltipWithDelay() {
+    new Timer() {
+      @Override
+      public void run() {
+        showTooltipNow();
+      }
+    }.schedule(500);
+  }
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorViewImpl.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -41,26 +41,31 @@
   private static SpaceSelectorViewImplUiBinder uiBinder = GWT.create(SpaceSelectorViewImplUiBinder.class);
   @UiField
   ToggleButton groupButton;
+  private final Tooltip groupSpaceTooltip;
   @UiField
   ToggleButton homeButton;
+  private final Tooltip homeSpaceTooltip;
   @UiField
   HorizontalPanel panel;
   @UiField
   ToggleButton publicButton;
+  private final Tooltip publicSpaceTooltip;
   @UiField
   ToggleButton userButton;
+  private final Tooltip userSpaceTooltip;
 
   @Inject
   public SpaceSelectorViewImpl(final GSpaceArmor armor, final I18nTranslationService i18n,
       final GSpaceArmorResources res) {
     armor.getSitebar().insert(uiBinder.createAndBindUi(this), 0);
     // homeButton.setVisible(false);
-    Tooltip.to(homeButton, i18n.t("Your home page in this site"));
-    Tooltip.to(userButton, i18n.t("User space: it shows a list of all your documents and contents "
-        + "in which you participate"));
-    Tooltip.to(groupButton, i18n.t("Group and personal space: Where you can create "
+    homeSpaceTooltip = Tooltip.to(homeButton, i18n.t("Your home page in this site"));
+    userSpaceTooltip = Tooltip.to(userButton,
+        i18n.t("User space: it shows a list of all your documents and contents "
+            + "in which you participate"));
+    groupSpaceTooltip = Tooltip.to(groupButton, i18n.t("Group and personal space: Where you can create "
         + "and publish contents for your personal or group web spaces"));
-    Tooltip.to(publicButton,
+    publicSpaceTooltip = Tooltip.to(publicButton,
         i18n.t("Public space: In this space you can see a preview of how the Personal o"
             + "r Group Space looks like on the web, outside this site"));
   }
@@ -109,4 +114,20 @@
   public void setUserBtnDown(final boolean down) {
     userButton.setDown(down);
   }
+
+  public void showGroupSpaceTooltip() {
+    groupSpaceTooltip.showTemporally();
+  }
+
+  public void showHomeSpaceTooltip() {
+    homeSpaceTooltip.showTemporally();
+  }
+
+  public void showPublicSpaceTooltip() {
+    publicSpaceTooltip.showTemporally();
+  }
+
+  public void showUserSpaceTooltip() {
+    userSpaceTooltip.showTemporally();
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -415,7 +415,7 @@
     // history.newItem(newToken.toString(), false);
     StateChangedEvent.fire(eventBus, newState);
     checkGroupAndToolChange(newState);
-    previousToken = newToken;
+    previousToken = newToken.copy();
     eventBus.fireEvent(new ProgressHideEvent());
   }
 

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-07-09 16:44:34 UTC (rev 1442)
@@ -1,4 +1,4 @@
-CHARSET           "UTF-8          "; body {
+CHARSET            "UTF-8           "; body {
   background-color: transparent;
   color: black;
   font-family: 'Ubuntu', Arial;
@@ -728,6 +728,7 @@
   background: #FFB380 none repeat scroll 0% 50%;
   /* color: #250; */
   padding: 10px;
+  margin: 16px -20px -20px -20px;
 }
 
 .k-error-tb img {
@@ -832,7 +833,7 @@
     white-space: nowrap;
 }
 */
-.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button,.gwt-FileUpload
+.k-sn-mainpanel .x-btn button,.k-sn-mainpanel button,button.k-button,.gwt-FileUpload,button.gwt-Button
   {
   font: 13px 'Ubuntu', arial;
   border: 2px solid #CCCCCC;
@@ -854,7 +855,7 @@
   height: 28px;
 }
 
-.k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover
+.k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover,button.gwt-Button:hover
   {
   border: 2px orange solid;
   outline: 0 none;
@@ -1201,7 +1202,7 @@
   -webkit-border-bottom-left-radius: 5px;
   -moz-border-radius-bottomleft: 5px;
   border-bottom-left-radius: 5px;
-  kfilter: alpha(opacity =                                                 90);
+  kfilter: alpha(opacity =                                                   90);
   -moz-opacity: 0.90;
   -khtml-opacity: 0.90;
   opacity: 0.90;
@@ -1411,4 +1412,4 @@
 
 .bullet-type-2 {
   list-style-type: square;
-}
+}
\ No newline at end of file

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-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2011-07-09 16:44:34 UTC (rev 1442)
@@ -38,7 +38,7 @@
           <g:SplitLayoutPanel width="100%" height="100%" styleName="k-space"
             ui:field="groupSpace">
             <g:center size="1.0">
-              <g:DockLayoutPanel unit="PX" ui:field="splitCenter">
+              <g:DockLayoutPanel unit="PX" ui:field="splitCenter" styleName="{res.style.entityCentralContainer}">
                 <g:north size="168">
                   <g:VerticalPanel width="100%" height="168px">
                     <g:FlowPanel height="70px" width="100%"

Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptions.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptions.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptions.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -20,4 +20,6 @@
 package cc.kune.gspace.client.options;
 
 public interface GroupOptions extends EntityOptions {
+
+  void showTooltip();
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -60,10 +60,12 @@
     // groupPrefsAction.putValue(Action.NAME, i18n.t("Group options"));
     groupPrefsAction.putValue(Action.SMALL_ICON, img.prefs());
     prefsItem = new ButtonDescriptor(groupPrefsAction);
-    prefsItem.withStyles("k-ent-header-btn, k-btn-min"); // , k-noborder,
-                                                         // k-nobackcolor,
-                                                         // k-btn-min");
+    prefsItem.withStyles("k-ent-header-btn, k-btn-min");
+    // k-noborder,
+    // k-nobackcolor,
+    // k-btn-min");
     prefsItem.setId(GROUP_OPTIONS_ICON);
+    prefsItem.withToolTip(i18n.t("Set your group preferences here"));
     prefsItem.setVisible(false);
     view.addAction(prefsItem);
   }
@@ -85,4 +87,9 @@
       }
     });
   }
+
+  @Override
+  public void showTooltip() {
+    prefsItem.toggleTooltipVisible();
+  }
 }

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-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -42,6 +42,8 @@
 
     String docSubheaderLeft();
 
+    String entityCentralContainer();
+
     String entityFooter();
 
     String entityHeader();

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-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css	2011-07-09 16:44:34 UTC (rev 1442)
@@ -34,6 +34,9 @@
   opacity: 0.38 !important; */
 }
 
+.entityCentralContainer {
+
+}
 .entityHeader {
   -webkit-border-top-right-radius: 7px;
   -moz-border-radius-topright: 7px;

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmorTheme.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmorTheme.css	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmorTheme.css	2011-07-09 16:44:34 UTC (rev 1442)
@@ -25,7 +25,7 @@
   color: c5;
 }
 
-.entityToolsNorth span ,.k-sn-deck div {
+.entityToolsNorth span,.k-sn-deck div {
   color: c1;
 }
 
@@ -54,6 +54,7 @@
 }
 
 .k-tool-item {
+
 }
 
 .k-tool-item span {
@@ -69,6 +70,7 @@
 }
 
 .k-tool-item-nofocus {
+
 }
 
 .k-tool-item-nofocus span {
@@ -101,11 +103,15 @@
   color: c4;
 }
 
+.entityCentralContainer {
+  border-left: 2px solid bc1;
+}
+
 .entityHeader {
   background-color: bc5;
 }
 
-.entityHeader span, .entityHeader div {
+.entityHeader span,.entityHeader div {
   color: c5;
 }
 
@@ -142,7 +148,7 @@
   background-color: bc7;
 }
 
-.k-empty-msg span, .k-folder-viewer span {
+.k-empty-msg span,.k-folder-viewer span {
   color: c7;
 }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -43,10 +43,7 @@
 
   @Override
   public void clearBackImage() {
-    if (!lastToken.equals(NO_TOKEN)) {
-      gSpaceArmor.clearBackImage();
-      lastToken = NO_TOKEN;
-    }
+    gSpaceArmor.clearBackImage();
   }
 
   @Override
@@ -61,7 +58,7 @@
     final StateToken tokenNoGroup = token.clearDocument().clearDocument();
     if (!tokenNoGroup.equals(lastToken)) {
       gSpaceArmor.setBackImage(downloadUtils.getBackgroundImageUrl(tokenNoGroup));
-      lastToken = tokenNoGroup;
+      lastToken = tokenNoGroup.copy();
     }
 
   }

Added: trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,162 @@
+/**
+ * Copyright 2011 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.server;
+
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.account.AccountData;
+import org.waveprotocol.box.server.persistence.AccountStore;
+import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.box.server.robots.util.RobotsUtil;
+import org.waveprotocol.box.server.robots.util.RobotsUtil.RobotRegistrationException;
+import org.waveprotocol.wave.model.id.TokenGenerator;
+import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.name.Named;
+import com.google.inject.name.Names;
+import com.google.wave.api.AbstractRobot;
+
+/**
+ * The base for robot agents that run on the WIAB server.
+ * 
+ * @author yurize at apache.org (Yuri Zelikov)
+ */
+ at SuppressWarnings("serial")
+public abstract class AbstractBaseRobotAgent extends AbstractRobot {
+
+  static class ServerFrontendAddressHolder {
+
+    private final List<String> addresses;
+
+    @Inject
+    ServerFrontendAddressHolder(@Named(CoreSettings.HTTP_FRONTEND_ADDRESSES) final List<String> addresses) {
+      this.addresses = addresses;
+    }
+
+    List<String> getAddresses() {
+      return addresses;
+    }
+  }
+
+  public static final String AGENT_PREFIX_URI = "/agent";
+  private static final Logger LOG = Logger.getLogger(AbstractBaseRobotAgent.class.getName());
+
+  /** Account store with user and robot accounts. */
+  private final AccountStore accountStore;
+
+  private final ServerFrontendAddressHolder frontendAddressHolder;
+
+  /** The wave server domain. */
+  private final String waveDomain;
+
+  /**
+   * Constructor. Initializes the agent to serve on the URI provided by
+   * {@link #getRobotUri()} and ensures that the agent is registered in the
+   * Account store.
+   * 
+   * @param injector
+   *          the injector instance.
+   */
+  public AbstractBaseRobotAgent(final Injector injector) {
+    this(injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))),
+        injector.getInstance(AccountStore.class), injector.getInstance(TokenGenerator.class),
+        injector.getInstance(ServerFrontendAddressHolder.class));
+  }
+
+  /**
+   * Constructor. Initializes the agent to serve on the URI provided by
+   * {@link #getRobotUri()} and ensures that the agent is registered in the
+   * Account store.
+   */
+  AbstractBaseRobotAgent(final String waveDomain, final AccountStore accountStore,
+      final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
+    this.waveDomain = waveDomain;
+    this.accountStore = accountStore;
+    this.frontendAddressHolder = frontendAddressHolder;
+    ensureRegistered(tokenGenerator, getFrontEndAddress()); // NOPMD by vjrj on
+                                                            // 6/07/11 21:15
+  }
+
+  /**
+   * Ensures that the robot agent is registered in the {@link AccountStore}.
+   */
+  private void ensureRegistered(final TokenGenerator tokenGenerator, final String serverFrontendAddress) {
+    ParticipantId robotId = null;
+    try {
+      robotId = ParticipantId.of(getRobotId() + "@" + waveDomain);
+    } catch (final InvalidParticipantAddress e) {
+      LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
+      return;
+    }
+    try {
+      final String location = "http://" + serverFrontendAddress + getRobotUri();
+      // Register this agent in the account store. The registration is forced
+      // in order to re-register the agents if the server frontend address has
+      // changed.
+      final AccountData account = accountStore.getAccount(robotId);
+      if ((account == null || (account != null && !account.asRobot().getUrl().equals(location)))) {
+        RobotsUtil.registerRobotUri(location, robotId, accountStore, tokenGenerator, true);
+      }
+
+    } catch (final RobotRegistrationException e) {
+      LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
+    } catch (final PersistenceException e) {
+      LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
+    }
+  }
+
+  /**
+   * Returns the account store.
+   */
+  protected AccountStore getAccountStore() {
+    return accountStore;
+  }
+
+  public String getFrontEndAddress() {
+    return frontendAddressHolder.getAddresses().get(0);
+  }
+
+  /**
+   * Returns the robot participant id.
+   */
+  public abstract String getRobotId();
+
+  @Override
+  protected String getRobotProfilePageUrl() { // NOPMD by vjrj on 6/07/11 21:15
+    return null;
+  }
+
+  /**
+   * Returns the robot URI.
+   */
+  public abstract String getRobotUri();
+
+  /**
+   * Returns the wave domain.
+   */
+  public String getWaveDomain() {
+    return waveDomain;
+  }
+}
\ No newline at end of file

Added: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,140 @@
+package cc.kune.wave.server;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.Nonnull;
+
+import org.waveprotocol.box.server.account.RobotAccountData;
+import org.waveprotocol.box.server.persistence.AccountStore;
+import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.wave.model.id.TokenGenerator;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Singleton;
+import com.google.wave.api.Wavelet;
+
+ at SuppressWarnings("serial")
+ at Singleton
+public class KuneAgent extends AbstractBaseRobotAgent implements KuneWaveManager {
+
+  private static final Logger LOG = Logger.getLogger(KuneAgent.class.getName());
+
+  private static final String NO_TITLE = "";
+  public static final String ROBOT_URI = AGENT_PREFIX_URI + "/kune-agent";
+
+  @Inject
+  public KuneAgent(final Injector injector) {
+    super(injector);
+  }
+
+  public KuneAgent(final String waveDomain, final AccountStore accountStore,
+      final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
+    super(waveDomain, accountStore, tokenGenerator, frontendAddressHolder);
+  }
+
+  @Override
+  public void addGadget(final WaveRef waveName, final String author, final String gadgetUrl) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void addParticipant(final WaveRef waveName, final String author, final String userWhoAdd,
+      final String newParticipant) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public WaveRef createWave(final String message, final ParticipantId participant) {
+    return createWave(NO_TITLE, message, participant);
+  }
+
+  @Override
+  public WaveRef createWave(@Nonnull final String title, final String message,
+      @Nonnull final ParticipantId... participantsArray) {
+    return createWave(title, message, WITHOUT_GADGET, participantsArray);
+  }
+
+  @Override
+  public WaveRef createWave(final String title, final String message, final URL gadgetUrl,
+      final ParticipantId... participantsArray) {
+    // super.newWave(getWaveDomain(), participantsArray);
+    final HashSet<String> parts = new HashSet<String>();
+    for (final ParticipantId part : participantsArray) {
+      parts.add(part.getAddress());
+    }
+    final Wavelet wave = newWave(getWaveDomain(), parts);
+    return WaveRef.of(wave.getWaveId(), wave.getWaveletId());
+  }
+
+  @Override
+  public Wavelet fetchWavelet(final WaveRef waveRef, final String author) {
+    // Preconditions.checkNotNull(author);
+    RobotAccountData account = null;
+    final String rpcUrl = "http://" + getFrontEndAddress() + "/robot/rpc";
+    try {
+      account = getAccountStore().getAccount(
+          ParticipantId.ofUnsafe(getRobotId() + "@" + getWaveDomain())).asRobot();
+    } catch (final PersistenceException e) {
+      LOG.log(Level.WARNING, "Cannot fetch account data for robot id: " + getRobotId(), e);
+    }
+    if (account != null) {
+      setupOAuth(account.getId().getAddress(), account.getConsumerSecret(), rpcUrl);
+      try {
+        return super.fetchWavelet(waveRef.getWaveId(), waveRef.getWaveletId(), "http://"
+            + getFrontEndAddress() + "/robot/rpc");
+      } catch (final IOException e) {
+        e.printStackTrace();
+        return null;
+      }
+    }
+    return null;
+  }
+
+  @Override
+  public String getRobotId() {
+    return "kune-agent";
+  }
+
+  @Override
+  protected String getRobotName() {
+    return "Kune Agent";
+  }
+
+  @Override
+  public String getRobotUri() {
+    return ROBOT_URI;
+  }
+
+  @Override
+  public boolean isParticipant(final Wavelet wavelet, final String user) {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public String render(final Wavelet wavelet) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public String render(final WaveRef waveRef, final String author) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public void setTitle(final WaveRef waveName, final String title, final String author) {
+    // TODO Auto-generated method stub
+
+  }
+}

Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -77,6 +77,7 @@
   // See: DocumentModifyServiceTest
   private static final String NO_ANNOTATION_KEY = null;
   private static final List<BundledAnnotation> NO_BUNDLED_ANNOTATIONS = Collections.emptyList();
+  private static final List<Element> NO_ELEMENTS = Collections.emptyList();
   private static final String NO_TITLE = "";
 
   private static final List<String> NO_VALUES = Collections.<String> emptyList();
@@ -163,8 +164,26 @@
     final Wavelet newWavelet = opQueue.createWavelet(domain, participants);
     opQueue.setTitleOfWavelet(newWavelet, title);
     final Blip rootBlip = newWavelet.getRootBlip();
-    // rootBlip.append(new com.google.wave.api.Markup(message).getText());
-    rootBlip.appendMarkup(message);
+    rootBlip.append(new com.google.wave.api.Markup(message).getText());
+    // rootBlip.all().delete();
+    // rootBlip.appendMarkup(message);
+    // opQueue.appendMarkupToDocument(rootBlip,
+    // ContentNewUnrenderer.unrender(message).toXmlString());
+
+    // final OperationRequest modifyDocument = opQueue.modifyDocument(rootBlip);
+    // ImmutableList<String> of =
+    // ImmutableList.of(ContentNewUnrenderer.unrender(message).toXmlString());
+    // rootBlip.getContent().hackConsume(
+    // Nindo.fromDocOp(ContentNewUnrenderer.unrender(message).asOperation(),
+    // false));
+    // modifyDocument.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
+    // new DocumentModifyAction(
+    // ModifyHow.REPLACE,
+    // ImmutableList.of(ContentNewUnrenderer.unrender(message).toXmlString()),
+    // null,
+    // null, null, false)));
+    // NO_ANNOTATION_KEY, NO_ELEMENTS, NO_BUNDLED_ANNOTATIONS, false)));
+    // rootBlip.appendMarkup(message);
     if (gadgetUrl != WITHOUT_GADGET) {
       final Gadget gadget = new Gadget(gadgetUrl.toString());
       rootBlip.append(gadget);

Added: trunk/src/main/java/com/google/wave/splash/text/ContentNewUnrenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/text/ContentNewUnrenderer.java	                        (rev 0)
+++ trunk/src/main/java/com/google/wave/splash/text/ContentNewUnrenderer.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,77 @@
+/**
+ * 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 com.google.wave.splash.text;
+
+import java.util.logging.Logger;
+
+import org.waveprotocol.wave.model.document.indexed.IndexedDocument;
+import org.waveprotocol.wave.model.document.operation.Nindo;
+import org.waveprotocol.wave.model.document.raw.RawDocumentProviderImpl;
+import org.waveprotocol.wave.model.document.raw.impl.Element;
+import org.waveprotocol.wave.model.document.raw.impl.Node;
+import org.waveprotocol.wave.model.document.raw.impl.RawDocumentImpl;
+import org.waveprotocol.wave.model.document.raw.impl.Text;
+import org.waveprotocol.wave.model.document.util.DocProviders;
+import org.waveprotocol.wave.model.document.util.Point;
+import org.waveprotocol.wave.model.document.util.RawElementStyleView;
+import org.waveprotocol.wave.model.operation.OperationException;
+import org.waveprotocol.wave.model.richtext.RichTextMutationBuilder;
+import org.waveprotocol.wave.model.richtext.RichTextTokenizer;
+import org.waveprotocol.wave.model.richtext.RichTextTokenizerImpl;
+import org.waveprotocol.wave.model.util.Pair;
+import org.waveprotocol.wave.model.util.ReadableStringSet;
+
+import cc.kune.core.client.errors.DefaultException;
+
+public class ContentNewUnrenderer {
+
+  private static final Logger LOG = Logger.getLogger(ContentNewUnrenderer.class.getName());
+
+  private static Pair<Nindo, IndexedDocument<Node, Element, Text>> applyTokensToEmptyDoc(
+      final RichTextTokenizer tokens) {
+    // final IndexedDocument<Node, Element, Text> doc =
+    // DocProviders.POJO.parse("<body><line/></body>");
+    final IndexedDocument<Node, Element, Text> doc = DocProviders.POJO.parse("<line/>");
+    // final Point<Node> insertAt = doc.locate(3);
+    final Point<Node> insertAt = doc.locate(1);
+
+    final Nindo.Builder builder = new Nindo.Builder();
+    builder.skip(1);
+    // builder.skip(3);
+    final ReadableStringSet mutations = new RichTextMutationBuilder().applyMutations(tokens, builder,
+        doc, insertAt.getContainer());
+
+    final Nindo nindo = builder.build();
+    try {
+      doc.consumeAndReturnInvertible(nindo);
+    } catch (final OperationException e) {
+      throw new DefaultException("Operation Exception " + e);
+    }
+    doc.asOperation();
+    return new Pair<Nindo, IndexedDocument<Node, Element, Text>>(nindo, doc);
+  }
+
+  public static IndexedDocument<Node, Element, Text> unrender(final String content) {
+    final RawElementStyleView rawEl = new RawElementStyleView(RawDocumentProviderImpl.create(
+        RawDocumentImpl.BUILDER).parse("<div>" + content + "</div>"));
+    final RichTextTokenizerImpl<Node, Element, Text> tokenizer = new RichTextTokenizerImpl<Node, Element, Text>(
+        rawEl);
+    final Pair<Nindo, IndexedDocument<Node, Element, Text>> result = applyTokensToEmptyDoc(tokenizer);
+    return result.getSecond();
+  }
+
+}

Modified: trunk/src/main/java/com/google/wave/splash/text/ContentRenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/text/ContentRenderer.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/com/google/wave/splash/text/ContentRenderer.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -149,7 +149,8 @@
       final String d = element.getProperty(Line.DIRECTION);
       final Integer ident = i != null ? Integer.valueOf(i) : 0;
       if (inheader) {
-        builder.append("</div>");
+        // New line, we close previous header
+        builder.append("</div> <!-- end h1/h2... header -->");
         inheader = false;
       }
       if (t != null && t.equals(Paragraph.LIST_TYPE)) {

Modified: trunk/src/main/java/com/google/wave/splash/text/ContentUnrenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/text/ContentUnrenderer.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/main/java/com/google/wave/splash/text/ContentUnrenderer.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -16,52 +16,54 @@
  */
 package com.google.wave.splash.text;
 
+import java.util.Map;
+import java.util.logging.Logger;
 
-import com.google.common.collect.Maps;
-import com.google.wave.api.Annotations;
-import com.google.wave.api.Line;
-
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.nodes.Node;
 import org.jsoup.nodes.TextNode;
+import org.jsoup.safety.Whitelist;
+import com.google.wave.api.Annotation;
+import com.google.common.collect.Maps;
+import com.google.wave.api.Annotations;
+import com.google.wave.api.Line;
 
-import java.util.Map;
-import java.util.logging.Logger;
-
-/**
- * @author anthonybaxter at gmail.com (Anthony Baxter)
- */
 public class ContentUnrenderer {
 
-  private static final Logger LOG = Logger.getLogger(ContentUnrenderer.class.getName());
-
   /**
-   * Turns a HTML document back into a set of text, elements, annotations.
+   * Container for the output of the unrender method.
    */
-  public static UnrenderedBlip unrender(String content) {
-    StringBuilder sb = new StringBuilder();
-    Map<Integer, com.google.wave.api.Element> elements = Maps.newHashMap();
+  public static class UnrenderedBlip {
     Annotations annotations = new Annotations();
-    Document doc = Jsoup.parse(content);
-    unrender(doc.body(), sb, elements, annotations);
-    return new UnrenderedBlip(sb.toString(), elements, annotations);
+    public String contents;
+    Map<Integer, com.google.wave.api.Element> elements;
+
+    UnrenderedBlip(final String contents, final Map<Integer, com.google.wave.api.Element> elements,
+        final Annotations annotations) {
+      this.contents = contents;
+      this.elements = elements;
+      this.annotations = annotations;
+    }
   }
 
+  private static final Logger LOG = Logger.getLogger(ContentUnrenderer.class.getName());
+
   /**
-   * Helper method to recursively parse a HTML element and construct a wave document.
+   * Helper method to recursively parse a HTML element and construct a wave
+   * document.
    */
-  private static void unrender(Node parent, StringBuilder output, Map<Integer,
-      com.google.wave.api.Element> elements, Annotations annotations) {
-    for (Node node : parent.childNodes()) {
+  private static void unrender(final Node parent, final StringBuilder output,
+      final Map<Integer, com.google.wave.api.Element> elements, final Annotations annotations) {
+    for (final Node node : parent.childNodes()) {
       if (node instanceof TextNode) {
-        output.append(((TextNode)node).text());
-      }
-      else if (node instanceof Element) {
-        int position = output.length();
-        Element element = (Element)node;
-        if ("p".equals(element.tag().getName())) {
+        output.append(((TextNode) node).text());
+      } else if (node instanceof Element) {
+        final int position = output.length();
+        final Element element = (Element) node;
+        final String name = element.tag().getName();
+        if ("p".equalsIgnoreCase(name)) {
           elements.put(position, new Line());
           // handle any attributes?
         }
@@ -73,18 +75,16 @@
   }
 
   /**
-   * Container for the output of the unrender method.
+   * Turns a HTML document back into a set of text, elements, annotations.
    */
-  public static class UnrenderedBlip {
-    public String contents;
-    Map<Integer, com.google.wave.api.Element> elements;
-    Annotations annotations = new Annotations();
-
-    UnrenderedBlip(String contents, Map<Integer, com.google.wave.api.Element> elements,
-        Annotations annotations) {
-      this.contents = contents;
-      this.elements = elements;
-      this.annotations = annotations;
-    }
+  public static UnrenderedBlip unrender(final String content) {
+    final StringBuilder sb = new StringBuilder();
+    final Map<Integer, com.google.wave.api.Element> elements = Maps.newHashMap();
+    final Annotations annotations = new Annotations();
+    // Sanitized
+    final String safe = Jsoup.clean(content, Whitelist.basic());
+    final Document doc = Jsoup.parse(safe);
+    unrender(doc.body(), sb, elements, annotations);
+    return new UnrenderedBlip(sb.toString(), elements, annotations);
   }
 }

Added: trunk/src/main/java/com/google/wave/splash/text/HtmlRawViewImpl.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/text/HtmlRawViewImpl.java	                        (rev 0)
+++ trunk/src/main/java/com/google/wave/splash/text/HtmlRawViewImpl.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,207 @@
+/**
+ * Copyright 2008 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 com.google.wave.splash.text;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.waveprotocol.wave.model.document.raw.impl.Element;
+import org.waveprotocol.wave.model.document.raw.impl.Node;
+import org.waveprotocol.wave.model.document.raw.impl.Text;
+import org.waveprotocol.wave.model.document.util.ElementStyleView;
+import org.waveprotocol.wave.model.document.util.Point;
+
+/**
+ * Presents a simple view of a HTML document where you can walk through every
+ * node. It is rooted at a specific element (i.e. it can be a subtree of a full
+ * document). However the results of attempting to traverse outside the document
+ * are undefined.
+ * 
+ * @author danilatos at google.com (Daniel Danilatos)
+ * 
+ *         Adapted to be used in served side by vjrj at ourproject.org
+ * 
+ */
+public class HtmlRawViewImpl implements ElementStyleView<Node, Element, Text> { // HTMLView
+
+  /**
+   * Singleton instance, if you don't care about not having a document element
+   * defined.
+   */
+  public static final HtmlRawViewImpl INSTANCE = new HtmlRawViewImpl(null);
+
+  Element documentElement;
+
+  /**
+   * @param documentElement
+   *          Root element for this "document"
+   */
+  public HtmlRawViewImpl(final Element documentElement) {
+    this.documentElement = documentElement;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Element asElement(final Node node) {
+    return node.asElement();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Text asText(final Node node) {
+    return node.asText();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public String getAttribute(final Element element, final String name) {
+    // FIXME: test!
+    return element.getAttribute(name);
+    // return name.equals("class") ? element.getClassName() :
+    // element.getAttribute(name);
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Map<String, String> getAttributes(final Element element) {
+    return Collections.emptyMap();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public String getData(final Text textNode) {
+    return textNode.getData();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Element getDocumentElement() {
+    return documentElement;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getFirstChild(final Node node) {
+    return node.getFirstChild();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getLastChild(final Node node) {
+    return node.getLastChild();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public int getLength(final Text textNode) {
+    return textNode.getLength();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getNextSibling(final Node node) {
+    return node.getNextSibling();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public short getNodeType(final Node node) { // NOPMD by vjrj on 4/07/11 20:55
+    return node.getNodeType();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Element getParentElement(final Node node) {
+    return node.getParentElement();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getPreviousSibling(final Node node) {
+    return node.getPreviousSibling();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public String getStylePropertyValue(final Element element, final String name) {
+    return getStylePropertyValue(element.getAttribute("style"), name);
+  }
+
+  private String getStylePropertyValue(final String styles, final String name) {
+    if (styles != null && styles.contains(name)) {
+      for (final String stylePair : styles.split(";")) {
+        final int index = stylePair.indexOf(':');
+        if (index >= 0 && index < stylePair.length() - 1) {
+          final String key = stylePair.substring(0, index).trim();
+          final String value = stylePair.substring(index + 1);
+          if (key.equalsIgnoreCase(name)) {
+            return value.trim();
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public String getTagName(final Element element) {
+    return element.getTagName();
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getVisibleNode(final Node node) {
+    return node;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getVisibleNodeFirst(final Node node) {
+    return node;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getVisibleNodeLast(final Node node) {
+    return node;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getVisibleNodeNext(final Node node) {
+    return node;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public Node getVisibleNodePrevious(final Node node) {
+    return node;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  public boolean isSameNode(final Node node, final Node other) {
+    // TODO(danilatos): Use .equals or isSameNode for nodelets in nodemanager,
+    // typing extractor, etc.
+    return node == other || (node != null && node.equals(other));
+  }
+
+  @Override
+  public void onBeforeFilter(final Point<Node> at) {
+  }
+}

Added: trunk/src/main/java/com/google/wave/splash/text/UnrenderUtils.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/text/UnrenderUtils.java	                        (rev 0)
+++ trunk/src/main/java/com/google/wave/splash/text/UnrenderUtils.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,123 @@
+/**
+ * Copyright 2009 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 com.google.wave.splash.text;
+
+import org.jsoup.nodes.Element;
+
+/**
+ * Adaptation from Wave RichTextTokenizer.
+ * 
+ * Not used yet, so deprecated
+ */
+ at Deprecated
+public class UnrenderUtils {
+
+  public static boolean isBlockElement(final String tagName) {
+    return "p".equalsIgnoreCase(tagName) || "div".equalsIgnoreCase(tagName) || isListItem(tagName);
+  }
+
+  public static boolean isHeading(final String tagName) {
+    if (tagName.length() == 2) {
+      if (tagName.charAt(0) == 'h' || tagName.charAt(0) == 'H') {
+        final int size = tagName.charAt(1) - '0';
+        if (size >= 1 && size <= 4) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
+  public static boolean isLink(final String tagName) {
+    return "a".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isList(final String tagName) {
+    return isOrderedList(tagName) || isUnorderedList(tagName);
+  }
+
+  public static boolean isListItem(final String tagName) {
+    return "li".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isNewline(final String tagName) {
+    return "br".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isOrderedList(final String tagName) {
+    return "ol".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isTable(final String tagName) {
+    return "table".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isTableCell(final String tagName) {
+    return "th".equalsIgnoreCase(tagName) || "td".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isTableRelated(final String tagName) {
+    // TODO(patcoleman): fix up table implementation once tables supported in
+    // the editor.
+    // When this happens, also extract out strings into symbolic constants.
+    return isTable(tagName) || isTableRow(tagName) || isTableCell(tagName)
+        || "thead".equalsIgnoreCase(tagName) || "tbody".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isTableRow(final String tagName) {
+    return "tr".equalsIgnoreCase(tagName);
+  }
+
+  public static boolean isUnorderedList(final String tagName) {
+    return "ul".equalsIgnoreCase(tagName);
+  }
+
+  private String getStylePropertyValue(final String styles, final String name) {
+    if (styles != null && styles.contains(name)) {
+      for (final String stylePair : styles.split(";")) {
+        final int index = stylePair.indexOf(':');
+        if (index >= 0 && index < stylePair.length() - 1) {
+          final String key = stylePair.substring(0, index).trim();
+          final String value = stylePair.substring(index + 1);
+          if (key.equalsIgnoreCase(name)) {
+            return value.trim();
+          }
+        }
+      }
+    }
+    return null;
+  }
+
+  public boolean isBackgroundColor(final Element el) {
+    return isStylePropertySet(el, "backgroundColor");
+  }
+
+  public boolean isColor(final Element el) {
+    return isStylePropertySet(el, "color");
+  }
+
+  public boolean isFontFamily(final Element el) {
+    return isStylePropertySet(el, "fontFamily");
+  }
+
+  public boolean isStylePropertySet(final Element el, final String property) {
+    final String value = getStylePropertyValue(el.attr("style"), property);
+    return value != null && !value.isEmpty();
+  }
+
+}

Added: trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,72 @@
+package cc.kune.wave.server;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.waveprotocol.box.server.account.AccountData;
+import org.waveprotocol.box.server.account.RobotAccountData;
+import org.waveprotocol.box.server.persistence.AccountStore;
+import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.wave.model.id.TokenGenerator;
+import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import cc.kune.wave.server.AbstractBaseRobotAgent.ServerFrontendAddressHolder;
+
+import com.google.common.collect.Lists;
+import com.google.wave.api.Wavelet;
+
+public class KuneAgentTest {
+  private static final String MESSAGE = "testing";
+  private static final String NEW_PARTICIPANT = "newparti";
+  private static final String RICHTEXT_MESSAGE = "<b>" + MESSAGE + "</b>";
+  private static final String TEST_GADGET = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
+  private static final String TITLE = "title";
+  private static final String TITLENEW = "titleNew";
+
+  KuneAgent manager;
+
+  @Before
+  public void before() throws PersistenceException, InvalidParticipantAddress {
+    final ServerFrontendAddressHolder frontendAddressHolder = Mockito.mock(ServerFrontendAddressHolder.class);
+    Mockito.when(frontendAddressHolder.getAddresses()).thenReturn(Lists.newArrayList("localhost:9898"));
+    final TokenGenerator tokenGenerator = Mockito.mock(TokenGenerator.class);
+    Mockito.when(tokenGenerator.generateToken(Mockito.anyInt())).thenReturn("abcde");
+    final AccountStore accountStore = Mockito.mock(AccountStore.class);
+    final AccountData accountData = Mockito.mock(AccountData.class);
+    final RobotAccountData accountRobotData = Mockito.mock(RobotAccountData.class);
+    final ParticipantId participantId = ParticipantId.of("kune-agent at example.com");
+
+    Mockito.when(accountStore.getAccount((ParticipantId) Mockito.anyObject())).thenReturn(accountData);
+    Mockito.when(accountData.asRobot()).thenReturn(accountRobotData);
+    Mockito.when(accountRobotData.getUrl()).thenReturn(KuneAgent.ROBOT_URI);
+    Mockito.when(accountRobotData.getId()).thenReturn(participantId);
+    Mockito.when(accountRobotData.getConsumerSecret()).thenReturn("someconsumer");
+    manager = new KuneAgent("example.com", accountStore, tokenGenerator, frontendAddressHolder);
+  }
+
+  private String getSiteAdminShortName() {
+    // TODO Auto-generated method stub
+
+    return "admin at example.com";
+  }
+
+  @Ignore
+  @Test
+  public void testBasicCreation() throws InvalidParticipantAddress {
+    final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
+        ParticipantId.of(getSiteAdminShortName()));
+    assertNotNull(waveletName);
+    final Wavelet fetchWavelet = manager.fetchWavelet(waveletName, getSiteAdminShortName());
+    assertNotNull(fetchWavelet);
+    assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
+    assertEquals("", fetchWavelet.getRootBlip().getContent());
+    assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+  }
+}

Modified: trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java	2011-07-08 00:00:41 UTC (rev 1441)
+++ trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -41,11 +41,12 @@
 
   private static final String MESSAGE = "testing";
   private static final String NEW_PARTICIPANT = "newparti";
+  private static final String RICHTEXT_MESSAGE = "<b>" + MESSAGE + "</b>";
   private static final String TEST_GADGET = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
   private static final String TITLE = "title";
   private static final String TITLENEW = "titleNew";
   @Inject
-  KuneWaveManagerDefault manager;
+  KuneWaveManager manager;
   @Inject
   ParticipantUtils participantUtils;
 
@@ -78,27 +79,28 @@
   @Before
   public void before() {
     new IntegrationTestHelper(this);
-
   }
 
   private WaveRef createTestWave() {
-    return manager.createWave(TITLE, MESSAGE, participantUtils.of(getSiteAdminShortName()));
+    return manager.createWave(TITLE, RICHTEXT_MESSAGE, participantUtils.of(getSiteAdminShortName()));
   }
 
   @Test
   public void createWave() throws DefaultException, IOException {
     doLogin();
-    final WaveRef waveletName = manager.createWave(MESSAGE, participantUtils.of(getSiteAdminShortName()));
+    final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
+        participantUtils.of(getSiteAdminShortName()));
     assertNotNull(waveletName);
     final Wavelet fetchWavelet = manager.fetchWavelet(waveletName, getSiteAdminShortName());
     assertNotNull(fetchWavelet);
+    assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
     assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
   }
 
   @Test
   public void createWaveWithGadget() throws DefaultException, IOException {
     doLogin();
-    final WaveRef waveletName = manager.createWave(TITLE, MESSAGE, new URL(TEST_GADGET),
+    final WaveRef waveletName = manager.createWave(TITLE, RICHTEXT_MESSAGE, new URL(TEST_GADGET),
         participantUtils.of(getSiteAdminShortName()));
     assertNotNull(waveletName);
     final Wavelet fetchWavelet = manager.fetchWavelet(waveletName, getSiteAdminShortName());

Added: trunk/src/test/java/com/google/wave/splash/text/ContentNewUnrendererTest.java
===================================================================
--- trunk/src/test/java/com/google/wave/splash/text/ContentNewUnrendererTest.java	                        (rev 0)
+++ trunk/src/test/java/com/google/wave/splash/text/ContentNewUnrendererTest.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,20 @@
+package com.google.wave.splash.text;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.google.wave.splash.text.ContentUnrenderer.UnrenderedBlip;
+
+public class ContentNewUnrendererTest {
+
+  @Ignore
+  @Test
+  public void testBasicUnrender() {
+    // final IndexedDocument<Node, Element, Text> result =
+    // ContentNewUnrenderer.unrender("<b>Some <em>bold</em></b>");
+    final UnrenderedBlip result = ContentUnrenderer.unrender("<p></p><p><b>Some <em>bold</em></b></p>");
+    assertEquals("", result.elements.toString());
+  }
+}

Added: trunk/src/test/java/com/google/wave/splash/text/ContentUnrendererTest.java
===================================================================
--- trunk/src/test/java/com/google/wave/splash/text/ContentUnrendererTest.java	                        (rev 0)
+++ trunk/src/test/java/com/google/wave/splash/text/ContentUnrendererTest.java	2011-07-09 16:44:34 UTC (rev 1442)
@@ -0,0 +1,22 @@
+package com.google.wave.splash.text;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.waveprotocol.wave.model.document.indexed.IndexedDocument;
+import org.waveprotocol.wave.model.document.raw.impl.Element;
+import org.waveprotocol.wave.model.document.raw.impl.Node;
+import org.waveprotocol.wave.model.document.raw.impl.Text;
+
+public class ContentUnrendererTest {
+
+  @Ignore
+  @Test
+  public void testBasicUnrender() {
+    final IndexedDocument<Node, Element, Text> unrender = ContentNewUnrenderer.unrender("<b>foo</b>");
+    assertEquals("", unrender.toXmlString());
+    // assertTrue(blip.annotations.size() > 0);
+  }
+
+}




More information about the kune-commits mailing list