<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2006-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.controls
{

import flash.events.FileListEvent;
import flash.events.KeyboardEvent;
import flash.filesystem.File;
import flash.ui.Keyboard;
import mx.collections.ArrayCollection;
import mx.collections.Sort;
import mx.controls.fileSystemClasses.FileSystemControlHelper;
import mx.controls.fileSystemClasses.FileSystemTreeDataDescriptor;
import mx.controls.Tree;
import mx.core.mx_internal;
import mx.core.ScrollPolicy;
import mx.events.FileEvent;
import mx.events.ListEvent;
import mx.events.TreeEvent;
import mx.styles.StyleManager;
import mx.styles.CSSStyleDeclaration;

use namespace mx_internal;

//--------------------------------------
//  Events
//--------------------------------------

/**
 *  Dispatched whenever the <code>directory</code> property changes
 *  for any reason.
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_CHANGE
 */
[Event(name="directoryChange", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user closes an open directory node
 *  using the mouse of keyboard.
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_CLOSING
 */
[Event(name="directoryClosing", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user opens a directory node
 *  using the mouse or keyboard.
 *
 *  <p>This is a cancelable event.
 *  If you call <code>event.preventDefault()</code>,
 *  this control continues to display the current directory
 *  rather than changing to display the subdirectory which was
 *  double-clicked.</p>
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_OPENING
 */
[Event(name="directoryOpening", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user chooses a file by double-clicking it
 *  or by selecting it and pressing Enter.
 *
 *  @eventType mx.events.FileEvent.FILE_CHOOSE
 */
[Event(name="fileChoose", type="mx.events.FileEvent")]

//--------------------------------------
//  Other metadata
//--------------------------------------

[IconFile("FileSystemTree.png")]

[ResourceBundle("aircontrols")]

/**
 *  The FileSystemTree control displays the contents of a
 *  file system directory as a tree.
 *
 *  <p>You specify the directory whose content is displayed by setting
 *  the <code>directory</code> property to an instance
 *  of the flash.filesystem.File class.
 *  (File instances can represent directories as well as files.)
 *  Whenever this property changes for any reason, the control
 *  dispatches a <code>directoryChange</code> event.</p>
 *
 *  <p>You can set the <code>enumerationMode</code> property to specify
 *  whether to show this directory's files, its subdirectories, or both.
 *  There are three ways to show both files and subdirectories within
 *  each tree node: directories first, files first, or intermixed.</p>
 *
 *  <p>You can set the <code>extensions</code> property to filter the list
 *  so that only files with the specified extensions are displayed.
 *  (Extensions on directories are ignored.)
 *  You can also specify an additional filtering function of your own
 *  by setting the <code>filterFunction</code> property.</p>
 *
 *  <p>You can use the <code>showExtensions</code> property to show
 *  or hide file extensions, and the <code>showIcons</code> property
 *  to show or hide icons.</p>
 *
 *  <p>You can do custom-sorting within each tree node by setting
 *  the <code>nameCompareFunction</code> property to a function
 *  that compares two file or directory names.</p>
 *
 *  <p>If the user double-clicks a closed directory node,
 *  or clicks its disclosure icon,
 *  this control dispatches a <code>directoryOpening</code> event.
 *  If the user double-clicks an open directory node,
 *  or clicks its disclosure icon,
 *  this control dispatches a <code>directoryClosing</code> event.
 *  A handler can cancel either event by calling
 *  <code>event.preventDefault()</code> in which case the node doesn't open.</p>
 *
 *  <p>If the user double-clicks a file node,
 *  this control dispatches a <code>select</code> event.</p>
 * 
 *  @mxml
 *
 *  <p>The <code>&lt;mx:FileSystemTree&gt;</code> tag inherits all of the tag
 *  attributes of its superclass and adds the following tag attributes:</p>
 *
 *  <pre>
 *  &lt;mx:FileSystemTree
 *    <strong>Properties</strong>
 *    directory="<i>null</i>"
 *    enumerationMode="directoriesFirst"
 *    extensions="<i>null</i>"
 *    filterFunction="<i>null</i>"
 *    nameCompareFunction="<i>null</i>"
 *    openPaths="<i>null</i>"
 *    selectedPath="<i>null</i>"
 *    selectedPaths="<i>null</i>"
 *    showExtensions="true"
 *    showHidden="false"
 *    showIcons="true"
 * 
 *    <strong>Events</strong>
 *    directoryChange="<i>No default</i>"
 *    directoryClosing="<i>No default</i>"
 *    directoryOpening="<i>No default</i>"
 *    fileChoose="<i>No default</i>"
 *  /&gt;
 *  </pre>
 * 
 *  @see flash.filesystem.File
 */
public class FileSystemTree extends Tree
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  @copy mx.controls.FileSystemList#COMPUTER
     */
    public static const COMPUTER:File = FileSystemControlHelper.COMPUTER;

    //--------------------------------------------------------------------------
    //
    //  Constructor<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2006-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.controls
{

import flash.events.FileListEvent;
import flash.events.KeyboardEvent;
import flash.filesystem.File;
import flash.ui.Keyboard;
import mx.collections.ArrayCollection;
import mx.collections.Sort;
import mx.controls.fileSystemClasses.FileSystemControlHelper;
import mx.controls.fileSystemClasses.FileSystemTreeDataDescriptor;
import mx.controls.Tree;
import mx.core.mx_internal;
import mx.core.ScrollPolicy;
import mx.events.FileEvent;
import mx.events.ListEvent;
import mx.events.TreeEvent;
import mx.styles.StyleManager;
import mx.styles.CSSStyleDeclaration;

use namespace mx_internal;

//--------------------------------------
//  Events
//--------------------------------------

/**
 *  Dispatched whenever the <code>directory</code> property changes
 *  for any reason.
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_CHANGE
 */
[Event(name="directoryChange", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user closes an open directory node
 *  using the mouse of keyboard.
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_CLOSING
 */
[Event(name="directoryClosing", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user opens a directory node
 *  using the mouse or keyboard.
 *
 *  <p>This is a cancelable event.
 *  If you call <code>event.preventDefault()</code>,
 *  this control continues to display the current directory
 *  rather than changing to display the subdirectory which was
 *  double-clicked.</p>
 *
 *  @eventType mx.events.FileEvent.DIRECTORY_OPENING
 */
[Event(name="directoryOpening", type="mx.events.FileEvent")]

/**
 *  Dispatched when the user chooses a file by double-clicking it
 *  or by selecting it and pressing Enter.
 *
 *  @eventType mx.events.FileEvent.FILE_CHOOSE
 */
[Event(name="fileChoose", type="mx.events.FileEvent")]

//--------------------------------------
//  Other metadata
//--------------------------------------

[IconFile("FileSystemTree.png")]

[ResourceBundle("aircontrols")]

/**
 *  The FileSystemTree control displays the contents of a
 *  file system directory as a tree.
 *
 *  <p>You specify the directory whose content is displayed by setting
 *  the <code>directory</code> property to an instance
 *  of the flash.filesystem.File class.
 *  (File instances can represent directories as well as files.)
 *  Whenever this property changes for any reason, the control
 *  dispatches a <code>directoryChange</code> event.</p>
 *
 *  <p>You can set the <code>enumerationMode</code> property to specify
 *  whether to show this directory's files, its subdirectories, or both.
 *  There are three ways to show both files and subdirectories within
 *  each tree node: directories first, files first, or intermixed.</p>
 *
 *  <p>You can set the <code>extensions</code> property to filter the list
 *  so that only files with the specified extensions are displayed.
 *  (Extensions on directories are ignored.)
 *  You can also specify an additional filtering function of your own
 *  by setting the <code>filterFunction</code> property.</p>
 *
 *  <p>You can use the <code>showExtensions</code> property to show
 *  or hide file extensions, and the <code>showIcons</code> property
 *  to show or hide icons.</p>
 *
 *  <p>You can do custom-sorting within each tree node by setting
 *  the <code>nameCompareFunction</code> property to a function
 *  that compares two file or directory names.</p>
 *
 *  <p>If the user double-clicks a closed directory node,
 *  or clicks its disclosure icon,
 *  this control dispatches a <code>directoryOpening</code> event.
 *  If the user double-clicks an open directory node,
 *  or clicks its disclosure icon,
 *  this control dispatches a <code>directoryClosing</code> event.
 *  A handler can cancel either event by calling
 *  <code>event.preventDefault()</code> in which case the node doesn't open.</p>
 *
 *  <p>If the user double-clicks a file node,
 *  this control dispatches a <code>select</code> event.</p>
 * 
 *  @mxml
 *
 *  <p>The <code>&lt;mx:FileSystemTree&gt;</code> tag inherits all of the tag
 *  attributes of its superclass and adds the following tag attributes:</p>
 *
 *  <pre>
 *  &lt;mx:FileSystemTree
 *    <strong>Properties</strong>
 *    directory="<i>null</i>"
 *    enumerationMode="directoriesFirst"
 *    extensions="<i>null</i>"
 *    filterFunction="<i>null</i>"
 *    nameCompareFunction="<i>null</i>"
 *    openPaths="<i>null</i>"
 *    selectedPath="<i>null</i>"
 *    selectedPaths="<i>null</i>"
 *    showExtensions="true"
 *    showHidden="false"
 *    showIcons="true"
 * 
 *    <strong>Events</strong>
 *    directoryChange="<i>No default</i>"
 *    directoryClosing="<i>No default</i>"
 *    directoryOpening="<i>No default</i>"
 *    fileChoose="<i>No default</i>"
 *  /&gt;
 *  </pre>
 * 
 *  @see flash.filesystem.File
 * 
 *  @productversion Apollo 1.0
 */
public class FileSystemTree extends Tree
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  @copy mx.controls.FileSystemList#COMPUTER
     */
    public static const COMPUTER:File = FileSystemControlHelper.COMPUTER;

    //--------------------------------------------------------------------------
    //
    //  Constructor
{'fraction_non_alphanumeric': 0.20051502145922748, 'fraction_numerical': 0.0015450643776824034, 'mean_word_length': 2.5586438607208306, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2561182', 'n_tokens_mistral': 3280, 'n_tokens_neox': 3236, 'n_words': 971}