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.

GridState.java 6.1KB

Migrate 7.7.5 branch patches to v8. (#7969) * Prevent adding several scrollbar handlers (#19189). Change-Id: Ib0cc6c6835aab6d263f153362a328bcf2be7bc5c * Prevent adding several scrollbar handlers (#19189). * Keep expand ratio for last row/column when reducing grid layout size (#20297) Change-Id: Iff53a803596f4fc1eae8e4bfa307b9c1f4df961a * Fixed drag and drop failure when message dragged from email client (#20451) When dragging message form email client on Windows, item.webkitGetAsEntry() might return null creating NPE on the client side. Added additional checks for this situation. Change-Id: I569f7e6d0d7b137f24be53d1fbce384695ae8c73 * Change expected pre-release version number pattern in publish report Change-Id: Icdacecc490d2490ea9e262f5c5736c1dece2a89d * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java * Fixed touch scrolling issue in Surface and WP devices (#18737) Fixed by using pointerevents instead of touchevents when the browser is IE11, or Edge. Also added touch-action: none; css rules into escalator.css to prevent default touch behaviour on IE11 and Edge. Does not affect IE8 to IE10 browsers, behaviour on those will stay the same as before the fix. No new unit tests since we do not have automatic touch testing possibilities yet. Please test manually with Surface: IE11 and Edge, use for example uitest: com.vaadin.tests.components.grid.basics.GridBasicsomponents.grid.basics.GridBasics Change-Id: Iddbf1852e6ffafc855f749d6f4ebb235ed0f5703 * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 # Conflicts: # client/src/main/java/com/vaadin/client/connectors/GridConnector.java # client/src/main/java/com/vaadin/client/widgets/Grid.java # server/src/main/java/com/vaadin/ui/Grid.java # shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java # themes/src/main/themes/VAADIN/themes/base/grid/grid.scss # uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java Change-Id: Ieca56121875198ed559a41c143b28926e2695433 * Fix NPE in case some items don't contain all properties of Grid. This could occur in when parent is a different entity than its children in hierarchical data. Change-Id: Icd53b5b5e5544a3680d0cd99702ab78224b2dc08 # Conflicts: # server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java # server/src/main/java/com/vaadin/ui/Grid.java * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 * Removed V8 VTextField unused import, forgotten @RunLocally. * Don't rely on selenium "sendKeys" behavior. * Revert "Change expected pre-release version number pattern in publish report" This reverts commit 8df27b952dddb691aead6a633c5b3724c98bf343. * Migrate TextField/TextArea patch from 7.7 to master (modern components) Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
7 years ago
Migrate 7.7.5 branch patches to v8. (#7969) * Prevent adding several scrollbar handlers (#19189). Change-Id: Ib0cc6c6835aab6d263f153362a328bcf2be7bc5c * Prevent adding several scrollbar handlers (#19189). * Keep expand ratio for last row/column when reducing grid layout size (#20297) Change-Id: Iff53a803596f4fc1eae8e4bfa307b9c1f4df961a * Fixed drag and drop failure when message dragged from email client (#20451) When dragging message form email client on Windows, item.webkitGetAsEntry() might return null creating NPE on the client side. Added additional checks for this situation. Change-Id: I569f7e6d0d7b137f24be53d1fbce384695ae8c73 * Change expected pre-release version number pattern in publish report Change-Id: Icdacecc490d2490ea9e262f5c5736c1dece2a89d * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java * Fixed touch scrolling issue in Surface and WP devices (#18737) Fixed by using pointerevents instead of touchevents when the browser is IE11, or Edge. Also added touch-action: none; css rules into escalator.css to prevent default touch behaviour on IE11 and Edge. Does not affect IE8 to IE10 browsers, behaviour on those will stay the same as before the fix. No new unit tests since we do not have automatic touch testing possibilities yet. Please test manually with Surface: IE11 and Edge, use for example uitest: com.vaadin.tests.components.grid.basics.GridBasicsomponents.grid.basics.GridBasics Change-Id: Iddbf1852e6ffafc855f749d6f4ebb235ed0f5703 * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 # Conflicts: # client/src/main/java/com/vaadin/client/connectors/GridConnector.java # client/src/main/java/com/vaadin/client/widgets/Grid.java # server/src/main/java/com/vaadin/ui/Grid.java # shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java # themes/src/main/themes/VAADIN/themes/base/grid/grid.scss # uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java Change-Id: Ieca56121875198ed559a41c143b28926e2695433 * Fix NPE in case some items don't contain all properties of Grid. This could occur in when parent is a different entity than its children in hierarchical data. Change-Id: Icd53b5b5e5544a3680d0cd99702ab78224b2dc08 # Conflicts: # server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java # server/src/main/java/com/vaadin/ui/Grid.java * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 * Removed V8 VTextField unused import, forgotten @RunLocally. * Don't rely on selenium "sendKeys" behavior. * Revert "Change expected pre-release version number pattern in publish report" This reverts commit 8df27b952dddb691aead6a633c5b3724c98bf343. * Migrate TextField/TextArea patch from 7.7 to master (modern components) Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
7 years ago
Migrate 7.7.5 branch patches to v8. (#7969) * Prevent adding several scrollbar handlers (#19189). Change-Id: Ib0cc6c6835aab6d263f153362a328bcf2be7bc5c * Prevent adding several scrollbar handlers (#19189). * Keep expand ratio for last row/column when reducing grid layout size (#20297) Change-Id: Iff53a803596f4fc1eae8e4bfa307b9c1f4df961a * Fixed drag and drop failure when message dragged from email client (#20451) When dragging message form email client on Windows, item.webkitGetAsEntry() might return null creating NPE on the client side. Added additional checks for this situation. Change-Id: I569f7e6d0d7b137f24be53d1fbce384695ae8c73 * Change expected pre-release version number pattern in publish report Change-Id: Icdacecc490d2490ea9e262f5c5736c1dece2a89d * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java * Fixed touch scrolling issue in Surface and WP devices (#18737) Fixed by using pointerevents instead of touchevents when the browser is IE11, or Edge. Also added touch-action: none; css rules into escalator.css to prevent default touch behaviour on IE11 and Edge. Does not affect IE8 to IE10 browsers, behaviour on those will stay the same as before the fix. No new unit tests since we do not have automatic touch testing possibilities yet. Please test manually with Surface: IE11 and Edge, use for example uitest: com.vaadin.tests.components.grid.basics.GridBasicsomponents.grid.basics.GridBasics Change-Id: Iddbf1852e6ffafc855f749d6f4ebb235ed0f5703 * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 # Conflicts: # client/src/main/java/com/vaadin/client/connectors/GridConnector.java # client/src/main/java/com/vaadin/client/widgets/Grid.java # server/src/main/java/com/vaadin/ui/Grid.java # shared/src/main/java/com/vaadin/shared/ui/grid/GridState.java # themes/src/main/themes/VAADIN/themes/base/grid/grid.scss # uitest/src/main/java/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java Change-Id: Ieca56121875198ed559a41c143b28926e2695433 * Fix NPE in case some items don't contain all properties of Grid. This could occur in when parent is a different entity than its children in hierarchical data. Change-Id: Icd53b5b5e5544a3680d0cd99702ab78224b2dc08 # Conflicts: # server/src/main/java/com/vaadin/data/fieldgroup/FieldGroup.java # server/src/main/java/com/vaadin/ui/Grid.java * Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50 # Conflicts: # client/src/main/java/com/vaadin/client/ui/VTextField.java # uitest/src/test/java/com/vaadin/tests/components/textfield/TextChangeEventsTest.java * Add lazy/simple resize mode to Grid (#20108) Change-Id: I47427efc28c350382dba8c1f50fd332a3f4585e4 * Removed V8 VTextField unused import, forgotten @RunLocally. * Don't rely on selenium "sendKeys" behavior. * Revert "Change expected pre-release version number pattern in publish report" This reverts commit 8df27b952dddb691aead6a633c5b3724c98bf343. * Migrate TextField/TextArea patch from 7.7 to master (modern components) Mark TextField/TextArea as busy when a text change event is pending (#20469) Change-Id: I404985ae0be1e7dc65171b610032f8649e700f50
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright 2000-2016 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.v7.shared.ui.grid;
  17. import java.util.ArrayList;
  18. import java.util.List;
  19. import com.vaadin.shared.annotations.DelegateToWidget;
  20. import com.vaadin.shared.data.sort.SortDirection;
  21. import com.vaadin.shared.ui.TabIndexState;
  22. /**
  23. * The shared state for the {@link com.vaadin.ui.components.grid.Grid} component
  24. *
  25. * @since 7.4
  26. * @author Vaadin Ltd
  27. */
  28. public class GridState extends TabIndexState {
  29. /**
  30. * A description of which of the three bundled SelectionModels is currently
  31. * in use.
  32. * <p>
  33. * Used as a data transfer object instead of the client/server ones, because
  34. * they don't know about each others classes.
  35. *
  36. * @see com.vaadin.ui.components.grid.Grid.SelectionMode
  37. * @see com.vaadin.client.ui.grid.Grid.SelectionMode
  38. */
  39. public enum SharedSelectionMode {
  40. /**
  41. * Representation of a single selection mode
  42. *
  43. * @see com.vaadin.ui.components.grid.Grid.SelectionMode#SINGLE
  44. * @see com.vaadin.client.ui.grid.Grid.SelectionMode#SINGLE
  45. */
  46. SINGLE,
  47. /**
  48. * Representation of a multiselection mode
  49. *
  50. * @see com.vaadin.ui.components.grid.Grid.SelectionMode#MULTI
  51. * @see com.vaadin.client.ui.grid.Grid.SelectionMode#MULTI
  52. */
  53. MULTI,
  54. /**
  55. * Representation of a no-selection mode
  56. *
  57. * @see com.vaadin.ui.components.grid.Grid.SelectionMode#NONE
  58. * @see com.vaadin.client.ui.grid.Grid.SelectionMode#NONE
  59. */
  60. NONE;
  61. }
  62. /**
  63. * The default value for height-by-rows for both GWT widgets
  64. * {@link com.vaadin.ui.components.grid Grid} and
  65. * {@link com.vaadin.client.ui.grid.Escalator Escalator}
  66. */
  67. public static final double DEFAULT_HEIGHT_BY_ROWS = 10.0d;
  68. /**
  69. * The key in which a row's data can be found
  70. *
  71. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  72. */
  73. public static final String JSONKEY_DATA = "d";
  74. /**
  75. * The key in which a row's own key can be found
  76. *
  77. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  78. */
  79. public static final String JSONKEY_ROWKEY = "k";
  80. /**
  81. * The key in which a row's generated style can be found
  82. *
  83. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  84. */
  85. public static final String JSONKEY_ROWSTYLE = "rs";
  86. /**
  87. * The key in which a generated styles for a row's cells can be found
  88. *
  89. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  90. */
  91. public static final String JSONKEY_CELLSTYLES = "cs";
  92. /**
  93. * The key in which a row's description can be found
  94. *
  95. * @since 7.6
  96. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  97. */
  98. public static final String JSONKEY_ROWDESCRIPTION = "rd";
  99. /**
  100. * The key in which a cell's description can be found
  101. *
  102. * @since 7.6
  103. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int, String)
  104. */
  105. public static final String JSONKEY_CELLDESCRIPTION = "cd";
  106. /**
  107. * The key that tells whether details are visible for the row.
  108. *
  109. * @since 7.5.0
  110. *
  111. * @see com.vaadin.ui.Grid#setDetailsGenerator(com.vaadin.ui.Grid.DetailsGenerator)
  112. * @see com.vaadin.ui.Grid#setDetailsVisible(Object, boolean)
  113. * @see com.vaadin.shared.data.DataProviderRpc#setRowData(int,
  114. * elemental.json.JsonArray)
  115. */
  116. public static final String JSONKEY_DETAILS_VISIBLE = "dv";
  117. /**
  118. * The key that tells whether row is selected.
  119. *
  120. * @since 7.6
  121. */
  122. public static final String JSONKEY_SELECTED = "s";
  123. {
  124. primaryStyleName = "v-grid";
  125. }
  126. /**
  127. * Column resize mode in grid.
  128. */
  129. public ColumnResizeMode columnResizeMode = ColumnResizeMode.ANIMATED;
  130. /**
  131. * Columns in grid.
  132. */
  133. public List<GridColumnState> columns = new ArrayList<>();
  134. /**
  135. * Column order in grid.
  136. */
  137. public List<String> columnOrder = new ArrayList<>();
  138. public GridStaticSectionState header = new GridStaticSectionState();
  139. public GridStaticSectionState footer = new GridStaticSectionState();
  140. /** The number of frozen columns */
  141. public int frozenColumnCount = 0;
  142. /** The height of the Grid in terms of body rows. */
  143. @DelegateToWidget
  144. public double heightByRows = DEFAULT_HEIGHT_BY_ROWS;
  145. /** The mode by which Grid defines its height. */
  146. @DelegateToWidget
  147. public HeightMode heightMode = HeightMode.CSS;
  148. /** Keys of the currently sorted columns */
  149. public String[] sortColumns = new String[0];
  150. /** Directions for each sorted column */
  151. public SortDirection[] sortDirs = new SortDirection[0];
  152. /** The enabled state of the editor interface */
  153. public boolean editorEnabled = false;
  154. /**
  155. * Buffered editor mode
  156. *
  157. * @since 7.6
  158. */
  159. @DelegateToWidget
  160. public boolean editorBuffered = true;
  161. /**
  162. * Whether rows and/or cells have generated descriptions (tooltips)
  163. *
  164. * @since 7.6
  165. */
  166. public boolean hasDescriptions;
  167. /** The caption for the save button in the editor */
  168. @DelegateToWidget
  169. public String editorSaveCaption = GridConstants.DEFAULT_SAVE_CAPTION;
  170. /** The caption for the cancel button in the editor */
  171. @DelegateToWidget
  172. public String editorCancelCaption = GridConstants.DEFAULT_CANCEL_CAPTION;
  173. /** Whether the columns can be reordered */
  174. @DelegateToWidget
  175. public boolean columnReorderingAllowed;
  176. }