Eclipse keybindings. Setting up a shortcut for executing a specific run configuration - eclipse

I'm trying to setup a key binding in Eclipse to directly execute a background Java file. My file is called CodeChecker.java and it's sufficient for my purposes to run the main method without any arguments. I need to run it repeatedly and so I'm trying to setup a shortcut key to run it directly without having to bring up the Run... menu or having to bring up the file itself.
As far as I'm aware Eclipse is not able to offer this functionality directly. I've tried using a plugin called Practically Macro according to this answer Assigning a keyboard shortcut for a specific Eclipse build configuration. But this answer is horribly out of date and doesn't work any longer.
So I'm wondering if Practically Macro can still be used to achieve this? Any other solution, plugin, script or otherwise would be equally welcome.

Related

Eclipse Pydev interactive console use inside functions

What are the best practices for developing with the Eclipse Pydev interactive console once code migrates inside a function?
I heavily use the interactive console as my projects are typically experimental, open-ended, and not spec-driven. The interactive console works well for code in the main loop, but as soon as I migrate that code to a function, I only know to use breakpoints with the debug view. However, that seems unwieldy, and I don't need the entire stack, nor error-catching mechanisms.
Is there a way to have the vanilla pydev environment interactive console inside a function, for example on the first breakpoint, or raised error?
Without this, I typically have to copy the function back into the main loop. Then, I end up using the same variable names, which leads to occasional global variable name accidents when I copy back to a function.
Thanks in advance.

Shortcut for selecting run configuration in Eclipse IDE

I have an Eclipse workspace with a bunch of projects. I manually created some run configurations for each project (it's necessary to pass some arguments to VM, so I can't just run it directly, e.g. using shortcut ALT+SHIFT+X, T in the specific file).
Most of the time, I just use one run configuration (whereas for the first time I manually launch it using Run -> Run configurations -> (name) -> Run). Since I configured Eclipse to always run the last run configuration (on F11 or CTRL+F11), it's usually enough.
However, sometimes I need to switch to a different run configuration and then back to previous one and then to a different one etc. Is there a quick way to do it? I'd like to see a shortcut, which would display pop-up window with all existing run configurations. By typing first few letters, I'd find an appropriate one and would be able to immediately run it by pressing ENTER. I mean something similar to what CTRL+SHIFT+T or CTRL+SHIFT+R looks like.
I'm afraid there's not something like that. Nonetheless, any advice on how to get more effective would be greatly appreciated, because I'm bored of switching run configurations via menu (as I described above). I can press ALT+R, N and then select a run configuration using arrow keys, but it's not really that comfortable.
You already gave most of the answer yourself. Start by pressing ALT+R, N and then simply start typing the name of the configuration you want. The cursor should be positioned in the filter field and thus incrementally reduce the list of launch configurations as you type. When you've narrowed it down to 1, complete the selection by ALT+R.
BTW: thanks for the reminder, I, too, was using the mouse way too much in this particular use case. I will stop doing so, now that I gave the answer :)
Since Eclipse 4.12 (June 2019, 4 years later) you can also launch any of the Run or Debug configurations available in your workspace from... the Quick Access menu (Ctrl+3 shortcut)
Note: For performance reasons, the extra Quick Access entries are only visible if the org.eclipse.debug.ui bundle was already activated by some previous action in the workbench such as editing a launch configuration, or expanding the Run As... menus.

how to restore escreen configuration on emacs startup?

Is there a way to restore all escreen screens and window configurations on emacs startup?
I tried to add the (escreen-configuration-alist) to desktop-saved-globals with no result.
I also tried to execute some code manually, but whenever I run (escreen-restore-screen-map screen-map) with screen-map being export of current escreen screen map, I get "wrong argument type window-configuration-p".
Not an elisp expert and a little bit stuck.
If there's no luck with escreen, maybe el-screen has the needed functionality?
Thanks.
Actually, escreen use the window configuration as defined in Emacs. Unfortunately window configuration is hard coded in C and there is no serialization. So you cannot save/restore between sessions but simply register it.
The only way is to rewrite window configuration in Emacs Lisp. HIROSE Yuuji wrote his own window configuration and it works great! I enhanced it to support frames and escreen case and post it on github: https://github.com/martialboniou/revive-plus
I provided this package WITHOUT ANY WARRANTY. No unit test, for instance, but it should work. Let me know (it's a fresh hack so there will be refactoring soon)!

Eclipse: On Save execute a program

I have recently come across the LESS Leaner CSS a template engine for CSS based on ruby. The idea sounded neat, but in practice we need to compile the program to get CSS. This is cumbersome as we make too many changes while working on CSS and for every edit we don't want to compile.
In Eclipse, there are "Save-Actions" but it handles only formatting changes.
Is there a way on saving the file in Eclipse, to call or trigger the compilation?
Its easy to do this in Vi or Emacs.
I think all you need is to define a custom Builder for your project. That way, you can run a program or an ant script whenever certain files change.
Right click on the project -> Properties -> Builders -> New
While the Builders are a good solution, keep in mind they only work when a build is issued - either using auto-build or using a manual build which is invoked, well, manually. If you are looking for something that will operate after a save, regardless of the auto-build state you will need to write a plugin which listens to resource changes in Eclipse.
You do that by creating a workspace change listener and installing it like that:
ResourcesPlugin.getWorkspace().addResourceChangeListener(
..., IResourceChangeEvent.POST_CHANGE);
I'm sure you can take it from here :-)

Can I script FlexBuilder without writing an extension?

I'd like to script FlexBuilder so that I can run debug or profile without having to switch to FlexBuilder and manually clicking the button (or using the key combo). Is this possible without writing an extension?
To be more specific, this is exactly what I want to do: I want to create a TextMate command that talks to FlexBuilder and makes it run the debug target for the currently selected project. TextMate already has support for interacting with Xcode in this way, and it would be great to be able to do the same with FlexBuilder.
When compiling I use Ant and have full control over that from TextMate, what I want is to be able to launch the debugger and the profiler. The command line debugger is unusable and there is no other profiler available than the one in FlexBuilder.
Since FlexBuilder essentially is an extended version of Eclipse, any tools/scripts for doing the same in Eclipse should work for FlexBuilder aswell. I couldn't find any tools like this googling it, have you considered doing away with FlexBuilder completely, there are plenty of guides for using the mxmlc (or fcsh) compilers directly from your editor.
I do not know if there is a plugin like this for Eclipse however if not you can write one as it should be easy.
If the specific command that you want to call shows up in Windows/Preferences - General/Keys, you can create a plugin that takes commands from TextMate (I do not know what protocol TextMate uses, socket or something else) and executed the specific action that is associated with the command that also appears in preferences.