Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/polypheny/qtf/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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( "" ) ) {
Expand Down Expand Up @@ -87,6 +99,7 @@ public void onCommit() {
} else {
printFeedback( String.format( "The commit was successful. %d rows were affected.", result.affectedRows ) );
}
booleanVar.set( false );
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/polypheny/qtf/fuse/ResultFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -545,6 +550,7 @@ public int truncate( String path, long offset ) {
return -ErrorCodes.EISDIR();
}
((ResultFile) p).truncate( offset );
Controller.booleanVar.set(true);
return 0;
}

Expand All @@ -560,6 +566,7 @@ public int unlink( String path ) {
} else {
p.delete();
}
Controller.booleanVar.set(true);
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/polypheny/qtf/web/SocketClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -113,6 +114,7 @@ public void onMessage( String message ) {
myFuse.add( dir );
}
myFuse.setResult( result );
Controller.booleanVar.set( false );
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/fxml/sample.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</children>
</FlowPane>
<Label id="feedback" fx:id="feedback" wrapText="true" GridPane.rowIndex="1"/>
<Label id="tag" text="Data changed but not committed" fx:id="tag" wrapText="true" GridPane.rowIndex="2"/>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
Expand Down