You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScrollbarBundle.java 31KB

Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
Migrating 7.7.1, 7.7.2, 7.7.3 to V8. commit 11c3f8bd9ea65f7a7b8da9a282c31a127bd475a6 - Test and its UI class are added (both V8 and V7). Required functionality should be available via modern GWT version. commit 729dbf96fe76e7627168ab2c9d1d71c4eb7214c8 - About update release notes. No need to be included. commit 675f38349c43ac45dae40cf33a7b1fd0f8f261ca - V8 already contains correct Import-Packages section which uses osgi.javax.servlet.version variable whise version is 3.0.0 at the moment. commit 5da7c052f55cb4703b74f38f5bb19fc3f3fa2a76 - Use Vaadin plugin 7.7.0 from 7.7.0.alpha1. Is not applicable. commit 1df80001ab6c916effa917781dba652d09d01056 - Updated tutorial to Vaadin 7.7.0. Is not applicable. The tutorial already contains correct links and updated source code snippets. commit 8b4f0ed8a894b04902a5d4258119dcdc8e76d1e0 - set-property-fallback name="user.agent" value="safari". Is already there. commit 28ed04e827669cc4dd329331dac9699bd93f70bc - Fix animation end listeners so they are always removed. Is already there. commit 408253bc3f8bd3975f0525ce6832be214a3552e9 - Use servlet context classloader when finding servlet class for websockets. Is already there. commit 7a6f250d89474849648ed2ee96a6bfb78c3b9ca8 - Fire actions before removing menu from the DOM. Is already there. commit 9b66c6eb9bebf657d3f2def8c767e0e9d51cc92c - Do not run test on IE8 as IE8 is broken. Transplanted. commit 3faa43ff39ecda56587b93f0c5e262a2907871a7 - Discard for DateField when the data source contains null. It is not applicable for V8 (There is no anymore discard method in DateField (and no datasource suport in field)). Transplanted for DateField in compatibility. commit e0c1f91a3d6d1884e07ce8d1ba957aff6a9bf29a - Fix ComboBox paging when number of items equals page length. It's already done by another fix which replaced ComboBox in compatibility package to the V7 version. commit 83a1b8a0961cc9b2d43e01757530cefd035b0a22 - Update DOM and update escalator row count in the correct order. Transplanted. commit 45f2fba8ff7a4b62680618a325d4afcebfb7a1e9 - Prevent editor from being canceled while it is being saved. Transplanted to compatibility package. Is not applicable to modern Grid. commit ad67f7f43afb0feec5e029aea90297f2abe4f2c1 - Delete broken stylesheet and revert to default style until a new stylesheet is created. Is already there. commit c970a78d42a2d8f1745df7a11a74f3731f8be9a5 - Always show loading indicator for JavaScript RPC. Transplanted. commit 2aad3416061586f7e2649160bd832eefe03702ad - Make test independent of any converters present in the factory. It's already there. commit c9ad48430be135d18fe9f30868e091dd51c57b94 - Do not include yuicompressor for Sass compiler. Transplanted. Exclusion is added into vaadin/pom.xml commit 52d01a68e91ce73306b3a1747af97e928048ecdf - Test for Firefox download disconnecting push channel. Transplanted. commit 4bc375d1d21f468e6433da3a183150e0bfe0cae4 - Handle encoded URL characters correctly when constructing widget set name. Transplanted. commit 17ba88eaf87e15e6f3c729e5c7f8e875d5f86d8d - Update version to 7.7-SNAPSHOT. Is not applicable. commit 47b7b13e5c959de3bd925693b074d85e7625a87e - Ensure Firefox always updates the grid scrollbar. Transplanted. Made changes in the logic to the test for modern Grid component. commit 4d851ba21d1b8f35685b631d2845731f8fb33252 - Calculate column widths immediately if there is data. Transplanted to both client side modules. commit 8f0b1a1dd026a756912c9f21bd2b34ea46897c7f - Skip Maven enforcer plugin during demo validation. Transplanted (one build file is affected). commit 62815353e1b9d3cd126809f5c818ad35bf913807 - Build demos from 7.7 branch (now for master branch). FW8 demos are added (one build file is affected). commit 815d72115d5aaf3676daefd5642115577e4151ef - Make test pass on all browsers. Transplanted to both V7 and V8 version tests. commit 516c428ca127e3c31b7b4d74220e4b7eed4571be - Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit b00c580ed70f682a42afbfa91f978921bb86c2cd - Use correct column index when calculating min width during resize. Transplanted into both client side classes (main and compatibility) as is. Test for V7 is transplanted as is. Test for V8 is written from scratch based on V7 version. commit 7dd91cf057eb06a09009096a8278f34aad9bd8d9 - Fix regression that broke widget set compilation in 7.7.1. It's already there. commit c665731b0b97b697e80c47955d3558c19f0c81cb - Ensure temporary layout manager state is cleared at the end of a layout phase. Transplanted to the one LayoutManager class. commit 57a965251afdb5ee9ac1913a0101d854d8215aa6 - Fix assertion error when column widths are calculated. Transplanted to both versions of the client Grid widget. commit c5c52684eb30d924cb75a632b526a0f879d5a33c - Format Java files using Eclipse Neon and Vaadin settings. Only formatting changes. Is not transplanted. f5d06d877165bf413ec71c4fc88cf46c8c57a372 - Change javadoc to a style Eclipse formatter can handle. Transplanted to both versions of the client Grid widget. commit 6033e13c20b3d6e8b6f5add0f786d5ab2e1bb3fe - Make initially disabled grid work when enabled. Transplanted to both client side modules. commit a2d6e4fb4b1fd13e9a1b88f2ab1b78d14d8b64a9 - Use requestAnimationFrame when scrolling in Grid. Transplanted to both client side modules. commit fe9438e7b77c606855cfd739dd7e30b3f8cd4165 - Specify branch also for Sampler. Is not applicable for master branch. commit 1ec5d8ef7cb8bbd82bae1c9b79a376a5dca28f48 - Update to Chrome 53. Is already there. commit 961851bfbc4844474299433c34af6c9e4323d891 - Updated link to new step 1 video in tutorial. Is already there. commit 41dc2fe1611adc70d00e6f77debb2a6d4dcdefb0 - Revert "Use widget set specified by init parameter. Transplanted to the one UIProvider class. commit 092b4f7f3192555fe3ae22ac03a89ac2ada2a2dd - Use widget set specified by init parameter. Transplanted to the common server side classes. commit 977cec7e3107c2da306d46449dbf32f6544313be - Fix widget set builder to create widget set in correct location. Transplanted to the one ClassPathExplorer class file. commit 6c12ad89ea1064cd4cc0456baca5ee00ae76d032 - Format project pom files using correct settings. Is not transplanted: only formatting changes for POM files. commit 0aad93ecc1ce743dffc093ce7ae2ef88831f6073 - Add tests for widgetset compilation in different modes. Transplanted. New test projects. commit 0a3a1ef8321ed421be2337034fdb1cae2c434c3d - Use versions-maven-plugin 2.3 to avoid NPE while setting project version. Is already there. Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
7 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.client.widget.escalator;
  17. import com.google.gwt.animation.client.AnimationScheduler;
  18. import com.google.gwt.animation.client.AnimationScheduler.AnimationSupportDetector;
  19. import com.google.gwt.core.client.Scheduler;
  20. import com.google.gwt.core.client.Scheduler.ScheduledCommand;
  21. import com.google.gwt.dom.client.Element;
  22. import com.google.gwt.dom.client.Style.Display;
  23. import com.google.gwt.dom.client.Style.Overflow;
  24. import com.google.gwt.dom.client.Style.Unit;
  25. import com.google.gwt.dom.client.Style.Visibility;
  26. import com.google.gwt.event.shared.EventHandler;
  27. import com.google.gwt.event.shared.GwtEvent;
  28. import com.google.gwt.event.shared.HandlerManager;
  29. import com.google.gwt.event.shared.HandlerRegistration;
  30. import com.google.gwt.user.client.DOM;
  31. import com.google.gwt.user.client.Event;
  32. import com.google.gwt.user.client.Timer;
  33. import com.vaadin.client.BrowserInfo;
  34. import com.vaadin.client.DeferredWorker;
  35. import com.vaadin.client.WidgetUtil;
  36. import com.vaadin.client.widget.grid.events.ScrollEvent;
  37. import com.vaadin.client.widget.grid.events.ScrollHandler;
  38. /**
  39. * An element-like bundle representing a configurable and visual scrollbar in
  40. * one axis.
  41. *
  42. * @since 7.4
  43. * @author Vaadin Ltd
  44. * @see VerticalScrollbarBundle
  45. * @see HorizontalScrollbarBundle
  46. */
  47. public abstract class ScrollbarBundle implements DeferredWorker {
  48. private static final boolean SUPPORTS_REQUEST_ANIMATION_FRAME = new AnimationSupportDetector()
  49. .isNativelySupported();
  50. private class ScrollEventFirer {
  51. private final ScheduledCommand fireEventCommand = () -> {
  52. /*
  53. * Some kind of native-scroll-event related asynchronous problem
  54. * occurs here (at least on desktops) where the internal bookkeeping
  55. * isn't up to date with the real scroll position. The weird thing
  56. * is, that happens only once, and if you drag scrollbar fast
  57. * enough. After it has failed once, it never fails again.
  58. *
  59. * Theory: the user drags the scrollbar, and this command is
  60. * executed before the browser has a chance to fire a scroll event
  61. * (which normally would correct this situation). This would explain
  62. * why slow scrolling doesn't trigger the problem, while fast
  63. * scrolling does.
  64. *
  65. * To make absolutely sure that we have the latest scroll position,
  66. * let's update the internal value.
  67. *
  68. * This might lead to a slight performance hit (on my computer it
  69. * was never more than 3ms on either of Chrome 38 or Firefox 31). It
  70. * also _slightly_ counteracts the purpose of the internal
  71. * bookkeeping. But since getScrollPos is called 3 times (on one
  72. * direction) per scroll loop, it's still better to have take this
  73. * small penalty than removing it altogether.
  74. */
  75. updateScrollPosFromDom();
  76. getHandlerManager().fireEvent(new ScrollEvent());
  77. isBeingFired = false;
  78. };
  79. private boolean isBeingFired;
  80. public void scheduleEvent() {
  81. if (!isBeingFired) {
  82. /*
  83. * We'll gather all the scroll events, and only fire once, once
  84. * everything has calmed down.
  85. */
  86. if (SUPPORTS_REQUEST_ANIMATION_FRAME) {
  87. // Chrome MUST use this as deferred commands will sometimes
  88. // be run with a 300+ ms delay when scrolling.
  89. AnimationScheduler.get().requestAnimationFrame(
  90. timestamp -> fireEventCommand.execute());
  91. } else {
  92. // Does not support requestAnimationFrame and the fallback
  93. // uses a delay of 16ms, we stick to the old deferred
  94. // command which uses a delay of 0ms
  95. Scheduler.get().scheduleDeferred(fireEventCommand);
  96. }
  97. isBeingFired = true;
  98. }
  99. }
  100. }
  101. /**
  102. * The orientation of the scrollbar.
  103. */
  104. public enum Direction {
  105. VERTICAL, HORIZONTAL;
  106. }
  107. private class TemporaryResizer {
  108. private static final int TEMPORARY_RESIZE_DELAY = 1000;
  109. private final Timer timer = new Timer() {
  110. @Override
  111. public void run() {
  112. internalSetScrollbarThickness(1);
  113. root.getStyle().setVisibility(Visibility.HIDDEN);
  114. }
  115. };
  116. public void show() {
  117. internalSetScrollbarThickness(OSX_INVISIBLE_SCROLLBAR_FAKE_SIZE_PX);
  118. root.getStyle().setVisibility(Visibility.VISIBLE);
  119. timer.schedule(TEMPORARY_RESIZE_DELAY);
  120. }
  121. }
  122. /**
  123. * A means to listen to when the scrollbar handle in a
  124. * {@link ScrollbarBundle} either appears or is removed.
  125. */
  126. public interface VisibilityHandler extends EventHandler {
  127. /**
  128. * This method is called whenever the scrollbar handle's visibility is
  129. * changed in a {@link ScrollbarBundle}.
  130. *
  131. * @param event
  132. * the {@link VisibilityChangeEvent}
  133. */
  134. void visibilityChanged(VisibilityChangeEvent event);
  135. }
  136. public static class VisibilityChangeEvent
  137. extends GwtEvent<VisibilityHandler> {
  138. public static final Type<VisibilityHandler> TYPE = new Type<ScrollbarBundle.VisibilityHandler>() {
  139. @Override
  140. public String toString() {
  141. return "VisibilityChangeEvent";
  142. }
  143. };
  144. private final boolean isScrollerVisible;
  145. private VisibilityChangeEvent(boolean isScrollerVisible) {
  146. this.isScrollerVisible = isScrollerVisible;
  147. }
  148. /**
  149. * Checks whether the scroll handle is currently visible or not.
  150. *
  151. * @return <code>true</code> if the scroll handle is currently visible.
  152. * <code>false</code> if not.
  153. */
  154. public boolean isScrollerVisible() {
  155. return isScrollerVisible;
  156. }
  157. @Override
  158. public Type<VisibilityHandler> getAssociatedType() {
  159. return TYPE;
  160. }
  161. @Override
  162. protected void dispatch(VisibilityHandler handler) {
  163. handler.visibilityChanged(this);
  164. }
  165. }
  166. /**
  167. * The pixel size for OSX's invisible scrollbars.
  168. * <p>
  169. * Touch devices don't show a scrollbar at all, so the scrollbar size is
  170. * irrelevant in their case. There doesn't seem to be any other popular
  171. * platforms that has scrollbars similar to OSX. Thus, this behavior is
  172. * tailored for OSX only, until additional platforms start behaving this
  173. * way.
  174. */
  175. private static final int OSX_INVISIBLE_SCROLLBAR_FAKE_SIZE_PX = 13;
  176. /**
  177. * A representation of a single vertical scrollbar.
  178. *
  179. * @see VerticalScrollbarBundle#getElement()
  180. */
  181. public static final class VerticalScrollbarBundle extends ScrollbarBundle {
  182. @Override
  183. public void setStylePrimaryName(String primaryStyleName) {
  184. super.setStylePrimaryName(primaryStyleName);
  185. root.addClassName(primaryStyleName + "-scroller-vertical");
  186. }
  187. @Override
  188. protected void internalSetScrollPos(int px) {
  189. root.setScrollTop(px);
  190. }
  191. @Override
  192. protected int internalGetScrollPos() {
  193. return root.getScrollTop();
  194. }
  195. @Override
  196. protected void internalSetScrollSize(double px) {
  197. scrollSizeElement.getStyle().setHeight(px, Unit.PX);
  198. }
  199. @Override
  200. protected String internalGetScrollSize() {
  201. return scrollSizeElement.getStyle().getHeight();
  202. }
  203. @Override
  204. protected void internalSetOffsetSize(double px) {
  205. root.getStyle().setHeight(px, Unit.PX);
  206. }
  207. @Override
  208. public String internalGetOffsetSize() {
  209. return root.getStyle().getHeight();
  210. }
  211. @Override
  212. protected void internalSetScrollbarThickness(double px) {
  213. root.getStyle().setPaddingRight(px, Unit.PX);
  214. root.getStyle().setWidth(0, Unit.PX);
  215. scrollSizeElement.getStyle().setWidth(px, Unit.PX);
  216. }
  217. @Override
  218. protected String internalGetScrollbarThickness() {
  219. return scrollSizeElement.getStyle().getWidth();
  220. }
  221. @Override
  222. protected void internalForceScrollbar(boolean enable) {
  223. if (enable) {
  224. root.getStyle().setOverflowY(Overflow.SCROLL);
  225. } else {
  226. root.getStyle().clearOverflowY();
  227. }
  228. }
  229. @Override
  230. public Direction getDirection() {
  231. return Direction.VERTICAL;
  232. }
  233. }
  234. /**
  235. * A representation of a single horizontal scrollbar.
  236. *
  237. * @see HorizontalScrollbarBundle#getElement()
  238. */
  239. public static final class HorizontalScrollbarBundle
  240. extends ScrollbarBundle {
  241. @Override
  242. public void setStylePrimaryName(String primaryStyleName) {
  243. super.setStylePrimaryName(primaryStyleName);
  244. root.addClassName(primaryStyleName + "-scroller-horizontal");
  245. }
  246. @Override
  247. protected void internalSetScrollPos(int px) {
  248. root.setScrollLeft(px);
  249. }
  250. @Override
  251. protected int internalGetScrollPos() {
  252. return root.getScrollLeft();
  253. }
  254. @Override
  255. protected void internalSetScrollSize(double px) {
  256. scrollSizeElement.getStyle().setWidth(px, Unit.PX);
  257. }
  258. @Override
  259. protected String internalGetScrollSize() {
  260. return scrollSizeElement.getStyle().getWidth();
  261. }
  262. @Override
  263. protected void internalSetOffsetSize(double px) {
  264. root.getStyle().setWidth(px, Unit.PX);
  265. }
  266. @Override
  267. public String internalGetOffsetSize() {
  268. return root.getStyle().getWidth();
  269. }
  270. @Override
  271. protected void internalSetScrollbarThickness(double px) {
  272. root.getStyle().setPaddingBottom(px, Unit.PX);
  273. root.getStyle().setHeight(0, Unit.PX);
  274. scrollSizeElement.getStyle().setHeight(px, Unit.PX);
  275. }
  276. @Override
  277. protected String internalGetScrollbarThickness() {
  278. return scrollSizeElement.getStyle().getHeight();
  279. }
  280. @Override
  281. protected void internalForceScrollbar(boolean enable) {
  282. if (enable) {
  283. root.getStyle().setOverflowX(Overflow.SCROLL);
  284. } else {
  285. root.getStyle().clearOverflowX();
  286. }
  287. }
  288. @Override
  289. public Direction getDirection() {
  290. return Direction.HORIZONTAL;
  291. }
  292. }
  293. protected final Element root = DOM.createDiv();
  294. protected final Element scrollSizeElement = DOM.createDiv();
  295. protected boolean isInvisibleScrollbar = false;
  296. private double scrollPos = 0;
  297. private double maxScrollPos = 0;
  298. private boolean scrollHandleIsVisible = false;
  299. private boolean isLocked = false;
  300. /** @deprecated access via {@link #getHandlerManager()} instead. */
  301. @Deprecated
  302. private HandlerManager handlerManager;
  303. private TemporaryResizer invisibleScrollbarTemporaryResizer = new TemporaryResizer();
  304. private final ScrollEventFirer scrollEventFirer = new ScrollEventFirer();
  305. private HandlerRegistration scrollInProgress;
  306. private ScrollbarBundle() {
  307. root.appendChild(scrollSizeElement);
  308. root.getStyle().setDisplay(Display.NONE);
  309. root.setTabIndex(-1);
  310. }
  311. protected abstract String internalGetScrollSize();
  312. /**
  313. * Sets the primary style name.
  314. *
  315. * @param primaryStyleName
  316. * The primary style name to use
  317. */
  318. public void setStylePrimaryName(String primaryStyleName) {
  319. root.setClassName(primaryStyleName + "-scroller");
  320. }
  321. /**
  322. * Gets the root element of this scrollbar-composition.
  323. *
  324. * @return the root element
  325. */
  326. public final Element getElement() {
  327. return root;
  328. }
  329. /**
  330. * Modifies the scroll position of this scrollbar by a number of pixels.
  331. * <p>
  332. * <em>Note:</em> Even though {@code double} values are used, they are
  333. * currently only used as integers as large {@code int} (or small but fast
  334. * {@code long}). This means, all values are truncated to zero decimal
  335. * places.
  336. *
  337. * @param delta
  338. * the delta in pixels to change the scroll position by
  339. */
  340. public final void setScrollPosByDelta(double delta) {
  341. if (delta != 0) {
  342. setScrollPos(getScrollPos() + delta);
  343. }
  344. }
  345. /**
  346. * Modifies {@link #root root's} dimensions in the axis the scrollbar is
  347. * representing.
  348. *
  349. * @param px
  350. * the new size of {@link #root} in the dimension this scrollbar
  351. * is representing
  352. */
  353. protected abstract void internalSetOffsetSize(double px);
  354. /**
  355. * Sets the length of the scrollbar.
  356. *
  357. * @param px
  358. * the length of the scrollbar in pixels
  359. * @see #setOffsetSizeAndScrollSize(double, double)
  360. */
  361. public final void setOffsetSize(final double px) {
  362. boolean newOffsetSizeIsGreaterThanScrollSize = px > getScrollSize();
  363. boolean offsetSizeBecomesGreaterThanScrollSize = showsScrollHandle()
  364. && newOffsetSizeIsGreaterThanScrollSize;
  365. if (offsetSizeBecomesGreaterThanScrollSize && getScrollPos() != 0) {
  366. setScrollPos(0);
  367. setOffsetSizeNow(px);
  368. } else if (px != getOffsetSize()) {
  369. setOffsetSizeNow(px);
  370. }
  371. }
  372. private void setOffsetSizeNow(double px) {
  373. internalSetOffsetSize(Math.max(0, px));
  374. recalculateMaxScrollPos();
  375. forceScrollbar(showsScrollHandle());
  376. fireVisibilityChangeIfNeeded();
  377. }
  378. /**
  379. * Sets the length of the scrollbar and the amount of pixels the scrollbar
  380. * needs to be able to scroll through.
  381. *
  382. * @param offsetPx
  383. * the length of the scrollbar in pixels
  384. * @param scrollPx
  385. * the number of pixels the scrollbar should be able to scroll
  386. * through
  387. */
  388. public final void setOffsetSizeAndScrollSize(final double offsetPx,
  389. final double scrollPx) {
  390. boolean newOffsetSizeIsGreaterThanScrollSize = offsetPx > scrollPx;
  391. boolean offsetSizeBecomesGreaterThanScrollSize = showsScrollHandle()
  392. && newOffsetSizeIsGreaterThanScrollSize;
  393. boolean needsMoreHandling = false;
  394. if (offsetSizeBecomesGreaterThanScrollSize && getScrollPos() != 0) {
  395. setScrollPos(0);
  396. if (offsetPx != getOffsetSize()) {
  397. internalSetOffsetSize(Math.max(0, offsetPx));
  398. }
  399. if (scrollPx != getScrollSize()) {
  400. internalSetScrollSize(Math.max(0, scrollPx));
  401. }
  402. needsMoreHandling = true;
  403. } else {
  404. if (offsetPx != getOffsetSize()) {
  405. internalSetOffsetSize(Math.max(0, offsetPx));
  406. needsMoreHandling = true;
  407. }
  408. if (scrollPx != getScrollSize()) {
  409. internalSetScrollSize(Math.max(0, scrollPx));
  410. needsMoreHandling = true;
  411. }
  412. }
  413. if (needsMoreHandling) {
  414. recalculateMaxScrollPos();
  415. forceScrollbar(showsScrollHandle());
  416. fireVisibilityChangeIfNeeded();
  417. }
  418. }
  419. /**
  420. * Force the scrollbar to be visible with CSS. In practice, this means to
  421. * set either <code>overflow-x</code> or <code>overflow-y</code> to "
  422. * <code>scroll</code>" in the scrollbar's direction.
  423. * <p>
  424. * This method is an IE8 workaround, since it doesn't always show scrollbars
  425. * with <code>overflow: auto</code> enabled.
  426. * <p>
  427. * Firefox on the other hand loses pending scroll events when the scrollbar
  428. * is hidden, so the event must be fired manually.
  429. * <p>
  430. * When IE8 support is dropped, this should really be simplified.
  431. */
  432. protected void forceScrollbar(boolean enable) {
  433. if (enable) {
  434. root.getStyle().clearDisplay();
  435. } else {
  436. if (BrowserInfo.get().isFirefox()) {
  437. /*
  438. * This is related to the Firefox workaround in setScrollSize
  439. * for setScrollPos(0)
  440. */
  441. scrollEventFirer.scheduleEvent();
  442. }
  443. root.getStyle().setDisplay(Display.NONE);
  444. }
  445. internalForceScrollbar(enable);
  446. }
  447. protected abstract void internalForceScrollbar(boolean enable);
  448. /**
  449. * Gets the length of the scrollbar.
  450. *
  451. * @return the length of the scrollbar in pixels
  452. */
  453. public double getOffsetSize() {
  454. return parseCssDimensionToPixels(internalGetOffsetSize());
  455. }
  456. public abstract String internalGetOffsetSize();
  457. /**
  458. * Sets the scroll position of the scrollbar in the axis the scrollbar is
  459. * representing.
  460. * <p>
  461. * <em>Note:</em> Even though {@code double} values are used, they are
  462. * currently only used as integers as large {@code int} (or small but fast
  463. * {@code long}). This means, all values are truncated to zero decimal
  464. * places.
  465. *
  466. * @param px
  467. * the new scroll position in pixels
  468. */
  469. public final void setScrollPos(double px) {
  470. if (isLocked()) {
  471. return;
  472. }
  473. double oldScrollPos = scrollPos;
  474. scrollPos = Math.max(0, Math.min(maxScrollPos, truncate(px)));
  475. if (!WidgetUtil.pixelValuesEqual(oldScrollPos, scrollPos)) {
  476. if (scrollInProgress == null) {
  477. // Only used for tracking that there is "workPending"
  478. scrollInProgress = addScrollHandler(event -> {
  479. scrollInProgress.removeHandler();
  480. scrollInProgress = null;
  481. });
  482. }
  483. if (isInvisibleScrollbar) {
  484. invisibleScrollbarTemporaryResizer.show();
  485. }
  486. /*
  487. * This is where the value needs to be converted into an integer no
  488. * matter how we flip it, since GWT expects an integer value.
  489. * There's no point making a JSNI method that accepts doubles as the
  490. * scroll position, since the browsers themselves don't support such
  491. * large numbers (as of today, 25.3.2014). This double-ranged is
  492. * only facilitating future virtual scrollbars.
  493. */
  494. internalSetScrollPos(toInt32(scrollPos));
  495. }
  496. }
  497. /**
  498. * Should be called whenever this bundle is attached to the DOM (typically,
  499. * from the onLoad of the containing widget). Used to ensure the DOM scroll
  500. * position is maintained when detaching and reattaching the bundle.
  501. *
  502. * @since 7.4.1
  503. */
  504. public void onLoad() {
  505. internalSetScrollPos(toInt32(scrollPos));
  506. }
  507. /**
  508. * Truncates a double such that no decimal places are retained.
  509. * <p>
  510. * E.g. {@code trunc(2.3d) == 2.0d} and {@code trunc(-2.3d) == -2.0d}.
  511. *
  512. * @param num
  513. * the double value to be truncated
  514. * @return the {@code num} value without any decimal digits
  515. */
  516. private static double truncate(double num) {
  517. if (num > 0) {
  518. return Math.floor(num);
  519. } else {
  520. return Math.ceil(num);
  521. }
  522. }
  523. /**
  524. * Modifies the element's scroll position (scrollTop or scrollLeft).
  525. * <p>
  526. * <em>Note:</em> The parameter here is a type of integer (instead of a
  527. * double) by design. The browsers internally convert all double values into
  528. * an integer value. To make this fact explicit, this API has chosen to
  529. * force integers already at this level.
  530. *
  531. * @param px
  532. * integer pixel value to scroll to
  533. */
  534. protected abstract void internalSetScrollPos(int px);
  535. /**
  536. * Gets the scroll position of the scrollbar in the axis the scrollbar is
  537. * representing.
  538. *
  539. * @return the new scroll position in pixels
  540. */
  541. public final double getScrollPos() {
  542. int internalScrollPos = internalGetScrollPos();
  543. assert Math.abs(internalScrollPos
  544. - toInt32(scrollPos)) <= 1 : "calculated scroll position ("
  545. + scrollPos
  546. + ") did not match the DOM element scroll position ("
  547. + internalScrollPos + ")";
  548. return scrollPos;
  549. }
  550. /**
  551. * Retrieves the element's scroll position (scrollTop or scrollLeft).
  552. * <p>
  553. * <em>Note:</em> The parameter here is a type of integer (instead of a
  554. * double) by design. The browsers internally convert all double values into
  555. * an integer value. To make this fact explicit, this API has chosen to
  556. * force integers already at this level.
  557. *
  558. * @return integer pixel value of the scroll position
  559. */
  560. protected abstract int internalGetScrollPos();
  561. /**
  562. * Modifies {@link #scrollSizeElement scrollSizeElement's} dimensions in
  563. * such a way that the scrollbar is able to scroll a certain number of
  564. * pixels in the axis it is representing.
  565. *
  566. * @param px
  567. * the new size of {@link #scrollSizeElement} in the dimension
  568. * this scrollbar is representing
  569. */
  570. protected abstract void internalSetScrollSize(double px);
  571. /**
  572. * Sets the amount of pixels the scrollbar needs to be able to scroll
  573. * through.
  574. *
  575. * @param px
  576. * the number of pixels the scrollbar should be able to scroll
  577. * through
  578. * @see #setOffsetSizeAndScrollSize(double, double)
  579. */
  580. public final void setScrollSize(final double px) {
  581. boolean newScrollSizeIsSmallerThanOffsetSize = px <= getOffsetSize();
  582. boolean scrollSizeBecomesSmallerThanOffsetSize = showsScrollHandle()
  583. && newScrollSizeIsSmallerThanOffsetSize;
  584. if (scrollSizeBecomesSmallerThanOffsetSize && getScrollPos() != 0) {
  585. setScrollPos(0);
  586. setScrollSizeNow(px);
  587. } else if (px != getScrollSize()) {
  588. setScrollSizeNow(px);
  589. }
  590. }
  591. private void setScrollSizeNow(double px) {
  592. internalSetScrollSize(Math.max(0, px));
  593. recalculateMaxScrollPos();
  594. forceScrollbar(showsScrollHandle());
  595. fireVisibilityChangeIfNeeded();
  596. }
  597. /**
  598. * Gets the amount of pixels the scrollbar needs to be able to scroll
  599. * through.
  600. *
  601. * @return the number of pixels the scrollbar should be able to scroll
  602. * through
  603. */
  604. public double getScrollSize() {
  605. return parseCssDimensionToPixels(internalGetScrollSize());
  606. }
  607. /**
  608. * Modifies {@link #scrollSizeElement scrollSizeElement's} dimensions in the
  609. * opposite axis to what the scrollbar is representing.
  610. *
  611. * @param px
  612. * the dimension that {@link #scrollSizeElement} should take in
  613. * the opposite axis to what the scrollbar is representing
  614. */
  615. protected abstract void internalSetScrollbarThickness(double px);
  616. /**
  617. * Sets the scrollbar's thickness.
  618. * <p>
  619. * If the thickness is set to 0, the scrollbar will be treated as an
  620. * "invisible" scrollbar. This means, the DOM structure will be given a
  621. * non-zero size, but {@link #getScrollbarThickness()} will still return the
  622. * value 0.
  623. *
  624. * @param px
  625. * the scrollbar's thickness in pixels
  626. */
  627. public final void setScrollbarThickness(double px) {
  628. isInvisibleScrollbar = (px == 0);
  629. if (isInvisibleScrollbar) {
  630. Event.sinkEvents(root, Event.ONSCROLL);
  631. Event.setEventListener(root,
  632. event -> invisibleScrollbarTemporaryResizer.show());
  633. root.getStyle().setVisibility(Visibility.HIDDEN);
  634. } else {
  635. Event.sinkEvents(root, 0);
  636. Event.setEventListener(root, null);
  637. root.getStyle().clearVisibility();
  638. }
  639. internalSetScrollbarThickness(Math.max(1d, px));
  640. }
  641. /**
  642. * Gets the scrollbar's thickness as defined in the DOM.
  643. *
  644. * @return the scrollbar's thickness as defined in the DOM, in pixels
  645. */
  646. protected abstract String internalGetScrollbarThickness();
  647. /**
  648. * Gets the scrollbar's thickness.
  649. * <p>
  650. * This value will differ from the value in the DOM, if the thickness was
  651. * set to 0 with {@link #setScrollbarThickness(double)}, as the scrollbar is
  652. * then treated as "invisible."
  653. *
  654. * @return the scrollbar's thickness in pixels
  655. */
  656. public final double getScrollbarThickness() {
  657. if (!isInvisibleScrollbar) {
  658. return parseCssDimensionToPixels(internalGetScrollbarThickness());
  659. } else {
  660. return 0;
  661. }
  662. }
  663. /**
  664. * Checks whether the scrollbar's handle is visible.
  665. * <p>
  666. * In other words, this method checks whether the contents is larger than
  667. * can visually fit in the element.
  668. *
  669. * @return <code>true</code> if the scrollbar's handle is visible
  670. */
  671. public boolean showsScrollHandle() {
  672. return getScrollSize() - getOffsetSize() > WidgetUtil.PIXEL_EPSILON;
  673. }
  674. public void recalculateMaxScrollPos() {
  675. double scrollSize = getScrollSize();
  676. double offsetSize = getOffsetSize();
  677. maxScrollPos = Math.max(0, scrollSize - offsetSize);
  678. // make sure that the correct max scroll position is maintained.
  679. setScrollPos(scrollPos);
  680. }
  681. /**
  682. * This is a method that JSNI can call to synchronize the object state from
  683. * the DOM.
  684. */
  685. private final void updateScrollPosFromDom() {
  686. /*
  687. * TODO: this method probably shouldn't be called from Escalator's JSNI,
  688. * but probably could be handled internally by this listening to its own
  689. * element. Would clean up the code quite a bit. Needs further
  690. * investigation.
  691. */
  692. int newScrollPos = internalGetScrollPos();
  693. if (!isLocked()) {
  694. scrollPos = newScrollPos;
  695. scrollEventFirer.scheduleEvent();
  696. } else {
  697. if (scrollPos != newScrollPos) {
  698. // we need to actually undo the setting of the scroll.
  699. internalSetScrollPos(toInt32(scrollPos));
  700. }
  701. if (scrollInProgress != null) {
  702. // cancel the in-progress indicator
  703. scrollInProgress.removeHandler();
  704. scrollInProgress = null;
  705. }
  706. }
  707. }
  708. protected HandlerManager getHandlerManager() {
  709. if (handlerManager == null) {
  710. handlerManager = new HandlerManager(this);
  711. }
  712. return handlerManager;
  713. }
  714. /**
  715. * Adds handler for the scrollbar handle visibility.
  716. *
  717. * @param handler
  718. * the {@link VisibilityHandler} to add
  719. * @return {@link HandlerRegistration} used to remove the handler
  720. */
  721. public HandlerRegistration addVisibilityHandler(
  722. final VisibilityHandler handler) {
  723. return getHandlerManager().addHandler(VisibilityChangeEvent.TYPE,
  724. handler);
  725. }
  726. private void fireVisibilityChangeIfNeeded() {
  727. final boolean oldHandleIsVisible = scrollHandleIsVisible;
  728. scrollHandleIsVisible = showsScrollHandle();
  729. if (oldHandleIsVisible != scrollHandleIsVisible) {
  730. final VisibilityChangeEvent event = new VisibilityChangeEvent(
  731. scrollHandleIsVisible);
  732. getHandlerManager().fireEvent(event);
  733. }
  734. }
  735. /**
  736. * Converts a double into an integer by JavaScript's terms.
  737. * <p>
  738. * Implementation copied from {@link Element#toInt32(double)}.
  739. *
  740. * @param val
  741. * the double value to convert into an integer
  742. * @return the double value converted to an integer
  743. */
  744. private static native int toInt32(double val)
  745. /*-{
  746. return Math.round(val) | 0;
  747. }-*/;
  748. /**
  749. * Locks or unlocks the scrollbar bundle.
  750. * <p>
  751. * A locked scrollbar bundle will refuse to scroll, both programmatically
  752. * and via user-triggered events.
  753. *
  754. * @param isLocked
  755. * <code>true</code> to lock, <code>false</code> to unlock
  756. */
  757. public void setLocked(boolean isLocked) {
  758. this.isLocked = isLocked;
  759. }
  760. /**
  761. * Checks whether the scrollbar bundle is locked or not.
  762. *
  763. * @return <code>true</code> if the scrollbar bundle is locked
  764. */
  765. public boolean isLocked() {
  766. return isLocked;
  767. }
  768. /**
  769. * Returns the scroll direction of this scrollbar bundle.
  770. *
  771. * @return the scroll direction of this scrollbar bundle
  772. */
  773. public abstract Direction getDirection();
  774. /**
  775. * Adds a scroll handler to the scrollbar bundle.
  776. *
  777. * @param handler
  778. * the handler to add
  779. * @return the registration object for the handler registration
  780. */
  781. public HandlerRegistration addScrollHandler(final ScrollHandler handler) {
  782. return getHandlerManager().addHandler(ScrollEvent.TYPE, handler);
  783. }
  784. private static double parseCssDimensionToPixels(String size) {
  785. /*
  786. * Sizes of elements are calculated from CSS rather than
  787. * element.getOffset*() because those values are 0 whenever display:
  788. * none. Because we know that all elements have populated
  789. * CSS-dimensions, it's better to do it that way.
  790. *
  791. * Another solution would be to make the elements visible while
  792. * measuring and then re-hide them, but that would cause unnecessary
  793. * reflows that would probably kill the performance dead.
  794. */
  795. if (size.isEmpty()) {
  796. return 0;
  797. } else {
  798. assert size.endsWith("px") : "Can't parse CSS dimension \"" + size
  799. + "\"";
  800. return Double.parseDouble(size.substring(0, size.length() - 2));
  801. }
  802. }
  803. @Override
  804. public boolean isWorkPending() {
  805. // Need to include scrollEventFirer.isBeingFired as it might use
  806. // requestAnimationFrame - which is not automatically checked
  807. return scrollInProgress != null || scrollEventFirer.isBeingFired;
  808. }
  809. }