import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.platform.PlatformList;
import org.tizen.emulator.manager.platform.PlatformStringResources;
+import org.tizen.emulator.manager.platform.Profile;
+import org.tizen.emulator.manager.platform.ProfileList;
import org.tizen.emulator.manager.ui.VMsMainView;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.VMProperty.FSImageType;
setSelectProperty();
}
+ @Override
+ public void drawVMList(int select, boolean isCreate) {
+ if (select < 0) {
+ return;
+ }
+ currentItem = null;
+ vmsTree.removeAll();
+ createItems.clear();
+ typeItems.clear();
+ itemsMap.clear();
+
+ RowItem rowItem = null;
+ TreeItem createItem = null;
+ TreeItem propertyItem = null;
+
+ // add standard image
+ for (Profile p : ProfileList.getProfileList()) {
+ String standardVersion = p.getName();
+ if (!standardVersion.isEmpty()) {
+ TreeItem tempItem = new TreeItem(vmsTree, SWT.NONE);
+ rowItem = new StandardVMsMarker(standardVersion, tempItem);
+ tempItem.setData(rowItem);
+ itemsMap.put(p.getName(), tempItem);
+ typeItems.add(tempItem);
+
+ createItem = new TreeItem(tempItem, SWT.NONE);
+ rowItem = new CreateMarker(createItem, p.getImageList().get(0));
+ createItem.setData(rowItem);
+ createItems.add(createItem);
+/*
+ for (BaseImage b : p.getImageList()) {
+ TreeItem t = new TreeItem(tempItem, SWT.NONE);
+ rowItem = new StandardVMsMarker(b.getName(), t);
+ t.setData(rowItem);
+ if (!p.isOldVersion()) {
+ itemsMap.put(p.getProfile() + "-" + p.getVersion() + b.getName(), t);
+ } else {
+ itemsMap.put(p.getName() + b.getName(), t);
+ }
+ typeItems.add(t);
+
+ createItem = new TreeItem(t, SWT.NONE);
+ rowItem = new CreateMarker(createItem, b);
+ createItem.setData(rowItem);
+ createItems.add(createItem);
+ }
+ */
+ }
+ }
+ //
+/*
+ // add custom image
+ for (CustomPlatform p : PlatformList.getCustomPlatform()) {
+ TreeItem t = new TreeItem(vmsTree, SWT.NONE);
+ BaseImage b = p.getImageList().get(0);
+ rowItem = new CustomVMsMarker(p.getName(), t);
+ t.setData(rowItem);
+ itemsMap.put(p.getProfile(), t);
+ typeItems.add(t);
+
+ createItem = new TreeItem(t, SWT.NONE);
+ rowItem = new CreateMarker(createItem, b);
+ createItem.setData(rowItem);
+ createItems.add(createItem);
+ }
+*/
+ // add VM
+ ArrayList<VMProperty> properties = (ArrayList<VMProperty>) VMsMainView.getInstance().getProfile().getEmulatorList();
+ VMProperty prop;
+ for(int i = 0; i < properties.size(); ++i) {
+ prop = properties.get(i);
+ propertyItem = itemsMap.get(prop.getImageProfile());
+ if (propertyItem != null) {
+ propertyItem = new TreeItem(propertyItem, SWT.NONE);
+ }
+ /*
+ // temporarily hard coded now...
+ //if(properties[i].getArch() == Architecture.ARM)
+ // continue;
+ prop = properties.get(i);
+ if(FSImageType.standard == prop.getImageType()) {
+ String version = prop.getImageVersion();
+ String profile = prop.getImageProfile();
+
+ version = profile + "-" + version;
+
+ String base = prop.getConfiguration().getBaseInformation().getDiskImage().getBase();
+ propertyItem = itemsMap.get(version+base);
+ if(propertyItem == null) {
+ propertyItem = itemsMap.get(version);
+ if (propertyItem == null) {
+ propertyItem = new TreeItem(vmsTree, SWT.NONE);
+ rowItem = new StandardVMsMarker(version, propertyItem);
+ propertyItem.setData(rowItem);
+ itemsMap.put(version, propertyItem);
+ typeItems.add(propertyItem);
+ }
+ propertyItem = new TreeItem(propertyItem, SWT.NONE);
+ rowItem = new StandardVMsMarker(base, propertyItem);
+ propertyItem.setData(rowItem);
+
+ itemsMap.put(version+base, propertyItem);
+ typeItems.add(propertyItem);
+ }
+ propertyItem = new TreeItem(propertyItem, SWT.NONE);
+ }
+ else {
+ String profile = prop.getImageProfile();
+ customItem = itemsMap.get((profile == null ? PlatformStringResources.MobileProfile : profile));
+ propertyItem = new TreeItem(customItem, SWT.NONE);
+ }
+*/
+ rowItem = new PropertyContent(prop, propertyItem);
+ propertyItem.setData(rowItem);
+ if (i == select) {
+ currentItem = propertyItem;
+ }
+
+ }
+
+ for (TreeItem item : createItems) {
+ item.setExpanded(true);
+ }
+
+ for(TreeItem item : typeItems) {
+ item.setExpanded(true);
+ }
+
+ packAll();
+ packAll(); // FIXME: Need second pack avoid column becomes too narrow... why ???
+
+ if (currentItem == null) {
+ currentItem = vmsTree.getItem(0);
+ }
+
+ setSelectProperty();
+ }
+
private boolean isCancelCreateMode = false;
@Override
public void drawEmptyVMList() {
isCancelCreateMode = false;
setSelectProperty();
} else {
- drawVMList(null, 0, false);
+ drawVMList(0, false);
}
}