Last active
October 15, 2017 20:19
-
-
Save grkvlt/679b307b584f837ebc5bdab9b4d10fc0 to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
This file contains hidden or 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
/** Method to display the dialog box. */ | |
void showDialog(); | |
@Override | |
default T get() { | |
return (T) this; | |
} | |
static <T extends Dialog<T>> void show(Supplier<T> supplier, | |
BiConsumer<Throwable,String>...handlers) { | |
try (Dialog dialog = supplier.get()) { | |
dialog.showDialog(); | |
} catch (Throwable t) { | |
for (BiConsumer<Throwable, String> handler : handlers) { | |
handler.accept(t, "Error displaying dialog"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment