Skip to content
Snippets Groups Projects
Commit 16794bc0 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #17 - tableview is not cleared correctly

parent 412d5412
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,7 @@ public class UserInterfaceController ...@@ -112,6 +112,7 @@ public class UserInterfaceController
labelTime.setText("0 h 0 min 0 sek"); labelTime.setText("0 h 0 min 0 sek");
createLogView();
loadAll(); loadAll();
// verwaltet den Start/Stopp-Button // verwaltet den Start/Stopp-Button
...@@ -195,7 +196,7 @@ public class UserInterfaceController ...@@ -195,7 +196,7 @@ public class UserInterfaceController
} }
catch(IOException d) catch(IOException d)
{ {
d.printStackTrace(); Logger.error(d);
} }
} }
else else
...@@ -302,12 +303,19 @@ public class UserInterfaceController ...@@ -302,12 +303,19 @@ public class UserInterfaceController
} }
catch(Exception ex) catch(Exception ex)
{ {
ex.printStackTrace(); Logger.error(ex);
AlertGenerator.showAlert(AlertType.ERROR, "Fehler", "", "Fehler beim Erstellen der Datenbank.", icon, stage, null, false); AlertGenerator.showAlert(AlertType.ERROR, "Fehler", "", "Fehler beim Erstellen der Datenbank.", icon, stage, null, false);
} }
} }
} }
private void updateTableView()
{
table.getItems().clear();
ObservableList<LogObject> objectsForTable = FXCollections.observableArrayList(logObjects);
table.setItems(objectsForTable);
}
private void createLogView() private void createLogView()
{ {
table.getItems().clear(); table.getItems().clear();
...@@ -387,8 +395,6 @@ public class UserInterfaceController ...@@ -387,8 +395,6 @@ public class UserInterfaceController
table.getColumns().add(tasks); table.getColumns().add(tasks);
table.getColumns().add(durations); table.getColumns().add(durations);
ObservableList<LogObject> objectsForTable = FXCollections.observableArrayList(logObjects);
table.setItems(objectsForTable);
table.setFixedCellSize(26); table.setFixedCellSize(26);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
...@@ -453,7 +459,7 @@ public class UserInterfaceController ...@@ -453,7 +459,7 @@ public class UserInterfaceController
public void loadAll() public void loadAll()
{ {
loadFromDB(); loadFromDB();
createLogView(); updateTableView();
createTreeView(); createTreeView();
} }
...@@ -723,7 +729,7 @@ public class UserInterfaceController ...@@ -723,7 +729,7 @@ public class UserInterfaceController
} }
catch(IOException d) catch(IOException d)
{ {
d.printStackTrace(); Logger.error(d);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment