Skip to content

Instantly share code, notes, and snippets.

@grkvlt
Last active October 15, 2017 20:19
Show Gist options
  • Save grkvlt/679b307b584f837ebc5bdab9b4d10fc0 to your computer and use it in GitHub Desktop.
Save grkvlt/679b307b584f837ebc5bdab9b4d10fc0 to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
/** 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