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 154210 Details for
Bug 66462
[KeyBindings] preference page: duplicate command names render with internal id
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]
Patch v01
KeysCategoryConflict 01.txt (text/plain), 3.86 KB, created by
Prakash Rangaraj
on 2009-12-10 03:51:50 EST
(
hide
)
Description:
Patch v01
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2009-12-10 03:51:50 EST
Size:
3.86 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.78 >diff -u -r1.78 NewKeysPreferencePage.java >--- Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 25 May 2009 20:52:12 -0000 1.78 >+++ Eclipse UI/org/eclipse/ui/internal/keys/NewKeysPreferencePage.java 10 Dec 2009 08:51:20 -0000 >@@ -19,7 +19,6 @@ > import java.util.Iterator; > import java.util.LinkedList; > import java.util.Map; >- > import org.eclipse.core.commands.Category; > import org.eclipse.core.commands.ParameterizedCommand; > import org.eclipse.core.commands.util.Tracing; >@@ -186,6 +185,8 @@ > > private TableViewer conflictViewer; > >+ private boolean hasNameConflicts; >+ > private ICommandImageService commandImageService; > > private ICommandService commandService; >@@ -828,22 +829,28 @@ > table.setHeaderVisible(true); > TableColumn bindingNameColumn = new TableColumn(table, SWT.LEAD); > bindingNameColumn.setText(NewKeysPreferenceMessages.CommandNameColumn_Text); >- bindingNameColumn.setWidth(150); >+ bindingNameColumn.setWidth(100); > TableColumn bindingContextNameColumn = new TableColumn(table, SWT.LEAD); > bindingContextNameColumn.setText(NewKeysPreferenceMessages.WhenColumn_Text); >- bindingContextNameColumn.setWidth(150); >+ bindingContextNameColumn.setWidth(100); >+ TableColumn bindingCategoryNameColumn = new TableColumn(table, SWT.LEAD); >+ bindingCategoryNameColumn.setText(NewKeysPreferenceMessages.CategoryColumn_Text); >+ bindingCategoryNameColumn.setWidth(100); > gridData = new GridData(SWT.FILL, SWT.FILL, true, true); > //gridData.horizontalIndent = 10; > table.setLayoutData(gridData); > TableLayout tableLayout = new TableLayout(); >- tableLayout.addColumnData(new ColumnWeightData(60)); >- tableLayout.addColumnData(new ColumnWeightData(40)); >+ tableLayout.addColumnData(new ColumnWeightData(50)); >+ tableLayout.addColumnData(new ColumnWeightData(25)); >+ tableLayout.addColumnData(new ColumnWeightData(25)); > table.setLayout(tableLayout); > conflictViewer.setContentProvider(new IStructuredContentProvider() { > > public Object[] getElements(Object inputElement) { > if (inputElement instanceof Collection) { >- return ((Collection) inputElement).toArray(); >+ Object[] bindings = ((Collection) inputElement).toArray(); >+ calculateConflicts(bindings); >+ return bindings; > } > return new Object[0]; > } >@@ -859,9 +866,18 @@ > public String getColumnText(Object o, int index) { > BindingElement element = (BindingElement) o; > if (index == 0) { >+ if (hasNameConflicts) { >+ String desc = element.getDescription(); >+ if (desc != null) >+ return element.getName() + " (" + desc + ")"; //$NON-NLS-1$ //$NON-NLS-2$ >+ return element.getName(); >+ } > return element.getName(); >+ } else if (index == 1) { >+ return element.getContext().getName(); >+ } else { >+ return element.getCategory(); > } >- return element.getContext().getName(); > } > }); > conflictViewer >@@ -962,6 +978,22 @@ > > } > >+ protected void calculateConflicts(Object[] bindings) { >+ hasNameConflicts = false; >+ outer: >+ for (int i = 0; i < bindings.length; i++) { >+ BindingElement binding1 = (BindingElement) bindings[i]; >+ for (int j = i + 1; j < bindings.length; j++) { >+ BindingElement binding2 = (BindingElement) bindings[j]; >+ if (binding1.getName().equals(binding2.getName()) >+ && binding1.getCategory().equals(binding2.getCategory())) { >+ hasNameConflicts = true; >+ break outer; >+ } >+ } >+ } >+ } >+ > private void createTree(Composite parent) { > fPatternFilter = new CategoryPatternFilter(true, fDefaultCategory); > fPatternFilter.filterCategories(true);
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 66462
: 154210