[kune-commits] r1389 - in trunk/src/main: java/cc/kune/common/client/ui java/cc/kune/core/public java/cc/kune/gspace/client java/cc/kune/gspace/client/actions java/cc/kune/gspace/client/tags java/cc/kune/gspace/client/viewers resources

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun May 15 12:54:08 CEST 2011


Author: vjrj_
Date: 2011-05-15 12:54:08 +0200 (Sun, 15 May 2011)
New Revision: 1389

Modified:
   trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
   trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
   trunk/src/main/resources/log4j.dev.properties
   trunk/src/main/resources/log4j.properties
Log:
Some feedback in folder creation


Modified: trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/common/client/ui/EditableLabel.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -63,6 +63,15 @@
     return addHandler(handler, EditEvent.getType());
   }
 
+  public void edit() {
+    if (editable) {
+      label.setVisible(false);
+      textbox.setVisible(true);
+      textbox.selectAll();
+      textbox.setFocus(true);
+    }
+  }
+
   private void finishEdit() {
     label.setText(textbox.getText());
     label.setVisible(true);
@@ -84,12 +93,7 @@
 
   @UiHandler("label")
   void onClick(final ClickEvent e) {
-    if (editable) {
-      label.setVisible(false);
-      textbox.setVisible(true);
-      textbox.setFocus(true);
-      textbox.selectAll();
-    }
+    edit();
   }
 
   @UiHandler("label")
@@ -99,6 +103,11 @@
     }
   }
 
+  @UiHandler("textbox")
+  void onMouseOutTextBox(final MouseOutEvent event) {
+    finishEdit();
+  }
+
   @UiHandler("label")
   void onMouseOver(final MouseOverEvent event) {
     if (editable) {

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-05-15 10:54:08 UTC (rev 1389)
@@ -1,4 +1,4 @@
-CHARSET       "UTF-8      "; body {
+CHARSET         "UTF-8        "; body {
   background-color: white;
   color: black;
   font-family: 'Ubuntu', Arial;
@@ -1157,9 +1157,17 @@
   font-size: 13px !important;
 }
 
+.k-empty-folder-panel {
+  padding: 10px;
+  width: auto;
+  height: auto;
+}
+
 .k-empty-msg {
-  font-size: 16px;
+  font-size: 18px;
+  /* font-weight: bold; */
   font-style: italic;
+  color: #A05A2C;
 }
 
 button.k-ent-header-btn {
@@ -1191,7 +1199,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;

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -109,6 +109,7 @@
     getDocSubheader().add(subheaderToolbar);
     getDocFooter().add(footerToolbar);
     entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
+    // entityToolsSouth.setVisible(false);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -32,6 +32,7 @@
 import cc.kune.core.shared.dto.HasContent;
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
 
 import com.google.gwt.resources.client.ImageResource;
 import com.google.inject.Inject;
@@ -43,6 +44,7 @@
 
     private final ContentCache cache;
     private final Provider<ContentServiceAsync> contentService;
+    private final FolderViewerPresenter folderViewer;
     private final I18nTranslationService i18n;
     private final Session session;
     private final StateManager stateManager;
@@ -50,27 +52,30 @@
     @Inject
     public NewContainerAction(final Session session, final StateManager stateManager,
         final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
-        final ContentCache cache) {
+        final ContentCache cache, final FolderViewerPresenter folderViewer) {
       super(AccessRolDTO.Editor, true);
       this.session = session;
       this.stateManager = stateManager;
       this.i18n = i18n;
       this.contentService = contentService;
       this.cache = cache;
+      this.folderViewer = folderViewer;
     }
 
     @Override
     public void actionPerformed(final ActionEvent event) {
       NotifyUser.showProgressProcessing();
       stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
-      contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(),
-          (String) getValue(NEW_NAME), (String) getValue(ID),
-          new AsyncCallbackSimple<StateContainerDTO>() {
+      final String newName = (String) getValue(NEW_NAME);
+      contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), newName,
+          (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
             @Override
             public void onSuccess(final StateContainerDTO state) {
               // contextNavigator.setEditOnNextStateChange(true);
               stateManager.setRetrievedStateAndGo(state);
               NotifyUser.hideProgress();
+              NotifyUser.info(i18n.tWithNT("[%s] created", "New folder created, for instance", newName));
+              // folderViewer.editTitle();
             }
           });
       cache.removeContent(session.getCurrentStateToken());

Modified: trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -32,54 +32,56 @@
 
 public class TagsSummaryPanel extends ViewImpl implements TagsSummaryView {
 
-    private final FlowPanel flowPanel;
-    private final I18nTranslationService i18n;
-    private FlowPanel mainPanel;
+  private final FlowPanel flowPanel;
+  private final I18nTranslationService i18n;
+  private final FlowPanel mainPanel;
 
-    @Inject
-    public TagsSummaryPanel(final I18nTranslationService i18n, final GSpaceArmor ws) {
-        this.i18n = i18n;
-        mainPanel = new FlowPanel();
-        flowPanel = new FlowPanel();
-        flowPanel.setWidth("100%");
-        Label header = new Label(i18n.t("Tags"));
-        header.setTitle(i18n.t("Keywords or terms associated with this group"));
-        // super.setBorderStylePrimaryName("k-dropdownouter-tags");
-        flowPanel.addStyleName("kune-Margin-Small-trbl");
-        flowPanel.addStyleName("k-tsp-cloud");
-        header.addStyleName("k-sn-maintitle");
-        mainPanel.addStyleName("k-sn-mainpanel");
-        mainPanel.add(header);
-        mainPanel.add(flowPanel);
-        ws.getEntityToolsSouth().add(mainPanel);
-    }
+  @Inject
+  public TagsSummaryPanel(final I18nTranslationService i18n, final GSpaceArmor ws) {
+    this.i18n = i18n;
+    mainPanel = new FlowPanel();
+    flowPanel = new FlowPanel();
+    flowPanel.setWidth("100%");
+    final Label header = new Label(i18n.t("Tags"));
+    header.setTitle(i18n.t("Keywords or terms associated with this group"));
+    // super.setBorderStylePrimaryName("k-dropdownouter-tags");
+    flowPanel.addStyleName("kune-Margin-Small-trbl");
+    flowPanel.addStyleName("k-tsp-cloud");
+    header.addStyleName("k-sn-maintitle");
+    mainPanel.addStyleName("k-sn-mainpanel");
+    mainPanel.add(header);
+    mainPanel.add(flowPanel);
+    // ws.getEntityToolsSouth().add(mainPanel);
+  }
 
-    public void addTag(final String name, final Long count, final String style, ClickHandler clickHandler) {
-        final Label label = new Label(name);
-        // i18n pluralization
-        if (count > 1) {
-            label.setTitle(i18n.t("There are [%d] items with this tag", count));
-        } else {
-            label.setTitle(i18n.t("There are [%d] item with this tag", count));
-        }
-        label.addClickHandler(clickHandler);
-        label.addStyleName("k-tsp-tag");
-        label.addStyleName(style);
-        flowPanel.add(label);
+  @Override
+  public void addTag(final String name, final Long count, final String style,
+      final ClickHandler clickHandler) {
+    final Label label = new Label(name);
+    // i18n pluralization
+    if (count > 1) {
+      label.setTitle(i18n.t("There are [%d] items with this tag", count));
+    } else {
+      label.setTitle(i18n.t("There are [%d] item with this tag", count));
     }
+    label.addClickHandler(clickHandler);
+    label.addStyleName("k-tsp-tag");
+    label.addStyleName(style);
+    flowPanel.add(label);
+  }
 
-    @Override
-    public void clear() {
-        flowPanel.clear();
-    }
+  @Override
+  public Widget asWidget() {
+    return mainPanel;
+  }
 
-    @Override
-    public void setVisible(boolean visible) {
-        mainPanel.setVisible(visible);
-    }
+  @Override
+  public void clear() {
+    flowPanel.clear();
+  }
 
-    @Override
-    public Widget asWidget() {
-        return mainPanel;
-    }
+  @Override
+  public void setVisible(final boolean visible) {
+    mainPanel.setVisible(visible);
+  }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -29,6 +29,7 @@
 import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
 
 import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.InlineLabel;
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.Widget;
@@ -37,7 +38,7 @@
 public abstract class AbstractFolderViewerPanel extends ViewImpl implements FolderViewerView {
   private final ContentCapabilitiesRegistry capabilitiesRegistry;
   private final ContentTitleWidget contentTitle;
-  private final InlineLabel emptyLabel;
+  private final FlowPanel emptyPanel;
   protected final GSpaceArmor gsArmor;
   protected final I18nTranslationService i18n;
   protected Widget widget;
@@ -47,8 +48,11 @@
     this.gsArmor = gsArmor;
     this.i18n = i18n;
     this.capabilitiesRegistry = capabilitiesRegistry;
-    emptyLabel = new InlineLabel(i18n.t("This folder is empty."));
+    emptyPanel = new FlowPanel();
+    final InlineLabel emptyLabel = new InlineLabel(i18n.t("This is empty."));
     emptyLabel.setStyleName("k-empty-msg");
+    emptyPanel.setStyleName("k-empty-folder-panel");
+    emptyPanel.add(emptyLabel);
     contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
   }
 
@@ -76,6 +80,11 @@
   }
 
   @Override
+  public void editTitle() {
+    contentTitle.edit();
+  }
+
+  @Override
   public HasEditHandler getEditTitle() {
     return contentTitle.getEditableTitle();
   }
@@ -100,6 +109,6 @@
 
   @Override
   public void showEmptyMsg() {
-    gsArmor.getDocContainer().add(emptyLabel);
+    gsArmor.getDocContainer().add(emptyPanel);
   }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -53,6 +53,10 @@
     initWidget(flow);
   }
 
+  public void edit() {
+    editableTitle.edit();
+  }
+
   public HasEditHandler getEditableTitle() {
     return editableTitle;
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-05-15 10:54:08 UTC (rev 1389)
@@ -84,6 +84,8 @@
 
     void detach();
 
+    void editTitle();
+
     HasEditHandler getEditTitle();
 
     void setActions(GuiActionDescCollection actions);
@@ -248,6 +250,10 @@
     getView().detach();
   }
 
+  public void editTitle() {
+    getView().editTitle();
+  }
+
   private String genId(final StateToken token) {
     return "k-cnav-" + token.toString().replace(StateToken.SEPARATOR, "-");
   }

Modified: trunk/src/main/resources/log4j.dev.properties
===================================================================
--- trunk/src/main/resources/log4j.dev.properties	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/resources/log4j.dev.properties	2011-05-15 10:54:08 UTC (rev 1389)
@@ -1,3 +1,4 @@
+# http://www.benmccann.com/dev-blog/sample-log4j-properties-file/
 #------------------------------------------------------------------------------
 #
 #  The following properties set the logging levels and log appender.  The

Modified: trunk/src/main/resources/log4j.properties
===================================================================
--- trunk/src/main/resources/log4j.properties	2011-05-15 10:01:33 UTC (rev 1388)
+++ trunk/src/main/resources/log4j.properties	2011-05-15 10:54:08 UTC (rev 1389)
@@ -1,3 +1,4 @@
+# http://www.benmccann.com/dev-blog/sample-log4j-properties-file/
 #------------------------------------------------------------------------------
 #
 #  The following properties set the logging levels and log appender.  The




More information about the kune-commits mailing list