Daniel Erez has posted comments on this change.
Change subject: webadmin: Disks sub-tab under Storage main-tab
......................................................................
Patch Set 2: (4 inline comments)
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageDiskListModel.java
Line 31:
Line 32: public UICommand getRemoveCommand() {
Line 33: return privateRemoveCommand;
Line 34: }
Line 35:
True, but it's our current convention for commands all over the models - I
prefer to keep it for consistency until cleaning up.
Line 36: private void setRemoveCommand(UICommand value) {
Line 37: privateRemoveCommand = value;
Line 38: }
Line 39:
Line 53: getSearchCommand().Execute();
Line 54: }
Line 55:
Line 56: @Override
Line 57: public void setEntity(Object value) {
It's usually better to avoid setting the entity unless needed (for preventing
non-mandatory events to the view). In this case I'll remove it since the parent
should handle it. (Done)
Line 58: if (value == null || !value.equals(getEntity())) {
Line 59: super.setEntity(value);
Line 60: }
Line 61: }
Line 108: Frontend.RunQuery(VdcQueryType.GetAllDisksByStorageDomainId,
parameters, query);
Line 109: }
Line 110:
Line 111: private void updateActionAvailability() {
Line 112: ArrayList<DiskImage> disks = getSelectedItems() != null ?
It's just for preventing null checks afterwards - updateActionAvailability()
method usually contains logic that analyzes the entities for deciding which
buttons to gray-out.
Line 113: Linq.<DiskImage> Cast(getSelectedItems()) : new
ArrayList<DiskImage>();
Line 114:
Line 115: getRemoveCommand().setIsExecutionAllowed(disks.size() > 0 &&
isRemoveCommandAvailable(disks));
Line 116: }
Line 139: model.setHashName("remove_disk"); //$NON-NLS-1$
Line 140:
model.setMessage(ConstantsManager.getInstance().getConstants().disksMsg());
Line 141:
Line 142: model.getLatch().setIsAvailable(false);
Line 143:
No real penalty here - they're both converted to the same JavaScript object..
Line 144: ArrayList<DiskModel> items = new ArrayList<DiskModel>();
Line 145: for (Object item : getSelectedItems()) {
Line 146: DiskImage disk = (DiskImage) item;
Line 147:
--
To view, visit http://gerrit.ovirt.org/10322
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I445de65ffacc9a6a77f6a350feba46da2d3f3e42
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches