diff options
author | Sarika Sinha | 2014-11-25 17:21:19 +0000 |
---|---|---|
committer | Mike Rennie | 2014-11-25 17:21:19 +0000 |
commit | f8e14408928261dc167508ea6610f5abdaf09153 (patch) | |
tree | c6890454fadb346cf7ad173271ee721b10b8ddcb /org.eclipse.ui.console | |
parent | 7c47c0f6697451e6c24d45d78376e3cb5acb33d3 (diff) | |
download | eclipse.platform.debug-f8e14408928261dc167508ea6610f5abdaf09153.tar.gz eclipse.platform.debug-f8e14408928261dc167508ea6610f5abdaf09153.tar.xz eclipse.platform.debug-f8e14408928261dc167508ea6610f5abdaf09153.zip |
Bug 155411 - [launch] Need a way to assign stdin to a file from Run
Dialog
Signed-off-by: Sarika Sinha <sarika.sinha@in.ibm.com>
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r-- | org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java index ef88148b6..f0daa22de 100644 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java +++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,7 @@ package org.eclipse.ui.console; import java.io.Closeable; import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -42,7 +43,7 @@ public class IOConsole extends TextConsole { /** * The stream from which user input may be read */ - private IOConsoleInputStream inputStream; + private InputStream inputStream; /** * A collection of open streams connected to this console. @@ -90,8 +91,10 @@ public class IOConsole extends TextConsole { openStreams.add(inputStream); } - partitioner = new IOConsolePartitioner(inputStream, this); - partitioner.connect(getDocument()); + if (inputStream instanceof IOConsoleInputStream) { + partitioner = new IOConsolePartitioner((IOConsoleInputStream) inputStream, this); + partitioner.connect(getDocument()); + } } /** @@ -154,9 +157,22 @@ public class IOConsole extends TextConsole { * @return the input stream connected to the keyboard. */ public IOConsoleInputStream getInputStream() { - return inputStream; + if (inputStream instanceof IOConsoleInputStream) { + return (IOConsoleInputStream) inputStream; + } + return null; } + /** + * Sets the new input stream . + * + * @return void. + * @since 3.6 + */ + public void setInputStream(InputStream inputStream) { + this.inputStream = inputStream; + } + /** * Returns this console's document partitioner. * |