com.android.sdklib.internal.repository.updater
Interface PackageLoader.ISourceLoadedCallback

Enclosing class:
PackageLoader

public static interface PackageLoader.ISourceLoadedCallback

Interface for the callback called by PackageLoader.loadPackages(boolean, ISourceLoadedCallback).

After processing each source, the package loader calls onUpdateSource(com.android.sdklib.internal.repository.sources.SdkSource, com.android.sdklib.internal.repository.packages.Package[]) with the list of packages found in that source. By returning true from onUpdateSource(com.android.sdklib.internal.repository.sources.SdkSource, com.android.sdklib.internal.repository.packages.Package[]), the client tells the loader to continue and process the next source. By returning false, it tells to stop loading.

The onLoadCompleted() method is guaranteed to be called at the end, no matter how the loader stopped, so that the client can clean up or perform any final action.


Method Summary
 void onLoadCompleted()
          This method is guaranteed to be called at the end, no matter how the loader stopped, so that the client can clean up or perform any final action.
 boolean onUpdateSource(SdkSource source, Package[] packages)
          After processing each source, the package loader calls this method with the list of packages found in that source.
 

Method Detail

onUpdateSource

boolean onUpdateSource(SdkSource source,
                       Package[] packages)
After processing each source, the package loader calls this method with the list of packages found in that source. By returning true from onUpdateSource(com.android.sdklib.internal.repository.sources.SdkSource, com.android.sdklib.internal.repository.packages.Package[]), the client tells the loader to continue and process the next source. By returning false, it tells to stop loading.

Important: This method is called from a sub-thread, so clients which try to access any UI widgets must wrap their calls into Display.syncExec(Runnable) or Display.asyncExec(Runnable).

Parameters:
packages - All the packages loaded from the source. Never null.
Returns:
True if the load operation should continue, false if it should stop.

onLoadCompleted

void onLoadCompleted()
This method is guaranteed to be called at the end, no matter how the loader stopped, so that the client can clean up or perform any final action.