View | Details | Raw Unified | Return to bug 182898 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java (-9 / +22 lines)
Lines 282-287 Link Here
282
		 * The number of columns being displayed.
282
		 * The number of columns being displayed.
283
		 */
283
		 */
284
		private static final int NUMBER_OF_COLUMNS = 5;
284
		private static final int NUMBER_OF_COLUMNS = 5;
285
		
286
		private static final String UNDEFINED_COMMAND="Undefined Command"; //$NON-NLS-1$
287
		
288
		private static final String UNAVAILABLE_CATEGORY="Unavailable Category"; //$NON-NLS-1$
289
		
290
		private static final String UNDEFINED_CONTEXT="Undefined context"; //$NON-NLS-1$
285
291
286
		/**
292
		/**
287
		 * A resource manager for this preference page.
293
		 * A resource manager for this preference page.
Lines 387-393 Link Here
387
						return binding.getParameterizedCommand().getName();
393
						return binding.getParameterizedCommand().getName();
388
						
394
						
389
					} catch (final NotDefinedException e) {
395
					} catch (final NotDefinedException e) {
390
						return null;
396
						return UNDEFINED_COMMAND;
391
					}
397
					}
392
				case COLUMN_TRIGGER_SEQUENCE:
398
				case COLUMN_TRIGGER_SEQUENCE:
393
					return binding.getTriggerSequence().format();
399
					return binding.getTriggerSequence().format();
Lines 397-403 Link Here
397
							return binding.getParameterizedCommand().getCommand().getCategory().getName();
403
							return binding.getParameterizedCommand().getCommand().getCategory().getName();
398
						} catch (NotDefinedException e) {
404
						} catch (NotDefinedException e) {
399
							// TODO Auto-generated catch block
405
							// TODO Auto-generated catch block
400
							return null;
406
							return UNAVAILABLE_CATEGORY;
401
						}
407
						}
402
				default:
408
				default:
403
					return null;
409
					return null;
Lines 407-413 Link Here
407
					try {
413
					try {
408
						return ((Category) value).getName();
414
						return ((Category) value).getName();
409
					} catch (final NotDefinedException e) {
415
					} catch (final NotDefinedException e) {
410
						return null;
416
						return UNAVAILABLE_CATEGORY;
411
					}
417
					}
412
				}
418
				}
413
419
Lines 420-426 Link Here
420
						return contextService.getContext((String) value)
426
						return contextService.getContext((String) value)
421
								.getName();
427
								.getName();
422
					} catch (final NotDefinedException e) {
428
					} catch (final NotDefinedException e) {
423
						return null;
429
						return UNDEFINED_CONTEXT;
424
					}
430
					}
425
				}
431
				}
426
432
Lines 430-436 Link Here
430
					try {
436
					try {
431
						return ((ParameterizedCommand) value).getName();
437
						return ((ParameterizedCommand) value).getName();
432
					} catch (final NotDefinedException e) {
438
					} catch (final NotDefinedException e) {
433
						return null;
439
						return UNDEFINED_COMMAND;
434
					}
440
					}
435
				}
441
				}
436
				if (columnIndex== COLUMN_TRIGGER_SEQUENCE)
442
				if (columnIndex== COLUMN_TRIGGER_SEQUENCE)
Lines 440-446 Link Here
440
						return ((ParameterizedCommand) value).getCommand().getCategory().getName();
446
						return ((ParameterizedCommand) value).getCommand().getCategory().getName();
441
					} catch (NotDefinedException e) {
447
					} catch (NotDefinedException e) {
442
						// TODO Auto-generated catch block
448
						// TODO Auto-generated catch block
443
						return null;
449
						return UNAVAILABLE_CATEGORY;
444
					}
450
					}
445
				}
451
				}
446
				return null;
452
				return null;
Lines 602-614 Link Here
602
					}
608
					}
603
609
604
				} else { // (GROUPING_NONE_NAME.equals(selectedText))
610
				} else { // (GROUPING_NONE_NAME.equals(selectedText))
611
					
605
					IBaseLabelProvider baseLabel = filteredTree.getViewer().getLabelProvider();
612
					IBaseLabelProvider baseLabel = filteredTree.getViewer().getLabelProvider();
606
					if (baseLabel instanceof ITableLabelProvider) {
613
					if (baseLabel instanceof ITableLabelProvider) {
607
						ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel;
614
						ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel;
608
						String e1p = tableProvider.getColumnText(a, sortColumn);
615
						String e1p = tableProvider.getColumnText(a, sortColumn);
609
						String e2p = tableProvider.getColumnText(b, sortColumn);
616
						String e2p = tableProvider.getColumnText(b, sortColumn);
610
						int result = getComparator().compare(e1p, e2p);
617
						if (e1p!=null && e2p!=null){
611
						return ascending ?  result : (-1) * result;
618
							int result = getComparator().compare(e1p, e2p);
619
							return ascending ?  result : (-1) * result;
620
							
621
						}
612
					}
622
					}
613
					return super.compare(viewer, a, b);
623
					return super.compare(viewer, a, b);
614
					
624
					
Lines 852-861 Link Here
852
	 *            The binding to be added; must not be <code>null</code>.
862
	 *            The binding to be added; must not be <code>null</code>.
853
	 */
863
	 */
854
	private final void bindingAdd(final Binding binding) {
864
	private final void bindingAdd(final Binding binding) {
865
		if (!(binding.getParameterizedCommand().getCommand().isDefined()))
866
			return;
867
		
855
		// Remember the parameterized command and context.
868
		// Remember the parameterized command and context.
856
		markedParameterizedCommand = binding.getParameterizedCommand();
869
		markedParameterizedCommand = binding.getParameterizedCommand();
857
		markedContextId = binding.getContextId();
870
		markedContextId = binding.getContextId();
858
871
		
859
		// Update the preference page.
872
		// Update the preference page.
860
		update();
873
		update();
861
874

Return to bug 182898