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 209154 Details for
Bug 367980
Support for pre-release versions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch
367980.txt (text/plain), 5.02 KB, created by
Thomas Watson
on 2012-01-06 16:56:52 EST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2012-01-06 16:56:52 EST
Size:
5.02 KB
patch
obsolete
>From 0a092196a566c2de64cc4a0f8a289154b31aa385 Mon Sep 17 00:00:00 2001 >From: Thomas Watson <tjwatson@us.ibm.com> >Date: Fri, 6 Jan 2012 15:46:56 -0600 >Subject: [PATCH] Bug 367980 - Support for pre-release versions > >--- > .../pde/internal/ui/parts/PluginVersionPart.java | 79 ++++++++++++++++--- > 1 files changed, 66 insertions(+), 13 deletions(-) > >diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java >index 2c1942a..c5df9d7 100644 >--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java >+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2012 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 >@@ -192,9 +192,9 @@ public class PluginVersionPart { > } > > public void preloadFields() { >+ fMinVersionText.setText(getMinumum(fVersionRange)); > if (fRangeAllowed) { >- fMinVersionText.setText((fVersionRange != null) ? fVersionRange.getMinimum().toString() : ""); //$NON-NLS-1$ >- fMaxVersionText.setText((fVersionRange != null && fVersionRange.getMaximum().getMajor() != Integer.MAX_VALUE) ? fVersionRange.getMaximum().toString() : ""); //$NON-NLS-1$ >+ fMaxVersionText.setText(getMaximum(fVersionRange)); > > if (fVersionRange != null) > fMinVersionBound.select((fVersionRange.getIncludeMinimum()) ? 0 : 1); >@@ -206,7 +206,58 @@ public class PluginVersionPart { > else > fMaxVersionBound.select(1); > } >- fMinVersionText.setText((fVersionRange != null) ? fVersionRange.getMinimum().toString() : ""); //$NON-NLS-1$ >+ } >+ >+ private String getMinumum(VersionRange range) { >+ if (range == null) >+ return ""; //$NON-NLS-1$ >+ return toString(range.getLeft(), range.getLeftType()); >+ >+ } >+ >+ private String getMaximum(VersionRange range) { >+ if (range == null) >+ return ""; //$NON-NLS-1$ >+ return toString(range.getRight(), range.getRightType()); >+ >+ } >+ >+ private static String toString(Version version, char endPointType) { >+ // need to avoid fully qualifying the versions if not needed. >+ if (version == null) >+ return ""; //$NON-NLS-1$ >+ int q = version.getQualifier().length(); >+ if (q > 0) { >+ return version.toString(); >+ } >+ StringBuffer buffer = new StringBuffer(version.toString().length() + 1); >+ buffer.append(version.getMajor()); >+ buffer.append('.'); >+ buffer.append(version.getMinor()); >+ buffer.append('.'); >+ buffer.append(version.getMicro()); >+ char separator = version.isReleaseVersion() ? '.' : '-'; >+ switch (endPointType) { >+ case VersionRange.LEFT_CLOSED : >+ if (separator == '.') // left release version [x.y.z. must fully qualify >+ buffer.append(separator); >+ break; >+ case VersionRange.LEFT_OPEN : >+ if (separator == '-') // left pre-release version [x.y.z- must fully qualify >+ buffer.append(separator); >+ break; >+ case VersionRange.RIGHT_CLOSED : >+ if (separator == '-') // right release version x.y.z.) must fully qualify >+ buffer.append(separator); >+ break; >+ case VersionRange.RIGHT_OPEN : >+ if (separator == '.') // right pre-release version x.y.z-] must fully qualify >+ buffer.append(separator); >+ break; >+ default : >+ break; >+ } >+ return buffer.toString(); > } > > private IStatus validateVersion(String text, Text textWidget, boolean shortErrorMessage) { >@@ -316,7 +367,6 @@ public class PluginVersionPart { > } > > public String getVersion() { >- String version; > if (fIsRanged) { > // if versions are equal they must be inclusive for a range to be valid > // blindly set for the user >@@ -326,15 +376,18 @@ public class PluginVersionPart { > boolean maxI = getMaxInclusive(); > if (minV.equals(maxV)) > minI = maxI = true; >- version = new VersionRange(new Version(minV), minI, new Version(maxV), maxI).toString(); >- } else { >- String singleversion = extractSingleVersionFromText(); >- if (singleversion == null || singleversion.length() == 0) >- version = ""; //$NON-NLS-1$ >- else >- version = new Version(singleversion).toString(); >+ StringBuffer buffer = new StringBuffer(minV.length() + maxV.length() + 3); >+ buffer.append(minI ? VersionRange.LEFT_CLOSED : VersionRange.LEFT_OPEN); >+ buffer.append(minV); >+ buffer.append(','); >+ buffer.append(maxV); >+ buffer.append(maxI ? VersionRange.RIGHT_CLOSED : VersionRange.RIGHT_OPEN); >+ return new VersionRange(buffer.toString()).toString(); > } >- return version; >+ String singleversion = extractSingleVersionFromText(); >+ if (singleversion == null || singleversion.length() == 0) >+ return ""; //$NON-NLS-1$ >+ return new Version(singleversion).toString(); > } > > public void addListeners(ModifyListener minListener, ModifyListener maxListener) { >-- >1.7.6 >
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 367980
:
209099
| 209154