files edit
This commit is contained in:
parent
2ccc2cbb0b
commit
a5378e8ee7
@ -6,6 +6,7 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.event.Event;
|
import javafx.event.Event;
|
||||||
@ -62,6 +63,8 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void navigationButtons(Stage primaryStage, GridPane grid, Label label) {
|
private void navigationButtons(Stage primaryStage, GridPane grid, Label label) {
|
||||||
|
|
||||||
boolean reloadValue = false;
|
boolean reloadValue = false;
|
||||||
@ -200,6 +203,8 @@ public class App extends Application {
|
|||||||
messBar.getText() + " " + attraktiv.getText() + " " + realistisch.getText() + ", "
|
messBar.getText() + " " + attraktiv.getText() + " " + realistisch.getText() + ", "
|
||||||
+ "thanks" + checkInDatePicker.getValue());
|
+ "thanks" + checkInDatePicker.getValue());
|
||||||
String date = checkInDatePicker.getValue().format(DateTimeFormatter.ofPattern("dd.MM.yyyy"));
|
String date = checkInDatePicker.getValue().format(DateTimeFormatter.ofPattern("dd.MM.yyyy"));
|
||||||
|
long seconds = System.currentTimeMillis() / 1000l;
|
||||||
|
String state = "open";
|
||||||
|
|
||||||
String[] createSmart = {
|
String[] createSmart = {
|
||||||
nameSmartZiel.getText() + "|" +
|
nameSmartZiel.getText() + "|" +
|
||||||
@ -207,10 +212,12 @@ public class App extends Application {
|
|||||||
messBar.getText() + "|" +
|
messBar.getText() + "|" +
|
||||||
attraktiv.getText() + "|" +
|
attraktiv.getText() + "|" +
|
||||||
realistisch.getText() + "|" +
|
realistisch.getText() + "|" +
|
||||||
|
state + "|" +
|
||||||
|
seconds + "|" +
|
||||||
date
|
date
|
||||||
};
|
};
|
||||||
|
|
||||||
long seconds = System.currentTimeMillis() / 1000l;
|
|
||||||
CreateFile.writeFile(filesDirectory + "/" + seconds + ".smart", createSmart);
|
CreateFile.writeFile(filesDirectory + "/" + seconds + ".smart", createSmart);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -270,59 +277,90 @@ public class App extends Application {
|
|||||||
reload.setOnAction(new EventHandler<ActionEvent>() {
|
reload.setOnAction(new EventHandler<ActionEvent>() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(ActionEvent e) {
|
public void handle(ActionEvent e) {
|
||||||
|
System.out.println("theoretischer reload des Inhaltes");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//System.out.println(Arrays.stream(ListFilesInDir.listFilesInDir(filesDirectory)).toList());
|
|
||||||
int filesDirTmpLength = ListFilesInDir.listFilesInDir(filesDirectory).length;
|
int filesDirTmpLength = ListFilesInDir.listFilesInDir(filesDirectory).length;
|
||||||
String filesDirTmp[] = new String[filesDirTmpLength];
|
String filesDirTmp[] = new String[filesDirTmpLength];
|
||||||
filesDirTmp = ListFilesInDir.listFilesInDir(filesDirectory);
|
filesDirTmp = ListFilesInDir.listFilesInDir(filesDirectory);
|
||||||
String filesDir[][] = new String[filesDirTmpLength][filesDirTmpLength];
|
//String filesDir[][] = new String[filesDirTmpLength][filesDirTmpLength];
|
||||||
|
String filesContent[] = new String[filesDirTmpLength];
|
||||||
|
String filesShow[] = new String[filesDirTmpLength];
|
||||||
|
|
||||||
|
|
||||||
for ( int i=0; i < filesDirTmpLength; ++i) {
|
for (int i = 0; i < filesDirTmpLength; ++i) {
|
||||||
filesDir[i][0] = filesDirTmp[i];
|
filesContent[i] = ReadFile.readFile(filesDirectory + "/" + filesDirTmp[i]);
|
||||||
String readTheFile = filesDirectory + "/" + filesDirTmp[i];
|
String regex = "\\|";
|
||||||
filesDir[i][1] = ReadFile.readFile(filesDirectory + "/" + filesDirTmp[i]);
|
String[] nameOfTarget = filesContent[i].replaceAll("^\\[", "").replaceAll("^\\]", "").split(regex);
|
||||||
//filesDir[0][i] = ReadFile.readFile(filesDirTmp[i]);
|
filesShow[i] = nameOfTarget[0];
|
||||||
//ReadFile.readFile(filesDirTmp[i]);
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("da: " + filesDir[i][0]);
|
|
||||||
System.out.println("da tmp: " + filesDir[i][1]);
|
|
||||||
System.out.println(i);
|
|
||||||
//System.out.println("inhalt file: " + filesDir[i][i]);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//System.out.println(ReadFile.readFile("/tmp/files/123.smart"));
|
|
||||||
//ReadFile.readFile("/tmp/files/123.smart");
|
|
||||||
|
|
||||||
//System.out.println("dada: " + filesDirTmp[0]);
|
|
||||||
|
|
||||||
//filesDirTmp = Arrays.copyOf(ListFilesInDir.listFilesInDir(filesDirectory), ListFilesInDir.listFilesInDir(filesDirectory).length);
|
|
||||||
//new String[ListFilesInDir.listFilesInDir(filesDirectory).length][ListFilesInDir.listFilesInDir(filesDirectory).length];
|
|
||||||
|
|
||||||
|
|
||||||
//filesDir[][] = ListFilesInDir.listFilesInDir(filesDirectory);
|
|
||||||
//System.out.println(filesDir.length);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ListView<String> list1 = new ListView<String>();
|
ListView<String> list1 = new ListView<String>();
|
||||||
ObservableList<String> items = FXCollections.observableArrayList (ListFilesInDir.listFilesInDir(filesDirectory));
|
ObservableList<String> items = FXCollections.observableArrayList(filesShow);
|
||||||
|
//list1.getItems().addAll(items);
|
||||||
|
//list1.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
|
||||||
|
//list1.getSelectionModel().getSelectedItems().addListener((ListChangeListener<? super String>) c -> selectionChanged());
|
||||||
list1.setItems(items);
|
list1.setItems(items);
|
||||||
GridPane.setConstraints(list1, 0, 1);
|
GridPane.setConstraints(list1, 0, 1);
|
||||||
grid.getChildren().add(list1);
|
grid.getChildren().add(list1);
|
||||||
|
|
||||||
//String fileName = "/tmp/files/1735938766.smart";
|
//ObservableList selectedIndices = list1.getSelectionModel().getSelectedIndices();
|
||||||
//ReadFile.readFile(fileName);
|
|
||||||
|
|
||||||
//System.out.println(ReadFile.readFile(fileName));
|
|
||||||
|
|
||||||
}
|
Button button = new Button("Read Selected Value");
|
||||||
|
GridPane.setConstraints(button, 2, 8);
|
||||||
|
grid.getChildren().add(button);
|
||||||
|
button.setOnAction(event -> {
|
||||||
|
ObservableList selectedIndices = list1.getSelectionModel().getSelectedIndices();
|
||||||
|
|
||||||
|
for(Object o : selectedIndices){
|
||||||
|
System.out.println("o = " + o + " (" + o.getClass() + ")");
|
||||||
|
System.out.println(filesContent[(int) o]);
|
||||||
|
|
||||||
|
final TextField max = new TextField(filesContent[(int) o]);
|
||||||
|
max.setPrefColumnCount(20);
|
||||||
|
max.setPromptText("Ist es realistisch selbst erreichbar ?");
|
||||||
|
GridPane.setConstraints(max, 2, 5);
|
||||||
|
grid.getChildren().add(max);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
ListView listView = new ListView();
|
||||||
|
|
||||||
|
listView.getItems().add("Item 1");
|
||||||
|
listView.getItems().add("Item 2");
|
||||||
|
listView.getItems().add("Item 3");
|
||||||
|
|
||||||
|
GridPane.setConstraints(listView, 0, 2);
|
||||||
|
grid.getChildren().add(listView);
|
||||||
|
|
||||||
|
Button button = new Button("Read Selected Value");
|
||||||
|
GridPane.setConstraints(button, 2, 8);
|
||||||
|
grid.getChildren().add(button);
|
||||||
|
|
||||||
|
button.setOnAction(event -> {
|
||||||
|
ObservableList selectedIndices = listView.getSelectionModel().getSelectedIndices();
|
||||||
|
|
||||||
|
for(Object o : selectedIndices){
|
||||||
|
System.out.println("o = " + o + " (" + o.getClass() + ")");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//ListFilesInDir.listFilesInDir(filesDirectory);
|
//ListFilesInDir.listFilesInDir(filesDirectory);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user