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 158576 Details for
Bug 300347
[Sync View][Apply Patch] Fix hunks sorting
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
300347_v01.txt (text/plain), 3.19 KB, created by
Pawel Pogorzelski
on 2010-02-09 06:32:10 EST
(
hide
)
Description:
Patch_v01
Filename:
MIME Type:
Creator:
Pawel Pogorzelski
Created:
2010-02-09 06:32:10 EST
Size:
3.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/plugin.xml,v >retrieving revision 1.204 >diff -u -r1.204 plugin.xml >--- plugin.xml 26 Jan 2010 12:35:05 -0000 1.204 >+++ plugin.xml 9 Feb 2010 11:30:16 -0000 >@@ -632,6 +632,14 @@ > <actionProvider > class="org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchSynchronizationActionProvider"> > </actionProvider> >+ <commonSorter >+ class="org.eclipse.team.ui.HunkDiffNodeSorter"> >+ <parentExpression> >+ <instanceof >+ value="org.eclipse.compare.internal.patch.PatchFileDiffNode"> >+ </instanceof> >+ </parentExpression> >+ </commonSorter> > </navigatorContent> > </extension> > <extension >Index: src/org/eclipse/team/ui/HunkDiffNodeSorter.java >=================================================================== >RCS file: src/org/eclipse/team/ui/HunkDiffNodeSorter.java >diff -N src/org/eclipse/team/ui/HunkDiffNodeSorter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/team/ui/HunkDiffNodeSorter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,60 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.ui; >+ >+import java.text.Collator; >+import java.util.regex.Pattern; >+ >+import org.eclipse.jface.viewers.*; >+ >+public class HunkDiffNodeSorter extends ViewerSorter { >+ >+ public HunkDiffNodeSorter() { >+ } >+ >+ public HunkDiffNodeSorter(Collator collator) { >+ super(collator); >+ } >+ >+ public int compare(Viewer viewer, Object e1, Object e2) { >+ String label1; >+ String label2; >+ >+ if (viewer == null || !(viewer instanceof ContentViewer)) { >+ label1 = e1.toString(); >+ label2 = e2.toString(); >+ } else { >+ IBaseLabelProvider prov = ((ContentViewer) viewer) >+ .getLabelProvider(); >+ if (prov instanceof ILabelProvider) { >+ ILabelProvider lprov = (ILabelProvider) prov; >+ label1 = lprov.getText(e1); >+ label2 = lprov.getText(e2); >+ } else { >+ label1 = e1.toString(); >+ label2 = e2.toString(); >+ } >+ } >+ >+ // see org.eclipse.compare.internal.patch.Hunk.getDescription() >+ String pattern = "\\d+,\\d+ -> \\d+,\\d+"; //$NON-NLS-1$ >+ >+ if (Pattern.matches(pattern, label1) >+ && Pattern.matches(pattern, label2)) { >+ int oldStart0 = Integer.parseInt(label1.split(",")[0]); //$NON-NLS-1$ >+ int oldStart1 = Integer.parseInt(label2.split(",")[0]); //$NON-NLS-1$ >+ >+ return oldStart0 - oldStart1; >+ } >+ return super.compare(viewer, e1, e2); >+ } >+ >+}
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 300347
:
158576
|
158682