From 0562faad709cbfb4352b64505327c9d714fce29e Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Fri, 30 Nov 2018 22:02:44 -0500 Subject: [PATCH] Javadoc Signed-off-by: Emmanuel Bigeon --- .../bigeon/gclc/swt/ConsoleInputManager.java | 19 ++++++++--- .../bigeon/gclc/swt/ConsolePromptManager.java | 24 ++++++++++---- .../gclc/swt/PromptReadingRunnable.java | 32 +++++++++++++++---- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsoleInputManager.java b/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsoleInputManager.java index 3c83881..4df15ab 100644 --- a/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsoleInputManager.java +++ b/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsoleInputManager.java @@ -9,19 +9,24 @@ import org.eclipse.swt.widgets.Text; import net.bigeon.gclc.utils.PipedConsoleInput; -/** @author Emmanuel Bigeon */ +/** The object managing the console input. + * + * @author Emmanuel Bigeon */ public final class ConsoleInputManager implements ConsoleDelayIO { private final Text text; private PipedConsoleInput input; - /** @param text the text */ + /** Create a managing object. + * + * @param text the text */ public ConsoleInputManager(final Text text) { super(); this.text = text; } - /** @param string the text */ + /* (non-Javadoc) + * @see net.bigeon.gclc.swt.ConsoleDelayIO#setInput(java.lang.String) */ @Override public void setInput(final String string) { text.setText(string); @@ -35,19 +40,23 @@ public final class ConsoleInputManager implements ConsoleDelayIO { return text.getText(); } + /* (non-Javadoc) + * @see net.bigeon.gclc.swt.ConsoleDelayIO#validateInput() */ @Override public void validateInput() throws IOException { input.type(text.getText()); } - /** Set the input to control + /** Set the input to control. * * @param input the input */ public void setManager(final PipedConsoleInput input) { this.input = input; } - /** @return the text */ + /** Get the text component containing the currently set input. + * + * @return the text */ public Text getText() { return text; } diff --git a/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsolePromptManager.java b/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsolePromptManager.java index 814dd75..bc261e0 100644 --- a/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsolePromptManager.java +++ b/gclc-swt/src/main/java/net/bigeon/gclc/swt/ConsolePromptManager.java @@ -7,25 +7,36 @@ import java.io.BufferedReader; import org.eclipse.swt.widgets.Label; -/** @author Emmanuel Bigeon */ +/** The manager for the console prompt updates. + * + * @author Emmanuel Bigeon */ public final class ConsolePromptManager { - private final Label label; + /** The label to set the prompts at. */ + private final Label label; + /** The current prompt reading runnable. */ private PromptReadingRunnable promptRead; - /** @param label the label to update */ + /** Create the manager. + * + * @param label the label to update with prompts */ public ConsolePromptManager(final Label label) { super(); this.label = label; } - /** @param string the text */ + /** Set the prompt. + *

+ * This method sets the prompt on the label as requested, without changing the + * actual prompt of the console input. + * + * @param string the text */ public void setPrompt(final String string) { label.setText(string); } - /** Set the input to control + /** Set the input to control. * * @param promptStream the input */ public void setStream(final BufferedReader promptStream) { @@ -39,8 +50,7 @@ public final class ConsolePromptManager { promptRead = null; return; } - promptRead = new PromptReadingRunnable(promptStream, - label); + promptRead = new PromptReadingRunnable(promptStream, label); final Thread th = new Thread(promptRead, "Prompt To Label"); th.start(); } diff --git a/gclc-swt/src/main/java/net/bigeon/gclc/swt/PromptReadingRunnable.java b/gclc-swt/src/main/java/net/bigeon/gclc/swt/PromptReadingRunnable.java index 98d3a8e..e119141 100644 --- a/gclc-swt/src/main/java/net/bigeon/gclc/swt/PromptReadingRunnable.java +++ b/gclc-swt/src/main/java/net/bigeon/gclc/swt/PromptReadingRunnable.java @@ -15,17 +15,29 @@ import org.eclipse.swt.widgets.Label; * @author Emmanuel Bigeon */ public class PromptReadingRunnable implements Runnable { - private static final Logger LOGGER = Logger + /** The logger for this class. */ + private static final Logger LOGGER = Logger .getLogger(PromptReadingRunnable.class.getName()); + + /** The reader providing the succession of prompts */ private final BufferedReader reader; + /** The label. */ private final Label view; + /** The running status. */ private boolean running = true; + /** The updating runnable implementation. + * + * @author Emmanuel Bigeon */ private static class LabelUpdater implements Runnable { + /** The label to update. */ private final Label label; + /** The text to set. */ private final String content; - /** @param label the label + /** Create the updating runnable. + * + * @param label the label * @param content the content */ public LabelUpdater(final Label label, final String content) { super(); @@ -41,7 +53,9 @@ public class PromptReadingRunnable implements Runnable { } } - /** @param reader the reader + /** Create the prompt flow updating runnable. + * + * @param reader the reader * @param view the view to update on lines. */ public PromptReadingRunnable(final BufferedReader reader, final Label view) { super(); @@ -63,17 +77,23 @@ public class PromptReadingRunnable implements Runnable { } } - /** @return the running */ + /** Get the running state. + * + * @return the running */ public synchronized boolean isRunning() { return running; } - /** @param running the running to set */ + /** Set the running state. + * + * @param running the running to set */ public synchronized void setRunning(final boolean running) { this.running = running; } - /** @return the reader */ + /** Get the prompt flow. + * + * @return the reader */ public BufferedReader getReader() { return reader; }