diff --git a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java index 1d58a7655dd299e8971bc61662671b14a2704709..e32cfef9de4c40bb2968a9f14e85130cbdd1d06d 100644 --- a/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java +++ b/PlayWall/src/de/tobias/playpad/layout/desktop/DesktopMenuToolbarViewController.java @@ -127,7 +127,7 @@ public class DesktopMenuToolbarViewController extends BasicMenuToolbarViewContro showLiveInfo(false); - helpMenu.getItems().add(new HelpMenuItem(helpMenu)); + // helpMenu.getItems().add(new HelpMenuItem(helpMenu)); BETA } private void initLayoutMenu() { diff --git a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java index 5983e6d5c7086995533cd2fe33a81feccf60935d..ecad385a074c58c0c9c1882cf3951d683ad4f9d4 100644 --- a/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java +++ b/PlayWall/src/de/tobias/playpad/pad/content/AudioContent.java @@ -34,7 +34,6 @@ import javafx.beans.value.ChangeListener; import javafx.scene.media.AudioEqualizer; import javafx.util.Duration; -// TODO Extract Fade in / Fade Out public class AudioContent extends PadContent implements Pauseable, Durationable, Fadeable, Equalizable, SinglePathContent { private static final String TYPE = "audio"; diff --git a/PlayWall/src/de/tobias/playpad/view/HelpMenuItem.java b/PlayWall/src/de/tobias/playpad/view/HelpMenuItem.java index 1059be7fc18a4924b45523fb2ee262ab692b88cc..25a935f3accd14176f1b7b5288808a64e3a9664a 100644 --- a/PlayWall/src/de/tobias/playpad/view/HelpMenuItem.java +++ b/PlayWall/src/de/tobias/playpad/view/HelpMenuItem.java @@ -26,7 +26,7 @@ public class HelpMenuItem extends CustomMenuItem implements ChangeListener<Strin setHideOnClick(false); - Label label = new Label("Suchen nach (Beta): "); // TODO BETA i18n + Label label = new Label("Suchen nach (Beta): "); // BETA i18n TextField textfield = new TextField(); textfield.textProperty().addListener(this); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/FixCell.java b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/FixCell.java index 6fb968cdb2ee6d0a1904bd08ca3774f049a1db3d..2e6e65f3117abbed7dff065272484dd5180b5fba 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/FixCell.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/FixCell.java @@ -1,16 +1,9 @@ package de.tobias.playpad.viewcontroller.cell.errordialog; -import java.nio.file.Files; import java.nio.file.Path; -import de.tobias.playpad.PlayPadPlugin; -import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.PadException; -import de.tobias.playpad.pad.conntent.PadContent; -import de.tobias.playpad.pad.conntent.PadContentConnect; -import de.tobias.playpad.registry.NoSuchComponentException; import de.tobias.playpad.view.ExceptionButton; -import de.tobias.utils.util.FileUtils; import javafx.scene.control.Button; import javafx.scene.control.Control; import javafx.scene.control.TableCell; @@ -38,33 +31,7 @@ public class FixCell extends TableCell<PadException, PadException> { case FILE_NOT_FOUND: ExceptionButton<Path> notExistsExButton = ExceptionButton.FILE_NOT_FOUND_EXCEPTION; Button notExistsButton = notExistsExButton.getButton(); - notExistsButton.setOnAction(a -> - { - Path path = notExistsExButton.getHandler().handle(item.getPad(), stage); - if (path != null) { - - Pad pad = item.getPad(); - PadContent content = item.getPad().getContent(); - try { - PadContentConnect padContentConnect = PlayPadPlugin.getRegistryCollection().getPadContents() - .getComponent(content.getType()); - - if (Files.exists(path) && PadContentConnect.isFileSupported(path, padContentConnect)) { - try { - content.handlePath(path); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); - pad.removeException(item); - } - } catch (NoSuchComponentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); + notExistsButton.setOnAction(new IOExceptionButtonListener(item, stage, notExistsExButton)); vbox.getChildren().add(notExistsButton); break; @@ -72,33 +39,7 @@ public class FixCell extends TableCell<PadException, PadException> { case CONVERT_NOT_SUPPORTED: ExceptionButton<Path> supportExButton = ExceptionButton.FILE_NOT_FOUND_EXCEPTION; Button supportButton = supportExButton.getButton(); - supportButton.setOnAction(a -> - { - Path path = supportExButton.getHandler().handle(item.getPad(), stage); - if (path != null) { - - Pad pad = item.getPad(); - PadContent content = item.getPad().getContent(); - try { - PadContentConnect padContentConnect = PlayPadPlugin.getRegistryCollection().getPadContents() - .getComponent(content.getType()); - - if (Files.exists(path) && PadContentConnect.isFileSupported(path, padContentConnect)) { - try { - content.handlePath(path); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); - pad.removeException(item); - } - } catch (NoSuchComponentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); + supportButton.setOnAction(new IOExceptionButtonListener(item, stage, supportExButton)); vbox.getChildren().add(supportButton); break; diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java new file mode 100644 index 0000000000000000000000000000000000000000..94b61fe98861c4299b201c66436513213f2f1f4d --- /dev/null +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/cell/errordialog/IOExceptionButtonListener.java @@ -0,0 +1,54 @@ +package de.tobias.playpad.viewcontroller.cell.errordialog; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import de.tobias.playpad.PlayPadPlugin; +import de.tobias.playpad.pad.Pad; +import de.tobias.playpad.pad.PadContentRegistry; +import de.tobias.playpad.pad.PadException; +import de.tobias.playpad.pad.conntent.PadContent; +import de.tobias.playpad.pad.conntent.PadContentConnect; +import de.tobias.playpad.registry.NoSuchComponentException; +import de.tobias.playpad.view.ExceptionButton; +import de.tobias.utils.util.FileUtils; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.stage.Stage; + +public class IOExceptionButtonListener implements EventHandler<ActionEvent> { + + private PadException item; + private Stage stage; + private ExceptionButton<Path> exButton; + + public IOExceptionButtonListener(PadException item, Stage stage, ExceptionButton<Path> notExistsExButton) { + this.item = item; + this.stage = stage; + this.exButton = notExistsExButton; + } + + @Override + public void handle(ActionEvent a) { + Path path = exButton.getHandler().handle(item.getPad(), stage); + if (path != null) { + + Pad pad = item.getPad(); + PadContent content = item.getPad().getContent(); + try { + PadContentRegistry padContents = PlayPadPlugin.getRegistryCollection().getPadContents(); + PadContentConnect padContentConnect = padContents.getComponent(content.getType()); + + if (Files.exists(path) && PadContentConnect.isFileSupported(path, padContentConnect)) { + content.handlePath(path); + pad.setName(FileUtils.getFilenameWithoutExtention(path.getFileName())); + pad.removeException(item); + } + } catch (NoSuchComponentException | IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } +}