Uses supportsDiskMap to check if a disk map can/should be added.

This commit is contained in:
Robert Greene 2003-12-22 07:12:12 +00:00
parent 2926f343ff
commit 01a1917d15

View File

@ -73,7 +73,9 @@ public class DiskWindow {
imageManager, this);
diskMapTabs = new DiskMapTab[disks.length];
for (int i=0; i<disks.length; i++) {
diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
if (disks[i].supportsDiskMap()) {
diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
}
}
diskInfoTab = new DiskInfoTab(tabFolder, disks);
tabFolder.setSelection(tabFolder.getItems()[0]);
@ -94,8 +96,8 @@ public class DiskWindow {
* Dispose of all shared resources.
*/
private void dispose(DisposeEvent event) {
for (int i=0; i<disks.length; i++) {
diskMapTabs[i].dispose();
for (int i=0; i<diskMapTabs.length; i++) {
if (diskMapTabs[i] != null) diskMapTabs[i].dispose();
}
diskInfoTab.dispose();