| 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 |
/** |
| 16 |
* @fileoverview Definition of the goog.ui.ItemEvent class. |
| 17 |
* |
| 18 |
*/ |
| 19 |
|
| 20 |
goog.provide('goog.ui.ItemEvent'); |
| 21 |
|
| 22 |
|
| 23 |
goog.require('goog.events.Event'); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
/** |
| 28 |
* Generic ui event class for events that take a single item like a menu click |
| 29 |
* event. |
| 30 |
* |
| 31 |
* @constructor |
| 32 |
* @extends {goog.events.Event} |
| 33 |
* @param {string} type Event Type. |
| 34 |
* @param {Object} target Reference to the object that is the target |
| 35 |
* of this event. |
| 36 |
* @param {Object} item The item that was clicked. |
| 37 |
* @final |
| 38 |
*/ |
| 39 |
goog.ui.ItemEvent = function(type, target, item) { |
| 40 |
goog.events.Event.call(this, type, target); |
| 41 |
|
| 42 |
/** |
| 43 |
* Item for the event. The type of this object is specific to the type |
| 44 |
* of event. For a menu, it would be the menu item that was clicked. For a |
| 45 |
* listbox selection, it would be the listitem that was selected. |
| 46 |
* |
| 47 |
* @type {Object} |
| 48 |
*/ |
| 49 |
this.item = item; |
| 50 |
}; |
| 51 |
goog.inherits(goog.ui.ItemEvent, goog.events.Event); |