enhancement on copy/paste
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@81305 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f9682ba221
commit
01eaeeedd4
|
@ -37,6 +37,8 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.Download
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.CopytemEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.CopytemEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
|
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FilterScopeEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.FilterScopeEventHandler;
|
||||||
|
@ -477,11 +479,14 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
if(refreshtemEvent.getFolderTarget()!=null){
|
if(refreshtemEvent.getFolderTarget()!=null){
|
||||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshtemEvent.getFolderTarget().getIdentifier(), true);
|
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(refreshtemEvent.getFolderTarget().getIdentifier(), true);
|
||||||
notifySubscriber(refreshtemEvent);
|
// notifySubscriber(refreshtemEvent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GWT.log("warn: escape refresh because item is null");
|
GWT.log("warn: escape refresh because item is null");
|
||||||
|
|
||||||
|
|
||||||
|
notifySubscriber(refreshtemEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -509,6 +514,14 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(CopytemEvent.TYPE, new CopytemEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCopyItem(CopytemEvent copytemEvent) {
|
||||||
|
notifySubscriber(copytemEvent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.addHandler(PasteItemEvent.TYPE, new PasteItemEventHandler() {
|
eventBus.addHandler(PasteItemEvent.TYPE, new PasteItemEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1678,6 +1691,10 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
||||||
|
|
||||||
sub.pasteEventIsCompleted();
|
sub.pasteEventIsCompleted();
|
||||||
|
|
||||||
|
}else if(event instanceof CopytemEvent){
|
||||||
|
|
||||||
|
sub.copyEventIsCompleted();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package org.gcube.portlets.user.workspace.client.event;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
|
||||||
|
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
public class CopytemEvent extends GwtEvent<CopytemEventHandler> implements GuiEventInterface{
|
||||||
|
public static Type<CopytemEventHandler> TYPE = new Type<CopytemEventHandler>();
|
||||||
|
|
||||||
|
private String itemId = null;
|
||||||
|
|
||||||
|
public CopytemEvent(String itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<CopytemEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(CopytemEventHandler handler) {
|
||||||
|
handler.onCopyItem(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface#getKey()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EventsTypeEnum getKey() {
|
||||||
|
return EventsTypeEnum.COPY_EVENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package org.gcube.portlets.user.workspace.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
public interface CopytemEventHandler extends EventHandler {
|
||||||
|
/**
|
||||||
|
* @param copytemEvent
|
||||||
|
*/
|
||||||
|
void onCopyItem(CopytemEvent copytemEvent);
|
||||||
|
}
|
|
@ -28,5 +28,6 @@ public enum EventsTypeEnum
|
||||||
REPLY_FORWARD_MESSAGE,
|
REPLY_FORWARD_MESSAGE,
|
||||||
FILE_DOWNLAD_EVENT,
|
FILE_DOWNLAD_EVENT,
|
||||||
SESSION_EXPIRED,
|
SESSION_EXPIRED,
|
||||||
PASTED_EVENT
|
PASTED_EVENT,
|
||||||
|
COPY_EVENT;
|
||||||
}
|
}
|
|
@ -46,5 +46,9 @@ public interface SubscriberInterface {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void pasteEventIsCompleted();
|
void pasteEventIsCompleted();
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void copyEventIsCompleted();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.portlets.user.workspace.client.constant.WorkspaceOperation;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
|
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.CopytemEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.CreateSharedFolderEvent;
|
import org.gcube.portlets.user.workspace.client.event.CreateSharedFolderEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.CreateUrlEvent;
|
import org.gcube.portlets.user.workspace.client.event.CreateUrlEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
|
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
|
||||||
|
@ -321,6 +322,7 @@ public class ContextMenuTree {
|
||||||
for (FileModel target : listSelectedItems) {
|
for (FileModel target : listSelectedItems) {
|
||||||
if(target.getIdentifier()!=null){
|
if(target.getIdentifier()!=null){
|
||||||
CopyAndPaste.copy(target.getIdentifier());
|
CopyAndPaste.copy(target.getIdentifier());
|
||||||
|
eventBus.fireEvent(new CopytemEvent(target.getIdentifier()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue