[kune-commits] r899 - in trunk/src: main/java/org/ourproject/kune/app/public/css main/java/org/ourproject/kune/docs/client main/java/org/ourproject/kune/docs/client/cnt main/java/org/ourproject/kune/docs/client/cnt/reader/ui main/java/org/ourproject/kune/platf/client/actions main/java/org/ourproject/kune/platf/client/actions/toolbar main/java/org/ourproject/kune/platf/client/dto main/java/org/ourproject/kune/platf/server/domain main/java/org/ourproject/kune/platf/server/manager/impl main/java/org/ourproject/kune/workspace/client/ctxnav main/java/org/ourproject/kune/workspace/client/editor main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu main/java/org/ourproject/kune/workspace/client/skel test/java/org/ourproject/kune/workspace/client/editor

vjrj vjrj at ourproject.org
Wed Oct 1 23:12:26 CEST 2008


Author: vjrj
Date: 2008-10-01 23:12:10 +0200 (Wed, 01 Oct 2008)
New Revision: 899

Removed:
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbarView.java
Modified:
   trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
   trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupListDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupList.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
   trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Log:
more editors refactorization and some fixes

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-10-01 21:12:10 UTC (rev 899)
@@ -1729,6 +1729,41 @@
   margin-left: 10px;
 }
 
+.kune-Margin-7-trbl {
+  margin: 7px;
+}
+
+.kune-Margin-7-lr {
+  margin-left: 7px;
+  margin-right: 7px;
+}
+
+.kune-Margin-7-tl {
+  margin-top: 7px;
+  margin-left: 7px;
+}
+
+.kune-Margin-7-tb {
+  margin-top: 7px;
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-t {
+  margin-top: 7px;
+}
+
+.kune-Margin-7-r {
+  margin-right: 7px;
+}
+
+.kune-Margin-7-b {
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-l {
+  margin-left: 7px;
+}
+
 .kune-Margin-Medium-trbl {
   margin: 5px;
 }
@@ -3191,7 +3226,7 @@
     background: #DDAFE9 none repeat scroll 0% 50%;
 }
 
-.k-entity-context-red div, .k-entity-context-purple .x-tree .x-panel-body {
+.k-entity-context-red div, .k-entity-context-red .x-tree .x-panel-body {
     background: #FFAAAA none repeat scroll 0% 50%;
 }
 

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css	2008-10-01 21:12:10 UTC (rev 899)
@@ -411,6 +411,41 @@
   margin-left: 10px;
 }
 
+.kune-Margin-7-trbl {
+  margin: 7px;
+}
+
+.kune-Margin-7-lr {
+  margin-left: 7px;
+  margin-right: 7px;
+}
+
+.kune-Margin-7-tl {
+  margin-top: 7px;
+  margin-left: 7px;
+}
+
+.kune-Margin-7-tb {
+  margin-top: 7px;
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-t {
+  margin-top: 7px;
+}
+
+.kune-Margin-7-r {
+  margin-right: 7px;
+}
+
+.kune-Margin-7-b {
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-l {
+  margin-left: 7px;
+}
+
 .kune-Margin-Medium-trbl {
   margin: 5px;
 }

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -149,10 +149,10 @@
 	delContent.setConfirmationTitle(i18n.t("Please confirm"));
 	delContent.setConfirmationText(i18n.t("Are you sure?"));
 	delContent.setEnableCondition(new ActionEnableCondition<StateToken>() {
-	    public boolean mustBeEnabled(final StateToken currentStateToken) {
+	    public boolean mustBeEnabled(final StateToken itemToken) {
 		final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent()
 			.getStateToken();
-		return !currentStateToken.equals(defContentToken);
+		return !itemToken.equals(defContentToken);
 	    }
 	});
 
@@ -166,8 +166,8 @@
 	go.setTextDescription(i18n.t("Open"));
 	go.setIconUrl("images/nav/go.png");
 	go.setEnableCondition(new ActionEnableCondition<StateToken>() {
-	    public boolean mustBeEnabled(final StateToken currentStateToken) {
-		return !contextNavigator.isSelected(currentStateToken);
+	    public boolean mustBeEnabled(final StateToken itemToken) {
+		return !contextNavigator.isSelected(itemToken);
 	    }
 	});
 
@@ -198,10 +198,10 @@
 	goGroupHome.setMustBeAuthenticated(false);
 	goGroupHome.setIconUrl("images/group-home.png");
 	goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
-	    public boolean mustBeEnabled(final StateToken currentStateToken) {
+	    public boolean mustBeEnabled(final StateToken itemToken) {
 		final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent()
 			.getStateToken();
-		return !currentStateToken.equals(defContentToken);
+		return !itemToken.equals(defContentToken);
 	    }
 	});
 
@@ -290,7 +290,7 @@
 	setGroupLogo.setTextDescription(i18n.t("Set this as the group logo"));
 	setGroupLogo.setIconUrl("images/nav/picture.png");
 	setGroupLogo.setEnableCondition(new ActionEnableCondition<StateToken>() {
-	    public boolean mustBeEnabled(final StateToken param) {
+	    public boolean mustBeEnabled(final StateToken itemToken) {
 		final BasicMimeTypeDTO mime = session.getCurrentState().getMimeType();
 		return mime != null && mime.getType().equals("image");
 	    }
@@ -344,19 +344,18 @@
 
 						    public void onSuccess(final Integer newVersion) {
 							Site.hideProgress();
+							session.getCurrentState().setVersion(newVersion);
+							session.getCurrentState().setContent(html);
 							editor.onSaved();
-							if (session.getCurrentStateToken().equals(stateToken)) {
-							    session.getCurrentState().setVersion(newVersion);
-							    session.getCurrentState().setContent(html);
-							    documentContent.refreshState();
-							}
 						    }
 						});
 				    }
 				}, new Listener0() {
 				    public void onEvent() {
 					// onClose
-					documentContent.refreshState();
+					if (session.getCurrentStateToken().equals(stateToken)) {
+					    documentContent.refreshState();
+					}
 				    }
 				});
 			    }
@@ -444,10 +443,10 @@
 	setAsDefGroupContent.setTextDescription(i18n.t("Set this as the group default page"));
 	setAsDefGroupContent.setIconUrl("images/group-home.png");
 	setAsDefGroupContent.setEnableCondition(new ActionEnableCondition<StateToken>() {
-	    public boolean mustBeEnabled(final StateToken currentStateToken) {
+	    public boolean mustBeEnabled(final StateToken itemToken) {
 		final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent()
 			.getStateToken();
-		return !currentStateToken.equals(defContentToken);
+		return !itemToken.equals(defContentToken);
 	    }
 	});
 	return setAsDefGroupContent;

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -96,7 +96,7 @@
 		    .getContainerRights(), true);
 	}
 	toolbar.disableMenusAndClearButtons();
-	toolbar.showActions(collection, true);
+	toolbar.setActions(collection);
 	toolbar.attach();
 	showContent();
     }

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -34,6 +34,9 @@
     }
 
     public void setContent(final String content) {
-	ws.getEntityWorkspace().setContent(new HTML(content));
+	final HTML html = new HTML(content);
+	html.setStyleName("kune-Content-Main");
+	html.addStyleName("kune-Margin-7-trbl");
+	ws.getEntityWorkspace().setContent(html);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,5 +1,5 @@
 package org.ourproject.kune.platf.client.actions;
 
 public interface ActionEnableCondition<T> {
-    boolean mustBeEnabled(T param);
+    boolean mustBeEnabled(T item);
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -16,6 +16,11 @@
 	this.item = item;
     }
 
+    public boolean checkEnabling() {
+	final ActionEnableCondition<T> enableCondition = action.getEnableCondition();
+	return enableCondition != null ? enableCondition.mustBeEnabled(getItem()) : true;
+    }
+
     public ActionDescriptor<T> getAction() {
 	return action;
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,6 +1,7 @@
 package org.ourproject.kune.platf.client.actions.toolbar;
 
 import org.ourproject.kune.platf.client.actions.ActionItemCollection;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
 
 public interface ActionToolbar<T> {
 
@@ -12,6 +13,8 @@
 
     void disableMenusAndClearButtons();
 
-    void showActions(ActionItemCollection<T> actionItemCollection, boolean isItemSelected);
+    void setActions(ActionItemCollection<T> actionItemCollection);
 
+    void setEnableAction(ActionToolbarDescriptor<T> action, boolean enable);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,17 +1,19 @@
 package org.ourproject.kune.platf.client.actions.toolbar;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionItem;
 import org.ourproject.kune.platf.client.actions.ActionManager;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
 import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 
+import com.allen_sauer.gwt.log.client.Log;
 import com.calclab.suco.client.ioc.Provider;
 import com.google.gwt.user.client.ui.Widget;
 import com.gwtext.client.core.EventObject;
@@ -31,7 +33,7 @@
     }
 
     private final HashMap<String, Menu> toolbarMenus;
-    private final ArrayList<Widget> removableToolbarItems;
+    private final HashMap<String, ToolbarButton> toolbarButtons;
     private final HashMap<String, Item> menuItems;
     private final Provider<ActionManager> actionManagerProvider;
     private final Position position;
@@ -48,11 +50,11 @@
 	this.actionManagerProvider = actionManagerProvider;
 
 	toolbarMenus = new HashMap<String, Menu>();
-	removableToolbarItems = new ArrayList<Widget>();
+	toolbarButtons = new HashMap<String, ToolbarButton>();
 	menuItems = new HashMap<String, Item>();
     }
 
-    public void addButtonAction(final ActionItem<T> actionItem) {
+    public void addButtonAction(final ActionItem<T> actionItem, final boolean enable) {
 	final ActionToolbarButtonDescriptor<T> action = (ActionToolbarButtonDescriptor<T>) actionItem.getAction();
 	final ActionToolbarPosition pos = action.getActionPosition();
 	final ToolbarButton button = new ToolbarButton();
@@ -72,15 +74,16 @@
 	}
 	button.setTooltip(action.getToolTip());
 
+	setEnableButton(button, enable);
 	final SimpleToolbar toolbar = getToolbar(pos);
 	if (action.hasLeftSeparator()) {
-	    removableToolbarItems.add(add(toolbar, action.getLeftSeparator()));
+	    add(toolbar, action.getLeftSeparator());
 	}
 	toolbar.add(button);
 	if (action.hasRightSeparator()) {
-	    removableToolbarItems.add(add(toolbar, action.getRightSeparator()));
+	    add(toolbar, action.getRightSeparator());
 	}
-	removableToolbarItems.add(button);
+	toolbarButtons.put(genButtonKey(pos, text), button);
     }
 
     public void addMenuAction(final ActionItem<T> actionItem, final boolean enable) {
@@ -94,11 +97,7 @@
 	    item = createToolbarMenu(pos, menuTitle, menuSubTitle, actionItem);
 	    menuItems.put(itemKey, item);
 	}
-	if (enable) {
-	    item.enable();
-	} else {
-	    item.disable();
-	}
+	setEnableMenuItem(item, enable);
     }
 
     public void attach() {
@@ -119,20 +118,13 @@
     public void clear() {
 	toolbarMenus.clear();
 	menuItems.clear();
-	removableToolbarItems.clear();
+	toolbarButtons.clear();
 	topbar.removeAll();
 	bottombar.removeAll();
 	getToolbar(ActionToolbarPosition.topbar).removeAll();
 	getToolbar(ActionToolbarPosition.bottombar).removeAll();
     }
 
-    public void clearRemovableActions() {
-	for (final Widget widget : removableToolbarItems) {
-	    widget.removeFromParent();
-	}
-	removableToolbarItems.clear();
-    }
-
     public void detach() {
 	if (topbar.isAttached()) {
 	    switch (position) {
@@ -154,6 +146,25 @@
 	}
     }
 
+    public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
+	final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
+	final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getText()));
+	if (button != null) {
+	    setEnableButton(button, enable);
+	} else {
+	    Log.error("Tryng to enable/disable a non existent toolbar button");
+	}
+    }
+
+    public void setMenuEnable(final ActionDescriptor<T> action, final boolean enable) {
+	final Item item = menuItems.get(genMenuKey((ActionToolbarMenuDescriptor<T>) action));
+	if (item != null) {
+	    setEnableMenuItem(item, enable);
+	} else {
+	    Log.error("Tryng to enable/disable a non existent toolbar menu item");
+	}
+    }
+
     private void add(final ActionToolbarPosition toolbar, final Widget widget) {
 	getToolbar(toolbar).add(widget);
     }
@@ -220,10 +231,20 @@
 	return menu;
     }
 
+    private String genButtonKey(final ActionToolbarPosition pos, final String actionText) {
+	final String basePart = "km-ctx-btn-" + pos.toString().substring(0, 2) + "-" + actionText;
+	return basePart;
+    }
+
+    private String genMenuKey(final ActionToolbarMenuDescriptor<T> action) {
+	return genMenuKey(action.getActionPosition(), action.getParentMenuTitle(), action.getParentSubMenuTitle(),
+		action.getText());
+    }
+
     private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuSubTitle,
 	    final String actionText) {
 
-	final String basePart = "km-ctx-" + pos.toString().substring(0, 2) + "-" + menuTitle;
+	final String basePart = "km-ctx-menu-" + pos.toString().substring(0, 2) + "-" + menuTitle;
 	final String subMenuPart = menuSubTitle != null ? "-subm-" + menuSubTitle : "";
 	final String itemPart = actionText != null ? "-item-" + actionText : "";
 	return basePart + subMenuPart + itemPart;
@@ -238,4 +259,20 @@
 	    return topbar;
 	}
     }
+
+    private void setEnableButton(final ToolbarButton button, final boolean enable) {
+	if (enable) {
+	    button.enable();
+	} else {
+	    button.disable();
+	}
+    }
+
+    private void setEnableMenuItem(final Item item, final boolean enable) {
+	if (enable) {
+	    item.enable();
+	} else {
+	    item.disable();
+	}
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,59 +1,71 @@
 package org.ourproject.kune.platf.client.actions.toolbar;
 
 import org.ourproject.kune.platf.client.actions.ActionDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
 import org.ourproject.kune.platf.client.actions.ActionItem;
 import org.ourproject.kune.platf.client.actions.ActionItemCollection;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuAndItemDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
 
 import com.allen_sauer.gwt.log.client.Log;
 
 public class ActionToolbarPresenter<T> implements ActionToolbar<T> {
-    private final ActionToolbarView<T> toolbar;
+    private final ActionToolbarView<T> view;
 
     public ActionToolbarPresenter(final ActionToolbarView<T> toolbar) {
-	this.toolbar = toolbar;
+	this.view = toolbar;
     }
 
     public void attach() {
-	toolbar.attach();
+	view.attach();
     }
 
-    public boolean checkEnabling(final ActionDescriptor<T> action, final T T) {
-	final ActionEnableCondition<T> enableCondition = action.getEnableCondition();
-	return enableCondition != null ? enableCondition.mustBeEnabled(T) : true;
-    }
-
     public void clear() {
-	toolbar.clear();
+	view.clear();
     }
 
     public void detach() {
-	toolbar.detach();
+	view.detach();
     }
 
     public void disableMenusAndClearButtons() {
-	toolbar.clear();
+	view.clear();
     }
 
-    public void showActions(final ActionItemCollection<T> actions, final boolean isItemSelected) {
+    public void setActions(final ActionItemCollection<T> actions) {
 	for (final ActionItem<T> actionItem : actions) {
 	    final ActionDescriptor<T> action = actionItem.getAction();
-	    if (action instanceof ActionToolbarMenuDescriptor || action instanceof ActionToolbarMenuAndItemDescriptor) {
-		toolbar.addMenuAction(actionItem, isItemSelected && checkEnabling(action, actionItem.getItem()));
+	    if (isToolbarMenu(action)) {
+		view.addMenuAction(actionItem, actionItem.checkEnabling());
 	    } else {
-		if (action instanceof ActionToolbarButtonDescriptor
-			|| action instanceof ActionToolbarButtonAndItemDescriptor) {
-		    if (isItemSelected && checkEnabling(action, actionItem.getItem())) {
-			toolbar.addButtonAction(actionItem);
-		    }
+		if (isToolbarButton(action)) {
+		    view.addButtonAction(actionItem, actionItem.checkEnabling());
 		} else {
 		    Log.error("Code error: Not an ActionMenuDescriptor or ActionButtonDescriptor: " + action.getText());
 		}
 	    }
 	}
     }
+
+    public void setEnableAction(final ActionToolbarDescriptor<T> action, final boolean enable) {
+	if (isToolbarMenu(action)) {
+	    view.setMenuEnable(action, enable);
+	} else {
+	    if (isToolbarButton(action)) {
+		view.setButtonEnable(action, enable);
+	    }
+	}
+
+    }
+
+    private boolean isToolbarButton(final ActionDescriptor<T> action) {
+	return action instanceof ActionToolbarButtonDescriptor
+		|| action instanceof ActionToolbarButtonAndItemDescriptor;
+    }
+
+    private boolean isToolbarMenu(final ActionDescriptor<T> action) {
+	return action instanceof ActionToolbarMenuDescriptor || action instanceof ActionToolbarMenuAndItemDescriptor;
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,21 +1,24 @@
 package org.ourproject.kune.platf.client.actions.toolbar;
 
+import org.ourproject.kune.platf.client.actions.ActionDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionItem;
 
 public interface ActionToolbarView<T> {
 
-    void addButtonAction(ActionItem<T> action);
+    void addButtonAction(ActionItem<T> actionItem, boolean enable);
 
-    void addMenuAction(ActionItem<T> action, boolean enable);
+    void addMenuAction(ActionItem<T> actionItem, boolean enable);
 
     void attach();
 
     void clear();
 
-    void clearRemovableActions();
-
     void detach();
 
     void disableAllMenuItems();
 
+    void setButtonEnable(ActionDescriptor<T> action, boolean enable);
+
+    void setMenuEnable(ActionDescriptor<T> action, boolean enable);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupListDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupListDTO.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupListDTO.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -55,10 +55,6 @@
     }
 
     public String toString() {
-	String groupString = "";
-	for (final GroupDTO group : list) {
-	    groupString = groupString + group.getShortName() + ", ";
-	}
-	return "GroupDTO[(" + mode + "): " + groupString + "]";
+	return "GroupListDTO[(" + mode + "): " + list + "]";
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupList.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupList.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/GroupList.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -116,11 +116,7 @@
     }
 
     public String toString() {
-	String groupString = "";
-	for (final Group group : list) {
-	    groupString = groupString + group.getShortName() + ", ";
-	}
-	return "Group[(" + mode + "): " + groupString + "]";
+	return "GroupList[(" + mode + "): " + list + "]";
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/SocialNetworkManagerDefault.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -132,7 +132,10 @@
 	final Long groupId = group.getId();
 	final List<Group> adminInGroups = finder.findAdminInGroups(groupId);
 	// Don't show self user group
-	adminInGroups.remove(userLogged.getUserGroup());
+	if (group.getType().equals(GroupType.PERSONAL)) {
+	    adminInGroups.remove(group);
+	}
+	// adminInGroups.remove(userLogged.getUserGroup());
 	final List<Group> collabInGroups = finder.findCollabInGroups(groupId);
 	return new ParticipationData(adminInGroups, collabInGroups);
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -163,7 +163,7 @@
     public void selectItem(final StateToken stateToken) {
 	view.selectItem(genId(stateToken));
 	toolbar.disableMenusAndClearButtons();
-	toolbar.showActions(actionsByItem.get(stateToken), true);
+	toolbar.setActions(actionsByItem.get(stateToken));
     }
 
     public void setEditOnNextStateChange(final boolean edit) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -20,7 +20,6 @@
 
 package org.ourproject.kune.workspace.client.editor;
 
-import org.ourproject.kune.platf.client.View;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
 import org.ourproject.kune.workspace.client.skel.Toolbar;
@@ -28,12 +27,11 @@
 
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.WindowResizeListener;
 import com.google.gwt.user.client.ui.RichTextArea;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.gwtext.client.widgets.BoxComponent;
 import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.event.ContainerListenerAdapter;
 
 public class TextEditorPanel implements TextEditorView {
     private static final String BACKCOLOR_ENABLED = "#FFF";
@@ -43,7 +41,7 @@
     private final TextEditorPresenter presenter;
     private final Timer saveTimer;
     private final I18nTranslationService i18n;
-    private final DefaultBorderLayout mainPanel;
+    private final VerticalPanel mainPanel;
     private final WorkspaceSkeleton ws;
 
     public TextEditorPanel(final TextEditorPresenter presenter, final I18nTranslationService i18n,
@@ -51,29 +49,30 @@
 	this.presenter = presenter;
 	this.i18n = i18n;
 	this.ws = ws;
-	mainPanel = new DefaultBorderLayout();
-	final Panel centerPanel = new Panel();
-	centerPanel.setLayout(new FitLayout());
+	mainPanel = new VerticalPanel();
+	mainPanel.setWidth("100%");
+
 	gwtRTarea = new RichTextArea();
-	// centerPanel.add(gwtRTarea);
 	gwtRTarea.setWidth("97%");
 	gwtRTarea.addStyleName("kune-TexEditorPanel-TextArea");
 
 	final Toolbar editorTopBar = new Toolbar();
+	editorTopBar.getPanel().setWidth("auto");
 	textEditorToolbar = new TextEditorToolbar(gwtRTarea, presenter, i18n);
 	editorTopBar.add(textEditorToolbar);
 	editorTopBar.addStyleName("k-toolbar-bottom-line");
 
-	// mainPanel.add(editorTopBar.getPanel(), Position.NORTH, false,
-	// DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
-	mainPanel.add(centerPanel, DefaultBorderLayout.Position.CENTER);
+	mainPanel.add(editorTopBar.getPanel());
+	mainPanel.add(gwtRTarea);
 
-	adjustSize("" + (Window.getClientHeight() - 265));
-	Window.addWindowResizeListener(new WindowResizeListener() {
-	    public void onWindowResized(final int arg0, final int arg1) {
-		adjustSize("" + (Window.getClientHeight() - 265));
+	ws.getEntityWorkspace().addContentListener(new ContainerListenerAdapter() {
+	    @Override
+	    public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
+		    final int rawWidth, final int rawHeight) {
+		adjustSize(adjHeight);
 	    }
 	});
+
 	saveTimer = new Timer() {
 	    public void run() {
 		presenter.onSave();
@@ -82,12 +81,11 @@
     }
 
     public void attach() {
-	// ws.getEntityWorkspace().setContent(mainPanel.getPanel());
-	ws.getEntityWorkspace().setContent(gwtRTarea);
+	ws.getEntityWorkspace().setContent(mainPanel);
     }
 
     public void detach() {
-	mainPanel.getPanel().removeFromParent();
+	mainPanel.removeFromParent();
     }
 
     public void editHTML(final boolean edit) {
@@ -102,10 +100,6 @@
 	return gwtRTarea.getText();
     }
 
-    public View getToolBar() {
-	return this.textEditorToolbar;
-    }
-
     public void saveTimerCancel() {
 	saveTimer.cancel();
     }
@@ -120,14 +114,6 @@
 	gwtRTarea.setEnabled(enabled);
     }
 
-    public void setEnabledCancelButton(final boolean enabled) {
-	textEditorToolbar.setEnabledCloseButton(enabled);
-    }
-
-    public void setEnabledSaveButton(final boolean enabled) {
-	textEditorToolbar.setEnabledSaveButton(enabled);
-    }
-
     public void setHeight(final String height) {
 	gwtRTarea.setHeight(height);
     }
@@ -140,10 +126,6 @@
 	gwtRTarea.setText(text);
     }
 
-    public void setTextSaveButton(final String text) {
-	textEditorToolbar.setTextSaveButton(text);
-    }
-
     public void showSaveBeforeDialog() {
 	MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
 	    public void execute(final String btnID) {
@@ -157,9 +139,8 @@
 
     }
 
-    @Deprecated
-    private void adjustSize(final String height) {
-	// While refactoring
-	// gwtRTarea.setHeight(height);
+    private void adjustSize(final int height) {
+	gwtRTarea.setHeight(""
+		+ (height - DefaultBorderLayout.DEF_TOOLBAR_HEIGHT - DefaultBorderLayout.DEF_TOOLBAR_HEIGHT - 5));
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -75,14 +75,14 @@
 
     public void init(final TextEditorView view) {
 	this.view = view;
-	this.view.setEnabledSaveButton(false);
+	toolbar.setEnableAction(save, false);
 	this.view.setEnabled(true);
     }
 
     public void onEdit() {
 	if (!savePending) {
 	    savePending = true;
-	    view.setEnabledSaveButton(true);
+	    toolbar.setEnableAction(save, true);
 	    if (autoSave) {
 		view.scheduleSave(10000);
 	    }
@@ -113,9 +113,7 @@
 	view.saveTimerCancel();
 	savePending = false;
 	saveAndCloseConfirmed = false;
-	view.setEnabledSaveButton(false);
-	view.detach();
-	toolbar.detach();
+	toolbar.setEnableAction(save, false);
     }
 
     protected void onCancel() {
@@ -129,6 +127,8 @@
 
     protected void onCancelConfirmed() {
 	reset();
+	view.detach();
+	toolbar.detach();
 	onEditCancelled.onEvent();
     }
 
@@ -174,7 +174,7 @@
 	final ActionItemCollection<StateToken> collection = new ActionItemCollection<StateToken>();
 	collection.add(new ActionItem<StateToken>(save, null));
 	collection.add(new ActionItem<StateToken>(close, null));
-	toolbar.showActions(collection, true);
+	toolbar.setActions(collection);
     }
 
     private void setContent(final String html) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbar.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -30,6 +30,7 @@
 import org.ourproject.kune.platf.client.ui.palette.ColorSelectListener;
 import org.ourproject.kune.platf.client.ui.palette.WebSafePalettePanel;
 import org.ourproject.kune.platf.client.ui.palette.WebSafePalettePresenter;
+import org.ourproject.kune.workspace.client.site.Site;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.Command;
@@ -46,7 +47,6 @@
 import com.google.gwt.user.client.ui.ToggleButton;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
 import com.gwtext.client.data.ArrayReader;
 import com.gwtext.client.data.DateFieldDef;
 import com.gwtext.client.data.FieldDef;
@@ -55,18 +55,15 @@
 import com.gwtext.client.data.RecordDef;
 import com.gwtext.client.data.Store;
 import com.gwtext.client.data.StringFieldDef;
-import com.gwtext.client.widgets.Button;
 import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.ToolbarButton;
 import com.gwtext.client.widgets.MessageBox.PromptCallback;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
 
 /**
  * A sample toolbar for use with {@link RichTextArea}. It provides a simple UI
  * for all rich text formatting, dynamically displayed only for the available
  * functionality.
  */
-public class TextEditorToolbar extends Composite implements TextEditorToolbarView {
+public class TextEditorToolbar extends Composite {
 
     /**
      * We use an inner EventListener class to avoid exposing event methods on
@@ -230,7 +227,7 @@
 
 		ic = new ImageChooser("Image Chooser", 515, 400, store);
 	    }
-
+	    Site.important("This is in development and very experimental...");
 	    ic.show(new ImageChooserCallback() {
 		public void onImageSelection(final ImageData data) {
 		    // Element el = DomHelper.append("images",
@@ -290,10 +287,8 @@
     private PushButton fontColor;
     private MenuBar fonts;
     private MenuBar fontSizes;
-    private final ToolbarButton save;
-    private final ToolbarButton close;
     private WebSafePalettePanel palettePanel;
-    private final TextEditorPresenter panelListener;
+    private final TextEditorPresenter presenter;
     private PopupPanel popupPalette;
     private WebSafePalettePresenter palettePresenter;
     private final I18nTranslationService i18n;
@@ -304,43 +299,20 @@
      * @param richText
      *                the rich text area to be controlled
      */
-    public TextEditorToolbar(final RichTextArea richText, final TextEditorPresenter panelListener,
+    public TextEditorToolbar(final RichTextArea richText, final TextEditorPresenter presenter,
 	    final I18nTranslationService i18n) {
 	this.richText = richText;
 	this.i18n = i18n;
 	this.basic = richText.getBasicFormatter();
 	this.extended = richText.getExtendedFormatter();
+	this.presenter = presenter;
 
-	this.panelListener = panelListener;
-
 	initWidget(outer);
 
 	outer.add(topPanel);
 	outer.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
 	setStyleName("gwt-RichTextToolbar");
 
-	save = new ToolbarButton(i18n.tWithNT("Save", "used in button"), new ButtonListenerAdapter() {
-	    @Override
-	    public void onClick(final Button button, final EventObject e) {
-		if (!save.isDisabled()) {
-		    fireSave();
-		}
-	    }
-	});
-
-	close = new ToolbarButton(i18n.tWithNT("Close", "used in button"), new ButtonListenerAdapter() {
-	    @Override
-	    public void onClick(final Button button, final EventObject e) {
-		if (!close.isDisabled()) {
-		    fireCancel();
-		}
-	    }
-	});
-
-	close.addStyleName("kune-Button-Large-lrSpace");
-	topPanel.add(save);
-	topPanel.add(close);
-
 	if (basic != null) {
 	    topPanel.add(bold = createToggleButton(images.bold(), i18n.t("Toggle Bold")));
 	    topPanel.add(italic = createToggleButton(images.italic(), i18n.t("Toggle Italic")));
@@ -422,26 +394,6 @@
 	}
     }
 
-    public void setEnabledCloseButton(final boolean enabled) {
-	if (enabled) {
-	    close.enable();
-	} else {
-	    close.disable();
-	}
-    }
-
-    public void setEnabledSaveButton(final boolean enabled) {
-	if (enabled) {
-	    save.enable();
-	} else {
-	    save.disable();
-	}
-    }
-
-    public void setTextSaveButton(final String text) {
-	save.setText(text);
-    }
-
     public void showPalette(final Widget sender, final int left, final int top) {
 	if (palettePanel == null) {
 	    palettePresenter = new WebSafePalettePresenter();
@@ -513,22 +465,14 @@
 	return tb;
     }
 
-    private void fireCancel() {
-	panelListener.onCancel();
-    }
-
     private void fireEdit() {
-	panelListener.onEdit();
+	presenter.onEdit();
     }
 
     private void fireEditHTML() {
-	panelListener.onEditHTML();
+	presenter.onEditHTML();
     }
 
-    private void fireSave() {
-	panelListener.onSave();
-    }
-
     /**
      * Updates the status of all the stateful buttons.
      */

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbarView.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorToolbarView.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface TextEditorToolbarView extends View {
-
-}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorView.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorView.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -34,26 +34,18 @@
 
     String getText();
 
-    View getToolBar();
-
     void saveTimerCancel();
 
     void scheduleSave(int delayMillis);
 
     void setEnabled(boolean enabled);
 
-    void setEnabledCancelButton(boolean enabled);
-
-    void setEnabledSaveButton(boolean enabled);
-
     void setHeight(String height);
 
     void setHTML(String html);
 
     void setText(String text);
 
-    void setTextSaveButton(String text);
-
     void showSaveBeforeDialog();
 
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/WrappedRichTextAreaImplMozilla.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -31,50 +31,51 @@
  */
 public class WrappedRichTextAreaImplMozilla extends RichTextAreaImplMozilla {
 
-    @Override
-    public native void initElement() /*-{
-       // Mozilla doesn't allow designMode to be set reliably until the iframe is
-       // fully loaded.
-       var _this = this;
-       var iframe = _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem;
-       _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard::initializing = true;
+  @Override
+  public native void initElement() /*-{
+    // Mozilla doesn't allow designMode to be set reliably until the iframe is
+    // fully loaded.
+    var _this = this;
+    var iframe = _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem;
+    _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard::initializing = true;
 
-       iframe.onload = function() {
-         // Some Mozillae have the nasty habit of calling onload again when you set
-         // designMode, so let's avoid doing it more than once.
-         iframe.onload = null;
+    iframe.onload = function() {
+      // Some Mozillae have the nasty habit of calling onload again when you set
+      // designMode, so let's avoid doing it more than once.
+      iframe.onload = null;
 
-         // patch ccs inject:
+      // patch ccs inject:
 
-         var doc = _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem.contentWindow.document;
-         head=doc.getElementsByTagName('head')[0];
-         link=document.createElement('link');
-         link.setAttribute('rel',"stylesheet");
-         link.setAttribute('type',"text/css");
-         link.setAttribute('href',"css/richtext.css" );
-         head.appendChild(link);
+      var doc = _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImpl::elem.contentWindow.document;
+      head=doc.getElementsByTagName('head')[0];
+      link=document.createElement('link');
+      link.setAttribute('rel',"stylesheet");
+      link.setAttribute('type',"text/css");
+      link.setAttribute('href',"css/richtext.css" );
+      head.appendChild(link);
 
-         var styles = document.createElement('style');
-         styles.setAttribute('type', 'text/css');
-         var newStyle = document.createTextNode('\n<!--\nbody{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400;}q:before,q:after{content:\'\';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}body{font:13px/1.22 arial,helvetica,clean,sans-serif;font-size:small;font:x-small;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;font-size:108%;line-height:99%;}h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px}\n-->\n');
-         styles.appendChild(newStyle);
-         head.appendChild(styles);
+       var styles = document.createElement('style');
+       styles.setAttribute('type', 'text/css');
+       var newStyle = document.createTextNode('\n<!--\nbody{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400;}q:before,q:after{content:\'\';}abbr,acronym{border:0;font-variant:normal;}sup,sub{line-height:-1px;vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}body{font:13px/1.22 arial,helvetica,clean,sans-serif;font-size:small;font:x-small;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;font-size:108%;line-height:99%;}h1{font-size:138.5%;}h2{font-size:123.1%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px}\n-->\n');
+       styles.appendChild(newStyle);
+       head.appendChild(styles);
 
-         // -- patch
+       // -- patch
 
-         // Send notification that the iframe has finished loading.
-         _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard::onElementInitialized()();
+       // Send notification that the iframe has finished loading.
+       _this. at com.google.gwt.user.client.ui.impl.RichTextAreaImplStandard::onElementInitialized()();
 
-         // Don't set designMode until the RTA actually gets focused. This is
-         // necessary because editing won't work on Mozilla if the iframe is
-         // *hidden, but attached*. Waiting for focus gets around this issue.
-         //
-         // Note: This onfocus will not conflict with the addEventListener('focus',
-         // ...) // in RichTextAreaImplStandard.
-         iframe.contentWindow.onfocus = function() {
-           iframe.contentWindow.onfocus = null;
-           iframe.contentWindow.document.designMode = 'On';
-
+       // Don't set designMode until the RTA actually gets focused. This is
+       // necessary because editing won't work on Mozilla if the iframe is
+       // *hidden, but attached*. Waiting for focus gets around this issue.
+       //
+       // Note: This onfocus will not conflict with the addEventListener('focus',
+       // ...) // in RichTextAreaImplStandard.
+       iframe.contentWindow.onfocus = function() {
+         iframe.contentWindow.onfocus = null;
+         iframe.contentWindow.document.designMode = 'On';
        };
-     }-*/;
+     };
+   }-*/;
 }
+

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -41,7 +41,6 @@
 	});
 	final Item userHomePage = new Item(i18n.t("Your homepage"));
 	userHomePage.setIcon("images/group-home.gif");
-	userHomePage.ensureDebugId(USER_HOME_PAGE_MENU_ITEM);
 	userHomePage.addListener(new BaseItemListenerAdapter() {
 	    @Override
 	    public void onClick(final BaseItem item, final EventObject e) {
@@ -49,9 +48,10 @@
 		presenter.onUserHomePage();
 	    }
 	});
+	userHomePage.setId(USER_HOME_PAGE_MENU_ITEM);
 	userMenu.addItem(userHomePage);
 	final Item userPreferences = new Item(i18n.t("Your preferences"));
-	userPreferences.ensureDebugId(USER_PREFERENCES_MENU_ITEM);
+	userPreferences.setId(USER_PREFERENCES_MENU_ITEM);
 	userPreferences.setIcon("images/kune-preferences.gif");
 	userPreferences.addListener(new BaseItemListenerAdapter() {
 	    @Override
@@ -62,7 +62,7 @@
 	});
 	userMenu.addItem(userPreferences);
 	userParticipation = new Menu();
-	userParticipation.ensureDebugId(USER_PARTICIPATION_MENU_ITEM);
+	userParticipation.setId(USER_PARTICIPATION_MENU_ITEM);
 	final MenuItem userParticipationItem = new MenuItem(i18n.t("Your groups"), userParticipation);
 	userParticipationItem.setIcon("");
 	userMenu.addItem(userParticipationItem);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -28,7 +28,6 @@
     private final Toolbar contextBottomBar;
     private final RoundedPanel roundedTitle;
     private final RoundedPanel roundedBottom;
-    private final DefaultBorderLayout contextWrap;
 
     public EntityWorkspace() {
 	final Panel titles = new Panel();
@@ -58,7 +57,7 @@
 	bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
 
 	final DefaultBorderLayout contentWrap = new DefaultBorderLayout();
-	contextWrap = new DefaultBorderLayout();
+	final DefaultBorderLayout contextWrap = new DefaultBorderLayout();
 	contentWrap.setBorder(true);
 	contextWrap.setBorder(true);
 	content = new Panel();
@@ -69,7 +68,7 @@
 	content.setBorder(false);
 	context.setBorder(false);
 	context.setCollapsible(true);
-	content.setPaddings(7);
+	// content.setPaddings(7);
 	content.setAutoScroll(true);
 	// context.setAutoScroll(true);
 

Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java	2008-10-01 01:29:01 UTC (rev 898)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java	2008-10-01 21:12:10 UTC (rev 899)
@@ -17,7 +17,7 @@
     @Test
     public void testSave() {
 	viewInit();
-	view.setEnabledSaveButton(true);
+	// view.setEnabledSaveButton(true);
 	view.scheduleSave(10000);
 	EasyMock.expect(view.getHTML()).andReturn("foo");
 	viewReset();
@@ -35,7 +35,7 @@
     @Test
     public void testSavePending() {
 	viewInit();
-	view.setEnabledSaveButton(true);
+	// view.setEnabledSaveButton(true);
 	view.scheduleSave(10000);
 	EasyMock.replay(view);
 	presenter.init(view);
@@ -46,7 +46,7 @@
     @Test
     public void testSavePendingCancel() {
 	viewInit();
-	view.setEnabledSaveButton(true);
+	// view.setEnabledSaveButton(true);
 	view.scheduleSave(10000);
 	view.saveTimerCancel();
 	view.showSaveBeforeDialog();
@@ -68,7 +68,7 @@
     @Test
     public void testSavePendingCancelSaveFails() {
 	viewInit();
-	view.setEnabledSaveButton(true);
+	// view.setEnabledSaveButton(true);
 	view.scheduleSave(10000);
 	view.saveTimerCancel();
 	view.showSaveBeforeDialog();
@@ -95,12 +95,12 @@
     }
 
     private void viewInit() {
-	view.setEnabledSaveButton(false);
+	// view.setEnabledSaveButton(false);
 	view.setEnabled(true);
     }
 
     private void viewReset() {
 	view.saveTimerCancel();
-	view.setEnabledSaveButton(false);
+	// view.setEnabledSaveButton(false);
     }
 }




More information about the kune-commits mailing list