From: dongkyu6 lee Date: Wed, 11 May 2016 06:52:58 +0000 (+0900) Subject: [SRADA-528] Implement empty TargetDialog X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e305a03ea83af54d0240d2ccb17497838b91e78;p=sdk%2Ftools%2Fdynamic-analyzer.git [SRADA-528] Implement empty TargetDialog Change-Id: I0ff29eba37979b2fe82ef73166fa0380a214821f --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.java new file mode 100644 index 0000000..0b1f791 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.java @@ -0,0 +1,35 @@ +package org.tizen.dynamicanalyzer.nl; + +import org.eclipse.osgi.util.NLS; + +public class TargetDialogLabels extends NLS { + + private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.TargetDialogLabels"; + + public static String TITLE; + public static String DEVICE; + public static String APPLICATION; + public static String DESCRIPTION; + + public static String CONNECT_DEVICE; + + public static String REFRESH; + + public static String VERSION; + public static String CPU; + public static String RAM; + public static String RESOLUTION; + + public static String PACKAGE_NAME; + public static String PACKAGE_VERSION; + public static String PACKAGE_INSTALLED_TIME; + public static String ALLPLICATION_EXEC_PATH; + + static { + NLS.initializeMessages(BUNDLE_NAME, TargetDialogLabels.class); + } + + public TargetDialogLabels() { + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.properties new file mode 100644 index 0000000..ba94910 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TargetDialogLabels.properties @@ -0,0 +1,18 @@ +TITLE=Target +DEVICE=Device +APPLICATION=Application +DESCRIPTION=Description + +CONNECT_DEVICE=Connect Device + +REFRESH=Refresh + +VERSION=Version +CPU=CPU +RAM=RAM +RESOLUTION=Resolution + +PACKAGE_NAME=Package name +PACKAGE_VERSION=Package version +PACKAGE_INSTALLED_TIME=Package installed time +ALLPLICATION_EXEC_PATH=Application exec path \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java index d422536..c5390f4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java @@ -67,6 +67,7 @@ import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar; import org.tizen.dynamicanalyzer.ui.toolbar.setting.FlatFeatureDialog; import org.tizen.dynamicanalyzer.ui.toolbar.setting.PreferencesDialog; +import org.tizen.dynamicanalyzer.ui.toolbar.setting.TargetDialog; import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager; import org.tizen.dynamicanalyzer.util.Logger; import org.tizen.dynamicanalyzer.util.WorkbenchUtil; @@ -235,7 +236,8 @@ public class MenuBar { @Override public void widgetSelected(SelectionEvent arg0) { - + TargetDialog targetDialog = new TargetDialog(currentShell); + targetDialog.open(); } }); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/TargetDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/TargetDialog.java new file mode 100644 index 0000000..5c36bd7 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/TargetDialog.java @@ -0,0 +1,171 @@ +package org.tizen.dynamicanalyzer.ui.toolbar.setting; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ShellEvent; +import org.eclipse.swt.events.ShellListener; +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.Shell; +import org.tizen.dynamicanalyzer.nl.TargetDialogLabels; +import org.tizen.dynamicanalyzer.nl.WidgetLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; +import org.tizen.dynamicanalyzer.widgets.da.base.DAButton; +import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox; + +public class TargetDialog extends DAMessageBox { + private static boolean opened = false; + + public TargetDialog(Shell parentShell) { + super(parentShell); + } + + protected boolean run() { + if (opened) { + return false; + } + + shell.setSize(1010, 620); + shell.setLayout(new FormLayout()); + shell.setText(TargetDialogLabels.TITLE); + shell.setBackground(ColorResources.WHITE); + + // base composite + Composite baseComp = new Composite(shell, SWT.NONE); + FormLayout compLayout = new FormLayout(); + baseComp.setLayout(compLayout); + + FormData compData = new FormData(); + compData.top = new FormAttachment(0, 0); + compData.left = new FormAttachment(0, 0); + compData.right = new FormAttachment(100, 0); + compData.bottom = new FormAttachment(100, -60); + baseComp.setLayoutData(compData); + + ScrolledComposite scrolledComp = new ScrolledComposite(baseComp, SWT.BORDER | SWT.V_SCROLL); + scrolledComp.setLayout(new FormLayout()); + FormData scrollCompData = new FormData(); + scrollCompData.top = new FormAttachment(0, 0); + scrollCompData.left = new FormAttachment(0, 0); + scrollCompData.right = new FormAttachment(100, 0); + scrollCompData.bottom = new FormAttachment(100, 0); + scrolledComp.setLayoutData(scrollCompData); + scrolledComp.setExpandVertical(true); + scrolledComp.setBackground(ColorResources.WHITE); + + + + // button composite + Composite buttonContentsComp = new Composite(shell, SWT.NONE); + compLayout = new FormLayout(); + buttonContentsComp.setLayout(compLayout); + buttonContentsComp.setBackground(ColorResources.WHITE); + compData = new FormData(); + compData.top = new FormAttachment(100, -60); + compData.left = new FormAttachment(0, 0); + compData.right = new FormAttachment(100, 0); + compData.bottom = new FormAttachment(100, 0); + buttonContentsComp.setLayoutData(compData); + + DACustomButton okButton = new DAButton(buttonContentsComp, SWT.NONE); + okButton.addClickListener(okButtonListener); + okButton.setText(WidgetLabels.OK); + okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT); + FormData buttonData = new FormData(); + buttonData.top = new FormAttachment(0, 15); + buttonData.right = new FormAttachment(100, -15); + buttonData.width = 100; + buttonData.height = 30; + okButton.setLayoutData(buttonData); + + DACustomButton cancelButton = new DAButton(buttonContentsComp, SWT.NONE); + cancelButton.addClickListener(cancelButtonListener); + cancelButton.setText(WidgetLabels.CANCEL); + cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT); + buttonData = new FormData(); + buttonData.top = new FormAttachment(0, 15); + buttonData.right = new FormAttachment(okButton, -8); + buttonData.width = 100; + buttonData.height = 30; + cancelButton.setLayoutData(buttonData); + + DACustomButton refressButton = new DAButton(buttonContentsComp, SWT.NONE); + refressButton.addClickListener(refreshButtonListener); + refressButton.setText(TargetDialogLabels.REFRESH); + refressButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT); + buttonData = new FormData(); + buttonData.top = new FormAttachment(0, 15); + buttonData.right = new FormAttachment(cancelButton, -8); + buttonData.width = 100; + buttonData.height = 30; + refressButton.setLayoutData(buttonData); + + opened = true; + ShortCutManager.getInstance().setEnabled(!opened); + + shell.addShellListener(shellListener); + shell.open(); + + return true; + } + + private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + shell.close(); + } + }; + + private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + shell.close(); + } + }; + + private DACustomButtonClickEventListener refreshButtonListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + + } + }; + + private ShellListener shellListener = new ShellListener() { + + @Override + public void shellActivated(ShellEvent e) { + // TODO Auto-generated method stub + } + + @Override + public void shellClosed(ShellEvent e) { + opened = false; + ShortCutManager.getInstance().setEnabled(!opened); + } + + @Override + public void shellDeactivated(ShellEvent e) { + // TODO Auto-generated method stub + } + + @Override + public void shellDeiconified(ShellEvent e) { + // TODO Auto-generated method stub + } + + @Override + public void shellIconified(ShellEvent e) { + // TODO Auto-generated method stub + } + + }; +}