--- /dev/null
+package org.tizen.emulator.manager.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.tool.About;
+import org.tizen.emulator.manager.tool.StringResource;
+import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+
+public class AboutDialog {
+ private static Shell dialog = null;
+ private static String textContents = "";
+ private static int width = 436; //149 + 287
+ private static int height = 290; // 180 + 110
+ static {
+ About.initAboutContents();
+ textContents = "\n" +
+ "Tizen SDK" +
+ "\n\n" +
+ "Version : " + About.getInstance().getAboutVersion() +
+ "\n" +
+ "Build id : " + About.getInstance().getBuildTime();
+
+ }
+
+ public static void open() {
+ makeDialog();
+ dialog.open();
+ }
+
+ private static void makeDialog() {
+ dialog = new Shell(EmulatorManager.getInstance().getMainDialog().getShell(), SWT.DIALOG_TRIM);
+ dialog.setText("About Emulator Manager");
+ dialog.setSize(width, height);
+ dialog.setLayout(getGridLayout(1, false));
+
+ Composite upperComposite = new Composite(dialog, SWT.NONE);
+ upperComposite.setLayout(getGridLayout(2, false));
+ upperComposite.setSize(width, 180);
+ upperComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ upperComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+
+ // About icon
+ Label label = new Label(upperComposite, SWT.NONE);
+ label.setImage(ResourceRegistry.getImage(ImageName.ABOUTSDK));
+
+ // About Contents
+ makeTextContents(upperComposite);
+
+ Composite lowerComposite = new Composite(dialog, SWT.NONE);
+ GridLayout layout = getGridLayout(1, true);
+ layout.marginRight = 10;
+ lowerComposite.setLayout(layout);
+ // TODO
+ lowerComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false));
+
+ Label dummy = new Label(lowerComposite, SWT.NONE);
+ dummy.setLayoutData(new GridData(110, 40));
+
+ Button okButton = new Button(lowerComposite, SWT.PUSH);
+ okButton.setLayoutData(new GridData(110, SWT.DEFAULT));
+ okButton.setText(StringResource.OK);
+ okButton.setFocus();
+ okButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ dialog.close();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ private static void makeTextContents(Composite upperComposite) {
+ Composite textComposite = new Composite(upperComposite, SWT.NONE);
+ GridLayout layout = getGridLayout(1, true);
+ layout.marginLeft = 5;
+ layout.marginRight = 5;
+ textComposite.setLayout(layout);
+ textComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ textComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+
+ // basic info - version , build time
+ Label contents = new Label(textComposite, SWT.NONE);
+ contents.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ contents.setText(textContents);
+ contents.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+
+ // workspace path
+ Link workspace = new Link(textComposite, SWT.NONE);
+ workspace.setLayoutData(new GridData(287, SWT.DEFAULT));
+ workspace.setText("Workspace Path : " +
+ "<a>" + EmulatorVMs.getInstance().getVMsBaseDirectory() + "</a>");
+ workspace.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ workspace.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ org.eclipse.swt.program.Program.launch(EmulatorVMs.getInstance().getVMsBaseDirectory());
+ }
+ });
+
+ // link to tizen site
+ Link visit = new Link(textComposite, SWT.NONE);
+ visit.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));
+ visit.setText("\n\n" +
+ "Visit <a>https://developer.tizen.org</a>");
+ visit.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ visit.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ org.eclipse.swt.program.Program.launch("https://developer.tizen.org");
+ }
+
+ });
+ }
+
+ private static GridLayout getGridLayout(int numColumns, boolean makeColumnEqualWidth) {
+ GridLayout layout = new GridLayout(numColumns, makeColumnEqualWidth);
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 0;
+ layout.marginBottom = 0;
+ layout.marginHeight = 0;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.marginTop = 0;
+ layout.marginWidth = 0;
+
+ return layout;
+ }
+}
+