diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/DuplicateProjectDialog.java b/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/DuplicateProjectDialog.java index efc0f104de995d3e19cee2a4ef1b808c8a06b716..facbfdaca8048a6301197e45e8f2935656b319e0 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/DuplicateProjectDialog.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/DuplicateProjectDialog.java @@ -29,17 +29,6 @@ public class DuplicateProjectDialog extends TextInputDialog { Stage dialog = (Stage) getDialogPane().getScene().getWindow(); PlayPadMain.stageIcon.ifPresent(dialog.getIcons()::add); - setResultConverter(button -> - { - String param = getEditor().getText(); - if (!param.endsWith(PlayPadMain.projectType.substring(1))) { - param += PlayPadMain.projectType.substring(1); - } - - ButtonData data = button == null ? null : button.getButtonData(); - return data == ButtonData.OK_DONE ? param : null; - }); - Button button = (Button) getDialogPane().lookupButton(ButtonType.OK); getEditor().textProperty().addListener((a, b, c) -> { diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/ProjectManagerDialog.java b/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/ProjectManagerDialog.java index 7d45a9b2e6369235b1d1dd6b0af0483224b242cc..b12131ab3b0a37b10da472e5e536c1c89ec4134c 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/ProjectManagerDialog.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/dialog/ProjectManagerDialog.java @@ -19,7 +19,6 @@ import de.tobias.playpad.project.ref.ProjectReferences; import de.tobias.playpad.settings.Profile; import de.tobias.playpad.viewcontroller.cell.ProjectCell; import de.tobias.utils.ui.NotificationHandler; -import de.tobias.utils.ui.ViewController; import de.tobias.utils.ui.scene.NotificationPane; import de.tobias.utils.util.Localization; import de.tobias.utils.util.TimeUtils; @@ -115,7 +114,7 @@ public class ProjectManagerDialog extends NVC implements NotificationHandler { try { ProfileReference profileRef = ref.getProfileReference(); profileLabel.setText(profileRef.getName()); - dateLabel.setText(TimeUtils.getDfmLong().format(ref.getLastMofied())); + dateLabel.setText(TimeUtils.getDfmLong().format(ref.getLastModified())); } catch (Exception e) { profileLabel.setText("-"); dateLabel.setText("-"); @@ -235,6 +234,7 @@ public class ProjectManagerDialog extends NVC implements NotificationHandler { if (getSelecteItem() != null) { DuplicateProjectDialog dialog = new DuplicateProjectDialog(this, getSelectedProject()); + dialog.getName().ifPresent(ref -> { projectList.getItems().add(ref); diff --git a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java index 1d0a3877030404ae3fffec969c967ee27e85d2f2..ad4ebafb1320b06f4758d3366a72022f9effa924 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReference.java @@ -19,21 +19,18 @@ import javafx.beans.property.StringProperty; public class ProjectReference implements Displayable { - /** - * Name + XML - */ private UUID uuid; private String name; private ProfileReference profileReference; private Set<Module> requestedModules; - private long lastMofied; + private long lastModified; public ProjectReference(UUID uuid, String name, ProfileReference profileReference) { this.uuid = uuid; this.name = name; - this.lastMofied = System.currentTimeMillis(); + this.lastModified = System.currentTimeMillis(); this.profileReference = profileReference; requestedModules = new HashSet<>(); @@ -43,27 +40,27 @@ public class ProjectReference implements Displayable { public ProjectReference(UUID uuid, String name, ProfileReference profileReference, Set<Module> modules) { this.uuid = uuid; this.name = name; - this.lastMofied = System.currentTimeMillis(); + this.lastModified = System.currentTimeMillis(); this.profileReference = profileReference; requestedModules = modules; updateDisplayProperty(); } - public ProjectReference(UUID uuid, String name, long lastMofied, ProfileReference profileReference) { + public ProjectReference(UUID uuid, String name, long lastModified, ProfileReference profileReference) { this.uuid = uuid; this.name = name; - this.lastMofied = lastMofied; + this.lastModified = lastModified; this.profileReference = profileReference; requestedModules = new HashSet<>(); updateDisplayProperty(); } - public ProjectReference(UUID uuid, String name, long lastMofied, ProfileReference profileReference, Set<Module> requestedModules) { + public ProjectReference(UUID uuid, String name, long lastModified, ProfileReference profileReference, Set<Module> requestedModules) { this.uuid = uuid; this.name = name; - this.lastMofied = lastMofied; + this.lastModified = lastModified; this.profileReference = profileReference; this.requestedModules = requestedModules; @@ -78,12 +75,12 @@ public class ProjectReference implements Displayable { return name; } - public void setLastMofied(long lastMofied) { - this.lastMofied = lastMofied; + public void setLastModified(long lastModified) { + this.lastModified = lastModified; } - public long getLastMofied() { - return lastMofied; + public long getLastModified() { + return lastModified; } public void setName(String name) { diff --git a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferenceSerializer.java b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferenceSerializer.java index 448e369358aef6bf48c9791c129f900a64852f18..8fe853f3afa742b9ac865954a62271fa210932b3 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferenceSerializer.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferenceSerializer.java @@ -41,7 +41,7 @@ public class ProjectReferenceSerializer implements XMLDeserializer<ProjectRefere Path projectPath = ApplicationUtils.getApplication().getPath(PathType.DOCUMENTS, ref.getFileName()); if (Files.exists(projectPath)) { try { - ref.setLastMofied(Files.getLastModifiedTime(projectPath).toMillis()); + ref.setLastModified(Files.getLastModifiedTime(projectPath).toMillis()); } catch (IOException e) { e.printStackTrace(); } diff --git a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java index feabcc448ff93cc1d8ab2697fdc785f57a646054..785c9ad618a0939f9d9fb0f4f5926315a8114472 100644 --- a/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java +++ b/PlayWallCore/src/de/tobias/playpad/project/ref/ProjectReferences.java @@ -115,7 +115,7 @@ public final class ProjectReferences { List<ProjectReference> items = new ArrayList<>(); projects.forEach(item -> items.add(item)); - items.sort((o1, o2) -> Long.compare(o2.getLastMofied(), o1.getLastMofied())); + items.sort((o1, o2) -> Long.compare(o2.getLastModified(), o1.getLastModified())); return items; } }