Added enable/disable versioning operation depending on selected items
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@144500 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
957985aacd
commit
fdb8ebf426
|
@ -349,9 +349,20 @@ public class VersioningInfoContainer extends LayoutContainer {
|
||||||
@Override
|
@Override
|
||||||
public void selectionChanged(SelectionChangedEvent<FileVersionModel> se) {
|
public void selectionChanged(SelectionChangedEvent<FileVersionModel> se) {
|
||||||
|
|
||||||
boolean selection = grid.getSelectionModel().getSelectedItems().size()>0;
|
List<FileVersionModel> selected = grid.getSelectionModel().getSelectedItems();
|
||||||
|
boolean selection = selected.size()>0;
|
||||||
activeButtonOnSelection(selection);
|
activeButtonOnSelection(selection);
|
||||||
|
|
||||||
|
for (FileVersionModel fileVersionModel : selected) {
|
||||||
|
activeCurrentVersionOperation(!fileVersionModel.isCurrentVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(selected.size()>1)
|
||||||
|
activeDownloadOperation(false);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
grid.getView().setAutoFill(true);
|
grid.getView().setAutoFill(true);
|
||||||
|
@ -363,7 +374,28 @@ public class VersioningInfoContainer extends LayoutContainer {
|
||||||
grid.setStyleAttribute("borderTop", "none");
|
grid.setStyleAttribute("borderTop", "none");
|
||||||
cp.add(grid);
|
cp.add(grid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active download operation.
|
||||||
|
*
|
||||||
|
* @param b the b
|
||||||
|
*/
|
||||||
|
private void activeDownloadOperation(boolean b) {
|
||||||
|
buttonDownload.setEnabled(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active current version operation.
|
||||||
|
*
|
||||||
|
* @param bool the bool
|
||||||
|
*/
|
||||||
|
private void activeCurrentVersionOperation(boolean bool){
|
||||||
|
buttonDelete.setEnabled(bool);
|
||||||
|
buttonRestore.setEnabled(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,6 @@ public class WindowVersioning extends Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update versioning container.
|
* Update versioning container.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue