multiple selection activated on grid to show the Move facility

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@172043 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-08 15:04:46 +00:00
parent 6a046f31db
commit 8d5ea237e9
1 changed files with 13 additions and 10 deletions

View File

@ -19,7 +19,6 @@ import org.gcube.portlets.user.workspace.client.gridevent.StoreGridChangedEvent;
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import org.gcube.portlets.user.workspace.client.model.GroupingStoreModel;
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay;
import com.extjs.gxt.ui.client.Style.SelectionMode;
import com.extjs.gxt.ui.client.data.ModelData;
@ -229,17 +228,21 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
public void handleEvent(GridEvent<FileGridModel> be)
{
if(be.isRightClick())
{
if(grid.getSelectionModel().getSelectedItem()!=null){
if(be.isRightClick()){
if(grid.getSelectionModel().getSelection().size()>1){
new InfoDisplay("Info", "The context menu is not available if multi-select is active");
return;
}
List<FileGridModel> selection = grid.getSelectionModel().getSelection();
if(selection!=null && selection.size()>0){
FileGridModel fileGridModel = grid.getSelectionModel().getSelectedItem();
AppController.getEventBus().fireEvent(new OpenContextMenuTreeEvent(fileGridModel, be.getClientX(), be.getClientY()));
// if(grid.getSelectionModel().getSelection().size()>1){
// new InfoDisplay("Info", "The context menu is not available if multi-select is active");
// return;
// }
List<FileModel> selected = new ArrayList<FileModel>(selection.size());
for (FileGridModel fileGridModel : selection) {
selected.add(fileGridModel);
}
//List<FileGridModel> selectedItems = grid.getSelectionModel().getSelectedItems();
AppController.getEventBus().fireEvent(new OpenContextMenuTreeEvent(selected, be.getClientX(), be.getClientY()));
}
}
}