diff options
111 files changed, 794 insertions, 1607 deletions
diff --git a/.gitignore b/.gitignore index 5fc4fd8e97..9f652e633f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,20 +34,7 @@ /WebContent/VAADIN/themes/runo/common/img/ajax-loader-yellow.gif # /WebContent/VAADIN/widgetsets/ -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.demo.reservation.gwt.WidgetSet -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.terminal.gwt.DefaultWidgetSet -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.demo.colorpicker.gwt.ColorPickerWidgetSet -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.demo.sampler.gwt.SamplerWidgetSet -/WebContent/VAADIN/widgetsets/.gwt-tmp -/WebContent/VAADIN/widgetsets/com.itmill.toolkit.demo.coverflow.gwt.CoverflowWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.demo.reservation.gwt.ReservationWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.demo.coverflow.gwt.CoverflowWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.demo.sampler.gwt.SamplerWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet -/WebContent/VAADIN/widgetsets/com.vaadin.demo.gwt.OptimizedWidgetSet +/WebContent/VAADIN/widgetsets /WebContent/VAADIN/gwt-unitCache* # /WebContent/WEB-INF/ diff --git a/WebContent/VAADIN/themes/base/button/button.css b/WebContent/VAADIN/themes/base/button/button.css index 874619747e..1bc7d3ac92 100644 --- a/WebContent/VAADIN/themes/base/button/button.css +++ b/WebContent/VAADIN/themes/base/button/button.css @@ -29,10 +29,6 @@ cursor: default;
}
-.v-ie7 .v-button {
- display: inline;
-}
-
.v-button-wrap,
.v-button-caption {
vertical-align: middle;
@@ -140,11 +136,6 @@ white-space: nowrap;
}
-/* Fix for IE7 issue where checkbox moves 1 pixel down after selection (#4636) */
-.v-ie7 .v-checkbox {
- vertical-align: baseline;
-}
-
.v-checkbox .v-icon {
margin: 0 2px;
}
diff --git a/WebContent/VAADIN/themes/base/datefield/datefield.css b/WebContent/VAADIN/themes/base/datefield/datefield.css index ef08509ed5..88d6f92c79 100644 --- a/WebContent/VAADIN/themes/base/datefield/datefield.css +++ b/WebContent/VAADIN/themes/base/datefield/datefield.css @@ -61,14 +61,6 @@ outline: 1px dotted black; } -.v-ie7 .v-datefield-calendarpanel-day { - margin: 1px; -} -.v-ie7 .v-datefield-calendarpanel-day-focused { - border: 1px dotted black; - margin: 0px; -} - .v-datefield-time { white-space: nowrap; } @@ -92,8 +84,3 @@ background-color: #ffe0e0; } */ -/* IE somehow loses generic v-disabled alpha. See #1960 */ -.v-ie7 .v-disabled .v-datefield-button, -.v-ie7 .v-disabled .v-datefield-textfield { - filter: alpha(opacity=30); -}
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/base/gridlayout/gridlayout.css b/WebContent/VAADIN/themes/base/gridlayout/gridlayout.css index 033fea5867..38e2bb3aed 100644 --- a/WebContent/VAADIN/themes/base/gridlayout/gridlayout.css +++ b/WebContent/VAADIN/themes/base/gridlayout/gridlayout.css @@ -23,7 +23,3 @@ .v-gridlayout-spacing-off { overflow: hidden; } -/* Ensure that resizing gridlayout works in IE */ -.v-ie7 .v-gridlayout { - overflow: hidden; -}
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/base/orderedlayout/orderedlayout.css b/WebContent/VAADIN/themes/base/orderedlayout/orderedlayout.css index 58badbc615..6ed04d8f06 100644 --- a/WebContent/VAADIN/themes/base/orderedlayout/orderedlayout.css +++ b/WebContent/VAADIN/themes/base/orderedlayout/orderedlayout.css @@ -31,9 +31,3 @@ padding-top: 0; padding-left: 0; } -/* To make sure IE don't expand elements larger than they should */ -.v-ie7 .v-orderedlayout, -.v-ie7 .v-horizontallayout, -.v-ie7 .v-verticallayout { - overflow: hidden; -} diff --git a/WebContent/VAADIN/themes/base/splitpanel/splitpanel.css b/WebContent/VAADIN/themes/base/splitpanel/splitpanel.css index 3473092fa5..c24e2df06b 100644 --- a/WebContent/VAADIN/themes/base/splitpanel/splitpanel.css +++ b/WebContent/VAADIN/themes/base/splitpanel/splitpanel.css @@ -33,8 +33,3 @@ .v-disabled .v-splitpanel-vsplitter div { cursor: default; } -/* IE specific styles */ -.v-ie7 .v-splitpanel-first-container, -.v-ie7 .v-splitpanel-second-container { - position: relative; -}
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/base/table/table.css b/WebContent/VAADIN/themes/base/table/table.css index dd452c851f..e2b2a16ffe 100644 --- a/WebContent/VAADIN/themes/base/table/table.css +++ b/WebContent/VAADIN/themes/base/table/table.css @@ -26,9 +26,6 @@ overflow: hidden; text-align: left; /* Force default alignment */ } -.v-ie7 .v-table { - overflow: visible; -} .v-table-header-wrap { overflow: hidden; border: 1px solid #aaa; @@ -93,10 +90,6 @@ white-space: nowrap; margin-left: 6px; } -.v-ie7 .v-table-caption-container-align-right { - margin-left: 0px; - padding-left: 6px; -} .v-table-caption-container-align-right { float: right; } @@ -181,9 +174,6 @@ position: relative; /* hide this from IE, it works without it */ cursor: pointer; } -.v-ie7 .v-table-column-selector { - position: static; -} .v-table-focus-slot-left { border-left: 2px solid #999; float: none; diff --git a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css index b150a1981e..7f978076b8 100644 --- a/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css +++ b/WebContent/VAADIN/themes/base/tabsheet/tabsheet.css @@ -36,9 +36,6 @@ text-align: right; margin-top: -1em; } -.v-ff2 .v-tabsheet-scroller { - position: relative; -} .v-disabled .v-tabsheet-scroller { display: none; } @@ -107,9 +104,6 @@ border-bottom: none; position: relative; } -.v-ie7 .v-tabsheet-content { - zoom: 1; -} .v-tabsheet-deco { height: 1px; background: #aaa; diff --git a/WebContent/VAADIN/themes/base/treetable/treetable.css b/WebContent/VAADIN/themes/base/treetable/treetable.css index 02f358e4e6..de505ba774 100644 --- a/WebContent/VAADIN/themes/base/treetable/treetable.css +++ b/WebContent/VAADIN/themes/base/treetable/treetable.css @@ -5,9 +5,6 @@ /* defines the amount of indent per level */ width: 18px; } -.v-ie7 .v-treetable-treespacer{ - height: 100%; /* #7388 */ -} .v-treetable-node-closed { background: url(../treetable/img/arrow-right.png) right center no-repeat; diff --git a/WebContent/VAADIN/themes/base/upload/upload.css b/WebContent/VAADIN/themes/base/upload/upload.css index e6951e5dbf..adc5751d7c 100644 --- a/WebContent/VAADIN/themes/base/upload/upload.css +++ b/WebContent/VAADIN/themes/base/upload/upload.css @@ -2,9 +2,6 @@ white-space: nowrap; } -.v-ie7 .v-upload { - margin:0; -} .v-upload-immediate { position: relative; diff --git a/WebContent/VAADIN/themes/chameleon/common/common.css b/WebContent/VAADIN/themes/chameleon/common/common.css index 2e0b9d8e75..9d5a64b2ad 100644 --- a/WebContent/VAADIN/themes/chameleon/common/common.css +++ b/WebContent/VAADIN/themes/chameleon/common/common.css @@ -28,8 +28,7 @@ -moz-border-radius: 4px; } -.v-sa .v-tooltip, -.v-ff3 .v-tooltip { +.v-sa .v-tooltip { outline: 1px solid rgba(0,0,0,.2); -webkit-border-radius: 0; -moz-border-radius: 0; diff --git a/WebContent/VAADIN/themes/chameleon/components/button/button.css b/WebContent/VAADIN/themes/chameleon/components/button/button.css index d31bdd0ecf..6629cfeb1e 100644 --- a/WebContent/VAADIN/themes/chameleon/components/button/button.css +++ b/WebContent/VAADIN/themes/chameleon/components/button/button.css @@ -1,5 +1,4 @@ .v-button:active, -.v-ie7 .v-pressed.v-button, .v-ie8 .v-pressed.v-button, div.v-button-down { background-image: url(../../img/grad-dark-bottom2.png); @@ -7,7 +6,6 @@ div.v-button-down { } .v-button:active .v-button-wrap, -.v-ie7 .v-pressed.v-button .v-button-wrap, .v-ie8 .v-pressed.v-button .v-button-wrap, .v-button-down .v-button-wrap { background-image: url(../../img/grad-dark-top2.png); @@ -96,7 +94,6 @@ div.v-button-down .v-button-wrap { } .v-button-small:active .v-button-wrap, -.v-ie7 .v-button-small.v-pressed .v-button-wrap, .v-ie8 .v-button-small.v-pressed .v-button-wrap, .v-button-down.small .v-button-wrap { padding: 2px 10px; @@ -117,7 +114,6 @@ div.v-button-down .v-button-wrap { } .v-button-wide:active .v-button-wrap, -.v-ie7 .v-button-wide.v-pressed .v-button-wrap, .v-ie8 .v-button-wide.v-pressed .v-button-wrap { padding-left: 25px; padding-right: 25px; @@ -133,7 +129,6 @@ div.v-button-down .v-button-wrap { } .v-button-tall:active .v-button-wrap, -.v-ie7 .v-button-tall.v-pressed .v-button-wrap, .v-ie8 .v-button-tall.v-pressed .v-button-wrap { padding-top: 12px; padding-bottom: 12px; @@ -249,19 +244,6 @@ body.v-ie .v-pressed.v-button-borderless .v-button-wrap { margin-right: -0.5em; } -.v-ie7 .v-button-icon-on-right { - position: relative; - } - -.v-ie7 .v-button-icon-on-right .v-button-caption { - padding-right: 14px; - } - -.v-ie7 .v-button-icon-on-right .v-icon { - position: absolute; - right: 0; - margin: 0; - } /******************************************************************************* * Icon-only diff --git a/WebContent/VAADIN/themes/chameleon/components/datefield/datefield.css b/WebContent/VAADIN/themes/chameleon/components/datefield/datefield.css index 79bf7f904a..3804ab52e0 100644 --- a/WebContent/VAADIN/themes/chameleon/components/datefield/datefield.css +++ b/WebContent/VAADIN/themes/chameleon/components/datefield/datefield.css @@ -23,24 +23,6 @@ height: 1.2em; } -.v-ie7 .v-datefield-button { - height: 1.55em; - margin-top: 1px; - padding: 0; - } - -.v-ie7 .v-datefield-button { - height: 1.85em; - } - -.v-ie7 .v-datefield-small .v-datefield-button { - height: 1.75em; - } - -.v-ie7 .v-datefield-big .v-datefield-button { - height: 2em; - } - .v-ie8 .v-datefield-button { height: 1.6em; padding: 0; diff --git a/WebContent/VAADIN/themes/liferay/datefield/datefield.css b/WebContent/VAADIN/themes/liferay/datefield/datefield.css index fc10f1639e..6040052798 100644 --- a/WebContent/VAADIN/themes/liferay/datefield/datefield.css +++ b/WebContent/VAADIN/themes/liferay/datefield/datefield.css @@ -116,11 +116,6 @@ span.v-datefield-calendarpanel-month { min-width: 22px; } -.v-ie7 .v-datefield-calendarpanel-prevyear button, -.v-ie7 .v-datefield-calendarpanel-nextyear button { - width: 22px; -} - .v-datefield-calendarpanel-day { display: block; width: 22px; diff --git a/WebContent/VAADIN/themes/liferay/window/window.css b/WebContent/VAADIN/themes/liferay/window/window.css index ae1516b78a..5ac7c02175 100644 --- a/WebContent/VAADIN/themes/liferay/window/window.css +++ b/WebContent/VAADIN/themes/liferay/window/window.css @@ -10,10 +10,6 @@ background: #fff url(top-left.png) no-repeat; } -.v-ie7 .v-window-wrap { - background-position: 1px 1px; -} - .v-window-outerheader { height: 16px; margin-left: 9px; diff --git a/WebContent/VAADIN/themes/reindeer/button/button-firefox.css b/WebContent/VAADIN/themes/reindeer/button/button-firefox.css deleted file mode 100644 index 4e8a1f58c9..0000000000 --- a/WebContent/VAADIN/themes/reindeer/button/button-firefox.css +++ /dev/null @@ -1,5 +0,0 @@ -.v-ff2 .v-button .v-button-caption { - display: -moz-inline-box; - padding-top: 6px; - height: 20px; - }
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/reindeer/button/button-ie.css b/WebContent/VAADIN/themes/reindeer/button/button-ie.css index b75a0c896e..47d9496e81 100644 --- a/WebContent/VAADIN/themes/reindeer/button/button-ie.css +++ b/WebContent/VAADIN/themes/reindeer/button/button-ie.css @@ -1,4 +1,3 @@ -.v-ie7 .v-nativebutton-link, .v-ie8 .v-nativebutton-link { padding: 0; text-align: left; diff --git a/WebContent/VAADIN/themes/reindeer/button/button.css b/WebContent/VAADIN/themes/reindeer/button/button.css index 14da4facc5..1948e5aafb 100644 --- a/WebContent/VAADIN/themes/reindeer/button/button.css +++ b/WebContent/VAADIN/themes/reindeer/button/button.css @@ -7,5 +7,4 @@ @import "button-link-style.css"; /* Browser-specific corrections to the standard implementation */ -@import "button-firefox.css"; @import "button-ie.css";
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/reindeer/datefield/datefield.css b/WebContent/VAADIN/themes/reindeer/datefield/datefield.css index a7e6506d5f..1dbc59257a 100644 --- a/WebContent/VAADIN/themes/reindeer/datefield/datefield.css +++ b/WebContent/VAADIN/themes/reindeer/datefield/datefield.css @@ -43,13 +43,7 @@ span.v-datefield-calendarpanel-month { .v-datefield-full { min-width: 240px; } -.v-ff2 .v-datefield-month, -.v-ff2 .v-datefield-day, -.v-ff2 .v-datefield-full { - min-width: 254px; -} -.v-datefield-popupcalendar, -.v-ff2 .v-datefield-popupcalendar { +.v-datefield-popupcalendar { min-width: 0; } .v-datefield-year .v-datefield-calendarpanel { @@ -227,7 +221,6 @@ td.v-datefield-calendarpanel-nextyear { -moz-border-radius: 3px; } .v-sa .v-datefield-popup, -.v-ff3 .v-datefield-popup, .v-op .v-datefield-popup { background: rgba(255,255,255,.95); } diff --git a/WebContent/VAADIN/themes/reindeer/table/table.css b/WebContent/VAADIN/themes/reindeer/table/table.css index f824ad00f9..bfbed67f93 100644 --- a/WebContent/VAADIN/themes/reindeer/table/table.css +++ b/WebContent/VAADIN/themes/reindeer/table/table.css @@ -25,11 +25,6 @@ line-height: normal; } -.v-ie7 .v-table.v-disabled { - /* Fixes ie issue #7324 where disabled shim does not cover table body */ - position: relative; -} - .v-table-footer-wrap, .white .v-table-footer-wrap { text-transform: none; diff --git a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-minimal-style.css b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-minimal-style.css index d0041e586a..dfa83d7088 100644 --- a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-minimal-style.css +++ b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-minimal-style.css @@ -105,8 +105,7 @@ .v-tabsheet-tabs-minimal .v-tabsheet-caption-close { margin-top: 1px; } -.v-ff .v-tabsheet-tabs-minimal .v-tabsheet-caption-close, -.v-ie7 .v-tabsheet-tabs-minimal .v-tabsheet-caption-close { +.v-ff .v-tabsheet-tabs-minimal .v-tabsheet-caption-close { margin-top: -15px; } .v-tabsheet-tabs-minimal .v-tabsheet-caption-close:hover, diff --git a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-normal-style.css b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-normal-style.css index 478348243e..47e8b94bc7 100644 --- a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-normal-style.css +++ b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-normal-style.css @@ -52,8 +52,7 @@ font-size: 14px; font-weight: normal; } -.v-ff .v-tabsheet-caption-close, -.v-ie7 .v-tabsheet-caption-close { +.v-ff .v-tabsheet-caption-close { margin-top: -17px; } .v-tabsheet-caption-close:hover { @@ -105,8 +104,7 @@ .v-tabsheet-tabsheetpanel { background: #fff; } -.v-sa .v-tabsheet-content, -.v-ff3 .v-tabsheet-content { +.v-sa .v-tabsheet-content { border-color: rgba(0,0,0,.1); } .blue .v-tabsheet-deco { @@ -120,8 +118,7 @@ background: #e2e2e2; overflow: hidden; } -.v-sa .v-tabsheet-deco, -.v-ff3 .v-tabsheet-deco { +.v-sa .v-tabsheet-deco { border-top-color: rgba(0,0,0,.1); background: rgba(0,0,0,.08); } @@ -148,10 +145,6 @@ height: 16px; background: transparent url(../common/icons/error.png) no-repeat 50%; } -.v-ff2 .v-tabsheet-tabs .v-icon, -.v-ff2 .v-tabsheet-tabs .v-errorindicator { - display: -moz-inline-stack; -} .v-ie .v-tabsheet-tabs .v-errorindicator { zoom: 1; display: inline; diff --git a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-small-style.css b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-small-style.css index e440f7fdd1..c7c79d35ee 100644 --- a/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-small-style.css +++ b/WebContent/VAADIN/themes/reindeer/tabsheet/tabsheet-small-style.css @@ -50,8 +50,7 @@ .v-tabsheet-tabs-bar .v-tabsheet-caption-close { margin-top: 1px; } -.v-ff .v-tabsheet-tabs-bar .v-tabsheet-caption-close, -.v-ie7 .v-tabsheet-tabs-bar .v-tabsheet-caption-close { +.v-ff .v-tabsheet-tabs-bar .v-tabsheet-caption-close { margin-top: -14px; } .v-tabsheet-tabs-bar .v-tabsheet-caption-close:hover { diff --git a/WebContent/VAADIN/themes/reindeer/window/window.css b/WebContent/VAADIN/themes/reindeer/window/window.css index 12139d60b7..25829b2f2b 100644 --- a/WebContent/VAADIN/themes/reindeer/window/window.css +++ b/WebContent/VAADIN/themes/reindeer/window/window.css @@ -5,26 +5,9 @@ border: 1px solid #808386; } .v-sa .v-window-wrap, -.v-ff3 .v-window-wrap, .v-op .v-window-wrap { border-color: rgba(0,0,0,.2); } -.v-ff2 .v-window-wrap { - border: none; -} -.v-ff2 .v-window-outerheader { - border: 1px solid #808386; - border-bottom: none; -} -.v-ff2 .v-window-contents { - border: 1px solid #808386; - border-top: none; - border-bottom: none; -} -.v-ff2 .v-window-footer { - border: 1px solid #808386; - border-top: none; -} .v-window-outerheader { padding: 12px 32px 0 14px; height: 25px; @@ -143,7 +126,6 @@ overflow: hidden; } .v-sa .v-window-black .v-window-wrap, -.v-ff3 .v-window-black .v-window-wrap, .v-op .v-window-black .v-window-wrap { border-color: rgba(0,0,0,.8); } @@ -153,7 +135,6 @@ -webkit-border-radius: 7px; } .v-sa .v-window-black .v-window-wrap2, -.v-ff3 .v-window-black .v-window-wrap2, .v-op .v-window-black .v-window-wrap2 { background-color: rgba(29,32,33,.9); } diff --git a/WebContent/VAADIN/themes/runo/button/button.css b/WebContent/VAADIN/themes/runo/button/button.css index 0ab4d60d1d..530c981436 100644 --- a/WebContent/VAADIN/themes/runo/button/button.css +++ b/WebContent/VAADIN/themes/runo/button/button.css @@ -56,12 +56,6 @@ text-overflow: ellipsis;
}
-.v-ie7 .v-button .v-button-wrap {
- overflow: visible;
-}
-
-
-
/* Small style */
.v-button-small .v-button-wrap,
.v-disabled.v-button-small .v-button-wrap {
@@ -160,9 +154,3 @@ .v-checkbox .v-errorindicator {
padding-left: 10px;
} -.v-ie7 .v-checkbox .v-errorindicator {
- padding-right: 7px;
- } -.v-ie7 .v-button .v-errorindicator {
- padding-right: 5px;
- }
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/runo/caption/caption.css b/WebContent/VAADIN/themes/runo/caption/caption.css index 43abda4067..93d7874665 100644 --- a/WebContent/VAADIN/themes/runo/caption/caption.css +++ b/WebContent/VAADIN/themes/runo/caption/caption.css @@ -6,6 +6,3 @@ height: 16px; background: transparent url(../icons/16/error.png) no-repeat top right; } -.v-ie7 .v-errorindicator { - margin-left: -3px; -}
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/runo/datefield/datefield.css b/WebContent/VAADIN/themes/runo/datefield/datefield.css index 0b65fd9054..5b80a0a5db 100644 --- a/WebContent/VAADIN/themes/runo/datefield/datefield.css +++ b/WebContent/VAADIN/themes/runo/datefield/datefield.css @@ -143,9 +143,3 @@ td.v-datefield-calendarpanel-month { color: #999; font-style: normal; } -/* IE specific styles */ -.v-ie7 .v-datefield-button { - background-position: right 1px; - height: 25px; - margin: 0; -}
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/runo/panel/panel.css b/WebContent/VAADIN/themes/runo/panel/panel.css index d69e319a8d..138fb07f9c 100644 --- a/WebContent/VAADIN/themes/runo/panel/panel.css +++ b/WebContent/VAADIN/themes/runo/panel/panel.css @@ -67,15 +67,12 @@ overflow: hidden; } /* IE specific rules */ -.v-ie7 .v-panel-content, .v-ie8 .v-panel-content { border-bottom: 1px solid #babfc0; } -.v-ie7 .v-panel-content-light, .v-ie8 .v-panel-content-light { border-bottom: none; } -.v-ie7 .v-panel-deco, .v-ie8 .v-panel-deco { height: 0; overflow: hidden; diff --git a/WebContent/VAADIN/themes/runo/table/table.css b/WebContent/VAADIN/themes/runo/table/table.css index 369aafa486..42f93752be 100644 --- a/WebContent/VAADIN/themes/runo/table/table.css +++ b/WebContent/VAADIN/themes/runo/table/table.css @@ -28,10 +28,6 @@ text-shadow: #ffffff 0 1px 0; margin-left: 4px; } -.v-ie7 .v-table-caption-container-align-right { - margin-left: 0px; - padding-left: 0px; -} .v-table-sort-indicator { width: 0; height: 36px; diff --git a/WebContent/VAADIN/themes/runo/tabsheet/tabsheet.css b/WebContent/VAADIN/themes/runo/tabsheet/tabsheet.css index da95cb0c8b..9c6559b0f3 100644 --- a/WebContent/VAADIN/themes/runo/tabsheet/tabsheet.css +++ b/WebContent/VAADIN/themes/runo/tabsheet/tabsheet.css @@ -141,7 +141,6 @@ overflow: hidden; margin: 0; } -.v-ie7 .v-tabsheet-deco, .v-ie8 .v-tabsheet-deco, .v-ie9 .v-tabsheet-deco { width: 100%; @@ -249,20 +248,6 @@ margin-left: -3px; padding-left: 3px; }*/ -/* IE specific styles */ -.v-ie7 .v-tabsheet-tabs-light { - height: 32px; -} -.v-ie7 .v-tabsheet-tabs-light .v-tabsheet-tabitem-selected { - border: none; - background: #fff url(img/inline-tab-right.png) no-repeat right top; - padding: 0; - height: 32px; -} -.v-ie7 .v-tabsheet-tabs-light .v-tabsheet-tabitem-selected .v-caption { - background: transparent url(img/inline-tab-left.png) no-repeat -7px 0; - padding: 9px 11px 0 11px; -} .v-ie .v-tabsheet-deco-light { height: 0; }
\ No newline at end of file diff --git a/WebContent/VAADIN/themes/runo/window/window.css b/WebContent/VAADIN/themes/runo/window/window.css index 7edea92ed1..210bccb9b9 100644 --- a/WebContent/VAADIN/themes/runo/window/window.css +++ b/WebContent/VAADIN/themes/runo/window/window.css @@ -34,12 +34,7 @@ background: transparent url(img/bottom-right.png) no-repeat right bottom; overflow: visible; } -.v-ie7 .v-window-footer { - position: relative; - overflow: visible; -} -.v-window-resizebox, -.v-ie7 .v-window-resizebox { +.v-window-resizebox { position: absolute; /* Needed to position the element over ScrollPanel, which is relatively positioned */ right: 5px; width: 10px; diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml index 9cf2a828db..f2fc764e28 100644 --- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml +++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml @@ -18,12 +18,6 @@ <when-type-is class="com.google.gwt.core.client.impl.SchedulerImpl" /> </replace-with> - <!-- Use our own history impl for IE7 to workaround #2931. --> - <replace-with class="com.vaadin.terminal.gwt.client.HistoryImplIEVaadin"> - <when-type-is class="com.google.gwt.user.client.impl.HistoryImpl" /> - <when-property-is name="user.agent" value="ie6" /> - </replace-with> - <generate-with class="com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator"> <when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap" /> @@ -57,7 +51,6 @@ <when-type-is class="com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper" /> <any> - <when-property-is name="user.agent" value="ie6" /> <when-property-is name="user.agent" value="ie8" /> </any> </replace-with> diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index daa62b4495..4c9be79787 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -192,10 +192,6 @@ public class BrowserInfo { return isSafari() && browserDetails.getBrowserMajorVersion() == 4; } - public boolean isIE7() { - return isIE() && browserDetails.getBrowserMajorVersion() == 7; - } - public boolean isIE8() { return isIE() && browserDetails.getBrowserMajorVersion() == 8; } @@ -216,23 +212,6 @@ public class BrowserInfo { return browserDetails.isWebKit(); } - public boolean isFF2() { - // FIXME: Should use browserVersion - return browserDetails.isFirefox() - && browserDetails.getBrowserEngineVersion() == 1.8; - } - - public boolean isFF3() { - // FIXME: Should use browserVersion - return browserDetails.isFirefox() - && browserDetails.getBrowserEngineVersion() == 1.9; - } - - public boolean isFF4() { - return browserDetails.isFirefox() - && browserDetails.getBrowserMajorVersion() == 4; - } - /** * Returns the Gecko version if the browser is Gecko based. The Gecko * version for Firefox 2 is 1.8 and 1.9 for Firefox 3. diff --git a/src/com/vaadin/terminal/gwt/client/HistoryImplIEVaadin.java b/src/com/vaadin/terminal/gwt/client/HistoryImplIEVaadin.java deleted file mode 100644 index f0ad3d561a..0000000000 --- a/src/com/vaadin/terminal/gwt/client/HistoryImplIEVaadin.java +++ /dev/null @@ -1,192 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ -/* - * Copyright 2008 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal.gwt.client; - -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.impl.HistoryImpl; - -/** - * A slightly modified version of GWT's HistoryImplIE6 to bypass bug #2931. Also - * combined with HistoryImplFrame. - * - * This class should be removed if GWT issue 3890 gets resolved. (Also remember - * to removed deferred binding rule from .gwt.xml file). - */ -public class HistoryImplIEVaadin extends HistoryImpl { - - private static native Element findHistoryFrame() - /*-{ - return $doc.getElementById('__gwt_historyFrame'); - }-*/; - - private static native Element getTokenElement(Element historyFrame) - /*-{ - // Initialize the history iframe. If '__gwt_historyToken' already exists, then - // we're probably backing into the app, so _don't_ set the iframe's location. - if (historyFrame.contentWindow) { - var doc = historyFrame.contentWindow.document; - return doc.getElementById('__gwt_historyToken'); - } - }-*/; - - protected Element historyFrame; - - @Override - protected final void nativeUpdate(String historyToken) { - /* - * Must update the location hash since it isn't already correct. - */ - updateHash(historyToken); - navigateFrame(historyToken); - } - - @Override - protected final void nativeUpdateOnEvent(String historyToken) { - updateHash(historyToken); - } - - /** - * Sanitizes an untrusted string to be used in an HTML context. NOTE: This - * method of escaping strings should only be used on Internet Explorer. - * - * @param maybeHtml - * untrusted string that may contain html - * @return sanitized string - */ - private static String escapeHtml(String maybeHtml) { - final Element div = DOM.createDiv(); - DOM.setInnerText(div, maybeHtml); - return DOM.getInnerHTML(div); - } - - /** - * For IE6, reading from $wnd.location.hash drops part of the fragment if - * the fragment contains a '?'. To avoid this bug, we use location.href - * instead. - */ - private static native String getLocationHash() - /*-{ - var href = $wnd.location.href; - var hashLoc = href.lastIndexOf("#"); - return (hashLoc > 0) ? href.substring(hashLoc) : ""; - }-*/; - - @Override - public boolean init() { - historyFrame = findHistoryFrame(); - if (historyFrame == null) { - return false; - } - - initHistoryToken(); - - // Initialize the history iframe. If a token element already exists, - // then - // we're probably backing into the app, so _don't_ create a new item. - Element tokenElement = getTokenElement(historyFrame); - if (tokenElement != null) { - setToken(getTokenElementContent(tokenElement)); - } else { - navigateFrame(getToken()); - } - - injectGlobalHandler(); - - initUrlCheckTimer(); - return true; - } - - protected native String getTokenElementContent(Element tokenElement) - /*-{ - return tokenElement.innerText; - }-*/; - - protected native void initHistoryToken() - /*-{ - // Assume an empty token. - var token = ''; - // Get the initial token from the url's hash component. - var hash = @com.vaadin.terminal.gwt.client.HistoryImplIEVaadin::getLocationHash()(); - if (hash.length > 0) { - try { - token = this.@com.google.gwt.user.client.impl.HistoryImpl::decodeFragment(Ljava/lang/String;)(hash.substring(1)); - } catch (e) { - // Clear the bad hash (this can't have been a valid token). - $wnd.location.hash = ''; - } - } - @com.google.gwt.user.client.impl.HistoryImpl::setToken(Ljava/lang/String;)(token); - }-*/; - - protected native void injectGlobalHandler() - /*-{ - var historyImplRef = this; - - $wnd.__gwt_onHistoryLoad = function(token) { - historyImplRef.@com.google.gwt.user.client.impl.HistoryImpl::newItemOnEvent(Ljava/lang/String;)(token); - }; - }-*/; - - protected native void navigateFrame(String token) - /*-{ - var escaped = @com.vaadin.terminal.gwt.client.HistoryImplIEVaadin::escapeHtml(Ljava/lang/String;)(token); - var doc = this.@com.vaadin.terminal.gwt.client.HistoryImplIEVaadin::historyFrame.contentWindow.document; - doc.open(); - doc.write('<html><body onload="if(parent.__gwt_onHistoryLoad)parent.__gwt_onHistoryLoad(__gwt_historyToken.innerText)"><div id="__gwt_historyToken">' + escaped + '</div></body></html>'); - doc.close(); - }-*/; - - protected native void updateHash(String token) - /*-{ - $wnd.location.hash = this.@com.google.gwt.user.client.impl.HistoryImpl::encodeFragment(Ljava/lang/String;)(token); - }-*/; - - private native void initUrlCheckTimer() - /*-{ - // This is the URL check timer. It detects when an unexpected change - // occurs in the document's URL (e.g. when the user enters one manually - // or selects a 'favorite', but only the #hash part changes). When this - // occurs, we _must_ reload the page. This is because IE has a really - // nasty bug that totally mangles its history stack and causes the location - // bar in the UI to stop working under these circumstances. - var historyImplRef = this; - var urlChecker = function() { - $wnd.setTimeout(urlChecker, 250); - var hash = @com.vaadin.terminal.gwt.client.HistoryImplIEVaadin::getLocationHash()(); - if (hash.length > 0) { - var token = ''; - try { - token = historyImplRef.@com.google.gwt.user.client.impl.HistoryImpl::decodeFragment(Ljava/lang/String;)(hash.substring(1)); - } catch (e) { - // If there's a bad hash, always reload. This could only happen if - // if someone entered or linked to a bad url. - $wnd.location.reload(); - } - - var historyToken = @com.google.gwt.user.client.impl.HistoryImpl::getToken()(); - if (token != historyToken) { - $wnd.location.reload(); - } - } - }; - urlChecker(); - }-*/; - -} diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index fd014bffe6..3601f385b1 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -13,7 +13,6 @@ import java.util.Set; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; -import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; @@ -195,36 +194,6 @@ public class Util { return null; } - /** - * Detects if current browser is IE. - * - * @deprecated use BrowserInfo class instead - * - * @return true if IE - */ - @Deprecated - public static boolean isIE() { - return BrowserInfo.get().isIE(); - } - - /** - * @deprecated use BrowserInfo class instead - * @return - */ - @Deprecated - public static boolean isIE7() { - return BrowserInfo.get().isIE7(); - } - - /** - * @deprecated use BrowserInfo class instead - * @return - */ - @Deprecated - public static boolean isFF2() { - return BrowserInfo.get().isFF2(); - } - private static final Element escapeHtmlHelper = DOM.createDiv(); /** @@ -236,8 +205,8 @@ public class Util { public static String escapeHTML(String html) { DOM.setInnerText(escapeHtmlHelper, html); String escapedText = DOM.getInnerHTML(escapeHtmlHelper); - if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { - // #7478 IE7-IE8 "incorrectly" returns "<br>" for newlines set using + if (BrowserInfo.get().isIE8()) { + // #7478 IE8 "incorrectly" returns "<br>" for newlines set using // setInnerText. The same for " " which is converted to " " escapedText = escapedText.replaceAll("<(BR|br)>", "\n"); escapedText = escapedText.replaceAll(" ", " "); @@ -317,23 +286,19 @@ public class Util { int offsetWidth = element.getOffsetWidth(); int offsetHeight = element.getOffsetHeight(); - if (!BrowserInfo.get().isIE7()) { - if (offsetHeight < 1) { - offsetHeight = 1; - } - if (offsetWidth < 1) { - offsetWidth = 10; - } - element.getStyle().setPropertyPx("height", offsetHeight); + if (offsetHeight < 1) { + offsetHeight = 1; } + if (offsetWidth < 1) { + offsetWidth = 10; + } + element.getStyle().setPropertyPx("height", offsetHeight); element.getStyle().setPropertyPx("width", offsetWidth); borders = element.getOffsetWidth() - element.getClientWidth(); element.getStyle().setProperty("width", width); - if (!BrowserInfo.get().isIE7()) { - element.getStyle().setProperty("height", height); - } + element.getStyle().setProperty("height", height); } else { borders = element.getOffsetWidth() - element.getPropertyInt("clientWidth"); @@ -758,33 +723,6 @@ public class Util { }-*/; /** - * IE7 sometimes "forgets" to render content. This function runs a hack to - * workaround the bug if needed. This happens easily in framset. See #3295. - */ - public static void runIE7ZeroSizedBodyFix() { - if (BrowserInfo.get().isIE7()) { - int offsetWidth = RootPanel.getBodyElement().getOffsetWidth(); - if (offsetWidth == 0) { - shakeBodyElement(); - } - } - } - - /** - * Does some very small adjustments to body element. We need this just to - * overcome some IE bugs. - */ - public static void shakeBodyElement() { - final DivElement shaker = Document.get().createDivElement(); - RootPanel.getBodyElement().insertBefore(shaker, - RootPanel.getBodyElement().getFirstChildElement()); - shaker.getStyle().setPropertyPx("height", 0); - shaker.setInnerHTML(" "); - RootPanel.getBodyElement().removeChild(shaker); - - } - - /** * Locates the child component of <literal>parent</literal> which contains * the element <literal>element</literal>. The child component is also * returned if "element" is part of its caption. If diff --git a/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java b/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java index 3778579b99..1e1fc5380a 100644 --- a/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java +++ b/src/com/vaadin/terminal/gwt/client/VBrowserDetails.java @@ -302,4 +302,28 @@ public class VBrowserDetails implements Serializable { return isLinux;
}
+ /**
+ * Checks if the browser is so old that it simply won't work with a Vaadin
+ * application.
+ *
+ * @return true if the browser won't work, false if not the browser is
+ * supported or might work
+ */
+ public boolean isTooOldToFunctionProperly() {
+ if (isIE() && getBrowserMajorVersion() < 8) {
+ return true;
+ }
+ if (isSafari() && getBrowserMajorVersion() < 5) {
+ return true;
+ }
+ if (isFirefox() && getBrowserMajorVersion() < 4) {
+ return true;
+ }
+ if (isOpera() && getBrowserMajorVersion() < 11) {
+ return true;
+ }
+
+ return false;
+ }
+
}
diff --git a/src/com/vaadin/terminal/gwt/client/WidgetSet.java b/src/com/vaadin/terminal/gwt/client/WidgetSet.java index 38984e75c3..1c09709bfd 100644 --- a/src/com/vaadin/terminal/gwt/client/WidgetSet.java +++ b/src/com/vaadin/terminal/gwt/client/WidgetSet.java @@ -6,8 +6,6 @@ package com.vaadin.terminal.gwt.client; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Widget; -import com.vaadin.terminal.gwt.client.ui.VButton; -import com.vaadin.terminal.gwt.client.ui.VCheckBox; import com.vaadin.terminal.gwt.client.ui.VFilterSelect; import com.vaadin.terminal.gwt.client.ui.VListSelect; import com.vaadin.terminal.gwt.client.ui.VPasswordField; @@ -79,9 +77,7 @@ public class WidgetSet { // add our historical quirks - if (widgetClass == VButton.class && uidl.hasAttribute("type")) { - return VCheckBox.class; - } else if (widgetClass == VView.class && uidl.hasAttribute("sub")) { + if (widgetClass == VView.class && uidl.hasAttribute("sub")) { return VWindow.class; } else if (widgetClass == VFilterSelect.class) { if (uidl.hasAttribute("type")) { @@ -143,9 +139,7 @@ public class WidgetSet { * is in multiselect mode, causing the clientside implementation to * *actually* be VListSelect, when the annotation says VFilterSelect */ - if (fullyqualifiedName.equals("com.vaadin.ui.Button")) { - loadImplementation(VCheckBox.class); - } else if (fullyqualifiedName.equals("com.vaadin.ui.Select")) { + if (fullyqualifiedName.equals("com.vaadin.ui.Select")) { loadImplementation(VListSelect.class); } else if (fullyqualifiedName.equals("com.vaadin.ui.TextField")) { loadImplementation(VTextArea.class); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/VButton.java index 3df623415a..5c940eab12 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VButton.java @@ -143,11 +143,6 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler, } wrapper.insertBefore(errorIndicatorElement, captionElement); - // Fix for IE7 - if (BrowserInfo.get().isIE7()) { - errorIndicatorElement.setInnerText(" "); - } - } else if (errorIndicatorElement != null) { wrapper.removeChild(errorIndicatorElement); errorIndicatorElement = null; @@ -451,25 +446,6 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler, } } - @Override - public void setWidth(String width) { - if (BrowserInfo.get().isIE7()) { - if (width != null && width.length() > 2) { - // Assume pixel values are always sent from - // ApplicationConnection - int w = Integer - .parseInt(width.substring(0, width.length() - 2)); - w -= getHorizontalBorderAndPaddingWidth(getElement()); - if (w < 0) { - // validity check for IE - w = 0; - } - width = w + "px"; - } - } - super.setWidth(width); - } - private static native int getHorizontalBorderAndPaddingWidth(Element elem) /*-{ // THIS METHOD IS ONLY USED FOR INTERNET EXPLORER, IT DOESN'T WORK WITH OTHERS diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java index ebdc0e547c..3f5973d804 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java @@ -4,10 +4,6 @@ package com.vaadin.terminal.gwt.client.ui; -import com.google.gwt.dom.client.InputElement; -import com.google.gwt.dom.client.LabelElement; -import com.google.gwt.dom.client.Node; -import com.google.gwt.dom.client.NodeList; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; @@ -19,7 +15,6 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.EventHelper; import com.vaadin.terminal.gwt.client.EventId; import com.vaadin.terminal.gwt.client.MouseEventDetails; @@ -31,6 +26,8 @@ import com.vaadin.terminal.gwt.client.VTooltip; public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements Paintable, Field, FocusHandler, BlurHandler { + public static final String VARIABLE_STATE = "state"; + public static final String CLASSNAME = "v-checkbox"; String id; @@ -60,7 +57,7 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements event.getNativeEvent(), getElement()); client.updateVariable(id, "mousedetails", details.serialize(), false); - client.updateVariable(id, "state", getValue(), immediate); + client.updateVariable(id, VARIABLE_STATE, getValue(), immediate); } }); @@ -124,41 +121,11 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements // Set text setText(uidl.getStringAttribute("caption")); - setValue(uidl.getBooleanVariable("state")); + setValue(uidl.getBooleanVariable(VARIABLE_STATE)); immediate = uidl.getBooleanAttribute("immediate"); } @Override - public void setText(String text) { - super.setText(text); - if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 8) { - - boolean breakLink = text == null || "".equals(text); - - // break or create link between label element and checkbox, to - // enable native focus outline around checkbox element itself, if - // caption is not present - NodeList<Node> childNodes = getElement().getChildNodes(); - String id = null; - for (int i = 0; i < childNodes.getLength(); i++) { - Node item = childNodes.getItem(i); - if (item.getNodeName().toLowerCase().equals("input")) { - InputElement input = (InputElement) item; - id = input.getId(); - } - if (item.getNodeName().toLowerCase().equals("label")) { - LabelElement label = (LabelElement) item; - if (breakLink) { - label.setHtmlFor(""); - } else { - label.setHtmlFor(id); - } - } - } - } - } - - @Override public void onBrowserEvent(Event event) { if (icon != null && (event.getTypeInt() == Event.ONCLICK) && (DOM.eventGetTarget(event) == icon.getElement())) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapperIE.java b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapperIE.java index 89f063eaf9..0032b1a5dc 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapperIE.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapperIE.java @@ -1,3 +1,7 @@ +/* +@ITMillApache2LicenseForJavaFiles@ + */ + package com.vaadin.terminal.gwt.client.ui; import com.google.gwt.dom.client.AnchorElement; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index 2af04cb97e..7be01a1195 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -12,7 +12,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -1244,22 +1243,13 @@ public class VFilterSelect extends Composite implements Paintable, Field, } /** - * Sets the text in the text box using a deferred command if on Gecko. This - * is required for performance reasons (see #3663). + * Sets the text in the text box. * * @param text * the text to set in the text box */ private void setTextboxText(final String text) { - if (BrowserInfo.get().isFF3()) { - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - tb.setText(text); - } - }); - } else { - tb.setText(text); - } + tb.setText(text); } /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java index f4691a3f27..378286381f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java @@ -404,6 +404,7 @@ public class VFormLayout extends SimplePanel implements Container { // Workaround for IE weirdness, sometimes returns bad height in some // circumstances when Caption is empty. See #1444 // IE7 bugs more often. I wonder what happens when IE8 arrives... + // FIXME: This could be unnecessary for IE8+ if (BrowserInfo.get().isIE()) { if (isEmpty) { setHeight("0px"); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java index 76ea1297ea..05017f22e8 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java @@ -124,8 +124,8 @@ public class VLabel extends HTML implements Paintable { @Override public void setText(String text) { - if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { - // #3983 - IE7,IE8 incorrectly replaces \n with <br> so we do the + if (BrowserInfo.get().isIE8()) { + // #3983 - IE8 incorrectly replaces \n with <br> so we do the // escaping manually and set as HTML super.setHTML(Util.escapeHTML(text)); } else { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java index 8b53fb01c1..5081734c7e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java @@ -714,27 +714,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, popup.setPopupPosition(left, top); - // IE7 really tests one's patience sometimes - // Part of a fix to correct #3850 - if (BrowserInfo.get().isIE7()) { - popup.getElement().getStyle().setProperty("zoom", ""); - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - if (popup == null) { - // The child menu can be hidden before this command is - // run. - return; - } - - if (popup.getElement().getStyle().getProperty("width") == null - || popup.getElement().getStyle() - .getProperty("width") == "") { - popup.setWidth(popup.getOffsetWidth() + "px"); - } - popup.getElement().getStyle().setProperty("zoom", "1"); - } - }); - } } private int adjustPopupHeight(int top, final int shadowSpace) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java index 458c43024c..d295ec86ee 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java @@ -4,7 +4,6 @@ package com.vaadin.terminal.gwt.client.ui; -import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.Element; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -13,7 +12,6 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.FocusEvent; import com.google.gwt.event.dom.client.FocusHandler; import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Button; @@ -99,13 +97,6 @@ public class VNativeButton extends Button implements Paintable, ClickHandler, } getElement().insertBefore(errorIndicatorElement, captionElement); - // Fix for IE - // TODO This was originally for IE6 & IE7 and might not be needed - // any more - if (BrowserInfo.get().isIE()) { - errorIndicatorElement.setInnerText(" "); - } - } else if (errorIndicatorElement != null) { getElement().removeChild(errorIndicatorElement); errorIndicatorElement = null; @@ -124,21 +115,6 @@ public class VNativeButton extends Button implements Paintable, ClickHandler, } } - if (BrowserInfo.get().isIE7()) { - /* - * Workaround for IE7 size calculation issues. Deferred because of - * issues with a button with an icon using the reindeer theme - */ - if (width.equals("")) { - Scheduler.get().scheduleDeferred(new Command() { - - public void execute() { - setWidth(""); - setWidth(getOffsetWidth() + "px"); - } - }); - } - } } @Override @@ -172,24 +148,8 @@ public class VNativeButton extends Button implements Paintable, ClickHandler, @Override public void setWidth(String width) { - /* Workaround for IE7 button size part 1 (#2014) */ - if (BrowserInfo.get().isIE7() && this.width != null) { - if (this.width.equals(width)) { - return; - } - - if (width == null) { - width = ""; - } - } - this.width = width; super.setWidth(width); - - /* Workaround for IE7 button size part 2 (#2014) */ - if (BrowserInfo.get().isIE7()) { - super.setWidth(width); - } } /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java index 0957b6270f..260aa1123e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java @@ -15,7 +15,6 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.RootPanel; import com.vaadin.terminal.gwt.client.BrowserInfo; -import com.vaadin.terminal.gwt.client.Util; /** * In Vaadin UI this Overlay should always be used for all elements that @@ -162,30 +161,18 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { private static int adjustByRelativeTopBodyMargin() { if (topFix == -1) { - topFix = detectRelativeBodyFixes("top", BrowserInfo.get().isIE7()); + topFix = detectRelativeBodyFixes("top"); } return topFix; } - private native static int detectRelativeBodyFixes(String axis, - boolean removeClientLeftOrTop) + private native static int detectRelativeBodyFixes(String axis) /*-{ try { var b = $wnd.document.body; var cstyle = b.currentStyle ? b.currentStyle : getComputedStyle(b); if(cstyle && cstyle.position == 'relative') { - var offset = b.getBoundingClientRect()[axis]; - if (removeClientLeftOrTop) { - // IE7 include the top left border of the client area into the boundingClientRect - var clientTopOrLeft = 0; - if (axis == "top") - clientTopOrLeft = $wnd.document.documentElement.clientTop; - else - clientTopOrLeft = $wnd.document.documentElement.clientLeft; - - offset -= clientTopOrLeft; - } - return offset; + return b.getBoundingClientRect()[axis]; } } catch(e){} return 0; @@ -193,7 +180,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { private static int adjustByRelativeLeftBodyMargin() { if (leftFix == -1) { - leftFix = detectRelativeBodyFixes("left", BrowserInfo.get().isIE7()); + leftFix = detectRelativeBodyFixes("left"); } return leftFix; @@ -210,13 +197,6 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { updateShadowSizeAndPosition(1.0); } } - Util.runIE7ZeroSizedBodyFix(); - } - - @Override - public void hide(boolean autoClosed) { - super.hide(autoClosed); - Util.runIE7ZeroSizedBodyFix(); } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java index 4611f6e4ab..20cfdd7ad4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java @@ -322,11 +322,10 @@ public class VPanel extends SimplePanel implements Container, } public void runHacks(boolean runGeckoFix) { - if ((BrowserInfo.get().isIE() || BrowserInfo.get().isFF2()) - && (width == null || width.equals(""))) { + if ((BrowserInfo.get().isIE()) && (width == null || width.equals(""))) { /* - * IE and FF2 needs width to be specified for the root DIV so we - * calculate that from the sizes of the caption and layout + * IE (what version??) needs width to be specified for the root DIV + * so we calculate that from the sizes of the caption and layout */ int captionWidth = captionText.getOffsetWidth() + getCaptionMarginLeft() + getCaptionPaddingHorizontal(); @@ -337,11 +336,6 @@ public class VPanel extends SimplePanel implements Container, width = captionWidth; } - if (BrowserInfo.get().isIE7()) { - Util.setWidthExcludingPaddingAndBorder(captionNode, width - - getCaptionMarginLeft(), 26, false); - } - super.setWidth(width + "px"); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index c42567f9b1..850e481cd5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2749,8 +2749,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, int hw = captionContainer.getOffsetWidth() + scrollBody.getCellExtraWidth(); - if (BrowserInfo.get().isGecko() - || BrowserInfo.get().isIE7()) { + if (BrowserInfo.get().isGecko()) { hw += sortIndicator.getOffsetWidth(); } if (columnIndex < 0) { @@ -5924,19 +5923,15 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, */ private int getContentAreaBorderHeight() { if (contentAreaBorderHeight < 0) { - if (BrowserInfo.get().isIE7()) { - contentAreaBorderHeight = Util - .measureVerticalBorder(scrollBodyPanel.getElement()); - } else { - DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", - "hidden"); - int oh = scrollBodyPanel.getOffsetHeight(); - int ch = scrollBodyPanel.getElement().getPropertyInt( - "clientHeight"); - contentAreaBorderHeight = oh - ch; - DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", - "auto"); - } + + DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", + "hidden"); + int oh = scrollBodyPanel.getOffsetHeight(); + int ch = scrollBodyPanel.getElement() + .getPropertyInt("clientHeight"); + contentAreaBorderHeight = oh - ch; + DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", + "auto"); } return contentAreaBorderHeight; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java index 6157079711..2841099198 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java @@ -6,7 +6,6 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.Set; -import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; import com.google.gwt.event.dom.client.DomEvent.Type; @@ -20,7 +19,6 @@ import com.google.gwt.event.dom.client.TouchStartEvent; import com.google.gwt.event.dom.client.TouchStartHandler; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; @@ -306,15 +304,6 @@ public class VSplitPanel extends ComplexPanel implements Container, renderInformation.updateSize(getElement()); - if (BrowserInfo.get().isIE7()) { - // Part III of IE7 hack - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - iLayout(); - } - }); - } - // This is needed at least for cases like #3458 to take // appearing/disappearing scrollbars into account. client.runDescendentsLayout(this); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index 016a411447..049e81e59a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -238,33 +238,6 @@ public class VTabsheet extends VTabsheetBase { return tab; } - @Override - public void setWidth(String width) { - super.setWidth(width); - if (BrowserInfo.get().isIE7()) { - /* - * IE7 apparently has problems with calculating width for - * floated elements inside a DIV with padding. Set the width - * explicitly for the caption. - */ - fixTextWidth(); - } - } - - private void fixTextWidth() { - Element captionText = getTextElement(); - if (captionText == null) { - return; - } - - int captionWidth = Util.getRequiredWidth(captionText); - int scrollWidth = captionText.getScrollWidth(); - if (scrollWidth > captionWidth) { - captionWidth = scrollWidth; - } - captionText.getStyle().setPropertyPx("width", captionWidth); - } - public void setClosable(boolean closable) { this.closable = closable; if (closable && closeButton == null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index fbbe603ee9..d0aebaf1de 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -287,44 +287,15 @@ public class VTextField extends TextBoxBase implements Paintable, Field, setPrompting(inputPrompt != null && focusedTextField != this && (text.equals(""))); - if (BrowserInfo.get().isFF3()) { - /* - * Firefox 3 is really sluggish when updating input attached to dom. - * Some optimizations seems to work much better in Firefox3 if we - * update the actual content lazily when the rest of the DOM has - * stabilized. In tests, about ten times better performance is - * achieved with this optimization. See for eg. #2898 - */ - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - String fieldValue; - if (prompting) { - fieldValue = isReadOnly() ? "" : inputPrompt; - addStyleDependentName(CLASSNAME_PROMPT); - } else { - fieldValue = text; - removeStyleDependentName(CLASSNAME_PROMPT); - } - /* - * Avoid resetting the old value. Prevents cursor flickering - * which then again happens due to this Gecko hack. - */ - if (!getText().equals(fieldValue)) { - setText(fieldValue); - } - } - }); + String fieldValue; + if (prompting) { + fieldValue = isReadOnly() ? "" : inputPrompt; + addStyleDependentName(CLASSNAME_PROMPT); } else { - String fieldValue; - if (prompting) { - fieldValue = isReadOnly() ? "" : inputPrompt; - addStyleDependentName(CLASSNAME_PROMPT); - } else { - fieldValue = text; - removeStyleDependentName(CLASSNAME_PROMPT); - } - setText(fieldValue); + fieldValue = text; + removeStyleDependentName(CLASSNAME_PROMPT); } + setText(fieldValue); lastTextChangeString = valueBeforeEdit = text; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 4115f30c37..caa9c67dd1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -15,7 +15,6 @@ import com.google.gwt.event.dom.client.FocusHandler; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.TextBox; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ContainerResizedListener; import com.vaadin.terminal.gwt.client.EventId; import com.vaadin.terminal.gwt.client.Focusable; @@ -367,10 +366,6 @@ public class VTextualDate extends VDateField implements Paintable, Field, if (fieldExtraWidth < 0) { text.setWidth("0"); fieldExtraWidth = text.getOffsetWidth(); - if (BrowserInfo.get().isFF3()) { - // Firefox somehow always leaves the INPUT element 2px wide - fieldExtraWidth -= 2; - } } return fieldExtraWidth; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java index 8db320b1da..fc6ec46d64 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java @@ -81,6 +81,7 @@ public class VTreeTable extends VScrollTable { colIndexOfHierarchy = uidl .hasAttribute(ATTRIBUTE_HIERARCHY_COLUMN_INDEX) ? uidl .getIntAttribute(ATTRIBUTE_HIERARCHY_COLUMN_INDEX) : 0; + int oldTotalRows = getTotalRows(); super.updateFromUIDL(uidl, client); if (collapseRequest) { if (collapsedRowKey != null && scrollBody != null) { @@ -96,15 +97,19 @@ public class VTreeTable extends VScrollTable { widget.setScrollPosition(scrollPosition); } - /* - * Triggers row calculations, removes cached rows etc. Basically - * cleans up state. Be careful if touching this, you will brake - * pageLength=0 if you remove this. - */ + // check which rows are needed from the server and initiate a + // deferred fetch onScroll(null); - + } + // Recalculate table size if collapse request, or if page length is zero + // (not sent by server) and row count changes (#7908). + if (collapseRequest + || (!uidl.hasAttribute("pagelength") && getTotalRows() != oldTotalRows)) { /* * Ensure that possibly removed/added scrollbars are considered. + * Triggers row calculations, removes cached rows etc. Basically + * cleans up state. Be careful if touching this, you will break + * pageLength=0 if you remove this. */ triggerLazyColumnAdjustment(true); @@ -164,7 +169,7 @@ public class VTreeTable extends VScrollTable { private boolean browserSupportsAnimation() { BrowserInfo bi = BrowserInfo.get(); - return !(bi.isIE7() || bi.isSafari4()); + return !(bi.isSafari4()); } class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 5e50bc7eb4..02da3dc185 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -472,9 +472,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler, * browser window. Constantly recalculating the layout causes the resize * operation to be really slow with complex layouts. */ - boolean lazy = resizeLazy - || (BrowserInfo.get().isIE() && BrowserInfo.get() - .getIEVersion() <= 8) || BrowserInfo.get().isFF3(); + boolean lazy = resizeLazy || BrowserInfo.get().isIE8(); if (lazy) { delayedResizeExecutor.trigger(); @@ -555,16 +553,6 @@ public class VView extends SimplePanel implements Container, ResizeHandler, @Override public int getWidth() { - int w = getRealWidth(); - if (w < 10 && BrowserInfo.get().isIE7()) { - // Overcome an IE7 bug #3295 - Util.shakeBodyElement(); - w = getRealWidth(); - } - return w; - } - - private int getRealWidth() { if (connection.getConfiguration().isStandalone()) { return getElement().getOffsetWidth() - getExcessWidth(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index f2460ef2f1..7f9f1edb4a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -660,42 +660,6 @@ public class VWindow extends VOverlay implements Container, showModalityCurtain(); } super.show(); - - setFF2CaretFixEnabled(true); - fixFF3OverflowBug(); - } - - /** Disable overflow auto with FF3 to fix #1837. */ - private void fixFF3OverflowBug() { - if (BrowserInfo.get().isFF3()) { - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - DOM.setStyleAttribute(getElement(), "overflow", ""); - } - }); - } - } - - /** - * Fix "missing cursor" browser bug workaround for FF2 in Windows and Linux. - * - * Calling this method has no effect on other browsers than the ones based - * on Gecko 1.8 - * - * @param enable - */ - private void setFF2CaretFixEnabled(boolean enable) { - if (BrowserInfo.get().isFF2()) { - if (enable) { - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - DOM.setStyleAttribute(getElement(), "overflow", "auto"); - } - }); - } else { - DOM.setStyleAttribute(getElement(), "overflow", ""); - } - } } @Override @@ -724,14 +688,6 @@ public class VWindow extends VOverlay implements Container, } private void showModalityCurtain() { - if (BrowserInfo.get().isFF2()) { - DOM.setStyleAttribute( - getModalityCurtain(), - "height", - DOM.getElementPropertyInt(RootPanel.getBodyElement(), - "offsetHeight") + "px"); - DOM.setStyleAttribute(getModalityCurtain(), "position", "absolute"); - } DOM.setStyleAttribute(getModalityCurtain(), "zIndex", "" + (windowOrder.indexOf(this) + Z_INDEX)); if (isShowing()) { @@ -753,8 +709,6 @@ public class VWindow extends VOverlay implements Container, private void showDraggingCurtain(boolean show) { if (show && draggingCurtain == null) { - setFF2CaretFixEnabled(false); // makes FF2 slow - draggingCurtain = DOM.createDiv(); DOM.setStyleAttribute(draggingCurtain, "position", "absolute"); DOM.setStyleAttribute(draggingCurtain, "top", "0px"); @@ -767,8 +721,6 @@ public class VWindow extends VOverlay implements Container, DOM.appendChild(RootPanel.getBodyElement(), draggingCurtain); } else if (!show && draggingCurtain != null) { - setFF2CaretFixEnabled(true); // makes FF2 slow - DOM.removeChild(RootPanel.getBodyElement(), draggingCurtain); draggingCurtain = null; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java index bcb972ca6a..ebb8bd41ea 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java +++ b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java @@ -9,7 +9,6 @@ import java.util.NoSuchElementException; import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.TableElement; import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; @@ -78,29 +77,12 @@ public class ChildComponentContainer extends Panel { containerDIV = Document.get().createDivElement(); widgetDIV = Document.get().createDivElement(); - if (BrowserInfo.get().isFF2()) { - // Style style = widgetDIV.getStyle(); - // FF2 chokes on some floats very easily. Measuring size escpecially - // becomes terribly slow - TableElement tableEl = Document.get().createTableElement(); - tableEl.setInnerHTML("<tbody><tr><td><div></div></td></tr></tbody>"); - DivElement div = (DivElement) tableEl.getFirstChildElement() - .getFirstChildElement().getFirstChildElement() - .getFirstChildElement(); - tableEl.setCellPadding(0); - tableEl.setCellSpacing(0); - tableEl.setBorder(0); - div.getStyle().setProperty("padding", "0"); - - setElement(tableEl); - containerDIV = div; - } else { - setFloat(widgetDIV, "left"); - setElement(containerDIV); - containerDIV.getStyle().setProperty("height", "0"); - containerDIV.getStyle().setProperty("width", "0px"); - containerDIV.getStyle().setProperty("overflow", "hidden"); - } + + setFloat(widgetDIV, "left"); + setElement(containerDIV); + containerDIV.getStyle().setProperty("height", "0"); + containerDIV.getStyle().setProperty("width", "0px"); + containerDIV.getStyle().setProperty("overflow", "hidden"); if (BrowserInfo.get().isIE()) { /* diff --git a/src/com/vaadin/terminal/gwt/server/WebBrowser.java b/src/com/vaadin/terminal/gwt/server/WebBrowser.java index 4835b3c55b..4ac9cb77b2 100644 --- a/src/com/vaadin/terminal/gwt/server/WebBrowser.java +++ b/src/com/vaadin/terminal/gwt/server/WebBrowser.java @@ -400,4 +400,25 @@ public class WebBrowser implements Terminal { } + /** + * Checks if the browser is so old that it simply won't work with a Vaadin + * application. Can be used to redirect to an alternative page, show + * alternative content or similar. + * + * When this method returns true chances are very high that the browser + * won't work and it does not make sense to direct the user to the Vaadin + * application. + * + * @return true if the browser won't work, false if not the browser is + * supported or might work + */ + public boolean isTooOldToFunctionProperly() { + if (browserDetails == null) { + // Don't know, so assume it will work + return false; + } + + return browserDetails.isTooOldToFunctionProperly(); + } + } diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index 9b05bf02f9..e91511ae39 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -19,8 +19,10 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import com.vaadin.Application; +import com.vaadin.event.ActionManager; import com.vaadin.event.EventRouter; import com.vaadin.event.MethodEventSource; +import com.vaadin.event.ShortcutListener; import com.vaadin.terminal.ErrorMessage; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; @@ -145,6 +147,12 @@ public abstract class AbstractComponent implements Component, MethodEventSource private ComponentErrorHandler errorHandler = null; + /** + * Keeps track of the Actions added to this component; the actual + * handling/notifying is delegated, usually to the containing window. + */ + private ActionManager actionManager; + /* Constructor */ /** @@ -635,6 +643,9 @@ public abstract class AbstractComponent implements Component, MethodEventSource if (delayedFocus) { focus(); } + if (actionManager != null) { + actionManager.setViewer(getRoot()); + } } /* @@ -642,6 +653,9 @@ public abstract class AbstractComponent implements Component, MethodEventSource * we use the default documentation from implemented interface. */ public void detach() { + if (actionManager != null) { + actionManager.setViewer((Root) null); + } } /** @@ -1517,4 +1531,34 @@ public abstract class AbstractComponent implements Component, MethodEventSource } -}
\ No newline at end of file + /* + * Actions + */ + + /** + * Gets the {@link ActionManager} used to manage the + * {@link ShortcutListener}s added to this {@link Field}. + * + * @return the ActionManager in use + */ + protected ActionManager getActionManager() { + if (actionManager == null) { + actionManager = new ActionManager(); + if (getRoot() != null) { + actionManager.setViewer(getRoot()); + } + } + return actionManager; + } + + public void addShortcutListener(ShortcutListener shortcut) { + getActionManager().addAction(shortcut); + } + + public void removeShortcutListener(ShortcutListener shortcut) { + if (actionManager != null) { + actionManager.removeAction(shortcut); + } + } + +} diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index ce3687ba1a..d28c3e5256 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -18,7 +18,6 @@ import com.vaadin.data.Validatable; import com.vaadin.data.Validator; import com.vaadin.data.Validator.InvalidValueException; import com.vaadin.event.Action; -import com.vaadin.event.ActionManager; import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutListener; import com.vaadin.terminal.CompositeErrorMessage; @@ -131,12 +130,6 @@ public abstract class AbstractField extends AbstractComponent implements Field, */ private boolean validationVisible = true; - /** - * Keeps track of the Actions added to this component; the actual - * handling/notifying is delegated, usually to the containing window. - */ - private ActionManager actionManager; - private boolean valueWasModifiedByDataSourceDuringCommit; /* Component basics */ @@ -1111,27 +1104,6 @@ public abstract class AbstractField extends AbstractComponent implements Field, } /** - * Notifies the component that it is connected to an application. - * - * @see com.vaadin.ui.Component#attach() - */ - @Override - public void attach() { - super.attach(); - if (actionManager != null) { - actionManager.setViewer(getRoot()); - } - } - - @Override - public void detach() { - super.detach(); - if (actionManager != null) { - actionManager.setViewer((Root) null); - } - } - - /** * Is this field required. Required fields must filled by the user. * * If the field is required, it is visually indicated in the user interface. @@ -1244,36 +1216,6 @@ public abstract class AbstractField extends AbstractComponent implements Field, requestRepaint(); } - /* - * Actions - */ - - /** - * Gets the {@link ActionManager} used to manage the - * {@link ShortcutListener}s added to this {@link Field}. - * - * @return the ActionManager in use - */ - protected ActionManager getActionManager() { - if (actionManager == null) { - actionManager = new ActionManager(); - if (getRoot() != null) { - actionManager.setViewer(getRoot()); - } - } - return actionManager; - } - - public void addShortcutListener(ShortcutListener shortcut) { - getActionManager().addAction(shortcut); - } - - public void removeShortcutListener(ShortcutListener shortcut) { - if (actionManager != null) { - actionManager.removeAction(shortcut); - } - } - /** * A ready-made {@link ShortcutListener} that focuses the given * {@link Focusable} (usually a {@link Field}) when the keyboard shortcut is @@ -1329,4 +1271,4 @@ public abstract class AbstractField extends AbstractComponent implements Field, focusable.focus(); } } -}
\ No newline at end of file +} diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index 16314f94c3..eb580efe31 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -9,7 +9,7 @@ import java.io.Serializable; import java.lang.reflect.Method; import java.util.Map; -import com.vaadin.data.Property; +import com.vaadin.event.Action; import com.vaadin.event.FieldEvents; import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; @@ -23,8 +23,9 @@ import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; import com.vaadin.terminal.gwt.client.MouseEventDetails; import com.vaadin.terminal.gwt.client.ui.VButton; +import com.vaadin.tools.ReflectTools; import com.vaadin.ui.ClientWidget.LoadStyle; -import com.vaadin.ui.themes.BaseTheme; +import com.vaadin.ui.Component.Focusable; /** * A generic button component. @@ -36,28 +37,22 @@ import com.vaadin.ui.themes.BaseTheme; */ @SuppressWarnings("serial") @ClientWidget(value = VButton.class, loadStyle = LoadStyle.EAGER) -public class Button extends AbstractField implements FieldEvents.BlurNotifier, - FieldEvents.FocusNotifier { +public class Button extends AbstractComponent implements + FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, Focusable, + Action.ShortcutNotifier { /* Private members */ - boolean switchMode = false; - boolean disableOnClick = false; /** - * Creates a new push button. The value of the push button is false and it - * is immediate by default. - * + * Creates a new push button. */ public Button() { - setValue(Boolean.FALSE); } /** - * Creates a new push button. - * - * The value of the push button is false and it is immediate by default. + * Creates a new push button with the given caption. * * @param caption * the Button caption. @@ -68,7 +63,7 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, } /** - * Creates a new push button with click listener. + * Creates a new push button with a click listener. * * @param caption * the Button caption. @@ -102,36 +97,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, } /** - * Creates a new switch button with initial value. - * - * @param state - * the Initial state of the switch-button. - * @param initialState - * @deprecated use {@link CheckBox} instead of Button in "switchmode" - */ - @Deprecated - public Button(String caption, boolean initialState) { - setCaption(caption); - setValue(Boolean.valueOf(initialState)); - setSwitchMode(true); - } - - /** - * Creates a new switch button that is connected to a boolean property. - * - * @param state - * the Initial state of the switch-button. - * @param dataSource - * @deprecated use {@link CheckBox} instead of Button in "switchmode" - */ - @Deprecated - public Button(String caption, Property dataSource) { - setCaption(caption); - setSwitchMode(true); - setPropertyDataSource(dataSource); - } - - /** * Paints the content of this component. * * @param event @@ -145,11 +110,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); - if (isSwitchMode()) { - target.addAttribute("type", "switch"); - } - target.addVariable(this, "state", booleanValue()); - if (isDisableOnClick()) { target.addAttribute(VButton.ATTR_DISABLE_ON_CLICK, true); } @@ -176,46 +136,14 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, } if (!isReadOnly() && variables.containsKey("state")) { - // Gets the new and old button states - final Boolean newValue = (Boolean) variables.get("state"); - final Boolean oldValue = (Boolean) getValue(); - - if (isSwitchMode()) { - - // For switch button, the event is only sent if the - // switch state is changed - if (newValue != null && !newValue.equals(oldValue) - && !isReadOnly()) { - setValue(newValue); - if (variables.containsKey("mousedetails")) { - fireClick(MouseEventDetails - .deSerialize((String) variables - .get("mousedetails"))); - } else { - // for compatibility with custom implementations which - // don't send mouse details - fireClick(); - } - } + // Send click events when the button is pushed + if (variables.containsKey("mousedetails")) { + fireClick(MouseEventDetails.deSerialize((String) variables + .get("mousedetails"))); } else { - - // Only send click event if the button is pushed - if (newValue.booleanValue()) { - if (variables.containsKey("mousedetails")) { - fireClick(MouseEventDetails - .deSerialize((String) variables - .get("mousedetails"))); - } else { - // for compatibility with custom implementations which - // don't send mouse details - fireClick(); - } - } - - // If the button is true for some reason, release it - if (null == oldValue || oldValue.booleanValue()) { - setValue(Boolean.FALSE); - } + // for compatibility with custom implementations which + // don't send mouse details + fireClick(); } } @@ -228,92 +156,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, } /** - * Checks if it is switchMode. - * - * @return <code>true</code> if it is in Switch Mode, otherwise - * <code>false</code>. - * @deprecated the {@link CheckBox} component should be used instead of - * Button in switch mode - */ - @Deprecated - public boolean isSwitchMode() { - return switchMode; - } - - /** - * Sets the switchMode. - * - * @param switchMode - * The switchMode to set. - * @deprecated the {@link CheckBox} component should be used instead of - * Button in switch mode - */ - @Deprecated - public void setSwitchMode(boolean switchMode) { - this.switchMode = switchMode; - if (!switchMode) { - setImmediate(true); - if (booleanValue()) { - setValue(Boolean.FALSE); - } - } - } - - /** - * Get the boolean value of the button state. - * - * @return True iff the button is pressed down or checked. - */ - public boolean booleanValue() { - Boolean value = (Boolean) getValue(); - return (null == value) ? false : value.booleanValue(); - } - - /** - * Sets immediate mode. Push buttons can not be set in non-immediate mode. - * - * @see com.vaadin.ui.AbstractComponent#setImmediate(boolean) - */ - @Override - public void setImmediate(boolean immediate) { - // Push buttons are always immediate - super.setImmediate(!isSwitchMode() || immediate); - } - - /** - * The type of the button as a property. - * - * @see com.vaadin.data.Property#getType() - */ - @Override - public Class getType() { - return Boolean.class; - } - - /* Click event */ - - private static final Method BUTTON_CLICK_METHOD; - - /** - * Button style with no decorations. Looks like a link, acts like a button - * - * @deprecated use {@link BaseTheme#BUTTON_LINK} instead. - */ - @Deprecated - public static final String STYLE_LINK = "link"; - - static { - try { - BUTTON_CLICK_METHOD = ClickListener.class.getDeclaredMethod( - "buttonClick", new Class[] { ClickEvent.class }); - } catch (final java.lang.NoSuchMethodException e) { - // This should never happen - throw new java.lang.RuntimeException( - "Internal error finding methods in Button"); - } - } - - /** * Click event. This event is thrown, when the button is clicked. * * @author IT Mill Ltd. @@ -484,6 +326,10 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, */ public interface ClickListener extends Serializable { + public static final Method BUTTON_CLICK_METHOD = ReflectTools + .findMethod(ClickListener.class, "buttonClick", + ClickEvent.class); + /** * Called when a {@link Button} has been clicked. A reference to the * button is given by {@link ClickEvent#getButton()}. @@ -502,7 +348,8 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, * the Listener to be added. */ public void addListener(ClickListener listener) { - addListener(ClickEvent.class, listener, BUTTON_CLICK_METHOD); + addListener(ClickEvent.class, listener, + ClickListener.BUTTON_CLICK_METHOD); } /** @@ -512,7 +359,8 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, * the Listener to be removed. */ public void removeListener(ClickListener listener) { - removeListener(ClickEvent.class, listener, BUTTON_CLICK_METHOD); + removeListener(ClickEvent.class, listener, + ClickListener.BUTTON_CLICK_METHOD); } /** @@ -538,16 +386,6 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, fireEvent(new Button.ClickEvent(this, details)); } - @Override - protected void setInternalValue(Object newValue) { - // Make sure only booleans get through - if (null != newValue && !(newValue instanceof Boolean)) { - throw new IllegalArgumentException(getClass().getSimpleName() - + " only accepts Boolean values"); - } - super.setInternalValue(newValue); - } - public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); @@ -573,6 +411,8 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, protected ClickShortcut clickShortcut; + private int tabIndex = 0; + /** * Makes it possible to invoke a click on this button by pressing the given * {@link KeyCode} and (optional) {@link ModifierKey}s.<br/> @@ -685,4 +525,18 @@ public class Button extends AbstractField implements FieldEvents.BlurNotifier, requestRepaint(); } + public int getTabIndex() { + return tabIndex; + } + + public void setTabIndex(int tabIndex) { + this.tabIndex = tabIndex; + + } + + @Override + public void focus() { + // Overridden only to make public + super.focus(); + } } diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java index b9ae236cb0..11d9619c8c 100644 --- a/src/com/vaadin/ui/CheckBox.java +++ b/src/com/vaadin/ui/CheckBox.java @@ -4,110 +4,129 @@ package com.vaadin.ui; -import java.lang.reflect.Method; +import java.util.Map; import com.vaadin.data.Property; +import com.vaadin.event.FieldEvents.BlurEvent; +import com.vaadin.event.FieldEvents.BlurListener; +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.terminal.PaintException; +import com.vaadin.terminal.PaintTarget; +import com.vaadin.terminal.gwt.client.ui.VCheckBox; @ClientWidget(com.vaadin.terminal.gwt.client.ui.VCheckBox.class) -public class CheckBox extends Button { +public class CheckBox extends AbstractField { /** - * Creates a new switch button. + * Creates a new checkbox. */ public CheckBox() { - setSwitchMode(true); } /** - * Creates a new switch button with a caption and a set initial state. + * Creates a new checkbox with a set caption. * * @param caption - * the caption of the switch button - * @param initialState - * the initial state of the switch button + * the Checkbox caption. */ - @SuppressWarnings("deprecation") - public CheckBox(String caption, boolean initialState) { - super(caption, initialState); - } - - /** - * Creates a new switch button with a caption and a click listener. - * - * @param caption - * the caption of the switch button - * @param listener - * the click listener - */ - public CheckBox(String caption, ClickListener listener) { - super(caption, listener); - setSwitchMode(true); + public CheckBox(String caption) { + this(); + setCaption(caption); } /** - * Convenience method for creating a new switch button with a method - * listening button clicks. Using this method is discouraged because it - * cannot be checked during compilation. Use - * {@link #addListener(Class, Object, Method)} or - * {@link #addListener(com.vaadin.ui.Component.Listener)} instead. The - * method must have either no parameters, or only one parameter of - * Button.ClickEvent type. + * Creates a new checkbox with a caption and a set initial state. * * @param caption - * the Button caption. - * @param target - * the Object having the method for listening button clicks. - * @param methodName - * the name of the method in target object, that receives button - * click events. + * the caption of the checkbox + * @param initialState + * the initial state of the checkbox */ - public CheckBox(String caption, Object target, String methodName) { - super(caption, target, methodName); - setSwitchMode(true); + public CheckBox(String caption, boolean initialState) { + this(caption); + setValue(initialState); } /** - * Creates a new switch button that is connected to a boolean property. + * Creates a new checkbox that is connected to a boolean property. * * @param state * the Initial state of the switch-button. * @param dataSource */ - @SuppressWarnings("deprecation") public CheckBox(String caption, Property dataSource) { - super(caption, dataSource); - setSwitchMode(true); + this(caption); + setPropertyDataSource(dataSource); } - /** - * Creates a new push button with a set caption. - * - * The value of the push button is always false and they are immediate by - * default. - * - * @param caption - * the Button caption. - */ + @Override + public Class<?> getType() { + return Boolean.class; + } - @SuppressWarnings("deprecation") - public CheckBox(String caption) { - super(caption, false); + @Override + public void paintContent(PaintTarget target) throws PaintException { + super.paintContent(target); + + target.addVariable(this, VCheckBox.VARIABLE_STATE, booleanValue()); } - @Deprecated @Override - public void setSwitchMode(boolean switchMode) - throws UnsupportedOperationException { - if (this.switchMode && !switchMode) { - throw new UnsupportedOperationException( - "CheckBox is always in switch mode (consider using a Button)"); + public void changeVariables(Object source, Map<String, Object> variables) { + super.changeVariables(source, variables); + + if (!isReadOnly() && variables.containsKey(VCheckBox.VARIABLE_STATE)) { + // Gets the new and old states + final Boolean newValue = (Boolean) variables + .get(VCheckBox.VARIABLE_STATE); + final Boolean oldValue = (Boolean) getValue(); + + // The event is only sent if the switch state is changed + if (newValue != null && !newValue.equals(oldValue)) { + setValue(newValue); + } + } + + if (variables.containsKey(FocusEvent.EVENT_ID)) { + fireEvent(new FocusEvent(this)); + } + if (variables.containsKey(BlurEvent.EVENT_ID)) { + fireEvent(new BlurEvent(this)); } - super.setSwitchMode(true); } - @Override - public void setDisableOnClick(boolean disableOnClick) { - throw new UnsupportedOperationException( - "CheckBox does not support disable on click"); + public void addListener(BlurListener listener) { + addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, + BlurListener.blurMethod); + } + + public void removeListener(BlurListener listener) { + removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); + } + + public void addListener(FocusListener listener) { + addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, + FocusListener.focusMethod); + } + + public void removeListener(FocusListener listener) { + removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); + + } + + /** + * Get the boolean value of the checkbox state. + * + * @return True iff the checkbox is checked. + * @deprecated in Vaadin 7.0.0. Retained to ease migration from Vaadin 6 + */ + @Deprecated + public boolean booleanValue() { + // FIXME: How should null really be handled? A default converter that + // converts it to false? The only UI values supported are true and + // false. + Boolean value = (Boolean) getValue(); + return (null == value) ? false : value.booleanValue(); } } diff --git a/src/com/vaadin/ui/NativeButton.java b/src/com/vaadin/ui/NativeButton.java index 6d128b4bb4..40b88951b3 100644 --- a/src/com/vaadin/ui/NativeButton.java +++ b/src/com/vaadin/ui/NativeButton.java @@ -3,7 +3,6 @@ */ package com.vaadin.ui; -import com.vaadin.data.Property; import com.vaadin.terminal.gwt.client.ui.VNativeButton; @SuppressWarnings("serial") @@ -26,30 +25,4 @@ public class NativeButton extends Button { super(caption, target, methodName); } - /** - * Creates a new switch button with initial value. - * - * @param state - * the Initial state of the switch-button. - * @param initialState - * @deprecated use the {@link CheckBox} component instead - */ - @Deprecated - public NativeButton(String caption, boolean initialState) { - super(caption, initialState); - } - - /** - * Creates a new switch button that is connected to a boolean property. - * - * @param state - * the Initial state of the switch-button. - * @param dataSource - * @deprecated use the {@link CheckBox} component instead - */ - @Deprecated - public NativeButton(String caption, Property dataSource) { - super(caption, dataSource); - } - }
\ No newline at end of file diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java index 63536baf68..2a5b50f4bb 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/TestAbstractFieldListeners.java @@ -5,16 +5,17 @@ import com.vaadin.data.Property.ReadOnlyStatusChangeListener; import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.server.component.AbstractListenerMethodsTest;
-import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
public class TestAbstractFieldListeners extends AbstractListenerMethodsTest {
public void testReadOnlyStatusChangeListenerAddGetRemove() throws Exception {
- testListenerAddGetRemove(Button.class, ReadOnlyStatusChangeEvent.class,
+ testListenerAddGetRemove(CheckBox.class,
+ ReadOnlyStatusChangeEvent.class,
ReadOnlyStatusChangeListener.class);
}
public void testValueChangeListenerAddGetRemove() throws Exception {
- testListenerAddGetRemove(Button.class, ValueChangeEvent.class,
+ testListenerAddGetRemove(CheckBox.class, ValueChangeEvent.class,
ValueChangeListener.class);
}
}
diff --git a/tests/testbench/com/vaadin/tests/ListenerOrder.java b/tests/testbench/com/vaadin/tests/ListenerOrder.java index 8ebf5525a2..a5283283fe 100644 --- a/tests/testbench/com/vaadin/tests/ListenerOrder.java +++ b/tests/testbench/com/vaadin/tests/ListenerOrder.java @@ -49,12 +49,12 @@ public class ListenerOrder extends com.vaadin.Application.LegacyApplication addListeners(b1, 1); b1.addListener(mutualListener); b1.addListener(mutualListener); - b1.addListener((Button.ClickListener) this); + b1.addListener(this); b1.addListener(mutualListener); Button.ClickListener b1Listener = addListeners(b1, 3); b1.addListener(mutualListener); - b1.addListener((Button.ClickListener) this); - b1.addListener((ValueChangeListener) this); + b1.addListener(this); + // b1.addListener((ValueChangeListener) this); b1.addListener(mutualListener); b1.removeListener(b1Listener); // remove non-existing listener diff --git a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java index 50b7be91ef..a838d2bf8e 100644 --- a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java +++ b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java @@ -4,10 +4,10 @@ package com.vaadin.tests; +import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; @@ -50,8 +50,9 @@ public class TestForRichTextEditor extends CustomComponent implements CheckBox b = new CheckBox("enabled"); b.setImmediate(true); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + b.addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { rte.setEnabled(!rte.isEnabled()); } }); diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java index 3fed6b233e..ad916e0cc4 100644 --- a/tests/testbench/com/vaadin/tests/TestForUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForUpload.java @@ -413,7 +413,7 @@ public class TestForUpload extends CustomComponent implements } private void beSluggish() { - if (beSluggish.booleanValue()) { + if ((Boolean) beSluggish.getValue()) { try { Thread.sleep(1000); } catch (InterruptedException e) { @@ -424,7 +424,7 @@ public class TestForUpload extends CustomComponent implements } private void throwExecption() { - if (throwExecption.booleanValue()) { + if ((Boolean) throwExecption.getValue()) { throwExecption.setValue(false); throw new RuntimeException("Test execption in receiver."); } diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java index 8344ed216a..14a7a85adb 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java @@ -8,6 +8,12 @@ import java.util.Locale; import java.util.Map;
import java.util.Set;
+import com.vaadin.event.FieldEvents.BlurEvent;
+import com.vaadin.event.FieldEvents.BlurListener;
+import com.vaadin.event.FieldEvents.BlurNotifier;
+import com.vaadin.event.FieldEvents.FocusEvent;
+import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.util.Log;
@@ -17,7 +23,8 @@ import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.MenuItem;
public abstract class AbstractComponentTest<T extends AbstractComponent>
- extends AbstractComponentTestCase<T> {
+ extends AbstractComponentTestCase<T> implements FocusListener,
+ BlurListener {
protected static final String TEXT_SHORT = "Short";
protected static final String TEXT_MEDIUM = "This is a semi-long text that might wrap.";
@@ -221,6 +228,39 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> }
+ protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
+
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((FocusNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((FocusNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+ protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
+
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((BlurNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((BlurNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+
+ protected void createFocusListener(String category) {
+ createBooleanAction("Focus listener", category, false,
+ focusListenerCommand);
+
+ }
+
+ protected void createBlurListener(String category) {
+ createBooleanAction("Blur listener", category, false,
+ blurListenerCommand);
+
+ }
+
private void createStyleNameSelect(String category) {
LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
options.put("-", null);
@@ -668,4 +708,13 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> }
}
+
+ public void focus(FocusEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
+ public void blur(BlurEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
}
diff --git a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java index 1e15f7a47b..a2c186df7e 100644 --- a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java +++ b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java @@ -7,6 +7,7 @@ import java.util.List; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; @@ -111,9 +112,10 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends boolean initialState, final Command<T, Boolean> command) { CheckBox checkBox = new CheckBox(caption); - checkBox.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - boolean enabled = (Boolean) event.getButton().getValue(); + checkBox.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean enabled = (Boolean) event.getProperty().getValue(); doCommand(command, enabled); } }); @@ -132,10 +134,13 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends final Command<T, Boolean> command) { Button button = new Button(caption); + button.setData(Boolean.FALSE); button.addListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { - boolean enabled = (Boolean) event.getButton().getValue(); - doCommand(command, enabled); + Button b = event.getButton(); + boolean state = (Boolean) b.getData(); + b.setData(!state); + doCommand(command, state); } }); diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java index 2f22d4633c..4e83543632 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java @@ -1,8 +1,9 @@ package com.vaadin.tests.components.abstractcomponent;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Root;
@@ -17,9 +18,10 @@ public class EnableState extends AbstractTestCase { panel.addComponent(button);
CheckBox enable = new CheckBox("Toggle button enabled", true);
- enable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ enable.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
button.setEnabled(enabled);
// button.requestRepaint();
}
@@ -27,17 +29,19 @@ public class EnableState extends AbstractTestCase { enable.setImmediate(true);
CheckBox caption = new CheckBox("Toggle button caption", true);
- caption.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ caption.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
button.setCaption(button.getCaption() + "+");
}
});
caption.setImmediate(true);
CheckBox visible = new CheckBox("Toggle panel visibility", true);
- visible.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean visible = (Boolean) event.getButton().getValue();
+ visible.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean visible = (Boolean) event.getProperty().getValue();
panel.setVisible(visible);
}
@@ -45,9 +49,10 @@ public class EnableState extends AbstractTestCase { visible.setImmediate(true);
CheckBox panelEnable = new CheckBox("Toggle panel enabled", true);
- panelEnable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ panelEnable.addListener(new Property.ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
panel.setEnabled(enabled);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java index 1c8e728908..064d81edc8 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java @@ -13,11 +13,7 @@ import com.vaadin.data.Property; import com.vaadin.data.Property.ReadOnlyStatusChangeEvent;
import com.vaadin.data.Property.ReadOnlyStatusChangeListener;
import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.event.FieldEvents.BlurEvent;
-import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.BlurNotifier;
-import com.vaadin.event.FieldEvents.FocusEvent;
-import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.AbstractField;
@@ -26,13 +22,20 @@ import com.vaadin.ui.MenuBar.MenuItem; public abstract class AbstractFieldTest<T extends AbstractField> extends
AbstractComponentTest<T> implements ValueChangeListener,
- ReadOnlyStatusChangeListener, FocusListener, BlurListener {
+ ReadOnlyStatusChangeListener {
@Override
protected void createActions() {
super.createActions();
createBooleanAction("Required", CATEGORY_STATE, false, requiredCommand);
createRequiredErrorSelect(CATEGORY_DECORATIONS);
+ if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
+ createFocusListener(CATEGORY_LISTENERS);
+ }
+
+ if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
+ createBlurListener(CATEGORY_LISTENERS);
+ }
createValueChangeListener(CATEGORY_LISTENERS);
createReadOnlyStatusChangeListener(CATEGORY_LISTENERS);
@@ -82,14 +85,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends createSelectAction("Required error message", category, options, "-",
requiredErrorMessageCommand);
- if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
- createFocusListener(CATEGORY_LISTENERS);
- }
-
- if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
- createBlurListener(CATEGORY_LISTENERS);
- }
-
}
private void createValueChangeListener(String category) {
@@ -104,18 +99,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends false, readonlyStatusChangeListenerCommand);
}
- private void createFocusListener(String category) {
- createBooleanAction("Focus listener", category, false,
- focusListenerCommand);
-
- }
-
- private void createBlurListener(String category) {
- createBooleanAction("Blur listener", category, false,
- blurListenerCommand);
-
- }
-
protected Command<T, Boolean> valueChangeListenerCommand = new Command<T, Boolean>() {
public void execute(T c, Boolean value, Object data) {
@@ -136,26 +119,7 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends }
}
};
- protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
-
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((FocusNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((FocusNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
- protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((BlurNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((BlurNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
protected Command<T, Object> setValueCommand = new Command<T, Object>() {
public void execute(T c, Object value, Object data) {
@@ -208,14 +172,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends log(event.getClass().getSimpleName());
}
- public void focus(FocusEvent event) {
- log(event.getClass().getSimpleName());
- }
-
- public void blur(BlurEvent event) {
- log(event.getClass().getSimpleName());
- }
-
protected void createSetTextValueAction(String category) {
String subCategory = "Set text value";
createCategory(subCategory, category);
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html index 850d553b5b..d39f72ef1f 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html @@ -16,7 +16,7 @@ <td>/run/com.vaadin.tests.components.button.Buttons2?restartApplication</td> <td></td> </tr> -<!--value change listener--> +<!--click listener--> <tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_Smenu#item0</td> @@ -29,7 +29,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item2</td> <td>35,8</td> </tr> <!--disable on click--> @@ -45,7 +45,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td> <td>22,4</td> </tr> <tr> @@ -133,7 +133,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td> <td>36,3</td> </tr> <tr> @@ -151,7 +151,6 @@ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_StestComponent</td> <td>v-disabled</td> </tr> - </tbody></table> </body> </html> diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java index 40caf620a8..4dc3fcd0fb 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java @@ -3,7 +3,6 @@ package com.vaadin.tests.components.button; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; public class ButtonMouseDetails extends TestBase { @@ -46,10 +45,6 @@ public class ButtonMouseDetails extends TestBase { button.setImmediate(true); addComponent(button); - CheckBox cb = new CheckBox("CHECK ME!", clickListener); - cb.setImmediate(true); - addComponent(cb); - addComponent(out); } diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java index c18e736082..0a1bd96ead 100644 --- a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java +++ b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java @@ -2,22 +2,14 @@ package com.vaadin.tests.components.button; import java.util.LinkedHashMap;
-import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
+import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.themes.Reindeer;
-public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
- ClickListener {
-
- private Command<T, Boolean> switchModeCommand = new Command<T, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(T c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
+public class Buttons2<T extends Button> extends AbstractComponentTest<T>
+ implements ClickListener {
private Command<T, Boolean> disableOnClickCommand = new Command<T, Boolean>() {
@@ -47,8 +39,9 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, false,
- switchModeCommand);
+ createFocusListener(CATEGORY_LISTENERS);
+ createBlurListener(CATEGORY_LISTENERS);
+
createBooleanAction("Disable on click", CATEGORY_FEATURES, false,
disableOnClickCommand);
addClickListener(CATEGORY_LISTENERS);
diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java index 20f1ece65e..4a98f09808 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java @@ -8,46 +8,15 @@ import com.vaadin.ui.CheckBox; public class CheckBoxes2 extends AbstractFieldTest<CheckBox> implements
ClickListener {
- // cannot extend Buttons2 because of Switch mode problems
-
@Override
protected Class<CheckBox> getTestClass() {
return CheckBox.class;
}
- private Command<CheckBox, Boolean> switchModeCommand = new Command<CheckBox, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(CheckBox c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
-
- private Command<CheckBox, Boolean> clickListenerCommand = new Command<CheckBox, Boolean>() {
-
- public void execute(CheckBox c, Boolean value, Object data) {
- if (value) {
- c.addListener((ClickListener) CheckBoxes2.this);
- } else {
- c.removeListener((ClickListener) CheckBoxes2.this);
- }
-
- }
- };
-
@Override
protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, true,
- switchModeCommand);
- addClickListener(CATEGORY_LISTENERS);
- }
-
- private void addClickListener(String category) {
- createBooleanAction("Click listener", category, false,
- clickListenerCommand);
-
}
public void buttonClick(ClickEvent event) {
diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html index 13d6312cf7..03ec163e40 100644 --- a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html +++ b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html @@ -18,7 +18,7 @@ </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VDragAndDropWrapper[2]</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper3</td> <td>0,0</td> </tr> <tr> @@ -28,17 +28,17 @@ </tr> <tr> <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VDragAndDropWrapper[3]</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper4</td> <td>30,41</td> </tr> <tr> <td>drop</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VDragAndDropWrapper[1]</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper2</td> <td>4,42</td> </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VDragAndDropWrapper[0]/VLabel[0]</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper1/VLabel[0]</td> <td>0,0</td> </tr> <tr> diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java index b147392480..6b89d1392c 100644 --- a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java +++ b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java @@ -45,6 +45,7 @@ public class DragAndDropWrapperTooltips extends TestBase { for (int i = 1; i <= 4; i++) { WrappedLabel wl = new WrappedLabel("Block"); + wl.setDebugId("wrapper" + i); wl.addStyleName("b" + i); cssLayout.addComponent(wl); } diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java index e42d64201e..0ba50f2277 100644 --- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java +++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java @@ -1,7 +1,8 @@ package com.vaadin.tests.components.formlayout;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.TextField;
@@ -14,7 +15,7 @@ public class FormLayoutReplaceComponent extends TestBase { }
- public class FL extends FormLayout implements ClickListener {
+ public class FL extends FormLayout implements ValueChangeListener {
private TextField messages;
private CheckBox control;
@@ -37,10 +38,11 @@ public class FormLayoutReplaceComponent extends TestBase { addComponent(messages);
}
- public final void buttonClick(Button.ClickEvent e) {
- if (e.getButton() == control) {
- messages.setVisible(control.booleanValue());
+ public void valueChange(ValueChangeEvent event) {
+ if (event.getProperty() == control) {
+ messages.setVisible((Boolean) control.getValue());
}
+
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html index 75eab71892..5f80004c7c 100644 --- a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html +++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html @@ -16,7 +16,7 @@ <td>/run/com.vaadin.tests.components.nativebutton.NativeButtonTest?restartApplication</td> <td></td> </tr> -<!--value change listener--> +<!-- click listener--> <tr> <td>mouseClick</td> <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::PID_Smenu#item0</td> @@ -29,7 +29,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item2</td> <td>35,8</td> </tr> <!--disable on click--> @@ -45,7 +45,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td> <td>22,4</td> </tr> <tr> @@ -133,7 +133,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td> <td>36,3</td> </tr> <tr> diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java index 6314486068..0d18c59689 100644 --- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java +++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java @@ -54,7 +54,7 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener Notification n = new Notification((String) captionField.getValue(),
(String) messageField.getValue(),
Notification.TYPE_HUMANIZED_MESSAGE,
- htmlAllowedBox.booleanValue());
+ (Boolean) htmlAllowedBox.getValue());
return n;
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java index 0c625f1c5d..fdcb458a6a 100644 --- a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java +++ b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java @@ -4,8 +4,6 @@ import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Select; @@ -37,14 +35,14 @@ public class ColumnHeaderAlignments extends TestBase { } }); addComponent(theme); - CheckBox footers = new CheckBox("Show footers", new ClickListener() { - public void buttonClick(ClickEvent event) { - fooTable.setFooterVisible((Boolean) event.getButton() - .getValue()); - barTable.setFooterVisible((Boolean) event.getButton() - .getValue()); - bazTable.setFooterVisible((Boolean) event.getButton() - .getValue()); + CheckBox footers = new CheckBox("Show footers"); + footers.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean visible = (Boolean) event.getProperty().getValue(); + fooTable.setFooterVisible(visible); + barTable.setFooterVisible(visible); + bazTable.setFooterVisible(visible); } }); footers.setImmediate(true); diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java index 6561ff0076..a6f25f4569 100644 --- a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java +++ b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java @@ -7,6 +7,8 @@ import java.io.Serializable; import java.util.HashMap; import com.vaadin.data.Container; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.Button; @@ -83,9 +85,9 @@ public class EditableTableLeak extends TestBase { protected void setup() { addComponent(useFieldFactory); useFieldFactory.setImmediate(true); - useFieldFactory.addListener(new Button.ClickListener() { + useFieldFactory.addListener(new ValueChangeListener() { - public void buttonClick(ClickEvent event) { + public void valueChange(ValueChangeEvent event) { if ((Boolean) useFieldFactory.getValue()) { table.setTableFieldFactory(new CachingFieldFactory()); } else { diff --git a/tests/testbench/com/vaadin/tests/components/table/Footer.java b/tests/testbench/com/vaadin/tests/components/table/Footer.java index d6a9853fff..c962ce8468 100644 --- a/tests/testbench/com/vaadin/tests/components/table/Footer.java +++ b/tests/testbench/com/vaadin/tests/components/table/Footer.java @@ -51,7 +51,7 @@ public class Footer extends TestBase { visible.setImmediate(true); visible.addListener(new Property.ValueChangeListener() { public void valueChange(ValueChangeEvent event) { - table.setFooterVisible(visible.booleanValue()); + table.setFooterVisible((Boolean) visible.getValue()); } }); diff --git a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java index b92d6ef362..f0075c2364 100644 --- a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java +++ b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java @@ -2,11 +2,11 @@ package com.vaadin.tests.components.table; import com.vaadin.data.Container; import com.vaadin.data.Item; +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Table; import com.vaadin.ui.Table.FooterClickEvent; @@ -51,10 +51,10 @@ public class FooterClick extends TestBase { CheckBox immediateCheckbox = new CheckBox("Immediate"); immediateCheckbox.setImmediate(true); immediateCheckbox.setValue(table.isImmediate()); - immediateCheckbox.addListener(new ClickListener() { + immediateCheckbox.addListener(new Property.ValueChangeListener() { - public void buttonClick(ClickEvent event) { - table.setImmediate(event.getButton().booleanValue()); + public void valueChange(ValueChangeEvent event) { + table.setImmediate((Boolean) event.getProperty().getValue()); } }); @@ -62,13 +62,14 @@ public class FooterClick extends TestBase { "Column reordering allowed"); columnReorderingCheckbox.setImmediate(true); columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed()); - columnReorderingCheckbox.addListener(new ClickListener() { - - public void buttonClick(ClickEvent event) { - table.setColumnReorderingAllowed(event.getButton() - .booleanValue()); - } - }); + columnReorderingCheckbox + .addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + table.setColumnReorderingAllowed((Boolean) event + .getProperty().getValue()); + } + }); addComponent(immediateCheckbox); addComponent(columnReorderingCheckbox); diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java index 3cb11781b1..c29fde927c 100644 --- a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java +++ b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java @@ -2,10 +2,10 @@ package com.vaadin.tests.components.table; import com.vaadin.data.Container; import com.vaadin.data.Item; +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Table; import com.vaadin.ui.Table.HeaderClickEvent; @@ -36,20 +36,20 @@ public class HeaderClick extends TestBase { CheckBox immediateCheckbox = new CheckBox("Immediate"); immediateCheckbox.setImmediate(true); immediateCheckbox.setValue(table.isImmediate()); - immediateCheckbox.addListener(new ClickListener() { + immediateCheckbox.addListener(new Property.ValueChangeListener() { - public void buttonClick(ClickEvent event) { - table.setImmediate(event.getButton().booleanValue()); + public void valueChange(ValueChangeEvent event) { + table.setImmediate((Boolean) event.getProperty().getValue()); } }); CheckBox sortEnabledCheckbox = new CheckBox("Sortable"); sortEnabledCheckbox.setImmediate(true); sortEnabledCheckbox.setValue(!table.isSortDisabled()); - sortEnabledCheckbox.addListener(new ClickListener() { + sortEnabledCheckbox.addListener(new Property.ValueChangeListener() { - public void buttonClick(ClickEvent event) { - table.setSortDisabled(!event.getButton().booleanValue()); + public void valueChange(ValueChangeEvent event) { + table.setSortDisabled(!(Boolean) event.getProperty().getValue()); } }); @@ -57,13 +57,14 @@ public class HeaderClick extends TestBase { "Column reordering allowed"); columnReorderingCheckbox.setImmediate(true); columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed()); - columnReorderingCheckbox.addListener(new ClickListener() { - - public void buttonClick(ClickEvent event) { - table.setColumnReorderingAllowed(event.getButton() - .booleanValue()); - } - }); + columnReorderingCheckbox + .addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + table.setColumnReorderingAllowed((Boolean) event + .getProperty().getValue()); + } + }); addComponent(immediateCheckbox); addComponent(sortEnabledCheckbox); diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java index bf1f9ca883..9c79b65fa5 100644 --- a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java +++ b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java @@ -1,7 +1,8 @@ package com.vaadin.tests.components.table; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Table; @@ -16,16 +17,17 @@ public class HeaderUpdateWhenNoRows extends TestBase { table.setHeight("100px"); table.setImmediate(true); - CheckBox showHeaders = new CheckBox("Show headers", - new CheckBox.ClickListener() { - public void buttonClick(ClickEvent event) { - if (event.getButton().booleanValue()) { - table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); - } else { - table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); - } - } - }); + CheckBox showHeaders = new CheckBox("Show headers"); + showHeaders.addListener(new ValueChangeListener() { + public void valueChange(ValueChangeEvent event) { + if ((Boolean) event.getProperty().getValue()) { + table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); + } else { + table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); + } + } + + }); showHeaders.setImmediate(true); showHeaders.setValue(true); diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java index fcf1b34310..59b89f3d7f 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java @@ -1,7 +1,8 @@ package com.vaadin.tests.components.table; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Root; import com.vaadin.ui.Table; @@ -30,24 +31,25 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase { table.addItem("1").getItemProperty("Name").setValue("Item 1"); table.addItem("2").getItemProperty("Name").setValue("Item 2"); - CheckBox showHeaders = new CheckBox("Show headers", - new CheckBox.ClickListener() { - public void buttonClick(ClickEvent event) { - if (event.getButton().booleanValue()) { - // table body height is now 77px, which together - // with header makes 100px - table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); - } else { - table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); - // header disappears, but table body height stays at - // 77px - // and below the body is an empty area (same height - // as header would - // have) + CheckBox showHeaders = new CheckBox("Show headers"); + showHeaders.addListener(new ValueChangeListener() { - } - } - }); + public void valueChange(ValueChangeEvent event) { + if ((Boolean) event.getProperty().getValue()) { + // table body height is now 77px, which together + // with header makes 100px + table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); + } else { + table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); + // header disappears, but table body height stays at + // 77px + // and below the body is an empty area (same height + // as header would + // have) + + } + } + }); showHeaders.setValue(true); showHeaders.setImmediate(true); diff --git a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java index 05e101a5f9..e6e121cba0 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java @@ -15,7 +15,7 @@ public class TableScrollOnFocus extends TestBase { chkSelectable.setImmediate(true);
chkSelectable.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- table.setSelectable(chkSelectable.booleanValue());
+ table.setSelectable((Boolean) chkSelectable.getValue());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html index fbb6f4c7f9..bfdf180e8b 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html +++ b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.html @@ -27,9 +27,9 @@ <td></td> </tr> <tr> - <td>verifyTextPresent</td> - <td>exact:1: Size 200x200 pixels</td> - <td></td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td> + <td>4. Size 200x200 pixels</td> </tr> <tr> <td>screenCapture</td> @@ -42,9 +42,9 @@ <td></td> </tr> <tr> - <td>verifyTextPresent</td> - <td>exact:2: Size 600x200 pixels<br />1: Size 200x200 pixels</td> - <td></td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td> + <td>5. Size 600x200 pixels</td> </tr> <tr> <td>screenCapture</td> @@ -57,9 +57,9 @@ <td></td> </tr> <tr> - <td>verifyTextPresent</td> - <td>exact:3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td> - <td></td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td> + <td>6. Size undefined</td> </tr> <tr> <td>select</td> @@ -67,9 +67,9 @@ <td>label=4</td> </tr> <tr> - <td>verifyTextPresent</td> - <td>exact:4: Page length: 4<br />3: Size undefined<br />2: Size 600x200 pixels<br />1: Size 200x200 pixels</td> - <td></td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::PID_SLog_row_0</td> + <td>7. Page length: 4</td> </tr> <tr> <td>screenCapture</td> @@ -97,14 +97,14 @@ <td>3,6</td> </tr> <tr> - <td>verifyTextPresent</td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>Column 2</td> - <td></td> </tr> <tr> - <td>verifyTextPresent</td> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableTableUndefinedSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td> <td>Column 3</td> - <td></td> </tr> <tr> <td>screenCapture</td> @@ -121,7 +121,6 @@ <td></td> <td>AllColumnsShown</td> </tr> - </tbody></table> </body> </html> diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java index 2b3204953b..c8e813e23d 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java @@ -5,22 +5,20 @@ import java.util.Arrays; import com.vaadin.data.Container; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.data.util.ObjectProperty; import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Table; public class TableUndefinedSize extends TestBase { - private ObjectProperty<String> output = new ObjectProperty<String>(""); - - private int counter = 1; + private Log log; @Override protected void setup() { @@ -37,17 +35,14 @@ public class TableUndefinedSize extends TestBase { tbl.setImmediate(true); tbl.setColumnCollapsingAllowed(true); - Label output = new Label(this.output); - output.setWidth("400px"); - output.setHeight("100px"); - output.setContentMode(Label.CONTENT_XHTML); + log = new Log(5); controls.addComponent(new Button("Fixed size (200x200)", new Button.ClickListener() { public void buttonClick(ClickEvent event) { tbl.setWidth("200px"); tbl.setHeight("200px"); - print("Size 200x200 pixels"); + log.log("Size 200x200 pixels"); } })); @@ -56,7 +51,7 @@ public class TableUndefinedSize extends TestBase { public void buttonClick(ClickEvent event) { tbl.setWidth("600px"); tbl.setHeight("200px"); - print("Size 600x200 pixels"); + log.log("Size 600x200 pixels"); } })); @@ -64,7 +59,7 @@ public class TableUndefinedSize extends TestBase { new Button.ClickListener() { public void buttonClick(ClickEvent event) { tbl.setSizeUndefined(); - print("Size undefined"); + log.log("Size undefined"); } })); @@ -77,35 +72,39 @@ public class TableUndefinedSize extends TestBase { int pageLength = Integer.valueOf(event.getProperty().getValue() .toString()); tbl.setPageLength(pageLength); - print("Page length: " + pageLength); + log.log("Page length: " + pageLength); } }); controls.addComponent(pageLength); - CheckBox cb = new CheckBox("Column 1", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - tbl.setColumnCollapsed("Column 1", !event.getButton() - .booleanValue()); - if (event.getButton().booleanValue()) { - print("Column 1 visible"); + CheckBox cb = new CheckBox("Column 1"); + cb.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + Boolean value = (Boolean) event.getProperty().getValue(); + tbl.setColumnCollapsed("Column 1", !value); + if (value) { + log.log("Column 1 visible"); } else { - print("Column 1 hidden"); + log.log("Column 1 hidden"); } - } + } }); cb.setImmediate(true); cb.setValue(true); visibilities.addComponent(cb); - cb = new CheckBox("Column 2", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - tbl.setColumnCollapsed("Column 2", !event.getButton() - .booleanValue()); + cb = new CheckBox("Column 2"); + cb.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + Boolean value = (Boolean) event.getProperty().getValue(); + tbl.setColumnCollapsed("Column 2", !value); - if (event.getButton().booleanValue()) { - print("Column 2 visible"); + if (value) { + log.log("Column 2 visible"); } else { - print("Column 2 hidden"); + log.log("Column 2 hidden"); } } }); @@ -113,15 +112,19 @@ public class TableUndefinedSize extends TestBase { cb.setValue(true); visibilities.addComponent(cb); - cb = new CheckBox("Column 3", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - tbl.setColumnCollapsed("Column 3", !event.getButton() - .booleanValue()); + cb = new CheckBox("Column 3"); - if (event.getButton().booleanValue()) { - print("Column 3 visible"); + cb.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + Boolean value = (Boolean) event.getProperty().getValue(); + + tbl.setColumnCollapsed("Column 3", !value); + + if (value) { + log.log("Column 3 visible"); } else { - print("Column 3 hidden"); + log.log("Column 3 hidden"); } } }); @@ -129,16 +132,11 @@ public class TableUndefinedSize extends TestBase { cb.setValue(true); visibilities.addComponent(cb); - addComponent(output); + addComponent(log); addComponent(tbl); } - protected void print(String message) { - output.setValue(counter + ": " + message + "<br/>" + output.getValue()); - counter++; - } - protected Container createDataSource() { IndexedContainer c = new IndexedContainer(); c.addContainerProperty("Column 1", String.class, "Column 1"); diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java index ff1ac96e26..f81df5f06b 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java @@ -48,8 +48,8 @@ public class TreeFiltering extends TestBase { filterType.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
- cont.setIncludeParentsWhenFiltering(((CheckBox) event
- .getProperty()).booleanValue());
+ cont.setIncludeParentsWhenFiltering((Boolean) ((CheckBox) event
+ .getProperty()).getValue());
ccTree.requestRepaint();
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html new file mode 100644 index 0000000000..8391ca186d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.html @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>ChangeDataSourcePageLengthZero</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ChangeDataSourcePageLengthZero</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.ChangeDataSourcePageLengthZero?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>initial</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>smallcontainer</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]</td> + <td>12,8</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>expanded</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>addeditem</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableChangeDataSourcePageLengthZero::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>bigcontainer</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java index 701c7a6a36..3d01883deb 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java @@ -31,8 +31,25 @@ public class ChangeDataSourcePageLengthZero extends TestBase { setupContainer(tt, 10);
}
});
+ Button addButton = new Button("Add item");
+ addButton.addListener(new Button.ClickListener() {
+ private int i = 1;
+
+ public void buttonClick(ClickEvent event) {
+ HierarchicalContainer container = (HierarchicalContainer) tt
+ .getContainerDataSource();
+ Object itemId = container.addItem();
+ container.getContainerProperty(itemId, "i").setValue(i++);
+ container.getContainerProperty(itemId, "link").setValue(
+ new Link(String.valueOf(i + 1), new ExternalResource(
+ "http://www.google.fi")));
+ container.setChildrenAllowed(itemId, false);
+ container.setParent(itemId, null);
+ }
+ });
addComponent(page1);
addComponent(page2);
+ addComponent(addButton);
}
private static void setupContainer(TreeTable tt, int num) {
diff --git a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java index 520986148e..ab7833a050 100644 --- a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java +++ b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java @@ -1,11 +1,10 @@ package com.vaadin.tests.components.window; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.util.Log; import com.vaadin.tests.util.LoremIpsum; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; import com.vaadin.ui.Root; @@ -17,7 +16,7 @@ public class LazyWindowResize extends AbstractTestCase { private Root mainWindow; private Window subWindow; - private Button lazyMode; + private CheckBox lazyMode; private Log log = new Log(5); private CheckBox resizeListenerCheckBox; @@ -58,19 +57,19 @@ public class LazyWindowResize extends AbstractTestCase { lazyMode = new CheckBox("Lazy resize"); lazyMode.setImmediate(true); - lazyMode.addListener(new ClickListener() { + lazyMode.addListener(new ValueChangeListener() { - public void buttonClick(ClickEvent event) { - setLazy(lazyMode.booleanValue()); + public void valueChange(ValueChangeEvent event) { + setLazy((Boolean) lazyMode.getValue()); } }); resizeListenerCheckBox = new CheckBox("Resize listener"); resizeListenerCheckBox.setImmediate(true); - resizeListenerCheckBox.addListener(new ClickListener() { + resizeListenerCheckBox.addListener(new ValueChangeListener() { - public void buttonClick(ClickEvent event) { - if (resizeListenerCheckBox.booleanValue()) { + public void valueChange(ValueChangeEvent event) { + if ((Boolean) resizeListenerCheckBox.getValue()) { subWindow.addListener(resizeListener); mainWindow.addListener(resizeListener); } else { @@ -83,11 +82,11 @@ public class LazyWindowResize extends AbstractTestCase { }); immediateCheckBox = new CheckBox("Windows immediate"); immediateCheckBox.setImmediate(true); - immediateCheckBox.addListener(new ClickListener() { + immediateCheckBox.addListener(new ValueChangeListener() { - public void buttonClick(ClickEvent event) { - mainWindow.setImmediate(immediateCheckBox.booleanValue()); - subWindow.setImmediate(immediateCheckBox.booleanValue()); + public void valueChange(ValueChangeEvent event) { + mainWindow.setImmediate((Boolean) immediateCheckBox.getValue()); + subWindow.setImmediate((Boolean) immediateCheckBox.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java index 62f998e20e..a225028726 100644 --- a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java +++ b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java @@ -1,9 +1,10 @@ package com.vaadin.tests.components.window; +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.terminal.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; @@ -43,9 +44,10 @@ public class WindowResizeListener extends TestBase { CheckBox subwindow = new CheckBox("show subwindow"); subwindow.setImmediate(true); - subwindow.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (event.getButton().booleanValue()) { + subwindow.addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + if ((Boolean) event.getProperty().getValue()) { getMainWindow().addWindow(subwin); } else { getMainWindow().removeWindow(subwin); @@ -55,9 +57,10 @@ public class WindowResizeListener extends TestBase { getLayout().addComponent(subwindow); CheckBox immediate = new CheckBox("immediate"); - immediate.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - boolean booleanValue = event.getButton().booleanValue(); + immediate.addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean booleanValue = (Boolean) event.getProperty().getValue(); getMainWindow().setImmediate(booleanValue); subwin.setImmediate(booleanValue); } diff --git a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java index 0d47cc426d..23521d5164 100644 --- a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java +++ b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java @@ -1,6 +1,8 @@ package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -84,17 +86,17 @@ public class BeanItemContainerFilteringTest extends TestBase { filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter on value",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
- container.addContainerFilter("value",
- filterString.getValue().toString(),
- false, false);
- }
- }
- });
+ final CheckBox cb = new CheckBox("Filter on value");
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
+ container.removeAllContainerFilters();
+ if ((Boolean) ((CheckBox) event.getProperty()).getValue()) {
+ container.addContainerFilter("value", filterString
+ .getValue().toString(), false, false);
+ }
+ }
+ });
cb.setImmediate(true);
vl.addComponent(cb);
diff --git a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java index 154118a393..9b41523068 100644 --- a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java +++ b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java @@ -1,6 +1,8 @@ package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -51,10 +53,12 @@ public class IndexedContainerFilteringTest extends TestBase { filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ final CheckBox cb = new CheckBox("Filter");
+ cb.addListener(new ValueChangeListener() {
+
+ public void valueChange(ValueChangeEvent event) {
container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
+ if ((Boolean) ((CheckBox) event.getProperty()).getValue()) {
container.addContainerFilter("column1", filterString
.getValue().toString(), false, false);
}
diff --git a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java index bf7ce6175a..0a1c592876 100644 --- a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java +++ b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java @@ -29,8 +29,8 @@ public class TestItemSorter extends TestBase { public int compare(Object o1, Object o2) { if (o1 instanceof CheckBox && o2 instanceof CheckBox) { - Boolean b1 = ((CheckBox) o1).booleanValue(); - return b1.compareTo(((CheckBox) o2).booleanValue()); + Boolean b1 = (Boolean) ((CheckBox) o1).getValue(); + return b1.compareTo((Boolean) ((CheckBox) o2).getValue()); } else if (o1 instanceof Button && o2 instanceof Button) { String caption1 = ((Button) o1).getCaption().toLowerCase(); String caption2 = ((Button) o2).getCaption().toLowerCase(); diff --git a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java index 4a719bfa7f..4ef7023aa6 100644 --- a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java +++ b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java @@ -48,7 +48,7 @@ public class TreeDragStart extends TestBase { checkBox.setValue(true); checkBox.addListener(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { - if (((CheckBox) event.getProperty()).booleanValue()) { + if ((Boolean) ((CheckBox) event.getProperty()).getValue()) { tree.setDragMode(TreeDragMode.NODE); } else { tree.setDragMode(TreeDragMode.NONE); diff --git a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java index 2cfda04312..9022f531f3 100644 --- a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java +++ b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java @@ -1,9 +1,9 @@ package com.vaadin.tests.integration; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Root; import com.vaadin.ui.Window; @@ -20,15 +20,16 @@ public class EmbedSizeTest extends TestBase { mainWindow.getContent().setSizeUndefined(); mainWindow.setImmediate(true); - CheckBox lazyCheckBox = new CheckBox("Lazy resize", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - boolean resizeLazy = Boolean.TRUE == event.getButton() - .getValue(); - getMainWindow().setResizeLazy(resizeLazy); - log.log("Resize lazy: " + resizeLazy); - } - }); + CheckBox lazyCheckBox = new CheckBox("Lazy resize"); + lazyCheckBox.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + CheckBox cb = (CheckBox) event.getProperty(); + Boolean resizeLazy = (Boolean) cb.getValue(); + getMainWindow().setResizeLazy(resizeLazy); + log.log("Resize lazy: " + resizeLazy); + } + }); lazyCheckBox.setValue(Boolean.FALSE); lazyCheckBox.setImmediate(true); addComponent(lazyCheckBox); diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java index 0630587b9f..de255e0b54 100644 --- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java +++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java @@ -5,15 +5,17 @@ import java.util.Iterator; import java.util.Locale; import com.vaadin.Application; +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.event.Action; import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.Resource; import com.vaadin.terminal.ThemeResource; +import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.Accordion; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; @@ -140,7 +142,7 @@ public class LiferayThemeDemo extends Application.LegacyApplication { l.setMargin(true); l.setSpacing(true); - Button b = new Button("Normal Button"); + AbstractComponent b = new Button("Normal Button"); b.setDescription("This is a tooltip!"); l.addComponent(b); @@ -311,12 +313,14 @@ public class LiferayThemeDemo extends Application.LegacyApplication { } } - closable.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + closable.addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { Iterator<Component> it = ts.getComponentIterator(); for (; it.hasNext();) { Component c = it.next(); - ts.getTab(c).setClosable(event.getButton().booleanValue()); + ts.getTab(c).setClosable( + (Boolean) event.getProperty().getValue()); } } }); @@ -463,12 +467,13 @@ public class LiferayThemeDemo extends Application.LegacyApplication { sp3.setSecondComponent(sp4); l.addComponent(sp3); - lockCheckBox.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - sp.setLocked(event.getButton().booleanValue()); - sp2.setLocked(event.getButton().booleanValue()); - sp3.setLocked(event.getButton().booleanValue()); - sp4.setLocked(event.getButton().booleanValue()); + lockCheckBox.addListener(new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + sp.setLocked((Boolean) event.getProperty().getValue()); + sp2.setLocked((Boolean) event.getProperty().getValue()); + sp3.setLocked((Boolean) event.getProperty().getValue()); + sp4.setLocked((Boolean) event.getProperty().getValue()); } }); diff --git a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java index e29c7559b3..bef997775d 100644 --- a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java +++ b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java @@ -1,8 +1,8 @@ package com.vaadin.tests.layouts; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.FormLayout; import com.vaadin.ui.TextField; @@ -24,15 +24,16 @@ public class FormLayoutWithInvisibleComponent extends TestBase { @Override protected void setup() { FormLayout formLayout = new FormLayout(); - CheckBox control = new CheckBox("Messages On/Off", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - messages.setVisible(event.getButton().booleanValue()); - messages.setRequired(true); - messages.setCaption("Messages visible"); - } - - }); + CheckBox control = new CheckBox("Messages On/Off"); + control.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + messages.setVisible((Boolean) event.getProperty().getValue()); + messages.setRequired(true); + messages.setCaption("Messages visible"); + } + + }); control.setImmediate(true); formLayout.addComponent(control); diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java index 31ee15983e..992c037611 100644 --- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java +++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java @@ -69,7 +69,7 @@ public class TestLayoutPerformance extends TestBase { Layout layout = getCurrentLayout();
for (int i = 0; i < components; i++) {
Component component = newTestComponent();
- if (cb.booleanValue()) {
+ if ((Boolean) cb.getValue()) {
component.setCaption("caption " + i);
}
layout.addComponent(component);
diff --git a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java index 80ce92a85a..562a2176e2 100644 --- a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java +++ b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java @@ -1,5 +1,7 @@ package com.vaadin.tests.themes; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.UserError; import com.vaadin.ui.Button; @@ -29,8 +31,10 @@ public class ButtonsTest extends com.vaadin.Application.LegacyApplication { setMainWindow(main); setTheme("reindeer"); - themeToggle = new CheckBox("Runo theme", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + themeToggle = new CheckBox("Runo theme"); + themeToggle.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { if (getTheme() == "reindeer") { setTheme("runo"); } else { @@ -41,8 +45,10 @@ public class ButtonsTest extends com.vaadin.Application.LegacyApplication { themeToggle.setStyleName("small"); themeToggle.setImmediate(true); - styleToggle = new CheckBox("Black style", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + styleToggle = new CheckBox("Black style"); + styleToggle.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { if (!main.getContent().getStyleName().contains("black")) { main.getContent().setStyleName("black"); } else { @@ -53,8 +59,10 @@ public class ButtonsTest extends com.vaadin.Application.LegacyApplication { styleToggle.setImmediate(true); styleToggle.setStyleName("small"); - iconToggle = new CheckBox("64x icons", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + iconToggle = new CheckBox("64x icons"); + iconToggle.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { largeIcons = !largeIcons; recreateAll(); } @@ -62,13 +70,14 @@ public class ButtonsTest extends com.vaadin.Application.LegacyApplication { iconToggle.setImmediate(true); iconToggle.setStyleName("small"); - nativeToggle = new CheckBox("Native buttons", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - nativeButtons = !nativeButtons; - recreateAll(); - } - }); + nativeToggle = new CheckBox("Native buttons"); + nativeToggle.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + nativeButtons = !nativeButtons; + recreateAll(); + } + }); nativeToggle.setImmediate(true); nativeToggle.setStyleName("small"); @@ -155,4 +164,4 @@ public class ButtonsTest extends com.vaadin.Application.LegacyApplication { return hl; } -}
\ No newline at end of file +} diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java index 6eb463ddb1..d30b24796b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java @@ -139,9 +139,6 @@ public class Ticket1710 extends com.vaadin.Application.LegacyApplication { private Form getFormPanelExample() {
Form f = new Form();
f.setCaption("Test form");
- Button fb1 = new Button("Test button");
- fb1.setComponentError(new SystemError("Test error"));
- f.addField("fb1", fb1);
CheckBox fb2 = new CheckBox("Test button", true);
fb2.setComponentError(new SystemError("Test error"));
f.addField("fb2", fb2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java index ac2fe18710..60c7e07da7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java @@ -1,10 +1,11 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; import com.vaadin.terminal.Sizeable; import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Layout; @@ -114,11 +115,11 @@ public class Ticket1983 extends Application.LegacyApplication { ol.addComponent(button); leftSide.setFirstComponent(ol); - button = new CheckBox("Two col"); - button.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - if (((Boolean) b.getValue()).booleanValue()) { + CheckBox checkBox = new CheckBox("Two col"); + checkBox.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + if ((Boolean) event.getProperty().getValue()) { table.setVisibleColumns(new Object[] { propId, propId2 }); } else { table.setVisibleColumns(new Object[] { propId }); @@ -127,7 +128,7 @@ public class Ticket1983 extends Application.LegacyApplication { } }); - ol.addComponent(button); + ol.addComponent(checkBox); return leftSide; } diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java index b909f894fc..49dfe951c7 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java @@ -23,7 +23,7 @@ public class Ticket2001 extends Application.LegacyApplication { final CheckBox b = new CheckBox("fixed width: 30px", false); b.addListener(new Property.ValueChangeListener() { public void valueChange(ValueChangeEvent event) { - if (b.booleanValue()) { + if ((Boolean) b.getValue()) { l.setWidth("30px"); } else { l.setWidth(null); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java index 7501694cab..4d28f7e36c 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java @@ -36,7 +36,7 @@ public class Ticket2038 extends Application.LegacyApplication { b.setImmediate(true); b.addListener(new Property.ValueChangeListener() { public void valueChange(ValueChangeEvent event) { - tf.setRequiredError(b.booleanValue() ? "Field must not be empty" + tf.setRequiredError((Boolean) b.getValue() ? "Field must not be empty" : null); } }); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java index a1bce499ba..7d592c334b 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java @@ -1,12 +1,12 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.MethodProperty; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; @@ -48,8 +48,10 @@ public class Ticket2104 extends Application.LegacyApplication { "multiSelect")); cb.setImmediate(true); ol.addComponent(cb); - cb = new CheckBox("icon", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { + cb = new CheckBox("icon"); + cb.addListener(new ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { if (tree.getItemIconPropertyId() == null) { tree.setItemIconPropertyId("icon"); } else { diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java index e8c7002d2f..547db61cab 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java @@ -51,7 +51,7 @@ public class Ticket2107 extends Application.LegacyApplication { b.setImmediate(true); b.addListener(new Property.ValueChangeListener() { public void valueChange(ValueChangeEvent event) { - tf.setRequiredError(b.booleanValue() ? "Field must not be empty" + tf.setRequiredError((Boolean) b.getValue() ? "Field must not be empty" : null); } }); diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java index 962aa84101..40bb4024d2 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java @@ -2,6 +2,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.AbstractField; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; @@ -38,16 +40,36 @@ public class Ticket2151 extends Application.LegacyApplication { layout.addComponent(new Label("b")); layout.addComponent(new Label("c")); - check(Button.class); - check(CheckBox.class); - checkDataBinding(Button.class); + checkButton(Button.class); + checkCheckBox(CheckBox.class); checkDataBinding(CheckBox.class); } - private void check(Class<? extends Button> class1) { + private void checkButton(Class<? extends Button> class1) { boolean ok = false; - Button b; + AbstractComponent b; + try { + b = class1.newInstance(); + b.setCaption("Button of type " + class1.getSimpleName()); + ok = true; + } catch (Exception e1) { + e1.printStackTrace(); + } + + if (ok) { + status.setValue(status.getValue() + " " + + class1.getClass().getSimpleName() + ": OK"); + } else { + status.setValue(status.getValue() + " " + + class1.getClass().getSimpleName() + ": FAILED"); + } + + } + + private void checkCheckBox(Class<? extends CheckBox> class1) { + boolean ok = false; + CheckBox b; try { b = class1.newInstance(); b.setCaption("Button of type " + class1.getSimpleName()); @@ -74,9 +96,9 @@ public class Ticket2151 extends Application.LegacyApplication { } - private void checkDataBinding(Class<? extends Button> class1) { + private void checkDataBinding(Class<? extends AbstractField> class1) { boolean ok = false; - Button b; + AbstractField b; try { b = class1.newInstance(); b.setCaption("Button of type " + class1.getSimpleName()); diff --git a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java index b1d6a8f068..936c843abd 100644 --- a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java +++ b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java @@ -98,7 +98,8 @@ public class EmptyFieldErrorIndicators extends TestBase { // same as basic DateField
// form.addField("Popup Date", new PopupDateField("Date"));
Button setDateButton = new Button("Set date");
- form.addField("Set Date", setDateButton);
+ form.getLayout().addComponent(setDateButton);
+ // form.addField("Set Date", setDateButton);
setDateButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
form.getField("Date").setValue(new Date(0));
|