Packagepotomac.ui
Classpublic class Folder
InheritanceFolder Inheritance Object

A Folder represents a portion of a Page. A folder can contain zero, one, or many parts.



Public Properties
 PropertyDefined By
  id : String
The id of the folder.
Folder
  page : Page
The page the folder resides in.
Folder
  pageInput : PageInput
The input for the page the folder resides in.
Folder
Public Methods
 MethodDefined By
  
Callers should not create Folders.
Folder
  
closePart(reference:PartReference, promptForSave:Boolean = true):void
Closes the given part.
Folder
  
containsDirty():Boolean
Returns true if any part within this folder has unsaved changes.
Folder
  
create(options:FolderOptions = null):Container
Creates the folder UI.
Folder
  
dispose():void
Callback that allows folders to dispose of any necessary resources or remove event listeners before being unreferenced for GC.
Folder
  
findPart(id:String, input:PartInput = null):PartReference
Returns the part references for the part with the given id and matching the given input.
Folder
  
getContainer():Container
Returns the UI control for this folder.
Folder
  
Returns the options used when creating the folder.
Folder
  
getPartReference(control:UIComponent):PartReference
Returns the reference for the given part UI control.
Folder
  
Returns all part references in this folder.
Folder
  
isDirty(partReference:PartReference):Boolean
True if the part has unsaved changes.
Folder
  
openPart(id:String, input:PartInput = null, options:PartOptions = null, setFocus:Boolean = true):void
Opens an instance of a part with the given id and input in this folder.
Folder
  
savePart(reference:PartReference):void
Initiates a save of the part represented by the given reference.
Folder
  
showPart(partReference:PartReference):void
Makes the given part visible (ex.
Folder
Public Constants
 ConstantDefined By
  DEFAULT_ID : String = default
[static] The id of the default folder.
Folder
Property Detail
idproperty
id:String

The id of the folder.


Implementation
    public function get id():String
    public function set id(value:String):void
pageproperty 
page:Page

The page the folder resides in.


Implementation
    public function get page():Page
    public function set page(value:Page):void
pageInputproperty 
pageInput:PageInput

The input for the page the folder resides in.


Implementation
    public function get pageInput():PageInput
    public function set pageInput(value:PageInput):void
Constructor Detail
Folder()Constructor
public function Folder()

Callers should not create Folders. Only Page instances should create folders via FolderFactory.

Method Detail
closePart()method
public function closePart(reference:PartReference, promptForSave:Boolean = true):void

Closes the given part. If promptForSave is true and the part is dirty, the user will be given an opportunity to save the part. If promptForSave is true and the part is dirty, this method runs asynchronously. When the user is prompted to save, he/she may select "Cancel" thus preventing the part from closing. Similarly if the part save fails, the part will stay open to allow the user to view the save errors.

Parameters

reference:PartReference — part to close.
 
promptForSave:Boolean (default = true) — True to prompt the user to save if the part is dirty, false to close immediately.

containsDirty()method 
public function containsDirty():Boolean

Returns true if any part within this folder has unsaved changes.

Returns
Boolean — returns true if any part in the folder has unsaved changes.
create()method 
public function create(options:FolderOptions = null):Container

Creates the folder UI. Only Page instances should call this method.

Parameters

options:FolderOptions (default = null) — The folder options.

Returns
Container — The folder UI control.
dispose()method 
public function dispose():void

Callback that allows folders to dispose of any necessary resources or remove event listeners before being unreferenced for GC.

findPart()method 
public function findPart(id:String, input:PartInput = null):PartReference

Returns the part references for the part with the given id and matching the given input.

Parameters

id:String — id of the part to find.
 
input:PartInput (default = null) — input of the part to find.

Returns
PartReference — the part reference.
getContainer()method 
public function getContainer():Container

Returns the UI control for this folder.

Returns
Container — The UI control for this folder.
getOptions()method 
public function getOptions():FolderOptions

Returns the options used when creating the folder.

Returns
FolderOptions — the folder options.
getPartReference()method 
public function getPartReference(control:UIComponent):PartReference

Returns the reference for the given part UI control.

Parameters

control:UIComponent — the part UI itself.

Returns
PartReference — the part reference.
getPartReferences()method 
public function getPartReferences():Array

Returns all part references in this folder.

Returns
Array — all part references in this folder.
isDirty()method 
public function isDirty(partReference:PartReference):Boolean

True if the part has unsaved changes.

Parameters

partReference:PartReference — part reference

Returns
Boolean — true if the part has unsaved changes.
openPart()method 
public function openPart(id:String, input:PartInput = null, options:PartOptions = null, setFocus:Boolean = true):void

Opens an instance of a part with the given id and input in this folder. If a part with this id and a matching input already exists within this folder, it will be made visible and the part creation will be prevented.

Parameters

id:String — The id of the part to open.
 
input:PartInput (default = null) — The input of the part.
 
options:PartOptions (default = null) — The options for the part instance.
 
setFocus:Boolean (default = true) — True if the part should be made visible (ex. its tab selected).

savePart()method 
public function savePart(reference:PartReference):void

Initiates a save of the part represented by the given reference. Saves are asynchronous and therefore this method returns before the save is complete.

Parameters

reference:PartReference — part to save.

showPart()method 
public function showPart(partReference:PartReference):void

Makes the given part visible (ex. selecting the tab in a tabnavigator).

Parameters

partReference:PartReference — part reference to show.

Constant Detail
DEFAULT_IDConstant
public static const DEFAULT_ID:String = default

The id of the default folder.