Skip to main content

[datafx~datafx2:71] allow write-support

  • From:
  • To:
  • Subject: [datafx~datafx2:71] allow write-support
  • Date: Fri, 5 Jul 2013 13:37:10 +0000

Project:    datafx
Repository: datafx2
Revision:   71
Author:     johanvos
Date:       2013-07-05 13:36:52 UTC
Link:       

Log Message:
------------
allow write-support


Revisions:
----------
71


Modified Paths:
---------------
datafx-websocket/src/main/java/org/datafx/websocket/MessageProvider.java
datafx-websocket/src/main/java/org/datafx/websocket/WebSocketReader.java


Diffs:
------
diff -r 39e974c3adcb -r 3ea31033be4d 
datafx-websocket/src/main/java/org/datafx/websocket/MessageProvider.java
--- 
a/datafx-websocket/src/main/java/org/datafx/websocket/MessageProvider.java  
Fri Jul 05 15:06:02 2013 +0200
+++ 
b/datafx-websocket/src/main/java/org/datafx/websocket/MessageProvider.java  
Fri Jul 05 15:36:52 2013 +0200
@@ -1,10 +1,8 @@
 package org.datafx.websocket;
 
-import javafx.beans.property.ListProperty;
-import javafx.beans.property.SimpleListProperty;
+import java.io.IOException;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
-import javafx.concurrent.Worker;
 import org.datafx.provider.ListObjectDataProvider;
 
 /**
@@ -13,7 +11,6 @@
  */
 public class MessageProvider extends ListObjectDataProvider<String> {
 
-//implements DataProvider<ObservableList<String>>{
     
     private final WebSocketReader reader;
     private ObservableList<String> incomingMessages = 
FXCollections.observableArrayList();
@@ -23,11 +20,8 @@
         this.reader = reader;
     }
 
-//    public ListProperty<String> getData() {
-//        return new SimpleListProperty(incomingMessages);
-//    }
-//
-//    public Worker<ObservableList<String>> retrieve() {
-//        throw new UnsupportedOperationException("Not supported yet."); 
//To change body of generated methods, choose Tools | Templates.
-//    }
+    public void sendMessage (String msg) throws IOException {
+        reader.sendMessage(msg);
+    }
+    
 }

diff -r 39e974c3adcb -r 3ea31033be4d 
datafx-websocket/src/main/java/org/datafx/websocket/WebSocketReader.java
--- 
a/datafx-websocket/src/main/java/org/datafx/websocket/WebSocketReader.java  
Fri Jul 05 15:06:02 2013 +0200
+++ 
b/datafx-websocket/src/main/java/org/datafx/websocket/WebSocketReader.java  
Fri Jul 05 15:36:52 2013 +0200
@@ -1,5 +1,6 @@
 package org.datafx.websocket;
 
+import java.io.IOException;
 import java.net.URI;
 import java.util.Collections;
 import java.util.LinkedList;
@@ -73,6 +74,10 @@
     public boolean next() {
         return !closed;
     }
+    
+    public void sendMessage (String msg) throws IOException {
+        session.getBasicRemote().sendText(msg);
+    }
 
 //    public void writeBack() {
 //        session.getBasicRemote().






[datafx~datafx2:71] allow write-support

johanvos 07/05/2013
 
 
Close
loading
Please Confirm
Close