Skip to content

Commit

Permalink
[NFD] Update javadoc; fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Jan 30, 2024
1 parent 8911ed8 commit 1888b34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,23 @@
* {@snippet lang = java:
* import overrungl.util.value.Pair;
* void main() {
* NFD.init();
* var nfd = NFD.INSTANCE;
* nfd.init();
*
* try (MemoryStack stack = MemoryStack.stackPush()) {
* String[] outPath = new String[1];
* var filterItem = NFDNFilterItem.create(stack,
* new Pair<>("Source code", "java"),
* new Pair<>("Image file", "png,jpg"));
* var result = NFD.openDialogN(outPath, filterItem, null);
* var result = nfd.openDialogN(outPath, filterItem, null);
* switch (result) {
* case ERROR -> System.err.println(STR."Error: \{NFD.getError()}");
* case ERROR -> System.err.println(STR."Error: \{nfd.getError()}");
* case OKAY -> System.out.println(STR."Success! \{outPath[0]}");
* case CANCEL -> System.out.println("User pressed cancel.");
* }
* }
*
* NFD.quit();
* nfd.quit();
* }}
*
* <h3>File Filter Syntax</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static NFDResult of(int i) {
case 0 -> ERROR;
case 1 -> OKAY;
case 2 -> CANCEL;
default -> throw new IllegalArgumentException(i);
default -> throw new IllegalArgumentException(STR."Unexpected value: \{i}");
};
}

Expand Down

0 comments on commit 1888b34

Please sign in to comment.