Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

DragSourceState.java 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.shared.ui.dnd;
  17. import java.util.ArrayList;
  18. import java.util.HashMap;
  19. import java.util.List;
  20. import java.util.Map;
  21. import com.vaadin.shared.communication.SharedState;
  22. import com.vaadin.shared.ui.dnd.criteria.Payload;
  23. /**
  24. * State class containing parameters for DragSourceExtension.
  25. *
  26. * @author Vaadin Ltd
  27. * @since 8.1
  28. */
  29. public class DragSourceState extends SharedState {
  30. /**
  31. * Event identifier for dragend event.
  32. */
  33. public static final String EVENT_DRAGEND = "dragend";
  34. /**
  35. * Event identifier for dragstart event.
  36. */
  37. public static final String EVENT_DRAGSTART = "dragstart";
  38. /**
  39. * Data type {@code "text"} for storing data in {@code DataTransfer} object.
  40. */
  41. public static final String DATA_TYPE_TEXT = "text";
  42. /**
  43. * Data type {@code "Text"}. IE 11 stores data dragged from the desktop as
  44. * "Text" with capital letter.
  45. */
  46. public static final String DATA_TYPE_TEXT_IE = "Text";
  47. /**
  48. * Data type {@code "text/plain"} for reading data from {@code DataTransfer}
  49. * object. Some browsers convert store data with {@code "text"} as {@code
  50. * "text/plain"} when transferring data.
  51. */
  52. public static final String DATA_TYPE_TEXT_PLAIN = "text/plain";
  53. public static final String RESOURCE_DRAG_IMAGE = "drag-image";
  54. /**
  55. * {@code DataTransfer.effectAllowed} parameter for the drag event.
  56. */
  57. public EffectAllowed effectAllowed = EffectAllowed.UNINITIALIZED;
  58. /**
  59. * {@code DataTransfer.types} parameter. Used to keep track of data formats
  60. * set for the drag event.
  61. */
  62. public List<String> types = new ArrayList<>();
  63. /**
  64. * Used to store data in the {@code DataTransfer} object for the drag event.
  65. */
  66. public Map<String, String> data = new HashMap<>();
  67. /**
  68. * Payload for comparing against acceptance criteria. Transferred in the
  69. * {@code DataTransfer} object as data type.
  70. */
  71. public Map<String, Payload> payload = new HashMap<>();
  72. }