Vojtech Szocs has posted comments on this change.
Change subject: webadmin,userportal: Upgrade GWT SDK and related modules
......................................................................
Patch Set 1: (9 inline comments)
Daniel, thanks for your comments! Let me know what you think.
I'll upload new patch set with one additional change: rename
IVdcQueryableCellTable to ListModelObjectCellTable, as suggested by Tomas (see
IVdcQueryableCellTable.java for details).
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/popup/ConsolePopupPresenterWidget.java
Line 250:
Line 251: // store to local storage
Line 252:
consoleOptionsPersister.storeToLocalStorage(model.getModel());
Line 253:
Line 254: ConsoleModelChangedEvent.fire(this, model.getModel());
This change is necessary because GWTP now works with (actual)
com.google.web.bindery.event.shared.EventBus instead of (legacy)
com.google.gwt.event.shared.EventBus:
* actual EventBus doesn't implement HasHandlers interface
* legacy EventBus extends actual EventBus and implements HasHandlers interface
* PresenterWidget.getEventBus() returns actual EventBus
* ConsoleModelChangedEvent.fire() expects HasHandlers implementation -> compile
error
* PresenterWidget ("this") implements HasHandlers interface -> fix compile error
In general, when firing events from within Presenters/PresenterWidgets, GWTP
recommends to use "this" as the event source.
Line 255: }
Line 256: }
Line 257:
Line 258: protected boolean isAdditionalConsoleAvailable(HasConsoleModel
currentItem) {
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/IVdcQueryableCellTable.java
Line 32: * Table row data type.
Line 33: * @param <M>
Line 34: * List model type.
Line 35: */
Line 36: public class IVdcQueryableCellTable<T, M extends ListModel> extends
ColumnResizeCellTable<T> implements IsEditorDriver<M> {
OK, I'll rename this class to ListModelObjectCellTable as part of this patch.
Line 37:
Line 38: private static final int DEFAULT_PAGESIZE = 1000;
Line 39: private static final int CHECK_COLUMN_WIDTH = 27;
Line 40:
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmRunOncePopupWidget.java
Line 132: @WithElementId("runAndPause")
Line 133: EntityModelCheckBoxEditor runAndPauseEditor;
Line 134:
Line 135: @UiField
Line 136: @Path(value = "kernel_path.entity")
In GWT 2.3 the EditorDriver generator wasn't too strict when checking subeditor
paths to resolve getter/setter methods, i.e. both "Kernel_path.Entity" and
"kernel_path.entity" would be acceptable values for
"getKernel_path().getEntity()" + corresponding setter.
In GWT 2.5 the EditorDriver generator is more strict when checking subeditor
paths, so only "kernel_path.entity" is acceptable for
"getKernel_path().getEntity()" + corresponding setter.
Line 137: @WithElementId("kernelPath")
Line 138: EntityModelTextBoxEditor kernelPathEditor;
Line 139:
Line 140: @UiField
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/storage/IscsiStorageView.ui.xml
Line 51: </g:VerticalPanel>
Line 52: <t:DialogTabPanel ui:field="dialogTabPanel"
height="340px" width="100%" addStyleNames="{style.tabPanel}">
Line 53: <t:tab>
Line 54: <t:DialogTab ui:field="targetsToLunTab">
Line 55: <t:content>
This is because GWT 2.5 compiler fails with following error:
[ERROR] Unexpected attributes: <t:content height='100%'> (:55)
<t:content> delegates to DialogTab.setContent(Widget) via @UiChild annotation,
and AFAIK @UiChild doesn't allow passing custom attributes (other than Widget).
So while GWT 2.3 compiler just ignores height="100%", GWT 2.5 compiler fails on
unexpected attribute.
In general, having height="100%" on <t:content> doesn't have any real effect
whatsoever.
Line 56: <w:ValidatedPanelWidget
ui:field="targetsToLunsPanel" addStyleNames="{style.tabContentPanel}" />
Line 57: </t:content>
Line 58: </t:DialogTab>
Line 59: </t:tab>
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/template/TemplateGeneralModelForm.java
Line 20: TextBoxLabel name = new TextBoxLabel();
Line 21: TextBoxLabel description = new TextBoxLabel();
Line 22: TextBoxLabel hostCluster = new TextBoxLabel();
Line 23: TextBoxLabel definedMemory = new TextBoxLabel();
Line 24: @Path("OS")
See my comment in VmRunOncePopupWidget.java - in GWT 2.5 the EditorDriver
generator is more strict when checking subeditor paths.
For example, "OS" is the acceptable value for getOS() / setOS() while "oS" is
not, due to incorrect letter case.
Line 25: TextBoxLabel oS = new TextBoxLabel();
Line 26: TextBoxLabel cpuInfo = new TextBoxLabel();
Line 27: TextBoxLabel defaultDisplayType = new TextBoxLabel();
Line 28: TextBoxLabel origin = new TextBoxLabel();
Line 102: @Override
Line 103: protected void doEdit(TemplateGeneralModel model) {
Line 104: driver.edit(model);
Line 105:
Line 106: // Required because of type conversion
Yeah, I remember seeing "TODO required because of GWT#5864" comments in several
classes.
For example, monitorCount.setText(String) is called using Integer.toString(x)
where x = primitive int value. This is essentially type conversion (int ->
String) to work around GWT#5864 (primitive values supported by the Editor
framework). Since this issue has been fixed in GWT, we could now use
NumberLabel (Editor<Number>) instead of TextBoxLabel (Editor<String>).
In general, to get rid of type conversion, we could use NumberLabel or
BooleanLabel instead of TextBoxLabel. I've updated
[http://www.ovirt.org/Features/GWT_Platform_Upgrade] to reflect this code
cleanup.
Line 107:
monitorCount.setText(Integer.toString(getModel().getMonitorCount()));
Line 108:
isStateless.setText(Boolean.toString(getModel().getIsStateless()));
Line 109: }
Line 110:
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/vm/PoolInterfaceListModelTable.java
Line 141:
Line 142: TextColumnWithTooltip<VmNetworkInterface> dropsColumn = new
SumUpColumn<VmNetworkInterface>() {
Line 143: @Override
Line 144: protected Double[] getRawValue(VmNetworkInterface object)
{
Line 145: Double receiveDropRate = object != null ?
object.getStatistics().getReceiveDropRate() : null;
Or maybe this:
return object != null ? new Double[] { object.getX(), object.getY() } : new
Double[];
But I'd rather prefer to stay with current code, since this pattern is used in
other places too. Current code is more verbose but also more explicit, though
:-)
Line 146: Double transmitDropRate = object != null ?
object.getStatistics().getTransmitDropRate() : null;
Line 147: return new Double[] { receiveDropRate,
transmitDropRate };
Line 148: }
Line 149: };
....................................................
File frontend/webadmin/modules/pom.xml
Line 164: <bindAddress>0.0.0.0</bindAddress>
Line 165: <gen>${gwtGenDirectory}</gen>
Line 166: <extraJvmArgs>${aspectj.agent} ${gwt-plugin.extraJvmArgs}
${gwt.dontPrune}</extraJvmArgs>
Line 167: <copyWebapp>true</copyWebapp>
Line 168: <strict>true</strict>
This is mainly to guard against the case when deferred binding generators
produce Java code containing compile-time errors and we should fail the build
(GWT compilation) upon such errors, instead of just passing code to compilation
phase and hoping for a successful compile.
For example, ClientGinjector is now generated by GWTP at deferred binding
phase, with the possibility to "extend" auto-generated ClientGinjector
interface with custom (application-provided) interface such as
ClientGinjectorExtension. Any potential errors regarding ClientGinjector should
be caught early on with <strict> set to true.
Line 169: <compileSourcesArtifacts>
Line 170:
<compileSourcesArtifact>${engine.groupId}:gwt-extension</compileSourcesArtifact>
Line 171:
<compileSourcesArtifact>${engine.groupId}:uicommonweb</compileSourcesArtifact>
Line 172: </compileSourcesArtifacts>
....................................................
File
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/WebAdmin.gwt.xml
Line 28
Line 29
Line 30
Line 31
Line 32
It's because GwtCommon.gwt.xml now inherits MvpWithEntryPoint instead of Mvp.
MvpWithEntryPoint provides standard (GWTP) EntryPoint implementation that
integrates with auto-generated ClientGinjector interface.
MvpWithEntryPoint is recommended since it eliminates boilerplate regarding
application startup, we can always use custom Bootstrapper's and
PreBootstrapper's to customize the startup process.
In other words, WebAdmin & UserPortal EntryPoint classes were doing the same
thing and with MvpWithEntryPoint they just became obsolete.
--
To view, visit http://gerrit.ovirt.org/16739
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ica797e68e2f56fd3f231baf36f0ac03c5df5c3f2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches