diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/cell/DisplayableCell.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/cell/DisplayableCell.java index 69045785485c04dd624aebf5866d4391a2d707a6..6cb8cce7926a7d3dfd1c6bf3b3655a31140bd410 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/cell/DisplayableCell.java +++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/cell/DisplayableCell.java @@ -9,15 +9,15 @@ public class DisplayableCell<T extends Displayable> extends ListCell<T> { private Displayable action; @Override - protected void updateItem(T action, boolean empty) { - super.updateItem(action, empty); + protected void updateItem(T item, boolean empty) { + super.updateItem(item, empty); if (!empty) { - if (this.action == null || this.action != action) { - Node graphics = action.getGraphics(); + if (this.action == null || this.action != item) { + Node graphics = item.getGraphics(); setGraphic(graphics); - textProperty().bind(action.displayProperty()); - this.action = action; + textProperty().bind(item.displayProperty()); + this.action = item; } } else { this.action = null; diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/ProfileViewController.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/ProfileViewController.java index e85315db92647ed2b4e45c6a9b292ff1f7f2e47f..2aa80127b626bf2f622a42033fbc5388b300d73a 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/ProfileViewController.java +++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/ProfileViewController.java @@ -1,5 +1,6 @@ package de.tobias.playpad.viewcontroller.dialog; +import de.thecodelabs.logger.Logger; import de.thecodelabs.utils.ui.NVC; import de.thecodelabs.utils.ui.NVCStage; import de.thecodelabs.utils.util.Localization; @@ -80,7 +81,8 @@ public class ProfileViewController extends NVC implements ChangeListener<Profile ref.setName(newValue); return; } - } catch (Exception ignored) { + } catch (Exception e) { + Logger.error(e); } } nameTextField.pseudoClassStateChanged(PseudoClasses.ERROR_CLASS, true); @@ -110,7 +112,7 @@ public class ProfileViewController extends NVC implements ChangeListener<Profile try { Profile.load(ref); } catch (ProfileNotFoundException | DocumentException | IOException e) { - e.printStackTrace(); + Logger.error(e); } getStageContainer().ifPresent(NVCStage::close); } @@ -156,8 +158,8 @@ public class ProfileViewController extends NVC implements ChangeListener<Profile ProfileReferenceManager.removeProfile(ref); profileList.getItems().remove(ref); } catch (Exception e) { - e.printStackTrace(); showErrorMessage(Localization.getString(Strings.Error_Profile_Delete, e.getMessage())); + Logger.error(e); } }); } diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/profile/ProfileChooseDialog.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/profile/ProfileChooseDialog.java index 0c9f444b74c0cf4bcccb34fcb4f31b3efa61b463..82cef96dc6ebe71ea10cb03ad9fa6eb47082127a 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/profile/ProfileChooseDialog.java +++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/profile/ProfileChooseDialog.java @@ -1,5 +1,6 @@ package de.tobias.playpad.viewcontroller.dialog.profile; +import de.thecodelabs.logger.Logger; import de.thecodelabs.utils.ui.NVC; import de.thecodelabs.utils.ui.NVCStage; import de.thecodelabs.utils.util.Localization; @@ -75,7 +76,7 @@ public class ProfileChooseDialog extends NVC { getStageContainer().ifPresent(NVCStage::close); } catch (IOException | DocumentException | ProfileNotFoundException e) { showErrorMessage(Localization.getString(Strings.Error_Profile_Save, e.getLocalizedMessage())); - e.printStackTrace(); + Logger.error(e); } } @@ -87,9 +88,9 @@ public class ProfileChooseDialog extends NVC { @FXML private void newProfileButtonHandler(ActionEvent event) { NewProfileDialog dialog = new NewProfileDialog(getContainingWindow()); - dialog.showAndWait().ifPresent(profile -> { + dialog.showAndWait().ifPresent(created -> { // Add new Profile to combo box and select it - profileComboBox.getItems().add(profile.getRef()); + profileComboBox.getItems().add(created.getRef()); profileComboBox.getSelectionModel().selectLast(); }); } diff --git a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/project/ProjectManagerDialog.java b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/project/ProjectManagerDialog.java index cf41c725908cec33630bad90df64b3ed8dfcb222..24127762af0f491c57160336ea36eb252b3d94d5 100644 --- a/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/project/ProjectManagerDialog.java +++ b/PlayWall/src/main/java/de/tobias/playpad/viewcontroller/dialog/project/ProjectManagerDialog.java @@ -1,5 +1,6 @@ package de.tobias.playpad.viewcontroller.dialog.project; +import de.thecodelabs.logger.Logger; import de.thecodelabs.utils.ui.NVC; import de.thecodelabs.utils.ui.NVCStage; import de.thecodelabs.utils.util.Localization; @@ -82,11 +83,9 @@ public class ProjectManagerDialog extends NVC { // Mouse Open Handler projectList.setOnMouseClicked(mouseEvent -> { - if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) { - if (mouseEvent.getClickCount() == 2) { - if (!projectList.getSelectionModel().isEmpty()) { - openHandler(null); - } + if (mouseEvent.getButton().equals(MouseButton.PRIMARY) && mouseEvent.getClickCount() == 2) { + if (!projectList.getSelectionModel().isEmpty()) { + openHandler(null); } } }); @@ -146,7 +145,7 @@ public class ProjectManagerDialog extends NVC { ProjectReferenceManager.setSync(reference, newValue); } catch (ProjectNotFoundException | ProfileNotFoundException | DocumentException | IOException e) { showErrorMessage(Localization.getString(Strings.Error_Project_Sync_Change, e.getLocalizedMessage())); - e.printStackTrace(); + Logger.error(e); } catch (ProjectReader.ProjectReaderDelegate.ProfileAbortException ignored) { } } @@ -211,7 +210,7 @@ public class ProjectManagerDialog extends NVC { Optional<ProjectReference> importedProject = dialog.showAndWait(); importedProject.ifPresent(projectList.getItems()::add); } catch (IOException | DocumentException e) { - e.printStackTrace(); + Logger.error(e); } } } @@ -248,7 +247,7 @@ public class ProjectManagerDialog extends NVC { projectList.getItems().remove(reference); } catch (IOException e) { showErrorMessage(Localization.getString(Strings.Error_Project_Delete, e.getLocalizedMessage())); - e.printStackTrace(); + Logger.error(e); } });