Added documentation

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2018-11-30 21:35:17 -05:00
parent 7fd1bf90bd
commit 185d19bfcf
2 changed files with 17 additions and 10 deletions

View File

@ -93,7 +93,8 @@ public final class SWTConsoleShell extends Shell {
/** Create the shell. /** Create the shell.
* *
* @param display the display */ * @param display the display
* @param style the shell style */
public SWTConsoleShell(final Display display, final int style) { public SWTConsoleShell(final Display display, final int style) {
super(display, style); super(display, style);
setLayout(new GridLayout(2, false)); setLayout(new GridLayout(2, false));
@ -121,6 +122,11 @@ public final class SWTConsoleShell extends Shell {
setText("Console Application"); //$NON-NLS-1$ setText("Console Application"); //$NON-NLS-1$
} }
/** Connect the console parts to the shell.
*
* @param input the input
* @param output the output
* @param promptStream the stream where the prompts are forwarded. */
public void connect(final PipedConsoleInput input, final PipedConsoleOutput output, public void connect(final PipedConsoleInput input, final PipedConsoleOutput output,
final BufferedReader promptStream) { final BufferedReader promptStream) {
inputManager.setManager(input); inputManager.setManager(input);

View File

@ -45,13 +45,15 @@ import net.bigeon.gclc.ConsoleApplication;
import net.bigeon.gclc.utils.PipedConsoleInput; import net.bigeon.gclc.utils.PipedConsoleInput;
import net.bigeon.gclc.utils.PipedConsoleOutput; import net.bigeon.gclc.utils.PipedConsoleOutput;
/** A SWT component to connect to gclc {@link ConsoleApplication} /** A SWT component to connect to gclc {@link ConsoleApplication}.
* <p>
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
public final class SWTConsoleView extends Composite { public final class SWTConsoleView extends Composite {
/** The input manager. */
private final ConsoleInputManager inManager; private final ConsoleInputManager inManager;
/** The output manager. */
private final ConsoleOutputManager outManager; private final ConsoleOutputManager outManager;
/** Create the composite. /** Create the composite.
* *
* @param parent the prent composite * @param parent the prent composite
@ -73,11 +75,6 @@ public final class SWTConsoleView extends Composite {
consoleInput.addKeyListener(new HistoryTextKeyListener(inManager)); consoleInput.addKeyListener(new HistoryTextKeyListener(inManager));
} }
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.swt.widgets.Composite#setFocus() */ * @see org.eclipse.swt.widgets.Composite#setFocus() */
@Override @Override
@ -95,12 +92,16 @@ public final class SWTConsoleView extends Composite {
inManager.setManager(input); inManager.setManager(input);
} }
/** @return the inManager */ /** Get the manager of console input.
*
* @return the input manager */
public ConsoleInputManager getInputManager() { public ConsoleInputManager getInputManager() {
return inManager; return inManager;
} }
/** @return the outManager */ /** Get the manager of console output.
*
* @return the output manager */
public ConsoleOutputManager getOutputManager() { public ConsoleOutputManager getOutputManager() {
return outManager; return outManager;
} }