am e4c98c01: SDK Manager: display packages revisions

Merge commit 'e4c98c0191242cd29712ab54fbe49e8a75f8db0b' into eclair-mr2

* commit 'e4c98c0191242cd29712ab54fbe49e8a75f8db0b':
  SDK Manager: display packages revisions
This commit is contained in:
Raphael
2009-10-11 10:29:30 -07:00
committed by Android Git Automerger
4 changed files with 75 additions and 36 deletions

View File

@@ -189,18 +189,29 @@ public class AddonPackage extends Package {
/** Returns a short description for an {@link IDescription}. */ /** Returns a short description for an {@link IDescription}. */
@Override @Override
public String getShortDescription() { public String getShortDescription() {
return String.format("%1$s by %2$s for Android API %3$s", return String.format("%1$s by %2$s, Android API %3$s, revision %4$s",
getName(), getName(),
getVendor(), getVendor(),
mVersion.getApiString()); mVersion.getApiString(),
getRevision());
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return String.format("%1$s,\nRevision %2$d.", String s = getDescription();
getShortDescription(), if (s == null || s.length() == 0) {
getRevision()); s = getShortDescription();
}
s += String.format(".\nRequires SDK Platform Android API %1$s.",
mVersion.getApiString());
return s;
} }
/** /**

View File

@@ -103,21 +103,34 @@ public class DocPackage extends Package {
@Override @Override
public String getShortDescription() { public String getShortDescription() {
if (mVersion.isPreview()) { if (mVersion.isPreview()) {
return String.format("Documentation for Android '%1$s' Preview SDK", return String.format("Documentation for Android '%1$s' Preview SDK, revision %2$s",
mVersion.getCodename()); mVersion.getCodename(),
} else if (mVersion.getApiLevel() != 0) { getRevision());
return String.format("Documentation for Android SDK, API %1$d", mVersion.getApiLevel());
} else { } else {
return String.format("Documentation for Android SDK"); return String.format("Documentation for Android SDK, API %1$d, revision %2$s",
mVersion.getApiLevel(),
getRevision());
} }
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return String.format("%1$s,\nRevision %2$d.", String s = getDescription();
getShortDescription(), if (s == null || s.length() == 0) {
getRevision()); s = getShortDescription();
}
if (!s.endsWith(".")) {
s += ".";
}
return s;
} }
/** /**

View File

@@ -152,25 +152,27 @@ public class ExtraPackage extends MinToolsPackage {
name, name,
getRevision()); getRevision());
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(" (tools rev: %1$d)", getMinToolsRevision());
}
return s; return s;
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
String s = String.format("Extra %1$s package, revision %2$d", String s = getDescription();
getPath(), if (s == null || s.length() == 0) {
getRevision()); s = String.format("Extra %1$s package, revision %2$d",
getPath(),
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) { getRevision());
s += String.format(" (min tools rev.: %1$d)", getMinToolsRevision());
} }
s += "."; if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(".\nRequires tools revision %1$d.", getMinToolsRevision());
}
return s; return s;
} }

View File

@@ -119,24 +119,37 @@ public class PlatformPackage extends MinToolsPackage {
String s; String s;
if (mVersion.isPreview()) { if (mVersion.isPreview()) {
s = String.format("SDK Platform Android %1$s (Preview)", getVersionName()); s = String.format("SDK Platform Android %1$s Preview, revision %2$s",
getVersionName(),
getRevision());
} else { } else {
s = String.format("SDK Platform Android %1$s, API %2$d", s = String.format("SDK Platform Android %1$s, API %2$d, revision %3$s",
getVersionName(), getVersionName(),
mVersion.getApiLevel()); mVersion.getApiLevel(),
} getRevision());
if (getMinToolsRevision() != MIN_TOOLS_REV_NOT_SPECIFIED) {
s += String.format(" (tools rev: %1$d)", getMinToolsRevision());
} }
return s; return s;
} }
/** Returns a long description for an {@link IDescription}. */ /**
* Returns a long description for an {@link IDescription}.
*
* The long description is whatever the XML contains for the <description> field,
* or the short description if the former is empty.
*/
@Override @Override
public String getLongDescription() { public String getLongDescription() {
return getShortDescription() + "."; String s = getDescription();
if (s == null || s.length() == 0) {
s = getShortDescription();
}
if (!s.endsWith(".")) {
s += ".";
}
return s;
} }
/** /**