Change in ovirt-engine[master]: userportal, webadmin: add advanced mode support for VM dialog...

tjelinek at redhat.com tjelinek at redhat.com
Fri Jun 21 08:14:11 UTC 2013


Tomas Jelinek has submitted this change and it was merged.

Change subject: userportal,webadmin: add advanced mode support for VM dialogs
......................................................................


userportal,webadmin: add advanced mode support for VM dialogs

A new button: Show/Hide advanced mode has been added to the
VM based widgets. There are defined fields which are considered
advanced and this fields are visible only after clicking this button.

For details please consult: http://www.ovirt.org/Features/Instance_Types#Design

To achieve this the folowing chnages have been done:
1: Added support for declarative configuration of the fields
(PopupWidgetConfigMap) and a support for changing the mode
(AbstractModeSwitchingPopupWidget).

2: Support for hooking some logic between UICommon's setIsAvailable and the
actual widget's AbstractValidatedWidgetWithLabel.setAccessible (using the
VisibilityRenderer interface). Implemented for most of widgets but not for all-
only for ones needed in this patch.

The actual logic deciding if the specific field should be visible or not
is implemented on the gwt-common layer and not on uicommonweb one for the
following reasons:
1: big part of the configured widgets are not backed by any uicommonweb models
(such as tabs or expanders) - e.g. needed to configure gui level objects, not
model level ones

2: big part of the logic showing/hiding the specific fields was already on this
layer

3: it is logically a presentation layer, not a model one

The usage:
- Any child of AbstractVmPopupWidget can owerride it's method
createWidgetConfiguration()
- It returns an instance of VmPopupWidgetConfigMap containing some basic
configuration which the user can extend or override.
- The content of this map are Widget -> VmPopupWidgetConfig
- The instance of VmPopupWidgetConfig defines if and how should be this widget
rendered

example:
    @Override
    protected PopupWidgetConfigMap createWidgetConfiguration() {
        return super.createWidgetConfiguration().
                putOne(myWidget, simpleField().visibleInAdvancedModeOnly());
    }
This says, that I want to use the default configuration enriched by myWidget,
which is visible only in advanced mode.

Any change of the visibility of fields has to be done using the
AbstractModeSwitchingPopupWidget.changeApplicationLevelVisibility method,
not the Widget.setVisible.

Examples to this:
1: if the widget is visible only in advanced mode and the mode is basic,
the changeApplicationLevelVisibility will not make the widget appear, but once
the popup switched to advanced mode, the widget will be visible.

3: if the widget is visible only in advanced mode and the mode is advanced,
the changeApplicationLevelVisibility will make the widget appear, but once
the popup switched to basic mode, the widget will be hidden.

2: if the widget is visible in all modes and the
changeApplicationLevelVisibility is set to false, the widget will disappear.

Each widget, which is backed by a model and the uicommon can deciede to hide it
has to be rendered using the ModeSwitchingVisibilityRenderer which bridges the
AbstractValidatedWidgetWithLabel.setAccessible to
AbstractModeSwitchingPopupWidget.changeApplicationLevelVisibility.

Change-Id: I36d206c1a0f97f9a76c8b30b7f21a90aae8984e3
Signed-off-by: Tomas Jelinek <tjelinek at redhat.com>
---
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/AbstractModelBoundWidgetPopupView.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/popup/AbstractVmPopupView.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/VisibilityRenderer.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/dialog/tab/DialogTabPanel.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/AbstractValueBoxWithLabelEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCheckBoxEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelRadioButtonEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextBoxEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextBoxOnlyEditor.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelListBoxEditor.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/popup/AbstractVmBasedPopupPresenterWidget.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractModeSwitchingPopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolEditPopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/template/TemplateNewPopupWidget.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/PopupWidgetConfig.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/PopupWidgetConfigMap.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmClonePopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDesktopNewPopupWidget.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmServerNewPopupWidget.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/Model.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmBasedWidgetSwitchModeCommand.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/popup/template/TemplateNewPopupPresenterWidget.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/popup/vm/VmClonePopupPresenterWidget.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/popup/vm/VmDesktopNewPopupPresenterWidget.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/popup/vm/VmServerNewPopupPresenterWidget.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/popup/template/TemplateNewPopupView.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/popup/vm/VmDesktopNewPopupView.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/popup/vm/VmServerNewPopupView.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/pool/PoolEditPopupPresenterWidget.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/pool/PoolNewPopupPresenterWidget.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/template/TemplateNewPresenterWidget.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/vm/VmClonePopupPresenterWidget.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/vm/VmDesktopNewPopupPresenterWidget.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/vm/VmServerNewPopupPresenterWidget.java
45 files changed, 862 insertions(+), 216 deletions(-)

Approvals:
  Tomas Jelinek: Verified; Looks good to me, approved


-- 
To view, visit http://gerrit.ovirt.org/14810
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I36d206c1a0f97f9a76c8b30b7f21a90aae8984e3
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen at redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkobzik at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list