diff --git a/build.gradle b/build.gradle index 52b4aba..b7ad471 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,10 @@ version = versionMajor + "." + versionMinor + versionQualifier mainClassName = 'org.polypheny.qtf.Main' +applicationDefaultJvmArgs = [ + '-Dfile.encoding=UTF-8' +] + tasks.withType(JavaCompile) { options.encoding = "UTF-8" sourceCompatibility = '11' diff --git a/src/main/java/org/polypheny/qtf/Controller.java b/src/main/java/org/polypheny/qtf/Controller.java index b2e9a07..6307e02 100644 --- a/src/main/java/org/polypheny/qtf/Controller.java +++ b/src/main/java/org/polypheny/qtf/Controller.java @@ -20,6 +20,8 @@ import java.awt.Desktop; import java.io.IOException; import javafx.application.Platform; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.control.TextArea; @@ -37,11 +39,21 @@ public class Controller extends QueryInterface { private Label feedback; @FXML private TextField tableId; + @FXML + private Label tag; + + @FXML + public static BooleanProperty booleanVar = new SimpleBooleanProperty(false); public Controller() { super(); } + public void initialize() { + // Bind a Boolean variable to the visible property of tag + tag.visibleProperty().bindBidirectional(booleanVar); + } + @FXML public void submit() { if ( !tableId.getText().equals( "" ) ) { @@ -87,6 +99,7 @@ public void onCommit() { } else { printFeedback( String.format( "The commit was successful. %d rows were affected.", result.affectedRows ) ); } + booleanVar.set( false ); } } diff --git a/src/main/java/org/polypheny/qtf/fuse/ResultFS.java b/src/main/java/org/polypheny/qtf/fuse/ResultFS.java index a512cba..7972d30 100644 --- a/src/main/java/org/polypheny/qtf/fuse/ResultFS.java +++ b/src/main/java/org/polypheny/qtf/fuse/ResultFS.java @@ -30,6 +30,7 @@ import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import org.polypheny.qtf.Controller; import org.polypheny.qtf.QTFConfig; import org.polypheny.qtf.web.BatchUpdateRequest; import org.polypheny.qtf.web.BatchUpdateRequest.Update; @@ -289,6 +290,7 @@ private int write( Pointer buffer, long bufSize, long writeOffset ) { contents.put( bytesToWrite ); contents.position( 0 ); // Rewind } + Controller.booleanVar.set(true); return (int) bufSize; } @@ -399,6 +401,7 @@ public int create( String path, @mode_t long mode, FuseFileInfo fi ) { if ( parent instanceof ResultDirectory ) { String lastComponent = getLastComponent( path ); ((ResultDirectory) parent).mkfile( lastComponent, result != null && result.containsColumn( lastComponent ) ); + Controller.booleanVar.set(true); return 0; } return -ErrorCodes.ENOENT(); @@ -447,6 +450,7 @@ public int mkdir( String path, @mode_t long mode ) { ResultPath parent = getParentPath( path ); if ( parent instanceof ResultDirectory ) { ((ResultDirectory) parent).mkdir( getLastComponent( path ) ); + Controller.booleanVar.set(true); return 0; } return -ErrorCodes.ENOENT(); @@ -517,6 +521,7 @@ public int rename( String path, String newName ) { } p.rename( newName.substring( newName.lastIndexOf( "/" ) ) ); ((ResultDirectory) newParent).add( p ); + Controller.booleanVar.set(true); return 0; } @@ -545,6 +550,7 @@ public int truncate( String path, long offset ) { return -ErrorCodes.EISDIR(); } ((ResultFile) p).truncate( offset ); + Controller.booleanVar.set(true); return 0; } @@ -560,6 +566,7 @@ public int unlink( String path ) { } else { p.delete(); } + Controller.booleanVar.set(true); return 0; } diff --git a/src/main/java/org/polypheny/qtf/web/SocketClient.java b/src/main/java/org/polypheny/qtf/web/SocketClient.java index bb57a94..5b766b7 100644 --- a/src/main/java/org/polypheny/qtf/web/SocketClient.java +++ b/src/main/java/org/polypheny/qtf/web/SocketClient.java @@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; +import org.polypheny.qtf.Controller; import org.polypheny.qtf.QTFConfig; import org.polypheny.qtf.QueryInterface; import org.polypheny.qtf.fuse.ResultFS; @@ -113,6 +114,7 @@ public void onMessage( String message ) { myFuse.add( dir ); } myFuse.setResult( result ); + Controller.booleanVar.set( false ); } @Override diff --git a/src/main/resources/fxml/sample.fxml b/src/main/resources/fxml/sample.fxml index b0db8f2..eea4519 100644 --- a/src/main/resources/fxml/sample.fxml +++ b/src/main/resources/fxml/sample.fxml @@ -56,6 +56,7 @@