From ecd7dafcfa1173c5829982f3bf5c01f567903e23 Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Mon, 24 Sep 2018 14:10:00 +0400 Subject: [PATCH] Split Window controller and Window component behaviour #337 Introduced separate screen/window.xsd, screen/fragment.xsd and screen/layout.xsd --- .../com/haulmont/cuba/core/global/view.xsd | 13 +- .../src/com/haulmont/cuba/gui/mainwindow.xsd | 157 - .../com/haulmont/cuba/gui/screen/fragment.xsd | 51 + .../com/haulmont/cuba/gui/screen/layout.xsd | 2984 +++++++++++++++++ .../com/haulmont/cuba/gui/screen/window.xsd | 55 + .../src/com/haulmont/cuba/gui/window-ext.xsd | 3 +- .../gui/src/com/haulmont/cuba/gui/window.xsd | 2928 +--------------- .../cuba/web/app/mainwindow/mainwindow.xml | 62 +- .../cuba/web/app/ui/demo/user/UserList.java | 27 +- .../cuba/web/app/ui/demo/user/user-list.xml | 27 + 10 files changed, 3211 insertions(+), 3096 deletions(-) delete mode 100644 modules/gui/src/com/haulmont/cuba/gui/mainwindow.xsd create mode 100644 modules/gui/src/com/haulmont/cuba/gui/screen/fragment.xsd create mode 100644 modules/gui/src/com/haulmont/cuba/gui/screen/layout.xsd create mode 100644 modules/gui/src/com/haulmont/cuba/gui/screen/window.xsd create mode 100644 modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/user-list.xml diff --git a/modules/global/src/com/haulmont/cuba/core/global/view.xsd b/modules/global/src/com/haulmont/cuba/core/global/view.xsd index 93378b86e0..4d4479b7c8 100644 --- a/modules/global/src/com/haulmont/cuba/core/global/view.xsd +++ b/modules/global/src/com/haulmont/cuba/core/global/view.xsd @@ -16,13 +16,10 @@ ~ --> - + @@ -66,4 +63,4 @@ - + \ No newline at end of file diff --git a/modules/gui/src/com/haulmont/cuba/gui/mainwindow.xsd b/modules/gui/src/com/haulmont/cuba/gui/mainwindow.xsd deleted file mode 100644 index 6d006b1491..0000000000 --- a/modules/gui/src/com/haulmont/cuba/gui/mainwindow.xsd +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/gui/src/com/haulmont/cuba/gui/screen/fragment.xsd b/modules/gui/src/com/haulmont/cuba/gui/screen/fragment.xsd new file mode 100644 index 0000000000..6188d34957 --- /dev/null +++ b/modules/gui/src/com/haulmont/cuba/gui/screen/fragment.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/gui/src/com/haulmont/cuba/gui/screen/layout.xsd b/modules/gui/src/com/haulmont/cuba/gui/screen/layout.xsd new file mode 100644 index 0000000000..ca340d4de0 --- /dev/null +++ b/modules/gui/src/com/haulmont/cuba/gui/screen/layout.xsd @@ -0,0 +1,2984 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/gui/src/com/haulmont/cuba/gui/screen/window.xsd b/modules/gui/src/com/haulmont/cuba/gui/screen/window.xsd new file mode 100644 index 0000000000..4e6402b907 --- /dev/null +++ b/modules/gui/src/com/haulmont/cuba/gui/screen/window.xsd @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/gui/src/com/haulmont/cuba/gui/window-ext.xsd b/modules/gui/src/com/haulmont/cuba/gui/window-ext.xsd index 9a23f1d517..a617b0cf93 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/window-ext.xsd +++ b/modules/gui/src/com/haulmont/cuba/gui/window-ext.xsd @@ -19,8 +19,7 @@ + elementFormDefault="qualified"> diff --git a/modules/gui/src/com/haulmont/cuba/gui/window.xsd b/modules/gui/src/com/haulmont/cuba/gui/window.xsd index a1a427803b..1106f83dee 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/window.xsd +++ b/modules/gui/src/com/haulmont/cuba/gui/window.xsd @@ -17,987 +17,16 @@ --> + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns="http://schemas.haulmont.com/cuba/window.xsd" + xmlns:views="http://schemas.haulmont.com/cuba/view.xsd" + xmlns:layout="http://schemas.haulmont.com/cuba/screen/layout.xsd" + elementFormDefault="qualified"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1021,66 +50,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1096,1664 +74,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -2766,16 +102,16 @@ - + - + - + @@ -2789,17 +125,17 @@ - + - + + /> @@ -2812,7 +148,7 @@ - + @@ -2821,19 +157,19 @@ - + - + - + - + @@ -2849,10 +185,10 @@ - + - + @@ -2868,10 +204,10 @@ - + - + @@ -2887,10 +223,10 @@ - + - + @@ -2936,137 +272,18 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -3099,24 +316,8 @@ - - - - - - - - - - - - - - - - - - + + @@ -3124,36 +325,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -3164,8 +338,8 @@ - - + + @@ -3173,27 +347,9 @@ - - + + - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/web/src/com/haulmont/cuba/web/app/mainwindow/mainwindow.xml b/modules/web/src/com/haulmont/cuba/web/app/mainwindow/mainwindow.xml index 5a35bf5001..cf75930c66 100644 --- a/modules/web/src/com/haulmont/cuba/web/app/mainwindow/mainwindow.xml +++ b/modules/web/src/com/haulmont/cuba/web/app/mainwindow/mainwindow.xml @@ -16,44 +16,62 @@ --> - + - + - + - + - + - + - - + + - + - - + + - - + + - - + + \ No newline at end of file diff --git a/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/UserList.java b/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/UserList.java index 6d707388e1..246e6d5b5b 100644 --- a/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/UserList.java +++ b/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/UserList.java @@ -21,18 +21,19 @@ import com.haulmont.cuba.gui.Notifications; import com.haulmont.cuba.gui.Notifications.NotificationType; import com.haulmont.cuba.gui.Screens; import com.haulmont.cuba.gui.UiComponents; -import com.haulmont.cuba.gui.components.*; +import com.haulmont.cuba.gui.components.Button; +import com.haulmont.cuba.gui.components.DialogAction; +import com.haulmont.cuba.gui.components.Label; import com.haulmont.cuba.gui.components.actions.BaseAction; import com.haulmont.cuba.gui.screen.Screen; import com.haulmont.cuba.gui.screen.Subscribe; import com.haulmont.cuba.gui.screen.UiController; -import com.haulmont.cuba.gui.screen.Provide; -import com.haulmont.cuba.security.entity.User; +import com.haulmont.cuba.gui.screen.UiDescriptor; import javax.inject.Inject; -import java.util.Date; @UiController("user-list") +@UiDescriptor("user-list.xml") public class UserList extends Screen implements UserListMixin { @Inject protected UiComponents uiComponents; @@ -43,22 +44,6 @@ public class UserList extends Screen implements UserListMixin { @Inject protected Notifications notifications; - @Provide(type = Table.StyleProvider.class, to = "usersTable") - protected String getStyleName(User user, String property) { - return null; - } - - @Provide(type = Table.ColumnGenerator.class, - to = "usersTable.name") - protected Component createNameColumnComponent(User user, String property) { - return null; - } - - @Provide(subject = "formatter", to = "label1") - protected String format(Date date) { - return ""; - } - @Subscribe protected void init(InitEvent event) { Label label = uiComponents.create(Label.NAME); @@ -90,7 +75,7 @@ public class UserList extends Screen implements UserListMixin { }) ); - Label spacer = uiComponents.create(Label.NAME); + Label spacer = uiComponents.create(Label.TYPE_DEFAULT); getWindow().add( label, diff --git a/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/user-list.xml b/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/user-list.xml new file mode 100644 index 0000000000..915078da2c --- /dev/null +++ b/modules/web/src/com/haulmont/cuba/web/app/ui/demo/user/user-list.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + \ No newline at end of file