//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.events { import flash.events.Event; import mx.controls.listClasses.IListItemRenderer; /** * The TreeEvent class represents the event object passed to the event * listener for events that are associated with activities * in tree, such as when a tree branch opens or closes. * * @see mx.controls.Tree * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public class TreeEvent extends Event { include "../core/Version.as"; //-------------------------------------------------------------------------- // // Class constants // //-------------------------------------------------------------------------- /** * The TreeEvent.ITEM_CLOSE event type constant indicates that a tree * branch closed or collapsed. * *
The properties of the event object for this event type have the * following values. * Not all properties are meaningful for all kinds of events. * See the detailed property descriptions for more information.
* *Property | Value |
---|---|
itemRenderer |
* The ListItemRenderer for the node that closed |
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
triggerEvent |
* If the node closed in response to a user action, * identifies it as a keyboard action or a mouse action. |
item | the Tree item (node) that closed |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
type | TreeEvent.ITEM_CLOSE |
The properties of the event object for this event type have the * following values. * Not all properties are meaningful for all kinds of events. * See the detailed property descriptions for more information.
* *Property | Value |
---|---|
itemRenderer |
* The ListItemRenderer for the item (node) that opened |
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event listener,
* myButton is the value of the currentTarget . |
triggerEvent |
* If the item (node) opened in response to a user action, * identifies it as a keyboard action or a mouse action. |
item | the Tree node that opened. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
type | TreeEvent.ITEM_OPEN |
The properties of the event object for this event type have the * following values. * Not all properties are meaningful for all kinds of events. * See the detailed property descriptions for more information.
* *Property | Value |
---|---|
animate | Whether to animate the opening * or closing operation. |
bubbles | false |
cancelable | true |
currentTarget | The Object that defines the
* event listener that handles the event. For example, if you use
* myButton.addEventListener() to register an event
* listener, myButton is the value of the currentTarget . |
dispatchEvent | Whether to dispatch an
* ITEM_OPEN or ITEM_CLOSE event
* after the open or close animation is complete. true |
itemRenderer |
* The ListItemRenderer for the item (node) that opened |
item | the Tree node that opened. |
opening | true if the item is opening, false * if it is closing. |
target | The Object that dispatched the event;
* it is not always the Object listening for the event.
* Use the currentTarget property to always access the
* Object listening for the event. |
triggerEvent |
* If the item opened in response to a user action, * identifies it as a keyboard action or a mouse action. |
type | TreeEvent.ITEM_OPENING |
ITEM_OPEN
or
* ITEM_CLOSE
) after the open or close animation
* is complete. Used for ITEM_OPENING type events only.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var dispatchEvent:Boolean;
//----------------------------------
// item
//----------------------------------
/**
* Storage for the item property.
* If you populate the Tree from XML data, access
* the properties for the node as
* event.item.@attribute_name
.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var item:Object;
//----------------------------------
// itemRenderer
//----------------------------------
/**
* The ListItemRenderer for the node that closed or opened.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var itemRenderer:IListItemRenderer;
//----------------------------------
// opening
//----------------------------------
/**
* Used for an ITEM_OPENING
type events only.
* Indicates whether the item
* is opening true
, or closing false
.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var opening:Boolean;
//----------------------------------
// triggerEvent
//----------------------------------
/**
* The low level MouseEvent or KeyboardEvent that triggered this
* event or null
if this event was triggered programatically.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
public var triggerEvent:Event;
//--------------------------------------------------------------------------
//
// Overridden methods: Event
//
//--------------------------------------------------------------------------
/**
* @private
*/
override public function clone():Event
{
return new TreeEvent(type, bubbles, cancelable,
item, itemRenderer, triggerEvent);
}
}
}