Package sc.util

Class DialogManager


  • public class DialogManager
    extends java.lang.Object
    This is a simple API to facilitate scripting of UIs which also prompt for dialogs. It's a place to stash the script's chosen answer for a dialog that's to come later. Use cmd.addDialogAnswer(dialogName, answerValue) from your script and call DialogManager.getDialogAnswer(dialogName) from the code before creating the dialog. Implementation note: originally I thought maybe we needed something fancier - like the ability to register an answer for a dialog that's already visible but there might be complexities because the command line interpreter is on the same thread as the dialog request and so the two can't overlap. Maybe this should go away and we could just add an API to the swing utilities for this? Or ideally, you can structure your "view model" so that the script can drive the UI entirely by setting this properties.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.ArrayList<sc.util.DialogManager.DialogAnswer> pendingAnswers  
    • Constructor Summary

      Constructors 
      Constructor Description
      DialogManager()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addDialogAnswer​(java.lang.String dialogName, java.lang.Object answerValue)  
      static java.lang.Object getDialogAnswer​(java.lang.String dialogName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pendingAnswers

        public static final java.util.ArrayList<sc.util.DialogManager.DialogAnswer> pendingAnswers
    • Constructor Detail

      • DialogManager

        public DialogManager()
    • Method Detail

      • getDialogAnswer

        public static java.lang.Object getDialogAnswer​(java.lang.String dialogName)
      • addDialogAnswer

        public static void addDialogAnswer​(java.lang.String dialogName,
                                           java.lang.Object answerValue)