Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hide Key Bindings from Preference Page(Pick and choose which key bindings to appear in Keys preference page)
Hide Key Bindings from Preference Page [message #926228] Fri, 28 September 2012 12:40 Go to next message
Kathryn Kaiser is currently offline Kathryn KaiserFriend
Messages: 2
Registered: September 2012
Junior Member
Here is what we want to do:

We have our own Eclipse RCP application in which we customize, pick and choose the Eclipse features for our use.

Within the Preferences -> General -> Keys we only want certain commands and their key binding on this preference page, therefore we want to hide the ones we don't want.

We tried to use activities to exclude the commands for these key bindings, but this did not work. We cannot extend the class org.eclipse.ui.internal.keys.KeysPreferencePage, and do not have the time nor desire to create our own Keys preference page.

Anyone have any ideas on how we can do this?
Re: Hide Key Bindings from Preference Page [message #929646 is a reply to message #926228] Mon, 01 October 2012 16:27 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can create your own scheme and then put the keys you want in it. If you make that the default scheme, your RCP app will show those key bindings on the Keys preference page.

But you need to copy over *all* of the keys that you want to expose.

It still doesn't prevent them from seeing the default scheme, I think.

PW


Re: Hide Key Bindings from Preference Page [message #930859 is a reply to message #929646] Tue, 02 October 2012 18:05 Go to previous messageGo to next message
Kathryn Kaiser is currently offline Kathryn KaiserFriend
Messages: 2
Registered: September 2012
Junior Member
We did do that, and all the keys we do not want are also included. I will check this
Re: Hide Key Bindings from Preference Page [message #931304 is a reply to message #930859] Wed, 03 October 2012 04:47 Go to previous messageGo to next message
Catalin Gerea is currently offline Catalin GereaFriend
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

Hello

A code reading of the KeysPreferencePage (from eclipse 3.8.1) reveals that the table with bindings are populated from the BindingManager; the BindingManager has a "removeBinding(Binding)" method.
So in theory you could get a reference to the BindingManager, iterate over all the bindings and remove the un-wanted ones. But I did not tried this approach and I am not sure if it works.


Time is what you make of it.
Re: Hide Key Bindings from Preference Page [message #941390 is a reply to message #931304] Fri, 12 October 2012 13:28 Go to previous messageGo to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 217
Registered: July 2009
Senior Member
If we create our own scheme and add to it the key bindings we want to use, all the available commands are listed (though not bound). Is there any way to exclude the commands we aren't using? I would have thought that an activities extension would hide the command contribution but it doesn't. The result is a customer who has to navigate around irrelevant and confusing commands when setting their key binding preferences.

(Using eclipse 3.7.2)

Craig
Re: Hide Key Bindings from Preference Page [message #945667 is a reply to message #941390] Mon, 15 October 2012 14:11 Go to previous messageGo to next message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 7
Registered: March 2011
Junior Member
Hi Craig.
We are facing exactly the same problem as you. Did you manage to somehow solve this problem?

Thanks in advance,
Anders

[Updated on: Mon, 15 October 2012 14:12]

Report message to a moderator

Re: Hide Key Bindings from Preference Page [message #945755 is a reply to message #945667] Mon, 15 October 2012 16:00 Go to previous messageGo to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 217
Registered: July 2009
Senior Member
No solution yet, please let us know if you find one.

Craig
Re: Hide Key Bindings from Preference Page [message #946740 is a reply to message #945755] Tue, 16 October 2012 13:04 Go to previous messageGo to next message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 7
Registered: March 2011
Junior Member
I have just looked at the code for the NewKeysPreferencePage. In the method #createContents there is the following code:

	fPatternFilter = new CategoryPatternFilter(true, commandService
				.getCategory(null));
		if (settings.get(TAG_FILTER_UNCAT) != null) {
			fPatternFilter.filterCategories(settings
					.getBoolean(TAG_FILTER_UNCAT));
		}


This means that commands without a category are automatically filtered. But it is not possible to specify other categories to filtered. That does'nt seem very flexible. Maybe we need to create a bug issue for this?

Re: Hide Key Bindings from Preference Page [message #947953 is a reply to message #946740] Wed, 17 October 2012 15:55 Go to previous messageGo to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 217
Registered: July 2009
Senior Member
I'd vote for the bug.

Craig
Re: Hide Key Bindings from Preference Page [message #954941 is a reply to message #947953] Tue, 23 October 2012 11:28 Go to previous message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 7
Registered: March 2011
Junior Member
Hi Craig.
I created a bug issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=392642

/Anders

[Updated on: Tue, 23 October 2012 11:29]

Report message to a moderator

Previous Topic:RCP application,product directory for files
Next Topic:Unconditionally opening an editor
Goto Forum:
  


Current Time: Tue Apr 16 10:50:14 GMT 2024

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

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

Back to the top