Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
public class TextAreaSocketPreviewView<T> extends SocketPreviewView<T> {

private final TextArea text;
private GRIPPlatform platform;
private final GRIPPlatform platform;

/**
* @param socket An output socket to preview
* @param socket An output socket to preview
*/
public TextAreaSocketPreviewView(GRIPPlatform platform, OutputSocket<T> socket) {
super(socket);
this.platform = platform;

this.setStyle("-fx-pref-width: 20em;");

this.text = new TextArea(socket.getValue().orElse((T)"").toString());
this.text = new TextArea(socket.getValue().orElse((T) "").toString());
text.setEditable(false);

this.setContent(text);
Expand All @@ -34,7 +35,7 @@ public TextAreaSocketPreviewView(GRIPPlatform platform, OutputSocket<T> socket)
public void onSocketChanged(SocketChangedEvent event) {
final Socket socket = event.getSocket();
if (socket == this.getSocket()) {
platform.runAsSoonAsPossible(() ->{
platform.runAsSoonAsPossible(() -> {
this.text.setText(socket.getValue().orElse("").toString());
});
}
Expand Down