[kune-commits] r1332 - in trunk/src/main/java/cc/kune: common/client/ui gspace/client/viewers

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Apr 29 15:26:13 CEST 2011


Author: vjrj_
Date: 2011-04-29 15:26:13 +0200 (Fri, 29 Apr 2011)
New Revision: 1332

Modified:
   trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
Log:
Minor fix (root cannot be renamed)

Modified: trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java	2011-04-29 13:16:37 UTC (rev 1331)
+++ trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java	2011-04-29 13:26:13 UTC (rev 1332)
@@ -75,12 +75,16 @@
 
   @UiHandler("label")
   void onMouseOut(final MouseOutEvent event) {
-    label.removeStyleDependentName("high");
+    if (editable) {
+      label.removeStyleDependentName("high");
+    }
   }
 
   @UiHandler("label")
   void onMouseOver(final MouseOverEvent event) {
-    label.addStyleDependentName("high");
+    if (editable) {
+      label.addStyleDependentName("high");
+    }
   }
 
   public void setEditable(final boolean editable) {

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-04-29 13:16:37 UTC (rev 1331)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-04-29 13:26:13 UTC (rev 1332)
@@ -15,6 +15,7 @@
 import com.gwtplatform.mvp.client.ViewImpl;
 
 public abstract class AbstractFolderViewerPanel extends ViewImpl implements FolderViewerView {
+  private final ContentCapabilitiesRegistry capabilitiesRegistry;
   private final ContentTitleWidget contentTitle;
   private final InlineLabel emptyLabel;
   protected final GSpaceArmor gsArmor;
@@ -25,6 +26,7 @@
       final ContentCapabilitiesRegistry capabilitiesRegistry) {
     this.gsArmor = gsArmor;
     this.i18n = i18n;
+    this.capabilitiesRegistry = capabilitiesRegistry;
     emptyLabel = new InlineLabel(i18n.t("This folder is empty."));
     emptyLabel.setStyleName("k-empty-msg");
     contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
@@ -66,7 +68,8 @@
 
   @Override
   public void setContainer(final StateContainerDTO state) {
-    contentTitle.setTitle(state.getTitle(), state.getTypeId(), state.getContainerRights().isEditable());
+    contentTitle.setTitle(state.getTitle(), state.getTypeId(), state.getContainerRights().isEditable()
+        && capabilitiesRegistry.isRenamable(state.getTypeId()));
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-29 13:16:37 UTC (rev 1331)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/DocViewerPanel.java	2011-04-29 13:26:13 UTC (rev 1332)
@@ -49,6 +49,7 @@
 
   private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
 
+  private final ContentCapabilitiesRegistry capabilitiesRegistry;
   private RemoteViewServiceMultiplexer channel;
   private final ContentTitleWidget contentTitle;
   @UiField
@@ -66,12 +67,14 @@
   @UiField
   ImplPanel waveHolder;
   private final WaveStore waveStore = new SimpleWaveStore();
+
   private final Widget widget;
 
   @Inject
   public DocViewerPanel(final GSpaceArmor wsArmor,
       final ContentCapabilitiesRegistry capabilitiesRegistry, final I18nTranslationService i18n) {
     this.gsArmor = wsArmor;
+    this.capabilitiesRegistry = capabilitiesRegistry;
     widget = uiBinder.createAndBindUi(this);
     contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
   }
@@ -134,7 +137,8 @@
   @Override
   public void setContent(final StateContentDTO state) {
     final boolean editable = state.getContentRights().isEditable();
-    contentTitle.setTitle(state.getTitle(), state.getTypeId(), state.getMimeType(), editable);
+    contentTitle.setTitle(state.getTitle(), state.getTypeId(), state.getMimeType(), editable
+        && capabilitiesRegistry.isRenamable(state.getTypeId()));
     if (editable) {
       initWaveClientIfNeeded();
       setEditableWaveContent(state.getWaveRef(), false);




More information about the kune-commits mailing list