Packagepotomac.ui
Classpublic class PartEvent
InheritancePartEvent Inheritance flash.events.Event

PartEvents are the main mechanism of communication between Parts and the Potomac User Interface. Some part events are sent from Potomac to parts and some are sent from parts to Potomac. In both cases, the PartEvents are dispatched on the parts themselves.

Part developers may construct PartEvent instances or use one of the convenient static sendmethods.



Public Properties
 PropertyDefined By
  busyText : String
The text to be shown on the busy animation.
PartEvent
  eventToBroadcast : Event
The event to broadcast for a BROADCAST_TO_PARTS event.
PartEvent
  folder : Folder
[read-only] The parent folder of the part.
PartEvent
  input : PartInput
[read-only] The part's input.
PartEvent
  page : Page
[read-only] The part's parent page.
PartEvent
  pageInput : PageInput
[read-only] The part's parent page's input.
PartEvent
  selection : Array
[read-only] The new selection on a SELECTION_CHANGED event.
PartEvent
Public Methods
 MethodDefined By
  
PartEvent(type:String, selection:Array = null, input:PartInput = null, folder:Folder = null, page:Page = null, pageInput:PageInput = null)
Parts are encouraged to use one of the static sendmethods rather than constructing the event manually.
PartEvent
  
clone():Event
[override]
PartEvent
  
sendBroadcast(part:UIComponent, eventToBroadcast:Event):void
[static] Sends an event to inform Potomac to in turn dispatch the given event on all parts.
PartEvent
  
sendBusy(part:UIComponent, busyText:String):void
[static] Sends an event to inform Potomac that the part is busy.
PartEvent
  
sendClean(part:UIComponent):void
[static] Sends an event informing Potomac that the given part is now clean.
PartEvent
  
sendDirty(part:UIComponent):void
[static] Sends an event informing Potomac that the given part is now dirty.
PartEvent
  
sendIdle(part:UIComponent):void
[static] Sends an event to inform Potomac that the part is no longer busy.
PartEvent
  
sendSaveComplete(part:UIComponent):void
[static] Sends an event informing Potomac that the save on the given part was successful.
PartEvent
  
sendSaveError(part:UIComponent):void
[static] Sends an event informing Potomac that the save on the given part did not complete as it encountered an error.
PartEvent
  
sendSelectionChanged(part:UIComponent, newSelection:Array):void
[static] Sends an event informing Potomac that the selection of the given part has changed.
PartEvent
Public Constants
 ConstantDefined By
  BROADCAST_TO_PARTS : String = partBroadcastToParts
[static] The PartEvent.BROADCAST_TO_PARTS constant defines the value of the type property of the event object for a partBroadcastToParts event.
PartEvent
  BUSY : String = partBusy
[static] The PartEvent.BUSY constant defines the value of the type property of the event object for a partBusy event.
PartEvent
  CLEAN : String = partClean
[static] The PartEvent.CLEAN constant defines the value of the type property of the event object for a partClean event.
PartEvent
  DIRTY : String = partDirty
[static] The PartEvent.DIRTY constant defines the value of the type property of the event object for a partDirty event.
PartEvent
  DO_SAVE : String = partDoSave
[static] The PartEvent.DO_SAVE constant defines the value of the type property of the event object for a partDoSave event.
PartEvent
  IDLE : String = partIdle
[static] The PartEvent.IDLE constant defines the value of the type property of the event object for a partIdle event.
PartEvent
  INITIALIZE : String = partInitialize
[static] The PartEvent.INITIALIZE constant defines the value of the type property of the event object for a partInitialize event.
PartEvent
  SAVE_COMPLETE : String = partSaveComplete
[static] The PartEvent.SAVE_COMPLETE constant defines the value of the type property of the event object for a partSaveComplete event.
PartEvent
  SAVE_ERROR : String = partSaveError
[static] The PartEvent.SAVE_ERROR constant defines the value of the type property of the event object for a partSaveError event.
PartEvent
  SELECTION_CHANGED : String = partSelectionChangeIncoming
[static] The PartEvent.SELECTION_CHANGED constant defines the value of the type property of the event object for a partSelectionChangeIncoming event.
PartEvent
Property Detail
busyTextproperty
busyText:String

The text to be shown on the busy animation.


Implementation
    public function get busyText():String
    public function set busyText(value:String):void
eventToBroadcastproperty 
eventToBroadcast:Event

The event to broadcast for a BROADCAST_TO_PARTS event.


Implementation
    public function get eventToBroadcast():Event
    public function set eventToBroadcast(value:Event):void
folderproperty 
folder:Folder  [read-only]

The parent folder of the part.


Implementation
    public function get folder():Folder
inputproperty 
input:PartInput  [read-only]

The part's input.


Implementation
    public function get input():PartInput
pageproperty 
page:Page  [read-only]

The part's parent page.


Implementation
    public function get page():Page
pageInputproperty 
pageInput:PageInput  [read-only]

The part's parent page's input.


Implementation
    public function get pageInput():PageInput
selectionproperty 
selection:Array  [read-only]

The new selection on a SELECTION_CHANGED event.


Implementation
    public function get selection():Array
Constructor Detail
PartEvent()Constructor
public function PartEvent(type:String, selection:Array = null, input:PartInput = null, folder:Folder = null, page:Page = null, pageInput:PageInput = null)

Parts are encouraged to use one of the static sendmethods rather than constructing the event manually.

Parameters
type:String — event type.
 
selection:Array (default = null) — new selection for a SELECTION_CHANGED event.
 
input:PartInput (default = null) — input for an INITIALIZE event.
 
folder:Folder (default = null) — folder for an INITIALIZE event.
 
page:Page (default = null) — page for an INITIALIZE event.
 
pageInput:PageInput (default = null) — pageInput for an INITIALIZE event.
Method Detail
clone()method
override public function clone():Event

Returns
Event
sendBroadcast()method 
public static function sendBroadcast(part:UIComponent, eventToBroadcast:Event):void

Sends an event to inform Potomac to in turn dispatch the given event on all parts.

Parameters

part:UIComponent — part doing the broadcasting.
 
eventToBroadcast:Event — event to broadcast to all parts.

sendBusy()method 
public static function sendBusy(part:UIComponent, busyText:String):void

Sends an event to inform Potomac that the part is busy. Potomac will disable the part and show an animation with the given text.

Parameters

part:UIComponent — part to mark busy.
 
busyText:String — text to show in busy animation.

sendClean()method 
public static function sendClean(part:UIComponent):void

Sends an event informing Potomac that the given part is now clean.

Parameters

part:UIComponent — part to mark clean.

sendDirty()method 
public static function sendDirty(part:UIComponent):void

Sends an event informing Potomac that the given part is now dirty.

Parameters

part:UIComponent — part to mark dirty.

sendIdle()method 
public static function sendIdle(part:UIComponent):void

Sends an event to inform Potomac that the part is no longer busy. If the part was busy, it will be re-enabled and the animation will be stopped.

Parameters

part:UIComponent — part to mark idle.

sendSaveComplete()method 
public static function sendSaveComplete(part:UIComponent):void

Sends an event informing Potomac that the save on the given part was successful.

Parameters

part:UIComponent — part which saved successfully.

sendSaveError()method 
public static function sendSaveError(part:UIComponent):void

Sends an event informing Potomac that the save on the given part did not complete as it encountered an error. Parts are expected to display the error themselves.

Parameters

part:UIComponent — part for which the save failed.

sendSelectionChanged()method 
public static function sendSelectionChanged(part:UIComponent, newSelection:Array):void

Sends an event informing Potomac that the selection of the given part has changed. Potomac will then dispatch a SelectionEvent.SELECTION_CHANGED event on all parts.

Parameters

part:UIComponent — part whose selection has changed.
 
newSelection:Array — the new selection.

Constant Detail
BROADCAST_TO_PARTSConstant
public static const BROADCAST_TO_PARTS:String = partBroadcastToParts

The PartEvent.BROADCAST_TO_PARTS constant defines the value of the type property of the event object for a partBroadcastToParts event.

A broadcast event is a mechanism by which parts can have an event dispatched on all currently open parts. This is a useful inter-part communication mechanism.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastThe event that will be broadcast to all parts.

BUSYConstant 
public static const BUSY:String = partBusy

The PartEvent.BUSY constant defines the value of the type property of the event object for a partBusy event.

Busy events are dispatched by parts to tell Potomac that the part is performing a long running activity, typically awaiting the results of a service call. Potomac will disable the part and show an animation. Parts can affect the text shown during this animation with the busyText property.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextThe text to be shown on the busy animation.
eventToBroadcastnull

CLEANConstant 
public static const CLEAN:String = partClean

The PartEvent.CLEAN constant defines the value of the type property of the event object for a partClean event.

Clean events are dispatched by parts to tell Potomac that the part no longer has unsaved changes.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

DIRTYConstant 
public static const DIRTY:String = partDirty

The PartEvent.DIRTY constant defines the value of the type property of the event object for a partDirty event.

Dirty events are dispatched by parts to tell Potomac that the part has unsaved changes.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

DO_SAVEConstant 
public static const DO_SAVE:String = partDoSave

The PartEvent.DO_SAVE constant defines the value of the type property of the event object for a partDoSave event.

Do Save events are dispatched by Potomac to parts when the user has requested the part's data be saved. Parts are expected to initiate (asynchronous) save logic and send back a PartEvent.SAVE_COMPLETE or PartEvent.SAVE_ERROR event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

IDLEConstant 
public static const IDLE:String = partIdle

The PartEvent.IDLE constant defines the value of the type property of the event object for a partIdle event.

Idle events are dispatched by parts to tell Potomac that the part is no longer performing a long running activity. If the part was busy, the busy animation will be stopped and the part will be re-enabled.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

INITIALIZEConstant 
public static const INITIALIZE:String = partInitialize

The PartEvent.INITIALIZE constant defines the value of the type property of the event object for a partInitialize event.

Initialize events are dispatched on parts to give them a chance to inspect their input and retrieve data.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputThe part input or null if no input was given.
folderThe part's parent folder.
pageThe part's parent page.
pageInputThe part's parent page's input.
selectionnull
busyTextnull
eventToBroadcastnull

SAVE_COMPLETEConstant 
public static const SAVE_COMPLETE:String = partSaveComplete

The PartEvent.SAVE_COMPLETE constant defines the value of the type property of the event object for a partSaveComplete event.

Save complete events are dispatched by parts to inform Potomac that an asynchronous save was successful.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

SAVE_ERRORConstant 
public static const SAVE_ERROR:String = partSaveError

The PartEvent.SAVE_ERROR constant defines the value of the type property of the event object for a partSaveError event.

Save error events are dispatched by parts to Potomac when asynchronous save logic failed. Parts are expected to show the necessary UI to communicate the error to the user.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionnull
busyTextnull
eventToBroadcastnull

SELECTION_CHANGEDConstant 
public static const SELECTION_CHANGED:String = partSelectionChangeIncoming

The PartEvent.SELECTION_CHANGED constant defines the value of the type property of the event object for a partSelectionChangeIncoming event.

Selection changed events are dispatched by parts to inform Potomac that the selection in this part has changed. Potomac will in turn dispatch a SelectionEvent.SELECTION_CHANGED event to all parts.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe 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.
inputnull
foldernull
pagenull
pageInputnull
selectionAn array of objects representing the new selection in the part.
busyTextnull
eventToBroadcastnull