enhancement: copy with multi-selection is implemented

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@90436 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-01-23 16:20:44 +00:00
parent d5dc2d4d30
commit 215a64a024
4 changed files with 39 additions and 16 deletions

View File

@ -5,6 +5,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree/WorkspaceTree">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/> <property name="context-root" value="workspace"/>
</wb-module> </wb-module>

13
pom.xml
View File

@ -164,21 +164,28 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId> <artifactId>workspace-tree-widget</artifactId>
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version> <version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
<!-- <scope>provided</scope> --> <scope>compile</scope>
</dependency> </dependency>
<!-- WSLT dependencies --> <!-- WSLT dependencies -->
<dependency> <dependency>
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-light-tree</artifactId> <artifactId>workspace-light-tree</artifactId>
<!-- <scope>provided</scope> --> <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>fileupload-progress-bar</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.portlets.widgets</groupId> <groupId>org.gcube.portlets.widgets</groupId>
<artifactId>wsmail-widget</artifactId> <artifactId>wsmail-widget</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> <version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<!-- <scope>provided</scope> --> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -212,6 +212,7 @@ public class AppController implements SubscriberInterface {
//PASTE EVENT //PASTE EVENT
eventBus.addHandler(PasteItemEvent.TYPE, new PasteItemEventHandler() { eventBus.addHandler(PasteItemEvent.TYPE, new PasteItemEventHandler() {
@Override @Override
public void onCopyAndPaste(PasteItemEvent pasteItemEvent) { public void onCopyAndPaste(PasteItemEvent pasteItemEvent) {
@ -227,9 +228,11 @@ public class AppController implements SubscriberInterface {
} }
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.VALIDATINGOPERATION,ConstantsExplorer.LOADINGSTYLE);
if(folderDestinationId!=null){ if(folderDestinationId!=null){
// Info.display("Info", "pasting..."); // Info.display("Info", "pasting...");
AppControllerExplorer.getEventBus().fireEvent(new PasteItemEvent(pasteItemEvent.getItemId(), folderDestinationId)); AppControllerExplorer.getEventBus().fireEvent(new PasteItemEvent(pasteItemEvent.getIds(), folderDestinationId));
} }
} }
}); });
@ -1433,6 +1436,8 @@ public class AppController implements SubscriberInterface {
resetSmartFolderSelected(); resetSmartFolderSelected();
GWT.log("refreshFolder method, forceRefresh is :" +forceRefresh);
if(folderTarget!=null){ if(folderTarget!=null){
if(forceRefresh){ if(forceRefresh){
@ -1440,7 +1445,7 @@ public class AppController implements SubscriberInterface {
//FORCED REFRESH FOLDER //FORCED REFRESH FOLDER
FileGridModel folder = wsPortlet.getGridGroupContainer().getFileGridModelByIdentifier(folderTarget.getIdentifier()); FileGridModel folder = wsPortlet.getGridGroupContainer().getFileGridModelByIdentifier(folderTarget.getIdentifier());
GWT.log("force refresh folder :" +folder); GWT.log("force refresh, folder :" +folder);
updateStoreByRpc(folderTarget); updateStoreByRpc(folderTarget);
@ -1547,8 +1552,8 @@ public class AppController implements SubscriberInterface {
*/ */
@Override @Override
public void pasteEventIsCompleted() { public void pasteEventIsCompleted() {
wsPortlet.getGridGroupContainer().unmask();
Info.display("Info", "paste submitting..."); // Info.display("Info", "paste submitting...");
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false); wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(false);
} }

View File

@ -309,13 +309,19 @@ public class GxtToolBarItemFunctionality {
btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() { btnCopyItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem(); List<String> listTarget = gridGroupViewContainer.getIdsSelectedItems();
if(listTarget!=null && listTarget.size()>0){
if(fileGridModel.getIdentifier()!=null){ CopyAndPaste.copy(listTarget);
CopyAndPaste.copy(fileGridModel.getIdentifier());
btnPasteItem.setEnabled(true); btnPasteItem.setEnabled(true);
} }
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
//
// if(fileGridModel.getIdentifier()!=null){
// CopyAndPaste.copy(fileGridModel.getIdentifier());
// btnPasteItem.setEnabled(true);
// }
} }
}); });
@ -330,8 +336,8 @@ public class GxtToolBarItemFunctionality {
if(parentTarget!=null) if(parentTarget!=null)
parentId=parentTarget.getIdentifier(); parentId=parentTarget.getIdentifier();
AppController.getEventBus().fireEvent(new PasteItemEvent(CopyAndPaste.getCopiedfileModelId(), parentId)); AppController.getEventBus().fireEvent(new PasteItemEvent(CopyAndPaste.getCopiedIdsFilesModel(), parentId));
CopyAndPaste.setCopiedfileModelId(null); CopyAndPaste.setCopiedIdsFileModels(null);
btnPasteItem.setEnabled(false); btnPasteItem.setEnabled(false);
} }
@ -646,13 +652,15 @@ public class GxtToolBarItemFunctionality {
} }
public void activeButtonForMultiSelection(boolean active){ public void activeButtonForMultiSelection(boolean active){
this.btnRemoveItem.setEnabled(active);
this.btnRenameItem.setEnabled(!active); this.btnRenameItem.setEnabled(!active);
this.btnDownloadFile.setEnabled(!active); this.btnDownloadFile.setEnabled(!active);
this.btnOpen.setEnabled(!active); this.btnOpen.setEnabled(!active);
this.btnCopyItem.setEnabled(!active);
this.btnGetSharedLink.setEnabled(!active); this.btnGetSharedLink.setEnabled(!active);
this.btnPublicLink.setEnabled(!active); this.btnPublicLink.setEnabled(!active);
//ONLY ENABLED
this.btnRemoveItem.setEnabled(active);
this.btnCopyItem.setEnabled(active);
} }
public ToolBar getToolBar() { public ToolBar getToolBar() {