Arik Hadas has posted comments on this change.
Change subject: webadmin: preview snapshot with memory popup
......................................................................
Patch Set 6: (8 inline comments)
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotPreviewPopupWidget.java
Line 40:
Line 41: private final Driver driver = GWT.create(Driver.class);
Line 42:
Line 43: public VmSnapshotPreviewPopupWidget(CommonApplicationConstants
constants) {
Line 44: memoryEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
Done
Line 45: initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
Line 46: localize(constants);
Line 47: ViewIdHandler.idHandler.generateAndSetIds(this);
Line 48: driver.initialize(this);
Line 49: }
Line 50:
Line 51: void localize(CommonApplicationConstants constants) {
Line 52:
memoryEditor.setLabel(constants.virtualMachineSnapshotPreviewPopupMemoryLabel());
Line 53:
messageLabel.setText(ConstantsManager.getInstance().getMessages().snapshotContainsMemory());
but it is not CommonApplicationMessages, it is UIMessages. I agree that in most
of the cases it's better to do inversion of control to make the code more
testable, but since it's a 'localize' method that is not going to be tested,
and the access is made to a singleton instance - I think there's no really
benefit to pass it as a parameter, don't you think?
Line 54: }
Line 55:
Line 56: @Override
Line 57: public void edit(final SnapshotModel model) {
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmSnapshotPreviewPopupWidget.ui.xml
Line 5:
Line 6: <ui:style>
Line 7:
Line 8: .memoryEditor {
Line 9: width: 100%;
Done
Line 10: }
Line 11:
Line 12: .messageLabel {
Line 13: padding-top: 15px;
Line 9: width: 100%;
Line 10: }
Line 11:
Line 12: .messageLabel {
Line 13: padding-top: 15px;
Done
Line 14: padding-left: 10px;
Line 15: padding-right: 5px;
Line 16: height: 40%;
Line 17: }
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
Line 426:
Line 427: model.getCommands().add(new UICommand("OnPreview", this)
//$NON-NLS-1$
Line 428:
.setTitle(ConstantsManager.getInstance().getConstants().ok())
Line 429: .setIsDefault(true));
Line 430: UICommand cancelCommand = new UICommand("Cancel", this)
//$NON-NLS-1$
once with title 'cancel' and once with title 'close', my reference was
VmSnapshotListModel#newEntity .. can we avoid that?
Line 431:
.setTitle(ConstantsManager.getInstance().getConstants().cancel())
Line 432: .setIsCancel(true);
Line 433: model.getCommands().add(cancelCommand);
Line 434: model.setCancelCommand(cancelCommand);
Line 441: private void OnPreview() {
Line 442: Snapshot snapshot = (Snapshot) getSelectedItem();
Line 443:
Line 444: if (snapshot == null)
Line 445: {
the formatter doesn't change anything - what's the problem?
Line 446: cancel();
Line 447: return;
Line 448: }
Line 449:
Line 468: private void newEntity()
Line 469: {
Line 470: VM vm = (VM) getEntity();
Line 471: if (vm == null || getWindow() != null)
Line 472: {
the formatter doesn't change anything - what's the problem?
Line 473: return;
Line 474: }
Line 475:
Line 476: SnapshotModel model = new SnapshotModel();
Line 807: }
Line 808:
Line 809: private boolean memorySnapshotSupported;
Line 810:
Line 811: protected void updateIsMemorySnapshotSupported()
yes, but it depends on the vds group of the VM - so when the entity (VM)
changes, we need to check the value again
Line 812: {
Line 813: if (getEntity() == null)
Line 814: {
Line 815: return;
--
To view, visit http://gerrit.ovirt.org/15686
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I18c99b22b33256e6bcf1cb9b1151e908e27ded8d
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches