Eclipse Mars.1 RCP
I am trying to determine a way of knowing what views are being populated from the workspace.xmi upon re-opening of my program. In particular:
"org.eclipse.ui.console.ConsoleView".
My reason for this is the program I am working on uses a custom(somewhat?) console that is invoked by going into a "help" tab and clicking a "show console" button that executes a showConsole() function that opens the view and begins logging of errors or displaying stored errors.
The problem I'm having is that upon closing the workspace and re-opening it the view is created however the console shows "there is not console to display at this time" until you go back into the help tab and click show console which executes that logging function. I need a way of determining if that view is being created on startup so I can then start the logging automatically.
Has anyone ever done something like this before or know if it's possible without writing some huge parser to parse the .xmi looking for that plugin on startup?
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.
does netbeans have something like Eclipse Debug display view?
I love the interactive window for trying out Java code in Eclipse debug mode, and it's mentioned in this post:
Is there any Python-like interactive console for Java?
Just wondering if I can get the same in netbeans
There is a menu option: Debug - Evaluate Expression...
And also a shortcut: Ctrl+F9 (in Windows)
You can see an explanation at How to Evaluate Code
There isn't an interactive window for debugging quite like Eclipse, although you can set up breakpoints in the program while debugging to follow the step by step route in which the program executes. Have you looked at the NetBeans site? http://netbeans.org/features/java/debugger.html
While debugging, press ctrl+shift+I to evaluate an expression. In the "Evaluate Expression" window you can do the same as in eclipse's display window.
I'm writing Java in eclipse and I'm just wondering if there's a shortcut or a way to open the class of the screen you are looking at when debugging an application.
So, I'm debugging a very large application, and at some point I open a dialog within the application, and I want to know which class in the Java project contains the code responsible for this dialog. Is there a shortcut to open this class in eclipse?
If you just want to go to a specific implementation of method or a class, ctrl + click will take you to the code (if it is not third party code, you will be able to see it)
If you are asking how to see the code getting executed in debug mode, use F6 key instead of F8.
Like firebug for debugging javascript,
is there such a feature in eclipse? or do I need a plugin?
Use the Display view, or a bit quicker: highlight the code you want to run and right-click/Execute or Ctrl+U.
You can use the Display view to execute commands while debugging. You can find this in Window -> Show View -> Display
Select the line and press ctrl+shift+D or ctrl+shift+I
This will give the result in a popup.
Use the debug shell! Coming from node, I was pretty used to being able to mess with my env variables at any time using node --inspect in chrome, and so it was imperative for me to find the same experience in eclipse without having to use JDB.
To open the debug shell, go to Window → Show View → Debug Shell
After you write the code you wish to run, simply highlight it, right click, and execute (⌘U also works)
I believe that what you're looking for are "watch expressions". Just mark the piece of code in the source code view, right-click and select "Watch".
I'm currently using Eclipse Photon (v4.8.0).
Eclipse changed the "Display" View name to "Debug Shell View".
Here, you can execute commands on-the-fly.
you can use the 'Display' view to evaluate expressions in eclipse.
Look under the debug list of views. It is a standard par part of the java tooling so you don't need a plugin
Complementing all the amazing answers, for mac users is cmd + D
You can also create a scrapbook page (a .jpage) file and type your code in there. Then click run. It looked slightly more convenient when I tried it.
Like others say, you use the Display view. But for some variants of Eclipse, it may be named differently. For instance, if you are using Spring Tool Suite as your Eclipse, the View name corresponding to Display view is Debug Shell.