From eaa23f4b7af97c108ecffa40c86c32e723a90594 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 29 Aug 2007 14:40:34 +0000
Subject: [PATCH] Fix issue 1831: dsconfig interactive mode.

---
 opends/src/server/org/opends/server/util/cli/MenuCallback.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/dsconfig/HelpCallback.java b/opends/src/server/org/opends/server/util/cli/MenuCallback.java
similarity index 60%
copy from opends/src/server/org/opends/server/tools/dsconfig/HelpCallback.java
copy to opends/src/server/org/opends/server/util/cli/MenuCallback.java
index 8412933..d26ed45 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/HelpCallback.java
+++ b/opends/src/server/org/opends/server/util/cli/MenuCallback.java
@@ -24,20 +24,29 @@
  *
  *      Portions Copyright 2007 Sun Microsystems, Inc.
  */
-package org.opends.server.tools.dsconfig;
+package org.opends.server.util.cli;
 
 
 
 /**
- * An interface for displaying help interactively.
+ * A menu call-back which should be associated with each menu option.
+ * When an option is selected the call-back is invoked.
+ *
+ * @param <T>
+ *          The type of success result value(s) returned by the
+ *          call-back. Use <code>Void</code> if the call-backs do
+ *          not return any values.
  */
-interface HelpCallback {
+public interface MenuCallback<T> {
 
   /**
-   * Displays help to the provided application console.
+   * Invoke the menu call-back.
    *
    * @param app
-   *          The console application.
+   *          The application console.
+   * @return Returns the result of invoking the menu call-back.
+   * @throws CLIException
+   *           If the menu call-back fails for some reason.
    */
-  void display(ConsoleApplication app);
+  MenuResult<T> invoke(ConsoleApplication app) throws CLIException;
 }

--
Gitblit v1.10.0