Ticket #677 (closed enhancement: fixed)

Opened 8 years ago

Last modified 8 years ago

Generalized Dialog Box

Reported by: gharris Owned by: gharris
Priority: major Milestone: biweekly-2011: Jul-18 to Jul-29
Component: UI Framework Version:
Severity: major Keywords:
Cc: Blocked By:
Blocking:

Description

Generalized Dialog Box

Added an interface DialogPrompt.
Added a SwingDialogPrompt implementation.
Added to imagej.ui.UserInterface a method,

DialogPrompt dialogPrompt(String message, String title,
DialogPrompt.MessageType msg, DialogPrompt.OptionType option);

So, to prompt the user for a yes/no/cancel or confirmation dialog,
do this:


final UserInterface ui = ImageJ.get(UIService.class).getUI();
DialogPrompt dialog = ui.dialogPrompt("Message", "Title",

DialogPrompt.MessageType.QUESTION_MESSAGE,
DialogPrompt.OptionType.YES_NO_OPTION);

DialogPrompt.Result result = dialog.prompt();
if (result == DialogPrompt.Result.YES_OPTION) {

System.out.println("That's a YES");

}


The plugin imagej.ui.swing.plugins.debug.TestDialogPrompt (menu: Plugins::Debug::TestDialogPrompt) demonstrates it use.

Change History

comment:1 Changed 8 years ago by gharris

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.