Adding Help Contents, Search Help using Command Framework - java

My colleagues and I are building a new RCP application and trying to find our footing in RCP. My coworker managed to get the Eclipse Help framework working pretty quickly - but he used the old style Actions and ActionBarAdvisor.makeActions() to do it. All of the RCP Menu creation tutorials I've read (the ones that were written post Eclipse 3.3 anyway) advocate depreciating Actions and switching over completely to Commands. So I'm trying to do this. However, I cannot get the help Commands to work - not without using the help actions.
Specifically, I'm attempting to figure out how to add the default Eclipse help menu commands org.eclipse.ui.help.helpContents and org.eclipse.ui.help.helpSearch to my help menu. I've created the menu contribution, and added the commands. But they remain greyed out. I can't find any mention of anything else I have to do to hook them up to the help framework my coworker had working before using actions. If I add the actions for them and register them in make Action, they still work. But I'm trying to do this without Actions. How is this done? What am I not doing?

According to the Command tutorial on vogella.de some common commands need some ActionFactories registered:
Standard commands sometimes map to actions which are contributed via ActionFactory in the class ApplicationActionBarAdvisor. If the ActionFactory returns an IAction you need to register this action. If not these commands are inactive in your menu. For example the following made the reset perspective and welcome command active.
I think, this might be the case with the Help command as well - but I have not tested it. The other possibility would be that there is no enabled handler for the command...

Related

Eclipse-Plugin - How to open a custom progam in a custom view?

Basically I want to open a file in a custom program, which I can define, thus I can run a bash terminal for example in the workbench with gvim or vim.
In theory I think, that I need a custom plugin which adds a new entry in the 'Show in' context menu.
Any guidance is appreciated.
Interacting with 3rd party program of generic origin has no common solution as it hardly depends on 3rd party technologies. You need to greatly restrict you scenario to something more specific to find an answer.
Please have a look at Eclipse Remote System Explorer (RSE) https://help.eclipse.org/2019-03/index.jsp?topic=%2Forg.eclipse.rse.doc.user%2Fgettingstarted%2Fg_start.html that sounds a bit related with what you want to achieve.

Is it possible to use/open a GUI in Eclipse Che?

I'm recently working with Eclipse Che and have the task to import a Java Project that opens a GUI in it (like a simple Swing/SWT Calculator).
I am using the Java CentOS Stack, importing the .jar files, etc. is no problem but I get the "No X11 DISPLAY variable was set, but this program performed an operation which requires it." error.
Obviously, I found many threads about that Error, but I just wanted to ask if it is even possible to open a GUI in a web based IDE like Eclipse Che before wasting hours trying to fix that error when it's not even possible.
Maybe some of you already tried that and have a solution/tip or smth for me.
edit: found a video that answered my question. https://www.youtube.com/watch?v=AjgSp0dkxxU
Thanks anyway.
This will help you out - https://eclipse-che.readme.io/docs/che-and-swing
You need to use the right stack
You need to set the display variable. The way I did this was modify the run command to set it just before the other commands.
The command I used is:
export DISPLAY=:0.0
Also note that this worked for a while for me but randomly stop working a few days back so please tell if you manage to get it working.

RCP Start the product with Clear Workspace

So I've come across this weird bug in RCP Apps.
I've created a new RCP App with the Mail Template. I've added a new org.eclipse.ui.menus extension with a menuContribution with locationURI:toolbar:org.eclipse.ui.main.toolbar. To that, I've added a command with a little icon.
Now, if I start the app without Clear Workspace in the Debug Configurations, my action appears AFTER the Quick Access text widget. Not only that, but a few other bugs come along (e.g. views aren't closing, too many views are opening at once). This is not a one-time thing, i.e. I have to start the app with Clear Workspace each time.
This method of adding actions on the coolBar is non-deprecated. Why does it behave like a spoiled brat?
Without Clear Workspace:
With Clear Workspace:
There is a long discussion on the Eclipse forums about this here with a bug filed as a result here.
The bug is not scheduled to be fixed until Eclipse 4.4M5 but using one of the workarounds to remove the Quick Access control discussed here should help.

Can Eclipse run a single instance only of a project?

I usually develop mobile apps for iOS and Android and I am used to launching projects repeatedly without asking if another instance is running or not, since the simulators will handle this for me.
When I use Eclipse to develop desktop apps, I face this problem since running multiple times the same project will result in multiple different instances. I would like Eclipse to be able to kill the previously-opened processes before running the new one. I've found this question, but this one addresses the problem to let a single instance of a Java application run, but this is not quite the point. I do not care if the final release will run one or two times, I just want to be able to run a single instance when developing, seamlessly like Xcode or Eclipse for Android do. Moreover, that solution will popup an alert when running the same project twice, but that's not a solution for me. Kill and run, that it.
Is it possible to change the run configuration of the project to achieve this without changing the source code, or is this achievable with a plugin or whatelse? I would like to find a completely automated solution that could make me work as if I were under Xcode.
No, it is not possible to change the Eclipse run configuration so that Eclipse stops existing instance before running new instance.
As an alternative, you might try setting a keyboard shortcut for "Terminate" action.
What is the short cut in eclipse to terminate debugging/running?
Is there a keyboard shortcut for stopping the current console in Eclipse?
As a general solution to this, try:
Goto Window->Preferences, search for Launching.
Select the "Terminate and Relaunch while launching" option.
Press Apply.
Not sure if it would work while developing Android (not very common in Eclipse now), but good option to know.

Can I find out which thread is running using Eclipse?

I close my application by pressing a "Close" button. But in the Eclipse I see a red square indicating that something is still running. When I press this red square, I kill my application completely.
Is it possible to find out what is still running (which method, which loop) using Eclipse?
P.S. I am a newbie. So, it would be nice to have a simple solution. I also might not understand your answer if you use "technical" words which I do not know.
ADDED:
I cannot use System.exit since it will kill not only my software but also an "external" software which calls my software.
Have a look at jps and jstack commands they will give you the process id for your application and then you can view the threads and their states using jstack.
Its very useful for this kind of issue.
Sorry just realised you wanted something in eclipse to do this. well I'll leave this answer as it should work but not inside eclipse.
Debug View shows just that. To see the concrete methods for each thread you need to stop the application. Most probably you just need to set default close operation for the main JFrame.

Categories

Resources