import java.io.File;
import java.io.RandomAccessFile;
import java.nio.channels.FileLock;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
public class EmulatorManager {
private static EmulatorManager instance;
+ public enum ManagerModeType {
+ PUBLIC_MODE("public"),
+ INHOUSE_MODE("inhouse");
+
+ private final String value;
+
+ ManagerModeType(String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ public static ManagerModeType fromValue(String v) {
+ for (ManagerModeType c : ManagerModeType.values()) {
+ if (c.value.equals(v)) {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+
+ }
+
+ private ManagerModeType mode;
Display display;
private MainDialog mainDialog;
- public EmulatorManager() {
+ public EmulatorManager(ManagerModeType mode) {
+ this.mode = mode;
this.display = new Display();
}
+ public ManagerModeType getManagerMode() {
+ return mode;
+ }
+
public static EmulatorManager getInstance() {
return instance;
}
private void preare() {
- mainDialog = new MainDialog();
+ mainDialog = new MainDialog(mode);
}
private void DrawUI() {
}
public static void main(String[] args) {
- instance = new EmulatorManager();
+ int result = 0; //TODO: enum
+ ManagerModeType mode = ManagerModeType.PUBLIC_MODE;
if(args.length > 0) {
for(int i = 0; i < args.length; i++) {
if(args[i].equals("--workspace") || args[i].equals("-w")) {
if(args.length == i + 1) {
- Shell shell = new Shell(instance.display);
- MessageBox msg = new MessageBox(shell, SWT.ICON_INFORMATION);
- msg.setText("INFO");
- msg.setMessage("You did not input workspace path after\n" +
- "command line option --workspace or -w\n" +
- "Emulator Manager sets in default workspace.");
- msg.open();
- break;
+ result = -1; //TODO: enum
}
EmulatorVMs.getInstance().setVMsBaseDirectory(args[i+1]);
- break;
+ } else if (args[i].equals("--inhouse")) {
+ mode = ManagerModeType.INHOUSE_MODE;
}
}
}
EmulatorVMs.getInstance().setVMsBaseDirectory(FileIO.getInstance().getTizenVmsPath());
}
+ instance = new EmulatorManager(mode);
+
+ if (result == -1) {
+ Shell shell = new Shell(instance.display);
+ MessageBox msg = new MessageBox(shell, SWT.ICON_INFORMATION);
+ msg.setText("INFO");
+ msg.setMessage("You did not input workspace path after\n" +
+ "command line option --workspace or -w\n" +
+ "Emulator Manager sets in default workspace.");
+ msg.open();
+ }
+
try {
EmulatorVMs.getInstance().loadProperties();
} catch (Exception e) {
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
import org.tizen.emulator.manager.ui.detail.DetailTableView;
import org.tizen.emulator.manager.ui.vmstree.VMsTree;
Shell shell;
Image icon;
- public MainDialog() {
+ public MainDialog(ManagerModeType mode) {
shell = new Shell(Display.getCurrent());
shell.setSize(700, 500);
- shell.setText("Emulator Manager");
+ if (mode.equals(ManagerModeType.INHOUSE_MODE)) {
+ shell.setText("Emulator Manager (Inhouse)");
+ } else {
+ shell.setText("Emulator Manager");
+ }
shell.setLayout(new FillLayout());
InputStream is = this.getClass().getClassLoader().getResourceAsStream(ICON_FILE_NAME);