Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » KeyBindings don't work after product is exported
KeyBindings don't work after product is exported [message #481767] Mon, 24 August 2009 05:07 Go to next message
Eclipse UserFriend
Hi all,

I configured KeyBindings for commands in my application following this
tutorial [1].

The Bindings work well if I start the application in the ide. After
exporting the product they don't work there.

Here is what I did.

Created an own Keybinding-Scheme
Added the scheme-id to all bindings.
Added file "plugin_customization.ini" to the root (as mentioned in [1])
and marked it to be exported on the build.properties page.

As it was not working the first time, i found somewhere else (don't
remember where) that adding the property "preferenceCustomization" with
value "plugin_customization.ini" to the product extension point could
help. Tried that, too, didn't work.

What am I missing?

TIA

Tom
[1] http://www.vogella.de/articles/EclipseCommands/article.html# keybinding
Re: KeyBindings don't work after product is exported [message #481837 is a reply to message #481767] Mon, 24 August 2009 09:55 Go to previous messageGo to next message
Eclipse UserFriend
How about showing us the content of the plugin_customization.ini file and the full attribute you used to add it in the product XML in the plugin.xml?

Did you make the plugin that includes plugin_customization.ini a directory plugin (done in the feature)? That might not be necessary, though.

PW
Re: KeyBindings don't work after product is exported [message #481968 is a reply to message #481767] Mon, 24 August 2009 18:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi Thomas,

did you include plugin_customization.ini in your build configuration?
See:
http://www.vogella.de/articles/RichClientPlatform/article.ht ml#deployproduct

Best regards, Lars

Thomas Haskes wrote:
> Hi all,
>
> I configured KeyBindings for commands in my application following this
> tutorial [1].
>
> The Bindings work well if I start the application in the ide. After
> exporting the product they don't work there.
>
> Here is what I did.
>
> Created an own Keybinding-Scheme
> Added the scheme-id to all bindings.
> Added file "plugin_customization.ini" to the root (as mentioned in [1])
> and marked it to be exported on the build.properties page.
>
> As it was not working the first time, i found somewhere else (don't
> remember where) that adding the property "preferenceCustomization" with
> value "plugin_customization.ini" to the product extension point could
> help. Tried that, too, didn't work.
>
> What am I missing?
>
> TIA
>
> Tom
> [1] http://www.vogella.de/articles/EclipseCommands/article.html# keybinding




--
http://www.vogella.de/ - Eclipse plugin and Eclipse RCP Tutorials
http://www.twitter.com/vogella - vogella on Twitter
Re: KeyBindings don't work after product is exported [message #481969 is a reply to message #481968] Mon, 24 August 2009 18:08 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, just read that you already said that you included this .ini file
in the build configuration.
Re: KeyBindings don't work after product is exported [message #482091 is a reply to message #481837] Tue, 25 August 2009 06:42 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster schrieb:
> How about showing us the content of the plugin_customization.ini file
> and the full attribute you used to add it in the product XML in the
> plugin.xml?


Sure:

The plugin_customization.ini just contains this line:

org.eclipse.ui/KEY_CONFIGURATION_ID=com.tp.keybindingschemes .scheme1

Heres the attribute from the plugin.xml:

<extension
id="Client"
point="org.eclipse.core.runtime.products">
<product
application="com.tp.workbenchapplication"
name="Client">
<property
name="preferenceCustomization"
value="plugin_customization.ini">
</property>
<property
name="appName"
value="Client">
</property>
</product>
</extension>
Re: KeyBindings don't work after product is exported [message #482410 is a reply to message #482091] Wed, 26 August 2009 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Thanx, that looks fine. What scheme does eclipse think is active? Either bring up the keys preference page or if that is not in your RCP product write a little command/handler:

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.bindings.Scheme;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.keys.IBindingService;

public class WhatSchemeHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
IBindingService s = (IBindingService) PlatformUI.getWorkbench()
.getService(IBindingService.class);
Scheme scheme = s.getActiveScheme();
System.out.println(scheme.getId() + "\t" + scheme);
return null;
}
}

That will tell you what scheme is active in your RCP product.

PW
Re: KeyBindings don't work after product is exported [message #482538 is a reply to message #481767] Wed, 26 August 2009 19:14 Go to previous messageGo to next message
Eclipse UserFriend
Thomas Haskes schrieb:
> Hi all,
>
> I configured KeyBindings for commands in my application following this
> tutorial [1].
>
> The Bindings work well if I start the application in the ide. After
> exporting the product they don't work there.
>
> Here is what I did.
>
> Created an own Keybinding-Scheme
> Added the scheme-id to all bindings.
> Added file "plugin_customization.ini" to the root (as mentioned in [1])
> and marked it to be exported on the build.properties page.
>
> As it was not working the first time, i found somewhere else (don't
> remember where) that adding the property "preferenceCustomization" with
> value "plugin_customization.ini" to the product extension point could
> help. Tried that, too, didn't work.
>
> What am I missing?
>
> TIA
>
> Tom
> [1] http://www.vogella.de/articles/EclipseCommands/article.html# keybinding


you could first try setting keybindings programmtically i.e.
call
PlatformUI.getPreferenceStore().setDefault(IWorkbenchPrefere nceConstants.KEY_CONFIGURATION_ID,
keyScheme);

before you create and run the workbench... if that also does not work
then you know for sure its not a problem with the ini file..

Christian
Re: KeyBindings don't work after product is exported [message #483105 is a reply to message #482410] Mon, 31 August 2009 03:18 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, forgot to reply on this one because it works meanwhile. Switching
to another workspace made it work, but I couldnt figure out what the
problem was exactly.

Tom

Paul Webster schrieb:
> Thanx, that looks fine. What scheme does eclipse think is active?
> Either bring up the keys preference page or if that is not in your RCP
> product write a little command/handler:
>
> import org.eclipse.core.commands.AbstractHandler;
> import org.eclipse.core.commands.ExecutionEvent;
> import org.eclipse.core.commands.ExecutionException;
> import org.eclipse.jface.bindings.Scheme;
> import org.eclipse.ui.PlatformUI;
> import org.eclipse.ui.keys.IBindingService;
>
> public class WhatSchemeHandler extends AbstractHandler {
> public Object execute(ExecutionEvent event) throws ExecutionException {
> IBindingService s = (IBindingService) PlatformUI.getWorkbench()
> .getService(IBindingService.class);
> Scheme scheme = s.getActiveScheme();
> System.out.println(scheme.getId() + "\t" + scheme);
> return null;
> }
> }
>
> That will tell you what scheme is active in your RCP product.
>
> PW
>
Re: KeyBindings don't work after product is exported [message #483179 is a reply to message #483105] Mon, 31 August 2009 09:46 Go to previous message
Eclipse UserFriend
Thomas Haskes wrote on Mon, 31 August 2009 03:18
Sorry, forgot to reply on this one because it works meanwhile. Switching
to another workspace made it work, but I couldnt figure out what the
problem was exactly.



The preference set in the customization is a "default". If anything had set the scheme preference at any time in that workspace, that setting would be saved and propagated forward. Maybe that's what happened (it was using an old bogus value).

PW
Previous Topic:How to
Next Topic:Main window size and position
Goto Forum:
  


Current Time: Thu Jul 10 23:19:22 EDT 2025

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

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

Back to the top