Author: polx
Date: Fri Jun 16 16:22:25 2006
New Revision: 414955
URL: http://svn.apache.org/viewvc?rev=414955&view=rev
Log:
Style cleanup.
paul
Modified:
jakarta/commons/proper/jelly/trunk/jelly-tags/interaction/src/java/org/apache/commons/jelly/tags/interaction/AskTag.java
Modified:
jakarta/commons/proper/jelly/trunk/jelly-tags/interaction/src/java/org/apache/commons/jelly/tags/interaction/AskTag.java
URL:
http://svn.apache.org/viewvc/jakarta/commons/proper/jelly/trunk/jelly-tags/interaction/src/java/org/apache/commons/jelly/tags/interaction/AskTag.java?rev=414955&r1=414954&r2=414955&view=diff
==============================================================================
---
jakarta/commons/proper/jelly/trunk/jelly-tags/interaction/src/java/org/apache/commons/jelly/tags/interaction/AskTag.java
(original)
+++
jakarta/commons/proper/jelly/trunk/jelly-tags/interaction/src/java/org/apache/commons/jelly/tags/interaction/AskTag.java
Fri Jun 16 16:22:25 2006
@@ -26,10 +26,10 @@
import jline.History;
import jline.SimpleCompletor;
-import org.apache.commons.jelly.TagSupport;
-import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.commons.jelly.TagSupport;
+import org.apache.commons.jelly.XMLOutput;
/**
* Jelly Tag that asks the user a question, and puts his answer into a
variable,
@@ -42,6 +42,9 @@
private static Log logger = LogFactory.getLog(AskTag.class);
+ /** The history of previous user-inputs.*/
+ private static History consoleHistory = new History();
+
/** The question to ask to the user. */
private String question;
@@ -54,9 +57,6 @@
/** The default value, if the user doesn't answer. */
private String defaultInput;
- /** The user's input */
- private String input = "";
-
/** The prompt to display before the user input. */
private String prompt = ">";
@@ -66,7 +66,6 @@
/** Whether to complete with previous completions as well. */
private boolean useHistoryCompletor = true;
- private static History consoleHistory = new History();
/**
* Sets the question to ask to the user. If a "default" attribute is
@@ -149,6 +148,7 @@
}
ConsoleReader consoleReader;
+ String input = null;
try {
consoleReader = new ConsoleReader();
@@ -157,9 +157,6 @@
consoleReader = null;
}
- String disableJlineProp = System.getProperty("ask.jline.disable");
- boolean disableJline = (disableJlineProp != null && disableJlineProp
- .equals("true"));
try {
if (consoleReader != null
@@ -172,8 +169,8 @@
consoleReader.setBellEnabled(false);
// add old commands as tab completion history
- ArrayList oldCommandsAsList = useHistoryCompletor ?
- new ArrayList(consoleHistory.getHistoryList()) : new
ArrayList(0);
+ List oldCommandsAsList = useHistoryCompletor
+ ? new ArrayList(consoleHistory.getHistoryList()) : new
ArrayList(0);
// add predefined commands if given
if (completor != null && !completor.isEmpty()) {
oldCommandsAsList.addAll(completor);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]