Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

EventTrigger.java 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.extensions;
  17. import com.google.gwt.user.client.Command;
  18. import com.google.gwt.user.client.ui.Widget;
  19. import com.google.web.bindery.event.shared.HandlerRegistration;
  20. /**
  21. * Provides support for triggering an event from a given parts of a component or
  22. * using various events.
  23. * <p>
  24. * Used by features such as {@link FileDownloaderConnector} and
  25. * {@link BrowserWindowOpenerConnector} to listen to a given event on a given
  26. * element. The component is the one responsible for deciding the element and
  27. * the event to listen to.
  28. * <p>
  29. * This is the client side interface.
  30. * <p>
  31. * If the component on the server side implements
  32. * {@code com.vaadin.server.EventTrigger} then this interface should be
  33. * implemented by the {@link Widget} used by the client side connector.
  34. *
  35. * @since 8.4
  36. */
  37. public interface EventTrigger {
  38. /**
  39. * Adds an appropriate event handler on the correct element inside the
  40. * widget and invokes the given file downloader when the event occurs.
  41. *
  42. * @param command
  43. * The command to execute when the event occurs
  44. * @param partInformation
  45. * Information passed from the server, typically telling which
  46. * element to attach the DOM handler to
  47. * @return a registration handler which can be used to remove the handler
  48. */
  49. public HandlerRegistration addTrigger(Command command,
  50. String partInformation);
  51. }