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 235744 Details for
Bug 417543
[KeyBindings] preference page:Implement Keys Scheme "Export CSV..." in the sorted way. implement Keys Scheme "Import CSV..."
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
I create a patch for the Export part.
export-csv.patch (text/plain), 2.67 KB, created by
Yonggang Luo
on 2013-09-24 06:03:13 EDT
(
hide
)
Description:
I create a patch for the Export part.
Filename:
MIME Type:
Creator:
Yonggang Luo
Created:
2013-09-24 06:03:13 EDT
Size:
2.67 KB
patch
obsolete
>d9c0f041ef8d20a692c76de48b9a94308021b8f2 > .../ui/internal/keys/model/KeyController.java | 40 ++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java >index b2511a9..bcc4e89 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/KeyController.java >@@ -16,6 +16,8 @@ import java.io.FileOutputStream; > import java.io.IOException; > import java.io.OutputStreamWriter; > import java.io.Writer; >+import java.util.Arrays; >+import java.util.Comparator; > import java.util.Map; > import java.util.ResourceBundle; > import org.eclipse.core.commands.CommandManager; >@@ -511,6 +513,42 @@ public class KeyController { > new FileOutputStream(filePath), "UTF-8")); //$NON-NLS-1$ > final Object[] bindingElements = bindingModel.getBindings() > .toArray(); >+ >+ class BindingElementComparator implements Comparator<Object> { >+ int compareObject(Object o1, Object o2) { >+ if (o1 == null && o2 == null) { >+ return 0; >+ } else if (o1 == null) { >+ return -1; >+ } else if (o2 == null) { >+ return 1; >+ } else { >+ return o1.hashCode() - o2.hashCode(); >+ } >+ } >+ >+ int compareString(String o1, String o2) { >+ if (o1 != null && o2 != null) { >+ return o1.compareTo(o2); >+ } >+ return compareObject(o1, o2); >+ } >+ >+ public int compare(Object o1, Object o2) { >+ final BindingElement BE1 = (BindingElement) o1; >+ final BindingElement BE2 = (BindingElement) o2; >+ >+ if (BE1 != null && BE2 != null) { >+ return compareString(BE1.getId(), BE2.getId()); >+ } else if (BE1 == null && BE2 == null) { >+ return compareObject(o1, o2); >+ } else { >+ return compareObject(BE1, BE2); >+ } >+ } >+ } >+ >+ Arrays.sort(bindingElements, new BindingElementComparator()); > for (int i = 0; i < bindingElements.length; i++) { > final BindingElement be = (BindingElement) bindingElements[i]; > if (be.getTrigger() == null >@@ -518,6 +556,8 @@ public class KeyController { > continue; > } > StringBuffer buffer = new StringBuffer(); >+ buffer.append(ESCAPED_QUOTE + be.getId() >+ + ESCAPED_QUOTE + DELIMITER); > buffer.append(ESCAPED_QUOTE > + Util.replaceAll(be.getCategory(), > ESCAPED_QUOTE, REPLACEMENT)
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 Raw
Actions:
View
Attachments on
bug 417543
: 235744