-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from IdelsTak/8-add-metadata-fetch-and-selectio…
…n-feature-with-undoredo-and-filename-rename-options #8
- Loading branch information
Showing
34 changed files
with
1,312 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.idea/ | ||
/target/ | ||
/logs/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/github/idelstak/metadata/views/Alert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.github.idelstak.metadata.views; | ||
|
||
import javafx.scene.control.*; | ||
import javafx.stage.*; | ||
|
||
public enum Alert { | ||
ERROR(javafx.scene.control.Alert.AlertType.ERROR); | ||
|
||
private final javafx.scene.control.Alert alert; | ||
private final DialogPane dialogPane; | ||
|
||
Alert(javafx.scene.control.Alert.AlertType type) { | ||
alert = new javafx.scene.control.Alert(type); | ||
dialogPane = alert.getDialogPane(); | ||
} | ||
|
||
void show(Window owner, String message, Exception exception) { | ||
show(owner, message, null, exception); | ||
} | ||
|
||
void show(Window owner, String header, String content, Exception exception) { | ||
alert.initOwner(owner); | ||
alert.setHeaderText(header); | ||
if (exception != null) { | ||
Label label = new Label(exception.getMessage()); | ||
label.getStyleClass().addAll("error", "expandable"); | ||
dialogPane.setExpandableContent(label); | ||
dialogPane.setExpanded(true); | ||
} else { | ||
alert.setContentText(content); | ||
} | ||
|
||
alert.show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.idelstak.metadata.views; | ||
|
||
import java.net.*; | ||
|
||
public enum Css { | ||
STYLES("/com/github/idelstak/metadata/views/styles.css"); | ||
|
||
private final String path; | ||
|
||
Css(String path) {this.path = path;} | ||
|
||
String toExternalForm() { | ||
URL resource = getClass().getResource(path); | ||
assert resource != null; | ||
return resource.toExternalForm(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.