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.

VHtml5DragEvent.java 3.5KB

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 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.client.ui.dd;
  17. import com.google.gwt.core.client.JsArrayString;
  18. import com.google.gwt.dom.client.NativeEvent;
  19. import com.vaadin.client.extensions.DropTargetExtensionConnector;
  20. /**
  21. * Helper class to access html5 style drag events.
  22. *
  23. * @author Vaadin Ltd
  24. * @deprecated Since 8.1, no direct replacement currently, see
  25. * {@link DropTargetExtensionConnector}
  26. */
  27. @Deprecated
  28. public class VHtml5DragEvent extends NativeEvent {
  29. protected VHtml5DragEvent() {
  30. }
  31. public final native JsArrayString getTypes()
  32. /*-{
  33. // IE does not support types, return some basic values
  34. return this.dataTransfer.types ? this.dataTransfer.types : ["Text","Url","Html"];
  35. }-*/;
  36. public final native String getDataAsText(String type)
  37. /*-{
  38. var v = this.dataTransfer.getData(type);
  39. return v;
  40. }-*/;
  41. /**
  42. * Works on FF 3.6 and possibly with gears.
  43. *
  44. * @param index
  45. * @return
  46. */
  47. public final native String getFileAsString(int index)
  48. /*-{
  49. if (this.dataTransfer.files.length > 0 && this.dataTransfer.files[0].getAsText) {
  50. return this.dataTransfer.files[index].getAsText("UTF-8");
  51. }
  52. return null;
  53. }-*/;
  54. public final native void setDropEffect(String effect)
  55. /*-{
  56. try {
  57. this.dataTransfer.dropEffect = effect;
  58. } catch (e) {}
  59. }-*/;
  60. public final native String getEffectAllowed()
  61. /*-{
  62. return this.dataTransfer.effectAllowed;
  63. }-*/;
  64. public final native void setEffectAllowed(String effect)
  65. /*-{
  66. this.dataTransfer.effectAllowed = effect;
  67. }-*/;
  68. public final native int getFileCount()
  69. /*-{
  70. return this.dataTransfer.files ? this.dataTransfer.files.length : 0;
  71. }-*/;
  72. public final native VHtml5File getFile(int fileIndex)
  73. /*-{
  74. return this.dataTransfer.files[fileIndex];
  75. }-*/;
  76. /**
  77. * Detects if dropped element is a file. <br>
  78. * Always returns <code>true</code> on Safari even if the dropped element is
  79. * a folder.
  80. */
  81. public final native boolean isFile(int fileIndex)
  82. /*-{
  83. // Chrome >= v21 and Opera >= v?
  84. if (this.dataTransfer.items) {
  85. var item = this.dataTransfer.items[fileIndex];
  86. if (typeof item.webkitGetAsEntry == "function") {
  87. var entry = item.webkitGetAsEntry();
  88. if (typeof entry !== "undefined" && entry !== null) {
  89. return entry.isFile;
  90. }
  91. }
  92. }
  93. // Zero sized files without a type are also likely to be folders
  94. var file = this.dataTransfer.files[fileIndex];
  95. if (file.size == 0 && !file.type) {
  96. return false;
  97. }
  98. // TODO Make it detect folders on all browsers
  99. return true;
  100. }-*/;
  101. public final native void setHtml5DataFlavor(String flavor, String data)
  102. /*-{
  103. this.dataTransfer.setData(flavor, data);
  104. }-*/;
  105. }