### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.properties,v retrieving revision 1.10 diff -u -r1.10 NewKeysPreferencePage.properties --- Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.properties 4 Apr 2007 18:46:47 -0000 1.10 +++ Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.properties 20 Apr 2007 17:56:53 -0000 @@ -34,3 +34,10 @@ PreferenceStoreError_Title=Error PreferenceStoreError_Message=Could not access the preference store + +Undefined_Command=Undefined Command + +Unavailable_Category=Unavailable Category + +Undefined_Context=Undefined Context + Index: Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferenceMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferenceMessages.java,v retrieving revision 1.5 diff -u -r1.5 NewKeysPreferenceMessages.java --- Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferenceMessages.java 4 Apr 2007 18:46:47 -0000 1.5 +++ Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferenceMessages.java 20 Apr 2007 17:56:53 -0000 @@ -48,6 +48,10 @@ public static String RestoreDefaultsMessageBoxText; public static String RestoreDefaultsMessageBoxMessage; + public static String Undefined_Command; + public static String Unavailable_Category; + public static String Undefined_Context; + static { // load message values from bundle file NLS.initializeMessages(BUNDLE_NAME, NewKeysPreferenceMessages.class); Index: Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java,v retrieving revision 1.34 diff -u -r1.34 NewKeysPreferencePage.java --- Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 4 Apr 2007 18:46:46 -0000 1.34 +++ Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 20 Apr 2007 17:56:53 -0000 @@ -387,7 +387,7 @@ return binding.getParameterizedCommand().getName(); } catch (final NotDefinedException e) { - return null; + return NewKeysPreferenceMessages.Undefined_Command; } case COLUMN_TRIGGER_SEQUENCE: return binding.getTriggerSequence().format(); @@ -397,7 +397,7 @@ return binding.getParameterizedCommand().getCommand().getCategory().getName(); } catch (NotDefinedException e) { // TODO Auto-generated catch block - return null; + return NewKeysPreferenceMessages.Unavailable_Category; } default: return null; @@ -407,7 +407,7 @@ try { return ((Category) value).getName(); } catch (final NotDefinedException e) { - return null; + return NewKeysPreferenceMessages.Unavailable_Category; } } @@ -420,7 +420,7 @@ return contextService.getContext((String) value) .getName(); } catch (final NotDefinedException e) { - return null; + return NewKeysPreferenceMessages.Undefined_Context; } } @@ -430,7 +430,7 @@ try { return ((ParameterizedCommand) value).getName(); } catch (final NotDefinedException e) { - return null; + return NewKeysPreferenceMessages.Undefined_Command; } } if (columnIndex== COLUMN_TRIGGER_SEQUENCE) @@ -440,7 +440,7 @@ return ((ParameterizedCommand) value).getCommand().getCategory().getName(); } catch (NotDefinedException e) { // TODO Auto-generated catch block - return null; + return NewKeysPreferenceMessages.Unavailable_Category; } } return null; @@ -602,13 +602,17 @@ } } else { // (GROUPING_NONE_NAME.equals(selectedText)) + IBaseLabelProvider baseLabel = filteredTree.getViewer().getLabelProvider(); if (baseLabel instanceof ITableLabelProvider) { ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel; String e1p = tableProvider.getColumnText(a, sortColumn); String e2p = tableProvider.getColumnText(b, sortColumn); - int result = getComparator().compare(e1p, e2p); - return ascending ? result : (-1) * result; + if (e1p!=null && e2p!=null){ + int result = getComparator().compare(e1p, e2p); + return ascending ? result : (-1) * result; + + } } return super.compare(viewer, a, b); @@ -852,10 +856,13 @@ * The binding to be added; must not be null. */ private final void bindingAdd(final Binding binding) { + if (!(binding.getParameterizedCommand().getCommand().isDefined())) + return; + // Remember the parameterized command and context. markedParameterizedCommand = binding.getParameterizedCommand(); markedContextId = binding.getContextId(); - + // Update the preference page. update();