How to programmatically load a desired plugin on eclipse start up - java

Is there any method in SWT to programmatically set my plugin as default whenever the eclipse IDE starts i.e. when the eclipse starts a desired plugin is set as perspective.

If I remember correctly, it should be possible with setDefaultPerspective(String id).
You can access this via:
PlatformUI.getWorkbench().getPerspectiveRegistry().setDefaultPerspective(id);
However, be careful when doing this. I can imagine that a lot of people might uninstall your plugin, just because they are annoyed by this small change.

Related

Eclipse juno function bug in ubuntu

I am using Eclipse Juno in an Ubuntu environment, and about every hour my eclipse functions start to act weird. Pressing delete, Ctrl-d will stop working, or delete things in another class I have opened.
Same thing for the cut/paste and inspect functionality, it either doesn't do anything or it pastes/inspects something in a different class I have opened. I doesn't matter if I try it by using the mouse or the keyboard shortcuts.
I'm fairly sure it's an eclipse issue, as this only affects eclipse, and when I restart eclipse these issues are resolved. This is a pain in the ass though, as I have multiple servers running in eclipse, and restarting these take some time.
Refreshing my project as described here doesn't work for me.. Any ideas?
sounds like your key bindings might be being overridden by a plugin you have installed..\
Open eclipse, go to -
Window->Preferences->General->Keys
filter for Delete Line- if it is not bound to Ctrl+d then set the binding.
To check for duplicates, click the Delete Line key binding, then sort by "Binding" and see if you have one overriding it. If you do, then you have a couple options -
Disable the Ctrl+d binding that the plugin is using
Change your Delete Line binding to another. I like mine being Ctrl+L
The way keybindings work in eclipse is all dependent on the When column in the key bindings window. It should be set to Editing Text - if it's not, then you should probably set it to that. It might not be working for you in some other content type, say, if you are editing the .classpath

Is it possible to save the workspace between different (Plugin) runs?

I want to manually test some features of a plugin I'm developing. To do so, it'd be nice to be able to create some projects in the test Eclipse instance and have them stay throughout all my testing season. At the moment it seems that Eclipse insists on clearing the Eclipse Plugin workspace. Is it possible to invert its default behavior?
Thanks
Open up the launch configuration for this launch
On the Main tab, unclick Clear so the workspace remains across launches (alternatively, you can select Ask for confirmation... so you can choose each time).
As far as I know, there is no way to mark this as the default.

Is it possible to trigger a sequence of actions in RCP-Plugin without plugins activation?

If I activate an Eclipse plugin (e.g. by clicking on a command from the plug-in in a menu) a number of actions is automatically triggering - like setting preferences, etc.
I would like to ask if is it possible to activate a plug-in automatically at the Eclipse startup without clicking on any actions?
Possible duplicate: Launch an action in Eclipse RCP at startup
I'm not sure if is is the same case like mine. If it is, then sorry for duplicate.
[It is not totally clear to me what you mean, but it does seem to be an exact duplicate as far as I can see...]
If you want to start an Eclipse plug-in as Eclipse is started, you can either use either start-levels of OGSi or use the org.eclipse.ui.startup extension point... The frmer is the most general, whereas later is probably the easiest if you can change the plugin.xml of the plug-in...

Being in Debug View, and after program termination, switch back to Java View in Eclipse

I am looking for a way to come back to the standard Java View in Eclipse after the application I'm debugging is over.
Is it possible to accomplish that? That is the default behaviour in some other IDEs (Visual Studio, for instance) and I'd prefer to have it that way. It's so boring to have to go an manually switch the view again to the initial one :(
Thanks
Eclipse is a generic platform where you can have a dozen type of different launch configurations, so a good and usable 'generic' implementation of this feature is not trivial.
However, there is an open bug report for this feature, which has some activity recently so there is a chance that this feature will be included after Eclipse 3.7.
I wrote a plugin that does what you want. Here's the update site:
http://backtojava.s3-website-us-east-1.amazonaws.com/
I didn't categorize the feature, so when you look for it, unselect the "Group items by category" checkbox.
And here's the project on Eclipse Labs I made to host the source:
https://hg.codespot.com/a/eclipselabs.org/backtojava
I haven't checked the Feature project in; just the plugin.
I personally have never seen such a feature. I also wouldn't consider such a feature desirable. Rare would be the occasion where I would be in debug mode for only a single run. Typically, the editing window provided in the debug mode is sufficient for any edits I would make during a debugging session.
Do you have to use Eclipse? There are other Java IDEs, for example in Intellij IDEA you can set the debug window 'unpinned', so it hides when you click on the editor. Personally I would find that behaviour annoying but it might work for you.

Dynamic language switching in an Eclipse RCP application

I am working on an Eclipse RCP application with localization. A user should be able to change the language used in the application on the fly. A restart of the application should not take place during this language switch. It should also be possible to switch between languages written from left to right and languages written from right to left.
Is there a (good) way to solve this problem?
According to this thread:
Most of the eclipse libraries load up their language info on widget creation. If you change your locale afterwards you need to restart eclipse to have it take effect.
You could write that kind of dynamic behaviour into your own SWT program, however (when the locale switches, you'd need to call setText(*) on everything :-)
So this is not currently managed dynamically unless you program it yourself...
Other rcp/plugins application like Birt specify the same instructions (i.e. "Restart Eclipse" at the end...)
That said, a slightly different problem was set in this thread:
switch the language setting, restart, and then run in that language
I got it to work by reading bug 222023 and mimicking org.eclipse.ui.internal.ide.actions.OpenWorkspaceAction
I tried it manually:
added "-configuration #user.home/.myapp/configuration" to the launcher.ini
added "osgi.nl" to the users config.ini residing there and it worked.
Since I can access the config-Location via Platform.getConfigurationLocation() I guess that could be the way.
Note: adding "osgi.nl" to the webstart jnlp works too.
You would need to call setText on each widget, with the respective text. Since there is no text variable mapping on the widgets, you would have to do that completely manually as well.

Categories