SDK Updater: remove UpdaterData.Display

This commit is contained in:
Raphael
2009-06-16 16:33:34 -07:00
parent eecf776ac4
commit 4d68551ef3
2 changed files with 6 additions and 13 deletions

View File

@@ -30,7 +30,6 @@ import com.android.sdklib.internal.repository.RepoSource;
import com.android.sdklib.internal.repository.RepoSources;
import com.android.sdkuilib.internal.repository.icons.ImageFactory;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import java.util.ArrayList;
@@ -63,7 +62,6 @@ class UpdaterData {
private final ArrayList<ISdkListener> mListeners = new ArrayList<ISdkListener>();
/** @deprecated */private Display mDisplay; // TODO remove
private Shell mWindowShell;
public interface ISdkListener {
@@ -90,10 +88,6 @@ class UpdaterData {
return mOsSdkRoot;
}
public void setDisplay(Display display) {
mDisplay = display;
}
public void setTaskFactory(ITaskFactory taskFactory) {
mTaskFactory = taskFactory;
}
@@ -235,8 +229,8 @@ class UpdaterData {
* <p/>This can be called from any thread.
*/
public void notifyListeners() {
if (mDisplay != null && mListeners.size() > 0) {
mDisplay.syncExec(new Runnable() {
if (mWindowShell != null && mListeners.size() > 0) {
mWindowShell.getDisplay().syncExec(new Runnable() {
public void run() {
for (ISdkListener listener : mListeners) {
try {

View File

@@ -85,7 +85,7 @@ public class UpdaterWindowImpl {
mAndroidSdkUpdater.open();
mAndroidSdkUpdater.layout();
firstInit(); //$hide$ (hide from SWT designer)
postCreate(); //$hide$ (hide from SWT designer)
Display display = Display.getDefault();
while (!mAndroidSdkUpdater.isDisposed()) {
@@ -105,7 +105,6 @@ public class UpdaterWindowImpl {
onAndroidSdkUpdaterDispose(); //$hide$ (hide from SWT designer)
}
});
mUpdaterData.setDisplay(mAndroidSdkUpdater.getDisplay());
FillLayout fl;
mAndroidSdkUpdater.setLayout(fl = new FillLayout(SWT.HORIZONTAL));
@@ -200,7 +199,7 @@ public class UpdaterWindowImpl {
* Once the UI has been created, initializes the content.
* This creates the pages, selects the first one, setup sources and scan for local folders.
*/
private void firstInit() {
private void postCreate() {
mUpdaterData.setWindowShell(getShell());
mTaskFactory = new ProgressTaskFactory(getShell());
mUpdaterData.setTaskFactory(mTaskFactory);
@@ -208,8 +207,8 @@ public class UpdaterWindowImpl {
setWindowImage(mAndroidSdkUpdater);
addPage(mAvdManagerPage, "Virtual Devices");
addPage(mLocalPackagePage, "Installed Packages");
addPage(mAvdManagerPage, "Virtual Devices");
addPage(mLocalPackagePage, "Installed Packages");
addPage(mRemotePackagesPage, "Available Packages");
addExtraPages();