This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252818 - Default keymap is always "Netbeans"
Summary: Default keymap is always "Netbeans"
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 8.0.2
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-04 23:26 UTC by SirIntellegence
Modified: 2015-08-03 14:00 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2015-06-04 23:26:49 UTC
It is impossible to change the default to something else (say, your product's name) without directly modifying the layer file. Is it possible to place it in a branding file somewhere?
Comment 1 SirIntellegence 2015-06-05 16:12:34 UTC
Even then, it looks like it gets set in KeymapModel$PL.run to "Netbeans"...
Comment 2 SirIntellegence 2015-06-05 17:19:17 UTC
One could work around it with this:
try{
			ClassLoader allLoader = Lookup.getDefault().lookup(ClassLoader.class);
			Class<?> layerBridgeClass = Class.forName("org.netbeans.modules."
					+ "options.keymap.LayersBridge", true, allLoader);
			Object instance = Lookup.getDefault().lookup(layerBridgeClass);
			Method getCurProfile = layerBridgeClass.getMethod("getCurrentProfile");
			Object curProfile = getCurProfile.invoke(instance);
			if (curProfile == null){
				Method setCurProfile = layerBridgeClass.getMethod("setCurrentProfile",
						String.class);
				setCurProfile.invoke(instance, "Fluency");
			}
		}
		catch (InvocationTargetException ite){
			//it's a simple getter/seter, it shouldn't explode
			throw new AssertionError(ite);
		}
		catch (IllegalAccessException iae){
			//All items are public...
			throw new AssertionError(iae);
		}
		catch (ReflectiveOperationException e){
			//ClassNotFound and NoSuchMethod
			//It should exist...
			throw new AssertionError(e);
		}
		catch (IllegalArgumentException e){
			// The arguments should be right
			throw new AssertionError(e);
		}
Comment 3 SirIntellegence 2015-06-05 17:21:20 UTC
It appears I forgot to remove the name of the product I am working on... Could an admin remove it please?
Comment 4 Theofanis Oikonomou 2015-07-07 09:25:50 UTC
re-assigning to correct component. Please evaluate. thank you
Comment 5 Svata Dedic 2015-08-03 14:00:57 UTC
A question: do you need a [default] profile with a different ID, or a profile with a different display name ?

If the latter, you can brand the NetBeans keymap folder in the XML layer (Keymaps/NetBeans) according to your product just as any other filename:

org.netbeans.modules.defaults.Bundle_product[_locale].properties:
Keymaps/NetBeans=FancyProduct