How to Implement Console View in Pure Eclipse 4 RCP - java

I have created a part in e4xmi which should act like a console view. How to make this part as a console like view.

There is no support for a console view or launching programs in a pure e4 RCP so you are going to have to craft everything yourself.
If you are using ProcessBuilder or Runtime.exec to launch a program you just need to set up threads to read the output of the program and send it to a part.
The part could use something like the JFace SourceViewer to display the output.

Related

Execute commands/code on the fly during debug mode in Eclipse

On Visual Studio while developing using ASP.NET with C# or VB, I used to be able to execute code or call some APIs on the fly using the console or debug window.
I am asking if this can be done using Eclipse while debugging JSP or Java classes, and how?
Tarek
The Display view in Eclipse is used to do this. You can open using the shortcut Ctrl+3 and search for Display.
There, you can inspect, evaluate expressions and execute code during the current debug context. To execute code in the view for instance, you would select the code that is typed in the view and press Ctrl+U (the same can be done by right-clicking on the selection and clicking on the appropriate option from the context menu).

Open Eclipse View in RCP headless mode?

I have headless (CLI) RCP app, normally handling command line options, but i'd occasionally need to show parts of the a gui anyway.
Is there a way to open a view part standalone(detached is fine) when PlatformUI/Workbench is not running?
WorkbenchPage.showView(the one I'd normally use to open the view) normally throws "workbench is not running" exception, which is expected of course in headless mode.
Is there some reasonable hack to do this? I tried running the RCP workbench with the event loop - the problem is that it's blocking execution and it seems too heavyweight.
I know I can create new Shell embedding the widget of the view, for it but then I'd miss the toolbars/menus that come with the proper view.
All the UI code is completely dependent on the workbench running. The workbench must be started with PlatformUI.createandRunWorkbench. So it is not possible to show a UI without doing this.
The simple SWT only Shell seems the easiest way.
Exclude the concept of RCP, and work with SWT/JFace components only.
Build some factory methods that simulate PlatformUI.createandRunWorkbench. Instead, they will create Shells and run the event loops themselves.
To me, this seems like a bit of an overkill if the app is going to be large. It it's not THAT enterprise-ish, then I guess you could do without the workbench framework. Be careful for dangling resources, though.

Which swt/jface control to use for writing telnet in eclipse rcp?

I have to write a telnet in eclipse rcp. So can anybody tell me which control should i use?
here control is for eg: swt.Text, swt.StyledText.
It depends on many things. If you want to allow for any form of formatting in the output - like support vt100 - then a StyledText control is good. If you want to keep it as simple as possible, I would probably use a Text for the current input, and a multi-line Text for the output.
If you have more freedom in your RCP application, consider adding the Console view to the application. This will give a very polished way of adding telnet support...

How to redirect the console output into the GUI console view using eclipse plugin?

I m doing a project using eclipse plugins in jave to create an ide like eclipse that runs vue scripts.Presently this programs are executed in console.I have created a GUI to write these program,when i press the run button in my GUI,I need to get back the output to my GUI Console view after running is completed.
How shall i do this?Can anyone help me in doing this?
How are you starting the programs? If you use Runtime.exec(), as a result you get a Process. You can call Process.getOutputStream() to get hold of the output stream of spawned process, and then read lines from it and output them to your GUI console view.

Can I connect my Java console application with GUI application?

I have Java console application but I need to create a user interface for the user interaction.
Is it possible to connect the GUI with Java console?
Not sure what the question is however,
You can use the console if you start with java.exe whether you use a GUI or not. If you use a GUI it is common practice to use javaw.exe which doesn't have a console, but you don't have to start your application that way.
On Unix there is only java ;)
You can connect jconsole ?Java Console? to either of these.
I have Java console application but I need to create a user interface for the user interaction.
If I understand you correctly, you have an application that takes input from the command line and you now need a GUI on top of it?
I'd say the easiest way to do this should be to create a new GUI app and use the exisiting application as a library. You might be able to call the console application's main method from the UI app and replace the standard input and output streams with your own implementations that connect to the GUI.

Categories