[kune-commits] r1475 - in trunk/src/main/java/cc/kune: common/client/tooltip core/client/dnd core/public gspace/client/resources gspace/client/tool/selector gspace/client/viewers

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Jul 29 21:44:19 CEST 2011


Author: vjrj_
Date: 2011-07-29 21:44:18 +0200 (Fri, 29 Jul 2011)
New Revision: 1475

Modified:
   trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
   trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmorTheme.css
   trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java
   trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
Log:
Drag&Drop look improved

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-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java	2011-07-29 19:44:18 UTC (rev 1475)
@@ -144,7 +144,7 @@
 
   @Override
   public void show() {
-    if (!Tooltip.this.isShowing() && ofWidget.isVisible()) {
+    if (!Tooltip.this.isShowing() && ofWidget.isAttached() && ofWidget.isVisible()) {
       Tooltip.super.show();
       Tooltip.this.showAt(TooltipPositionCalculator.calculate(Window.getClientWidth(),
           Window.getClientHeight(), ofWidget.getAbsoluteLeft(), ofWidget.getAbsoluteTop(),

Modified: trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java	2011-07-29 19:44:18 UTC (rev 1475)
@@ -8,6 +8,7 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.viewers.FolderItemWidget;
 
 import com.allen_sauer.gwt.dnd.client.DragContext;
@@ -33,6 +34,7 @@
   private final KuneDragController dragController;
   private SimpleDropController dropController;
   private final ErrorHandler erroHandler;
+  private final I18nTranslationService i18n;
   private final Session session;
   private final StateManager stateManager;
   private Object target;
@@ -40,12 +42,13 @@
   @Inject
   public FolderViewerDropController(final KuneDragController dragController,
       final ContentServiceAsync contentService, final Session session, final StateManager stateManager,
-      final ErrorHandler erroHandler) {
+      final ErrorHandler erroHandler, final I18nTranslationService i18n) {
     this.dragController = dragController;
     this.contentService = contentService;
     this.session = session;
     this.stateManager = stateManager;
     this.erroHandler = erroHandler;
+    this.i18n = i18n;
   }
 
   @Override
@@ -58,6 +61,7 @@
         for (final Widget widget : context.selectedWidgets) {
           if (widget instanceof FolderItemWidget) {
             getDropTarget().removeStyleName("k-drop-allowed-hover");
+            NotifyUser.showProgress(i18n.t("Moving"));
             if (target != null) {
               final StateToken destToken = (StateToken) target;
               contentService.moveContent(session.getUserHash(), ((FolderItemWidget) widget).getToken(),
@@ -66,15 +70,18 @@
                     public void onFailure(final Throwable caught) {
                       erroHandler.process(caught);
                       stateManager.refreshCurrentState();
+                      NotifyUser.hideProgress();
                     }
 
                     @Override
                     public void onSuccess(final StateContainerDTO result) {
                       stateManager.refreshCurrentState();
+                      NotifyUser.hideProgress();
                     }
                   });
             } else {
               NotifyUser.info(TextUtils.IN_DEVELOPMENT);
+              NotifyUser.hideProgress();
             }
           }
         }
@@ -114,6 +121,9 @@
     };
 
     dropTarget.addStyleName("k-drop-allowed");
+    if (dropTarget.isAttached()) {
+      dragController.registerDropController(dropController);
+    }
     dropTarget.addAttachHandler(new Handler() {
       @Override
       public void onAttachOrDetach(final AttachEvent event) {

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-07-29 19:44:18 UTC (rev 1475)
@@ -1428,6 +1428,7 @@
   border-radius: 4px;
 }
 
+button.k-drop-allowed-hover,
 .k-drop-allowed-hover {
   border: dashed 2px #3a9fd6;
 }
\ No newline at end of file

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-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmorTheme.css	2011-07-29 19:44:18 UTC (rev 1475)
@@ -33,11 +33,11 @@
 
 }
 
-.k-sn-2nd-spanel {
+.k-sn-2nd-panel {
   background-color: bc2;
 }
 
-.k-sn-2nd-spanel span {
+.k-sn-2nd-panel span {
   color: c2;
 }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java	2011-07-29 19:44:18 UTC (rev 1475)
@@ -29,6 +29,7 @@
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.uibinder.client.UiHandler;
 import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.FocusPanel;
 import com.google.gwt.user.client.ui.HTMLPanel;
 import com.google.gwt.user.client.ui.HasText;
@@ -46,6 +47,8 @@
   @UiField
   HTMLPanel arrow;
   @UiField
+  FlowPanel flow;
+  @UiField
   Image iconLeft;
   @UiField
   Image iconRight;
@@ -70,15 +73,15 @@
     self.removeStyleDependentName("nofocus");
   }
 
-  public Widget getFlow() {
-    return self;
-  }
-
   @Override
   public HasClickHandlers getFocus() {
     return self;
   }
 
+  public Widget getFocusPanel() {
+    return flow;
+  }
+
   @Override
   public HasText getLabel() {
     return label;
@@ -89,16 +92,6 @@
     unfocus();
   }
 
-  // public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
-  // if (oldTheme != null) {
-  // final String oldName = oldTheme.getName();
-  // hl.removeStyleDependentName(oldName);
-  // }
-  // final String newName = newTheme.getName();
-  // hl.addStyleDependentName(newName);
-  // super.setCornerStyleName(hl.getStyleName());
-  // }
-
   @UiHandler("self")
   void onSelfMouseOver(final MouseOverEvent event) {
     focus();

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2011-07-29 19:44:18 UTC (rev 1475)
@@ -49,7 +49,6 @@
   public ToolSelectorPanel(final GSpaceArmor wsArmor,
       final Provider<FolderViewerDropController> dropControllerProv) {
     this.dropControllerProv = dropControllerProv;
-
     wsArmor.getEntityToolsCenter().add(uiBinder.createAndBindUi(this));
   }
 
@@ -57,7 +56,9 @@
   public void addItem(final ToolSelectorItemView item) {
     final Widget widget = item.asWidget();
     flow.add(widget);
-    dropControllerProv.get().init(((ToolSelectorItemPanel) widget).getParent());
+    // dropControllerProv.get().init((InlineLabel) ((ToolSelectorItemPanel)
+    // widget).getLabel());
+    dropControllerProv.get().init(((ToolSelectorItemPanel) widget).getFocusPanel());
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	2011-07-29 19:44:18 UTC (rev 1475)
@@ -9,6 +9,10 @@
     @external .k-folderitem-focus-nofocused;
     .k-folderitem-focus {
       background-color: none;
+      border: solid 2px transparent;
+      -moz-border-radius: 4px;
+      -webkit-border-radius: 4px;
+      border-radius: 4px;
     }
 
     .k-folderitem-focus-focused {
@@ -65,11 +69,11 @@
   </ui:style>
   <g:FocusPanel ui:field="focusPanel" styleName="{style.k-folderitem-focus}">
     <g:FlowPanel styleName="{style.flow}" ui:field="flow">
-      <g:Image styleName="{style.icon}" ui:field="icon" />
-      <g:InlineLabel styleName="{style.title}" ui:field="title" />
-      <g:SimplePanel styleName="{style.menu}" ui:field="menu" />
+      <g:Image styleName="{style.icon}" ui:field="icon"/>
+      <g:InlineLabel styleName="{style.title}" ui:field="title"/>
+      <g:SimplePanel styleName="{style.menu}" ui:field="menu"/>
       <g:InlineLabel styleName="{style.modified}"
-        ui:field="modified" />
+        ui:field="modified"/>
     </g:FlowPanel>
   </g:FocusPanel>
 </ui:UiBinder>
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-07-29 18:12:12 UTC (rev 1474)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2011-07-29 19:44:18 UTC (rev 1475)
@@ -26,6 +26,7 @@
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
 import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.core.client.dnd.FolderViewerDropController;
 import cc.kune.core.client.dnd.KuneDragController;
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
@@ -144,6 +145,9 @@
     flex.setWidget(rowCount + 1, 0, itemWidget);
     if (item.isDraggable()) {
       dragController.makeDraggable(itemWidget, itemWidget.getTitleWidget());
+      Tooltip.to(itemWidget, i18n.t("Drag and drop to move this. Double click to open"));
+    } else {
+      Tooltip.to(itemWidget, i18n.t("Double click to open"));
     }
     if (item.isDroppable()) {
       final FolderViewerDropController dropController = dropControllerProv.get();




More information about the kune-commits mailing list