package com.cjmalloy.torrentfs.editor.controller;

import java.nio.file.Path;

import com.cjmalloy.torrentfs.editor.model.FileSystemModel;


public class FileSystemController extends Controller<FileSystemModel>
{

    public FileSystemController(FileSystemModel model)
    {
        this.model = model;
    }

    public void setWorkspace(Path workspace)
    {
        model.workspace = workspace;
        update();
    }
}

@@ -70,16 +70,80 @@
 le.Path;
+%0Aimport java.nio.file.Paths;%0Aimport java.util.prefs.Preferences;
 %0A%0Aimport
@@ -274,155 +274,401 @@
 %3E%0A%7B%0A
-%0A    public FileSystemController(FileSystemModel model)%0A    %7B%0A        this.model = model;%0A    %7D%0A%0A    public void setWorkspace(Path workspace)%0A    %7B
+    private static Preferences P = Preferences.userNodeForPackage(FileSystemController.class);%0A%0A    public FileSystemController(FileSystemModel model)%0A    %7B%0A        this.model = model;%0A%0A        setWorkspace(Paths.get(P.get(%22tfsLastWorkspace%22, System.getProperty(%22user.home%22))));%0A    %7D%0A%0A    public void setWorkspace(Path workspace)%0A    %7B%0A        P.put(%22tfsLastWorkspace%22, workspace.toString());
 %0A   

Set workspace persistence and defaults.