Packagecom.yworks.remote
Classpublic class LoadHandler
InheritanceLoadHandler Inheritance AbstractFileReadHandler Inheritance flash.events.EventDispatcher

A Handler which loads a GraphML file.

This implementation delegates the work to a flash.net.FileReference.

For a server-based read handler see class UploadHandler

See also

flash.net.FileReference
UploadHandler


Public Properties
 PropertyDefined By
 InheritedfileFilter : Array
An array of flash.net.FileFilter to use with the file browser.
AbstractFileReadHandler
 Inheritedfilename : String
[read-only] The filename of the last selected file.
AbstractFileReadHandler
 InheritedinputIOHandler : GraphMLIOHandler
The GraphMLIOHandler instance that will be used for graph deserialization.
AbstractFileReadHandler
 InheritedroundtripHandler : RoundtripHandler
The RoundtripHandler instance that will be used for the server roundtrip.
AbstractFileReadHandler
Protected Properties
 PropertyDefined By
 InheritedfileReference : FileReference
The FileReference which handles the file operations.
AbstractFileReadHandler
Public Methods
 MethodDefined By
  
LoadHandler(roundtripHandler:RoundtripHandler = null)
Create a new instance.
LoadHandler
  
load(graph:IGraph = null, defaultFileName:String = null):void
Opens the file browser to load a file.
LoadHandler
Protected Methods
 MethodDefined By
 Inherited
Create the GraphMLIOHandler instance that will be used for graph deserialization.
AbstractFileReadHandler
 Inherited
dispatchXMLResult(result:XML):void
Dispatches a XMLResultEvent containing the received XML data.
AbstractFileReadHandler
 Inherited
handleResult(result:XML):void
Updates the graph with the new GraphML Has to be called after the upload is complete and the response is received.
AbstractFileReadHandler
 Inherited
onCancel(event:Event):void
Called when the user chose the cancel button of the upload dialog.
AbstractFileReadHandler
  
onComplete(event:Event):void
[override] Called after the load is complete and the response is received.
LoadHandler
 Inherited
onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status.
AbstractFileReadHandler
 Inherited
onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the file download.
AbstractFileReadHandler
 Inherited
onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the file download.
AbstractFileReadHandler
  
onSelected(event:Event):void
[override] Called when a file is chosen to load from the FileChooser.
LoadHandler
 Inherited
onUploadComplete(event:DataEvent):void
Called after the upload is complete and the response is received.
AbstractFileReadHandler
 Inherited
openDialog(graph:IGraph = null, defaultFileName:String = null):void
Opens the file dialog.
AbstractFileReadHandler
Events
 Event Summary Defined By
 InheritedDispatched when a valid result is received.AbstractFileReadHandler
Constructor Detail
LoadHandler()Constructor
public function LoadHandler(roundtripHandler:RoundtripHandler = null)

Create a new instance.

Parameters
roundtripHandler:RoundtripHandler (default = null) — The roundtrip handler to receive the inputIOHandler from. If none is provided a new DefaultGraphMLIOHandler is created.
Method Detail
load()method
public function load(graph:IGraph = null, defaultFileName:String = null):void

Opens the file browser to load a file.

Event handling can be customized by overriding the various protected event handler functions.

Parameters

graph:IGraph (default = null) — The graph instance in which the file contents will be stored. If no graph is passed, the roundtripHandler will be used to store the graph to. Note, that in this case, the roundtripHandler has to be properly initialized.
 
defaultFileName:String (default = null) — The default file name to be shown in the browser's download dialog.

See also

flash.net.FileReference
flash.net.FileFilter
onComplete()method 
override protected function onComplete(event:Event):void

Called after the load is complete and the response is received.

Parameters

event:Event

onSelected()method 
override protected function onSelected(event:Event):void

Called when a file is chosen to load from the FileChooser.

Starts the load process.

Parameters

event:Event