Skip to content
Snippets Groups Projects
Commit 982a35eb authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Small fixes

parent ddda1629
Branches
Tags
No related merge requests found
...@@ -37,6 +37,7 @@ public class TodoDocumentAppController extends FileMenuController implements Doc ...@@ -37,6 +37,7 @@ public class TodoDocumentAppController extends FileMenuController implements Doc
@FXML @FXML
private void initialize() { private void initialize() {
setDocumentStorage(todoModelStorage); setDocumentStorage(todoModelStorage);
todoModelStorage.newDocument();
} }
// DocumentListener // DocumentListener
......
...@@ -17,6 +17,9 @@ import todolist.core.TodoListListener; ...@@ -17,6 +17,9 @@ import todolist.core.TodoListListener;
public class TodoListController { public class TodoListController {
@FXML
Button newTodoItemButton;
@FXML @FXML
TextField newTodoItemText; TextField newTodoItemText;
...@@ -94,6 +97,8 @@ public class TodoListController { ...@@ -94,6 +97,8 @@ public class TodoListController {
todoItemsView.getSelectionModel().select(selectedItem); todoItemsView.getSelectionModel().select(selectedItem);
} }
newTodoItemText.setText(null); newTodoItemText.setText(null);
newTodoItemButton.setDisable(todoList == null);
newTodoItemText.setDisable(todoList == null);
updateTodoListButtons(); updateTodoListButtons();
} }
......
package todolist.ui; package todolist.ui;
import fxutil.doc.AbstractDocumentStorageImpl; import fxutil.doc.AbstractDocumentStorage;
import fxutil.doc.DocumentImporter; import fxutil.doc.DocumentImporter;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
...@@ -16,7 +16,7 @@ import java.util.Collections; ...@@ -16,7 +16,7 @@ import java.util.Collections;
import todolist.core.TodoModel; import todolist.core.TodoModel;
import todolist.json.TodoPersistence; import todolist.json.TodoPersistence;
public class TodoModelStorage extends AbstractDocumentStorageImpl<TodoModel, File> { public class TodoModelStorage extends AbstractDocumentStorage<TodoModel, File> {
private TodoModel todoModel; private TodoModel todoModel;
......
...@@ -20,7 +20,7 @@ import java.util.Collection; ...@@ -20,7 +20,7 @@ import java.util.Collection;
* @param <D> the document type * @param <D> the document type
* @param <L> the location type * @param <L> the location type
*/ */
public abstract class AbstractDocumentStorageImpl<D, L> implements DocumentStorage<L>, DocumentPersistence<D, L> { public abstract class AbstractDocumentStorage<D, L> implements DocumentStorage<L>, DocumentPersistence<D, L> {
private L documentLocation; private L documentLocation;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment