am f8a2fbab: Merge change 9062 into donut

Merge commit 'f8a2fbab9094d5525179770e00042ac2f85be991'

* commit 'f8a2fbab9094d5525179770e00042ac2f85be991':
  Adds call back to the SDK updater for SDK content notifications.
This commit is contained in:
Android (Google) Code Review
2009-07-30 09:57:18 -07:00
committed by Android Git Automerger
8 changed files with 61 additions and 17 deletions

View File

@@ -313,16 +313,7 @@ public class AdtPlugin extends AbstractUIPlugin {
if (checkSdkLocationAndId()) {
// if sdk if valid, reparse it
// add all the opened Android projects to the list of projects to be updated
// after the SDK is reloaded
synchronized (getSdkLockObject()) {
// get the project to refresh.
IJavaProject[] androidProjects = BaseProjectHelper.getAndroidProjects();
mPostLoadProjectsToResolve.addAll(Arrays.asList(androidProjects));
}
// parse the SDK resources at the new location
parseSdkContent();
reparseSdk();
}
} else if (PREFS_BUILD_VERBOSITY.equals(property)) {
mBuildVerbosity = BuildPreferencePage.getBuildLevel(
@@ -1388,6 +1379,22 @@ public class AdtPlugin extends AbstractUIPlugin {
SdkStatsService.ping("adt", versionString, getDisplay()); //$NON-NLS-1$
}
/**
* Reparses the content of the SDK and updates opened projects.
*/
public void reparseSdk() {
// add all the opened Android projects to the list of projects to be updated
// after the SDK is reloaded
synchronized (getSdkLockObject()) {
// get the project to refresh.
IJavaProject[] androidProjects = BaseProjectHelper.getAndroidProjects();
mPostLoadProjectsToResolve.addAll(Arrays.asList(androidProjects));
}
// parse the SDK resources at the new location
parseSdkContent();
}
/**
* Prints messages, associated with a project to the specified stream
* @param stream The stream to write to

View File

@@ -49,6 +49,11 @@ public class AvdManagerAction implements IWorkbenchWindowActionDelegate, IObject
null /*sdk log*/,
sdk.getSdkLocation(),
false /*userCanChangeSdkRoot*/);
window.addListeners(new UpdaterWindow.ISdkListener() {
public void onSdkChange() {
AdtPlugin.getDefault().reparseSdk();
}
});
window.open();
}
}