SDK Updater: remove UpdaterData.Display
This commit is contained in:
@@ -30,7 +30,6 @@ import com.android.sdklib.internal.repository.RepoSource;
|
|||||||
import com.android.sdklib.internal.repository.RepoSources;
|
import com.android.sdklib.internal.repository.RepoSources;
|
||||||
import com.android.sdkuilib.internal.repository.icons.ImageFactory;
|
import com.android.sdkuilib.internal.repository.icons.ImageFactory;
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -63,7 +62,6 @@ class UpdaterData {
|
|||||||
|
|
||||||
private final ArrayList<ISdkListener> mListeners = new ArrayList<ISdkListener>();
|
private final ArrayList<ISdkListener> mListeners = new ArrayList<ISdkListener>();
|
||||||
|
|
||||||
/** @deprecated */private Display mDisplay; // TODO remove
|
|
||||||
private Shell mWindowShell;
|
private Shell mWindowShell;
|
||||||
|
|
||||||
public interface ISdkListener {
|
public interface ISdkListener {
|
||||||
@@ -90,10 +88,6 @@ class UpdaterData {
|
|||||||
return mOsSdkRoot;
|
return mOsSdkRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisplay(Display display) {
|
|
||||||
mDisplay = display;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskFactory(ITaskFactory taskFactory) {
|
public void setTaskFactory(ITaskFactory taskFactory) {
|
||||||
mTaskFactory = taskFactory;
|
mTaskFactory = taskFactory;
|
||||||
}
|
}
|
||||||
@@ -235,8 +229,8 @@ class UpdaterData {
|
|||||||
* <p/>This can be called from any thread.
|
* <p/>This can be called from any thread.
|
||||||
*/
|
*/
|
||||||
public void notifyListeners() {
|
public void notifyListeners() {
|
||||||
if (mDisplay != null && mListeners.size() > 0) {
|
if (mWindowShell != null && mListeners.size() > 0) {
|
||||||
mDisplay.syncExec(new Runnable() {
|
mWindowShell.getDisplay().syncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
for (ISdkListener listener : mListeners) {
|
for (ISdkListener listener : mListeners) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class UpdaterWindowImpl {
|
|||||||
mAndroidSdkUpdater.open();
|
mAndroidSdkUpdater.open();
|
||||||
mAndroidSdkUpdater.layout();
|
mAndroidSdkUpdater.layout();
|
||||||
|
|
||||||
firstInit(); //$hide$ (hide from SWT designer)
|
postCreate(); //$hide$ (hide from SWT designer)
|
||||||
|
|
||||||
Display display = Display.getDefault();
|
Display display = Display.getDefault();
|
||||||
while (!mAndroidSdkUpdater.isDisposed()) {
|
while (!mAndroidSdkUpdater.isDisposed()) {
|
||||||
@@ -105,7 +105,6 @@ public class UpdaterWindowImpl {
|
|||||||
onAndroidSdkUpdaterDispose(); //$hide$ (hide from SWT designer)
|
onAndroidSdkUpdaterDispose(); //$hide$ (hide from SWT designer)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mUpdaterData.setDisplay(mAndroidSdkUpdater.getDisplay());
|
|
||||||
|
|
||||||
FillLayout fl;
|
FillLayout fl;
|
||||||
mAndroidSdkUpdater.setLayout(fl = new FillLayout(SWT.HORIZONTAL));
|
mAndroidSdkUpdater.setLayout(fl = new FillLayout(SWT.HORIZONTAL));
|
||||||
@@ -200,7 +199,7 @@ public class UpdaterWindowImpl {
|
|||||||
* Once the UI has been created, initializes the content.
|
* Once the UI has been created, initializes the content.
|
||||||
* This creates the pages, selects the first one, setup sources and scan for local folders.
|
* This creates the pages, selects the first one, setup sources and scan for local folders.
|
||||||
*/
|
*/
|
||||||
private void firstInit() {
|
private void postCreate() {
|
||||||
mUpdaterData.setWindowShell(getShell());
|
mUpdaterData.setWindowShell(getShell());
|
||||||
mTaskFactory = new ProgressTaskFactory(getShell());
|
mTaskFactory = new ProgressTaskFactory(getShell());
|
||||||
mUpdaterData.setTaskFactory(mTaskFactory);
|
mUpdaterData.setTaskFactory(mTaskFactory);
|
||||||
@@ -208,8 +207,8 @@ public class UpdaterWindowImpl {
|
|||||||
|
|
||||||
setWindowImage(mAndroidSdkUpdater);
|
setWindowImage(mAndroidSdkUpdater);
|
||||||
|
|
||||||
addPage(mAvdManagerPage, "Virtual Devices");
|
addPage(mAvdManagerPage, "Virtual Devices");
|
||||||
addPage(mLocalPackagePage, "Installed Packages");
|
addPage(mLocalPackagePage, "Installed Packages");
|
||||||
addPage(mRemotePackagesPage, "Available Packages");
|
addPage(mRemotePackagesPage, "Available Packages");
|
||||||
addExtraPages();
|
addExtraPages();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user