Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Displaying a console-like view
Displaying a console-like view [message #1419600] Mon, 08 September 2014 21:32 Go to next message
Steve Jandali is currently offline Steve JandaliFriend
Messages: 2
Registered: September 2014
Junior Member
Hi,

I just started using RCP to write Java-based applications. I am curious to know how do I implement something similar to the console in Eclipse for my application? I know that in Netbeans RCP there is designated space for all applications build on their platform, so I am curious to know if there's something similar.
Re: Displaying a console-like view [message #1420604 is a reply to message #1419600] Wed, 10 September 2014 07:59 Go to previous messageGo to next message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi Tuan,

You can use directly the console view in your RCP application.

To do so, you need :


  1. Add the plug-in org.eclipse.ui.console as dependecy in your plugin.
  2. Add the view to your perspective using org.eclipse.ui.perspectiveExtensions or in your perspective class.
  3. Create an instance of org.eclipse.ui.console.MessageConsole and add it to the ConsoleManager :
    	private MessageConsole messageConsole; 
    	private MessageConsole getMessageConsole() {
    		if (messageConsole == null) {
    			messageConsole = new MessageConsole("CONSOLE_NAME", null);
    			ConsolePlugin.getDefault().getConsoleManager()
    					.addConsoles(new IConsole[] { messageConsole });
    		}
    		return messageConsole;
    	}

  4. Open a mesasge stream to write in the MessageConsole that we have created :
    		MessageConsoleStream msgConsoleStream = messageConsole
    				.newMessageStream();
    		msgConsoleStream.println("MyText");
    



Regards,

Hussein


ALL4TEC
Re: Displaying a console-like view [message #1420705 is a reply to message #1420604] Wed, 10 September 2014 10:54 Go to previous messageGo to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hi Hussein,

this is e4 forum. So except for using the compat layer, it isn't
possible to add a view via extension points or Perspective class because
it's not there anymore. And org.eclipse.ui pulls in the compat layer.
Using e3 views isn't possible in pure e4 application.

Regards,
Marina

On 10.09.2014 09:59, Hussein MHANNA wrote:
> Hi Tuan,
>
> You can use directly the console view in your RCP application.
> To do so, you need :
>
>
> Add the plug-in org.eclipse.ui.console as dependecy in your plugin.
> Add the view to your perspective using
> org.eclipse.ui.perspectiveExtensions or in your perspective class.
> Create an instance of org.eclipse.ui.console.MessageConsole and add it
> to the ConsoleManager :
> private MessageConsole messageConsole; private MessageConsole
> getMessageConsole() {
> if (messageConsole == null) {
> messageConsole = new MessageConsole("CONSOLE_NAME", null);
> ConsolePlugin.getDefault().getConsoleManager()
> .addConsoles(new IConsole[] { messageConsole });
> }
> return messageConsole;
> }
> Open a mesasge stream to write in the MessageConsole that we have created :
> MessageConsoleStream msgConsoleStream = messageConsole
> .newMessageStream();
> msgConsoleStream.println("MyText");
>
>
>
> Regards,
>
> Hussein
Re: Displaying a console-like view [message #1420732 is a reply to message #1420705] Wed, 10 September 2014 11:45 Go to previous messageGo to next message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi Marina,

I'm sorry that I haven't paid attention that this is the e4 forum.

I agree that it isn't possible to use the e3 views with pure E4 application but it is possible to use it with the compatibility layer (Tuan hasn't indicate if he want to use this in a pure E4 application or no).

To create a console-like view in a pure e4 application, you can create a Part and add to it an instance of org.eclipse.jface.text.source.SourceViewer or an instance of org.eclipse.jface.text.TextViewer.

Regards,

Hussein


ALL4TEC

[Updated on: Wed, 10 September 2014 11:46]

Report message to a moderator

Re: Displaying a console-like view [message #1696131 is a reply to message #1420732] Fri, 22 May 2015 09:22 Go to previous messageGo to next message
Crenguta Manea is currently offline Crenguta ManeaFriend
Messages: 2
Registered: May 2015
Junior Member
Hi Hussein,

Could you elaborate a little maybe on " add to it an instance of org.eclipse.jface.text.source.SourceViewer or an instance of org.eclipse.jface.text.TextViewer."? I have been searching for days now...I want to add a simple eclipse standard view(like console, or problems, or any other) to an E4 application and with no success....

Thanks,
Crenguta.
Re: Displaying a console-like view [message #1696237 is a reply to message #1696131] Sun, 24 May 2015 09:45 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Are you talking about plain e4 or e4 with compat layer? Plain e4 doesn't officially support adding e3 views to the application. And since the Eclipse "standard" views are Eclipse 3 based views of the ide, your requirement doesn't work out that easily.

There are unofficial ways to get that done using the compat layer and model contributions. You should find blog posts about that when searching for migration.
Previous Topic:containerData effectively deprecated?
Next Topic:eclipse 4 Delta pack error
Goto Forum:
  


Current Time: Tue Mar 19 10:48:38 GMT 2024

Powered by FUDForum. Page generated in 0.02964 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top