--- /dev/null
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.ColorResources;
+import org.tizen.dynamicanalyzer.FontResources;
+import org.tizen.dynamicanalyzer.ImageResources;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class SingletonInfoDialog {
+ private Shell parent = null;
+ private Shell shell = null;
+ private DACustomButton okButton = null;
+
+ private final Image iconImage = ImageResources.DYNAIC_ANALYZER_ICON;
+
+ public SingletonInfoDialog(Shell parent, int style) {
+ this.parent = parent;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ System.exit(-1);
+ }
+ };
+
+
+ public int open() {
+ shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.TITLE);
+ shell.setSize(446, 153);
+ shell.setLayout(new FormLayout());
+ shell.setText(AnalyzerLabels.SINGLETON_INFO_DLG_TITLE);
+
+ Composite base = new Composite(shell, SWT.NONE);
+ base.setLayout(new FormLayout());
+ FormData baseData = new FormData();
+ baseData.top = new FormAttachment(0, 0);
+ baseData.left = new FormAttachment(0, 0);
+ baseData.right = new FormAttachment(100, 0);
+ baseData.height = 76;
+ base.setLayoutData(baseData);
+ base.setVisible(true);
+ base.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ // Icon
+ Label icon = new Label(base, SWT.TRANSPARENT);
+ icon.setBackground(ColorResources.WINDOW_BG_COLOR);
+ icon.setImage(iconImage);
+
+ // Contents
+ Label strMessage_1 = new Label(base, SWT.TRANSPARENT);
+ strMessage_1.setText(AnalyzerLabels.SINGLETON_INFO_DLG_MESSAGE_1);
+ strMessage_1.setBackground(ColorResources.DIALOG_BG_UPPER);
+ strMessage_1.setAlignment(SWT.LEFT);
+ strMessage_1.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ strMessage_1.setFont(FontResources.ABOUT_TEXT);
+
+ Label strMessage_2 = new Label(base, SWT.TRANSPARENT);
+
+ strMessage_2.setText(AnalyzerLabels.SINGLETON_INFO_DLG_MESSAGE_2); //$NON-NLS-1$
+ strMessage_2.setBackground(ColorResources.DIALOG_BG_UPPER);
+ strMessage_2.setAlignment(SWT.LEFT);
+ strMessage_2.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ strMessage_2.setFont(FontResources.ABOUT_TEXT);
+
+ FormData labelData = new FormData();
+ labelData.left = new FormAttachment(0, 15);
+ labelData.top = new FormAttachment(0, 6);
+ labelData.height = 64;
+ labelData.width = 64;
+ icon.setLayoutData(labelData);
+
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 95);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, 17);
+ labelData.height = 22;
+ strMessage_1.setLayoutData(labelData);
+
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 95);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, 39);
+ labelData.height = 22;
+ strMessage_2.setLayoutData(labelData);
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ buttonComp.setLayout(compLayout);
+ buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(base, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(compData);
+
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.ABOUT_DIALOG_OK); //$NON-NLS-1$
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ FormData okData = new FormData();
+ okData.top = new FormAttachment(0, 12);
+ okData.right = new FormAttachment(100, -9);
+ okData.width = 100;
+ okData.height = 34;
+ okButton.setLayoutData(okData);
+
+ shell.open();
+
+ Display display = PlatformUI.createDisplay();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+
+ shell.dispose();
+
+
+
+ return 0;
+ }
+}