0

I am trying to create a plug-in in eclipse that can create a console and take input from user I have a code..

    MessageConsole console=new MessageConsole("MyConsole", null);
    console.activate();
    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{console});
    MessageConsoleStream stream = console.newMessageStream();
    stream.println("Hello Eclipse");

But this console is not interactive. Is there any way to make it interactive.

OR

Is it possible to use default console of eclipse for user interaction using plug-in.

1 Answer 1

0

If you mean getting user input from the console view, you can use the Scanner class or the Console class.

Code sample:

Scanner reader = new Scanner(System.in);
String userInput = reader.next();

Or

Console console = System.console();
String userInput = console.readLine("Please input:");
1
  • By using scanner or console class neither I am able to write on eclipse console nor I can convert msgconsole in to interactive console......
    – DEV
    Jul 8, 2013 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.