Java Reference
In-Depth Information
javafx.asynch.RemoteTextDocument
+document
+method
+url
+canceled
+done
+failed
+failureText
+listener
+onDone
+progressCur
+progressMax
+cancel()
+onCompletion(Object)
+start()
+seek(object)
+seek(object,integer)
+toString()
Figure 10.2
The RemoteTextDocument Class
chronously make an HTTP request to a URL that you provide. When the return
document has been received, the onDone function, which you implement, is
called with an indication of success or failure. Next, you can access the returned
document through the RemoteTextDocument.document member variable. List-
ing 10.4 shows an example of these steps in action.
Listing 10.4
Using RemoteTextDocument
var rtd: RemoteTextDocument = null;
var bis: InputStream = null;
var serverURL = "http://...";
// ...
function requestData() : Void {
// Request data from remote server
rtd = RemoteTextDocument {
url: bind serverURL
onDone: function(success:Boolean):Void {
if(success) {
var doc = rtd.document;
bis= new ByteArrayInputStream(doc.getBytes());
parser.parse();
continues
Search WWH ::




Custom Search