View | Details | Raw Unified | Return to bug 379289
Collapse All | Expand All

(-)a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java (-17 / +13 lines)
Lines 636-658 Link Here
636
		return null;
636
		return null;
637
	}
637
	}
638
638
639
	/**
639
	/*
640
	 * TODO Promote this method to API.
640
	 * (non-Javadoc)
641
	 * <p>
642
	 * Adds a single new binding to the existing array of bindings. If the array
643
	 * is currently <code>null</code>, then a new array is created and this
644
	 * binding is added to it. This method does not detect duplicates.
645
	 * </p>
646
	 * <p>
647
	 * This method completes in amortized <code>O(1)</code>.
648
	 * </p>
649
	 * 
641
	 * 
650
	 * @param binding
642
	 * @see
651
	 *            The binding to be added; must not be <code>null</code>.
643
	 * org.eclipse.ui.keys.IBindingService#addBinding(org.eclipse.jface.bindings
644
	 * .Binding)
652
	 */
645
	 */
653
	public final void addBinding(final Binding binding) {
646
	public final void addBinding(final Binding binding) {
654
		MBindingTable table = getMTable(binding.getContextId());
647
		MBindingTable table = getMTable(binding.getContextId());
655
		createORupdateMKeyBinding(application, table, binding);
648
		createORupdateMKeyBinding(application, table, binding);
649
		manager.addBinding(binding);
656
	}
650
	}
657
651
658
	/**
652
	/**
Lines 851-862 Link Here
851
		return null;
845
		return null;
852
	}
846
	}
853
847
854
	/**
848
	/*
855
	 * Remove the specific binding by identity. Does nothing if the binding is
849
	 * (non-Javadoc)
856
	 * not in the manager.
857
	 * 
850
	 * 
858
	 * @param binding
851
	 * @see
859
	 *            The binding to be removed; must not be <code>null</code>.
852
	 * org.eclipse.ui.keys.IBindingService#removeBinding(org.eclipse.jface.bindings
853
	 * .Binding)
860
	 */
854
	 */
861
	public final void removeBinding(final Binding binding) {
855
	public final void removeBinding(final Binding binding) {
862
		MKeyBinding mKeyBinding;
856
		MKeyBinding mKeyBinding;
Lines 889-894 Link Here
889
				mKeyBinding.getTags().add(EBindingService.DELETED_BINDING_TAG);
883
				mKeyBinding.getTags().add(EBindingService.DELETED_BINDING_TAG);
890
			}
884
			}
891
		}
885
		}
886
887
		manager.removeBinding(binding);
892
	}
888
	}
893
889
894
	public BindingManager getBindingManager() {
890
	public BindingManager getBindingManager() {
(-)a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/keys/IBindingService.java (-1 / +24 lines)
Lines 13-19 Link Here
13
import java.io.IOException;
13
import java.io.IOException;
14
import java.util.Collection;
14
import java.util.Collection;
15
import java.util.Map;
15
import java.util.Map;
16
17
import org.eclipse.core.commands.ParameterizedCommand;
16
import org.eclipse.core.commands.ParameterizedCommand;
18
import org.eclipse.jface.bindings.Binding;
17
import org.eclipse.jface.bindings.Binding;
19
import org.eclipse.jface.bindings.IBindingManagerListener;
18
import org.eclipse.jface.bindings.IBindingManagerListener;
Lines 56-61 Link Here
56
55
57
	/**
56
	/**
58
	 * <p>
57
	 * <p>
58
	 * Adds a single new binding to the existing array of bindings. If the array
59
	 * is currently <code>null</code>, then a new array is created and this
60
	 * binding is added to it. This method does not detect duplicates.
61
	 * </p>
62
	 * <p>
63
	 * This method completes in amortized <code>O(1)</code>.
64
	 * </p>
65
	 * 
66
	 * @param binding
67
	 *            The binding to be added; must not be <code>null</code>.
68
	 */
69
	public void addBinding(final Binding binding);
70
71
	/**
72
	 * Remove the specific binding by identity. Does nothing if the binding is
73
	 * not in the manager.
74
	 * 
75
	 * @param binding
76
	 *            The binding to be removed; must not be <code>null</code>.
77
	 */
78
	public void removeBinding(final Binding binding);
79
80
	/**
81
	 * <p>
59
	 * Adds a listener to this binding service. The listener will be notified
82
	 * Adds a listener to this binding service. The listener will be notified
60
	 * when the set of defined schemes or bindings changes. This can be used to
83
	 * when the set of defined schemes or bindings changes. This can be used to
61
	 * track the global appearance and disappearance of bindings.
84
	 * track the global appearance and disappearance of bindings.

Return to bug 379289