Skip to content

Instantly share code, notes, and snippets.

@eugener
Created October 16, 2010 02:47
Show Gist options
  • Save eugener/629333 to your computer and use it in GitHub Desktop.
Save eugener/629333 to your computer and use it in GitHub Desktop.
TaskDialog dlg = new TaskDialog("Security Warning");
dlg.setInstruction( "The publisher cannot be verified.\nDo you want to run this software?" );
dlg.setText( "Name: C:\\Program Files\\eclipse\\eclipse.exe\n" +
"Publisher: <b>Unknown Publisher</b>\n" +
"Type: Application\n");
dlg.setIcon( TaskDialog.StandardIcon.WARNING );
dlg.getFooter().setCheckBoxText("Always ask before opening this file");
dlg.setCommands( StandardCommand.OK.derive("Run"), StandardCommand.CANCEL );
if ( dlg.show().equals(StandardCommand.OK)) {
//do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment