import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
public class BaseImageCreateDialog extends ModifyDialog {
- private final static String TITLE = "New Base Image";
public final static int WIDTH = 484;
private final static int HEIGHT = 305;
- public BaseImageCreateDialog(Shell parent) {
- super(parent, TITLE, WIDTH, HEIGHT);
+ public BaseImageCreateDialog(Shell parent, String title) {
+ super(parent, title, WIDTH, HEIGHT);
}
public void create(CustomBaseImageValue imageValue, List<ModifyDialogItem> itemList) {
import java.util.List;
import org.eclipse.swt.SWT;
+import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.baseimage.CustomBaseImageValue;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
import org.tizen.emulator.manager.ui.renewal.dialog.BaseImageCreateDialog;
public class BaseImageDialogHandler {
public static CustomBaseImageValue create() {
- BaseImageCreateDialog dialog
- = new BaseImageCreateDialog(MainDialog.getShell());
-
- dialog.setDialogMode(DIALOG_MODE.CREATE);
CustomBaseImageValue value = new CustomBaseImageValue();
- dialog.create(value, getDefaultItemList() );
+ value = openDialog("New Base Image", DIALOG_MODE.CREATE, value);
+
+ return value;
+ }
+
+ public static CustomBaseImageValue modify(BaseImage image) {
+ CustomBaseImageValue value = new CustomBaseImageValue(image);
+ value = openDialog("Modify Base Image", DIALOG_MODE.MODIFY, value);
+
+ return value;
+ }
+
+ private static CustomBaseImageValue openDialog(String dialogTitle, DIALOG_MODE mode,
+ CustomBaseImageValue value) {
+ BaseImageCreateDialog dialog
+ = new BaseImageCreateDialog(MainDialog.getShell(), dialogTitle);
+ dialog.setDialogMode(mode);
+ dialog.create(value, getDefaultItemList());
if (dialog.open() == SWT.OK) {
dialog.saveDataInto(value);
}
}
+ public Platform getPlatform() {
+ if (isBaseImageValue()) {
+ return baseImageValue.getPlatform();
+ }
+ return null;
+ }
+
public void setPlatform(Platform platform) {
if (isBaseImageValue()) {
baseImageValue.setPlatform(platform);
}
}
+ public String getDescritpion() {
+ if (isBaseImageValue()) {
+ return baseImageValue.getDescription();
+ }
+ return "";
+ }
+
public void setDescription(String message) {
if (isBaseImageValue()) {
baseImageValue.setDescription(message);
}
}
+ public boolean isAmendable() {
+ if (isBaseImageValue()) {
+ return baseImageValue.isAmendable();
+ }
+ return false;
+ }
+
private static boolean checkOn(String onOffVal) {
if (onOffVal.equals(VALUE_ON)) {
return true;