private boolean isModifyMode = false;
private boolean isChnagePlatform = false;
+ private boolean isChangeProfile = false;
public VMsDetailView(Composite parent) {
this.parent = parent;
isChnagePlatform = true;
}
+ public void changeProfile() {
+ isChangeProfile = true;
+ }
+
public void drawEmptyVM() {
// for setting text
emptyView.drawPropertyView(null, false);
import org.eclipse.swt.widgets.Composite;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.Profile;
import org.tizen.emulator.manager.platform.TotalPlatform;
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.FontResources;
TopListView.drawPlatform(platform, imageIndex);
}
+ public void drawProfile(Profile profile, boolean isRefresh) {
+ if (profile.getName().equals("all")) { // TODO
+ if (!isRefresh) {
+ itemButton.setEnabled(false);
+ selectRadioButton(true);
+ }
+ imageCombo.removeAll();
+ imageCombo.setEnabled(false);
+ imageCombo.layout();
+ } else {
+ if (!isRefresh) {
+ itemButton.setEnabled(true);
+ selectRadioButton(false);
+ }
+ }
+
+ TopListView.drawProfile(profile);
+ }
+
public void drawVMList(BaseImage base, int select, boolean isCreate) {
TopListView.drawVMList(base, select, isCreate);
mainView.layout(true, true);
}
+ public void drawVMList(int select, boolean isCreate) {
+ TopListView.drawVMList(select, isCreate);
+ mainView.layout(true, true);
+ }
+
public void drawEmptyVMList() {
TopListView.drawEmptyVMList();
mainView.layout(true, true);
import org.eclipse.swt.widgets.Composite;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.Profile;
public abstract class AbstractListView {
protected Composite listView;
public abstract void init(Composite parent, int width, int height);
public abstract void drawPlatform(Platform platform, int imageIndex);
+ public abstract void drawProfile(Profile profile);
public abstract void drawVMList(BaseImage base, int select, boolean isCreate);
+ public abstract void drawVMList(int select, boolean isCreate);
public abstract void drawEmptyVMList();
public abstract void cancelModify(int index);
public abstract void draw();
import org.eclipse.swt.widgets.Text;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.Profile;
import org.tizen.emulator.manager.platform.SortBy;
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.ImageResources;
}
@Override
+ public void drawProfile(Profile profile) {
+ VMsMainView.getInstance().drawVMList(profile);
+ }
+
+ @Override
+ public void drawVMList(int select, boolean isCreate) {
+ Profile profile = VMsMainView.getInstance().getProfile();
+ if (createButton != null) {
+ if (profile.getEmulatorList().isEmpty()) {
+ FormData data = new FormData();
+ data.width = 0;
+ data.height = 0;
+ createButton.setLayoutData(data);
+ createButton.setEnabled(false);
+ } else {
+ createButton.dispose();
+ createButton = null;
+ }
+ }
+
+ resetPopupMenu(profile.getSortType());
+
+ if (select == -1) {
+ select = 0;
+ }
+
+ state = VIEW_STATE.DETAIL;
+
+ VMButtonFactory.clear();
+ if (profile.getEmulatorList().size() != 0) {
+ VMButton button = null;
+ for (int i = 0; i < profile.getEmulatorList().size(); i++) {
+ // TODO
+ button = VMButtonFactory.getButton(vmList, profile.getImageList().get(0));
+ button.setProperty(profile.getEmulatorList().get(i));
+ if (i == select) {
+ VMButtonFactory.clickVMButton(button);
+ }
+ }
+ }
+
+ // add create button
+ // TODO
+ addNewButton = VMButtonFactory.getCreateButton(vmList, profile.getImageList().get(0));
+ if (isCreate) {
+ addNewButton.setSelection(true);
+ } else {
+ addNewButton.setSelection(false);
+ }
+ addNewButton.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ clickCreateButton();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+ });
+
+ BUTTON_WIDTH = VMButtonFactory.getButtonSize().x + 4;
+ BUTTON_HEIGHT = VMButtonFactory.getButtonSize().y + 4;
+
+ arrayVMList();
+ dumyText.setFocus();
+ }
+
+ @Override
public void drawVMList(BaseImage base, int select, boolean isCreate) {
if (createButton != null) {
if (base.getVmsList().isEmpty()) {
}
}
}
-
}
import org.eclipse.swt.widgets.TreeItem;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.Profile;
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.ui.VMsMainView;
VMsMainView.getInstance().drawVMList(imageIndex);
}
+ @Override
+ public void drawProfile(Profile profile) {
+ VMsMainView.getInstance().drawVMList(profile);
+ }
+
+ @Override
+ public void drawVMList(int select, boolean isCreate) {
+ if (select >= 0) {
+ vmsTree.removeAll();
+ //currentProp = null;
+ currentItem = null;
+ RowItem rowItem = null;
+ TreeItem createItem = null;
+ TreeItem propertyItem = null;
+ Profile profile = VMsMainView.getInstance().getProfile();
+ // TODO
+ BaseImage base = profile.getImageList().get(0);
+ createItem = new TreeItem(vmsTree, SWT.NONE);
+ rowItem = new CreateMarker(createItem, base);
+ createItem.setData(rowItem);
+
+ VMProperty prop = null;
+ for(int i = 0; i < base.getVmsList().size(); i++) {
+ prop = base.getVmsList().get(i);
+ propertyItem = new TreeItem(vmsTree, SWT.NONE);
+ rowItem = new PropertyContent(prop, propertyItem);
+ propertyItem.setData(rowItem);
+ if (i == select) {
+ //currentProp = (PropertyContent)rowItem;
+ currentItem = propertyItem;
+ VMsMainView.getInstance().drawDetailVM(prop, -1);
+ }
+ }
+ packAll();
+ packAll(); // FIXME: Need second pack avoid column becomes too narrow... why ???
+ setSelectProperty();
+ }
+ }
+
//private ArrayList<TreeItem> createItems = new ArrayList<TreeItem>();
//private ArrayList<TreeItem> typeItems = new ArrayList<TreeItem>();
//private Map<String, TreeItem> itemsMap = new HashMap<String, TreeItem>();
public void draw() {
// TODO
- view.clearPlatform();
+ view.clearProfile();
view.setProfile(profile);
}