itemevent.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2006 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview Definition of the goog.ui.ItemEvent class.
  16. *
  17. */
  18. goog.provide('goog.ui.ItemEvent');
  19. goog.require('goog.events.Event');
  20. /**
  21. * Generic ui event class for events that take a single item like a menu click
  22. * event.
  23. *
  24. * @constructor
  25. * @extends {goog.events.Event}
  26. * @param {string} type Event Type.
  27. * @param {Object} target Reference to the object that is the target
  28. * of this event.
  29. * @param {Object} item The item that was clicked.
  30. * @final
  31. */
  32. goog.ui.ItemEvent = function(type, target, item) {
  33. goog.events.Event.call(this, type, target);
  34. /**
  35. * Item for the event. The type of this object is specific to the type
  36. * of event. For a menu, it would be the menu item that was clicked. For a
  37. * listbox selection, it would be the listitem that was selected.
  38. *
  39. * @type {Object}
  40. */
  41. this.item = item;
  42. };
  43. goog.inherits(goog.ui.ItemEvent, goog.events.Event);