Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66383 Details for
Bug 185150
[KeyBindings] Do not allow duplicate key bindings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Show conflict v02
keyConflict-v02.txt (text/plain), 4.59 KB, created by
Paul Webster
on 2007-05-08 19:17:38 EDT
(
hide
)
Description:
Show conflict v02
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2007-05-08 19:17:38 EDT
Size:
4.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >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.59 >diff -u -r1.59 NewKeysPreferencePage.java >--- Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 8 May 2007 19:02:46 -0000 1.59 >+++ Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 8 May 2007 23:15:26 -0000 >@@ -133,14 +133,14 @@ > * </p> > * <p> > * This preference page has four general types of methods. Create methods are >- * called when the page is first made visisble. They are responsible for >- * creating all of the widgets, and laying them out within the preference page. >- * Fill methods populate the contents of the widgets that contain collections of >- * data from which items can be selected. The select methods respond to >- * selection events from the user, such as a button press or a table selection. >- * The update methods update the contents of various widgets based on the >- * current state of the user interface. For example, the command name label will >- * always try to match the current select in the binding table. >+ * called when the page is first made visible. They are responsible for creating >+ * all of the widgets, and laying them out within the preference page. Fill >+ * methods populate the contents of the widgets that contain collections of data >+ * from which items can be selected. The select methods respond to selection >+ * events from the user, such as a button press or a table selection. The update >+ * methods update the contents of various widgets based on the current state of >+ * the user interface. For example, the command name label will always try to >+ * match the current select in the binding table. > * </p> > * > * @since 3.2 >@@ -603,6 +603,23 @@ > return null; > } > >+ private boolean checkConflict(Binding binding) { >+ Collection matches = (Collection) localChangeManager >+ .getActiveBindingsDisregardingContext().get( >+ binding.getTriggerSequence()); >+ if (matches != null) { >+ Iterator i = matches.iterator(); >+ while (i.hasNext()) { >+ Binding b = (Binding) i.next(); >+ if (binding != b >+ && b.getContextId().equals(binding.getContextId())) { >+ return true; >+ } >+ } >+ } >+ return false; >+ } >+ > public final String getColumnText(final Object element, > final int columnIndex) { > final Object value = element; >@@ -617,6 +634,9 @@ > return NewKeysPreferenceMessages.Undefined_Command; > } > case COLUMN_TRIGGER_SEQUENCE: >+ if (checkConflict(binding)) { >+ return "*" + binding.getTriggerSequence().format(); //$NON-NLS-1$ >+ } > return binding.getTriggerSequence().format(); > > case COLUMN_WHEN: >@@ -701,6 +721,7 @@ > for (int i = 1; i < COLUMN_USER; i++) { > String text = getColumnText(element, i); > if (text != null) { >+ buf.append(' '); > buf.append(text); > } > } >@@ -1038,9 +1059,26 @@ > > // update the model > bindingModel.remove(binding); >+ updateConflicts(binding); > bindingAdd(binding); > } > >+ private final void updateConflicts(final Binding binding) { >+ Collection matches = (Collection) localChangeManager >+ .getActiveBindingsDisregardingContext().get( >+ binding.getTriggerSequence()); >+ if (matches != null) { >+ Iterator i = matches.iterator(); >+ while (i.hasNext()) { >+ Binding b = (Binding) i.next(); >+ if (binding != b >+ && b.getContextId().equals(binding.getContextId())) { >+ filteredTree.getViewer().update(b, null); >+ } >+ } >+ } >+ } >+ > private final void bindingRestore(final KeyBinding binding) { > final ParameterizedCommand cmd = binding.getParameterizedCommand(); > bindingRestore(cmd, false); >@@ -1870,6 +1908,8 @@ > // update the model > bindingModel.remove(keyBinding); > bindingModel.add(binding); >+ updateConflicts(keyBinding); >+ updateConflicts(binding); > // end update the model > update(); > filteredTree.getViewer().setSelection( >@@ -1886,6 +1926,7 @@ > // end update the model > bindingModel.add(binding); > commandModel.remove(object); >+ updateConflicts(binding); > update(); > > filteredTree.getViewer().setSelection( >@@ -2371,6 +2412,8 @@ > // update the model > bindingModel.remove(keyBinding); > bindingModel.add(binding); >+ updateConflicts(keyBinding); >+ updateConflicts(binding); > // end update the model > update(); > filteredTree.getViewer().setSelection(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185150
:
66353
|
66383
|
66386