From dd22b3f3176196b1d43e81f6625c42b57750085a Mon Sep 17 00:00:00 2001 From: dongkyu6 lee Date: Tue, 5 Jul 2016 16:19:22 +0900 Subject: [PATCH] [SRADA-854][SRADA-862] Add a Save popup window and adjust UX guide on DADialog - Refactoring DADialog - Change icon, size, color on DADialog - Add a dailog when there is unsaved data Change-Id: Iec991ea9f26b00b921f80a7fcd5d8eac63e4081e --- .../appearance/DesignConstants.java | 4 +- .../org/tizen/dynamicanalyzer/nl/WidgetLabels.java | 6 + .../dynamicanalyzer/nl/WidgetLabels.properties | 6 + .../dynamicanalyzer/widgets/da/base/DADialog.java | 374 +++++++++++++++------ .../theme/flat/img/dialog_error.png | Bin 5681 -> 1318 bytes .../theme/flat/img/dialog_warning.png | Bin 4478 -> 1414 bytes .../dynamicanalyzer/workbench/Application.java | 4 +- .../tizen/dynamicanalyzer/common/DALogExport.java | 152 ++++----- .../tizen/dynamicanalyzer/handlers/UIAction.java | 60 ++-- .../tizen/dynamicanalyzer/nl/ConfigureLabels.java | 2 + .../dynamicanalyzer/nl/ConfigureLabels.properties | 2 + .../org/tizen/dynamicanalyzer/project/Project.java | 20 +- .../ui/common/explorer/FileExplorerDialog.java | 1 + .../ui/hierarchy/tree/HierarchyTreeView.java | 4 +- .../hierarchy/tree/tool/HierarchyTreeExporter.java | 4 +- .../org/tizen/dynamicanalyzer/ui/page/MenuBar.java | 175 ++++++---- .../ui/timeline/dlog/DlogTable.java | 2 +- .../opentrace/OpenTraceProgressManager.java | 3 +- .../ui/toolbar/setting/SettingDialog.java | 3 +- .../dynamicanalyzer/ui/widgets/FilterDialog.java | 4 +- 20 files changed, 534 insertions(+), 292 deletions(-) diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/appearance/DesignConstants.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/appearance/DesignConstants.java index 85e773d..70ceadb 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/appearance/DesignConstants.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/appearance/DesignConstants.java @@ -45,8 +45,8 @@ public class DesignConstants { public static final int TABLE_VIEW_HEIGHT = 204; - public static final int DA_BUTTON_HEIGHT = 28; - public static final int DA_BUTTON_WIDTH = 100; + public static final int DA_BUTTON_HEIGHT = 24; + public static final int DA_BUTTON_WIDTH = 86; public static final int DA_BUTTON_TOP = 11; public static final int COMBO_ARROW_HEIGHT = 24; diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.java index fe25951..77b6607 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.java @@ -44,11 +44,17 @@ public class WidgetLabels extends NLS { public static String YES; public static String NO; + + public static String SAVE; + public static String DISCARD; public static String OPEN; public static String CLOSE; public static String DA_WARNING; + + public static String EXPORT_LOGS; + public static String TITLE; static { NLS.initializeMessages(BUNDLE_NAME, WidgetLabels.class); diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.properties b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.properties index 0716f7d..2418973 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.properties +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/nl/WidgetLabels.properties @@ -1,3 +1,5 @@ +TITLE=Dynamic Analyzer + ON=On OFF=Off @@ -13,7 +15,11 @@ NEXT=Next YES=Yes NO=No +SAVE=Save +DISCARD=Discard + OPEN=Open CLOSE=Close DA_WARNING=Warning +EXPORT_LOGS=Export Logs \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/DADialog.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/DADialog.java index 17fb67e..961a902 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/DADialog.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/DADialog.java @@ -27,13 +27,13 @@ package org.tizen.dynamicanalyzer.widgets.da.base; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.PaintEvent; -import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; 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.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; @@ -43,149 +43,315 @@ import org.tizen.dynamicanalyzer.nl.WidgetLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; import org.tizen.dynamicanalyzer.resources.ImageResources; -import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; -import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; public class DADialog { + public static enum DIALOGTYPE { + ERROR_WITH_EXPORT, + ERROR, + SAVE, + YES_NO + } + private final int gapwithbuttons = -8; + private final int wideWidth = 480; + private final int miniWidth = 320; + private final int defaultHeifght = 220; + private final int button_top = 18; + private Shell parent = null; private Shell shell = null; - private DACustomButton okButton = null; - private DACustomButton exportButton = null; + private Button okButton = null; + private Button exportButton = null; + private Button yesButton = null; + private Button noButton = null; + private Button saveButton = null; + private Button discardButton = null; private String message = null; private boolean returnType = false; - private String titleText = WidgetLabels.DA_WARNING; - private final int defaultWidth = 446; - private final int defaultHeifght = 153; + private String titleText = WidgetLabels.TITLE; private int width = 0; private int height = 0; private Image iconImage = ImageResources.DYNANMIC_ANALYZER_ICON; + private DIALOGTYPE dialogtype = DIALOGTYPE.ERROR; - private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() { - @Override - public void handleClickEvent(DACustomButton button) { - returnType = true; - shell.dispose(); - } - }; - - public DADialog(Shell parent, int style) { - this.width = this.defaultWidth; - this.height = this.defaultHeifght; + public DADialog(Shell parent, DIALOGTYPE type, int style, int width, int height) { + this.width = width; + this.height = height; this.parent = parent; + this.dialogtype = type; } - public DADialog(Shell parent, int style, int width, int height) { - this(parent, style); - this.width = width; - this.height = height; + public DADialog(Shell parent, DIALOGTYPE type, int style) { + this.parent = parent; + this.dialogtype = type; + this.width = this.wideWidth; + this.height = this.defaultHeifght; + + if(type == DIALOGTYPE.SAVE || type == DIALOGTYPE.YES_NO) { + this.width = this.miniWidth; + } } - - public boolean setDialog(boolean isExport) { + + public boolean setDialog() { + returnType = false; + shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM); - int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - this.width)/2; - int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - this.height)/2; + int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - this.width) / 2; + int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - this.height) / 2; shell.setLocation(dialogLocationX, dialogLocationY); shell.setSize(width, height); shell.setLayout(new FormLayout()); shell.setText(titleText); + shell.setBackground(ColorResources.DIALOG_TOP_LINE_COLOR); // Base composite 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); + FormData formData = new FormData(); + formData.top = new FormAttachment(0, 1); + formData.left = new FormAttachment(0, 0); + formData.right = new FormAttachment(100, 0); + formData.height = 128; + base.setLayoutData(formData); + base.setBackground(ColorResources.WHITE); // Icon Label icon = new Label(base, SWT.TRANSPARENT); - icon.setBackground(ColorResources.DIALOG_BG_UPPER); + icon.setBackground(ColorResources.WHITE); icon.setImage(iconImage); + formData = new FormData(); + formData.top = new FormAttachment(0, 50); + formData.left = new FormAttachment(0, 35); + formData.height = 28; + formData.width = 28; + icon.setLayoutData(formData); + // Contents - Label strMessage = new Label(base, SWT.TRANSPARENT | SWT.WRAP); - strMessage.setText(message); - strMessage.setBackground(ColorResources.DIALOG_BG_UPPER); - strMessage.setAlignment(SWT.LEFT); - strMessage.setForeground(ColorResources.DEFAULT_FONT_COLOR); - strMessage.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, 90); - labelData.right = new FormAttachment(95, 0); - labelData.top = new FormAttachment(0, 17); - labelData.height = 50; - strMessage.setLayoutData(labelData); + if(message.contains("\n")) { + Label boldMessage = new Label(base, SWT.TRANSPARENT | SWT.WRAP); + boldMessage.setText(message.substring(0, message.indexOf("\n"))); + boldMessage.setBackground(ColorResources.WHITE); + boldMessage.setAlignment(SWT.LEFT); + boldMessage.setForeground(ColorResources.DIALOG_TEXT_FONT_COLOR); + boldMessage.setFont(FontResources.DIALOG_CONTENTS_BOLD_FONT); + + formData = new FormData(); + formData.top = new FormAttachment(0, 45); + formData.height = 20; + formData.left = new FormAttachment(icon, 15); + formData.right = new FormAttachment(95, 0); + boldMessage.setLayoutData(formData); + + Label normalMessage = new Label(base, SWT.TRANSPARENT | SWT.WRAP); + normalMessage.setText(message.substring(message.indexOf("\n") + 1)); + normalMessage.setBackground(ColorResources.WHITE); + normalMessage.setAlignment(SWT.LEFT); + normalMessage.setForeground(ColorResources.DIALOG_TEXT_FONT_COLOR); + normalMessage.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT); + + formData = new FormData(); + formData.top = new FormAttachment(boldMessage, 1); + formData.bottom = new FormAttachment(100, 0); + formData.left = new FormAttachment(icon, 15); + formData.right = new FormAttachment(95, 0); + normalMessage.setLayoutData(formData); + } + else { + Label strMessage = new Label(base, SWT.TRANSPARENT | SWT.WRAP); + strMessage.setText(message); + strMessage.setBackground(ColorResources.WHITE); + strMessage.setAlignment(SWT.LEFT); + strMessage.setForeground(ColorResources.DIALOG_CONTENT_BACKGROUND); + strMessage.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT); + + formData = new FormData(); + formData.top = new FormAttachment(0, 50 + 5); + formData.bottom = new FormAttachment(100, 0); + formData.left = new FormAttachment(icon, 15); + formData.right = new FormAttachment(95, 0); + strMessage.setLayoutData(formData); + } + + // middle line composite + Composite middlLinebase = new Composite(shell, SWT.NONE); + middlLinebase.setLayout(new FormLayout()); + formData = new FormData(); + formData.top = new FormAttachment(base, 0); + formData.left = new FormAttachment(0, 0); + formData.right = new FormAttachment(100, 0); + formData.height = 1; + middlLinebase.setLayoutData(formData); + middlLinebase.setBackground(ColorResources.DIALOG_MIDDLE_LINE_COLOR); // Button composite Composite buttonComp = new Composite(shell, SWT.NONE); - FormLayout compLayout = new FormLayout(); - buttonComp.setLayout(compLayout); - buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER); + buttonComp.setLayout(new FormLayout()); + buttonComp.setBackground(ColorResources.DIALOG_BUTTON_BACKGROUND); + + formData = new FormData(); + formData.top = new FormAttachment(middlLinebase, 0); + formData.left = new FormAttachment(0, 0); + formData.right = new FormAttachment(100, 0); + formData.bottom = new FormAttachment(100, 0); + buttonComp.setLayoutData(formData); + + if (dialogtype == DIALOGTYPE.ERROR_WITH_EXPORT) { + addOKButton(buttonComp); + addExportButton(buttonComp); + } else if (dialogtype == DIALOGTYPE.ERROR) { + addOKButton(buttonComp); + } else if (dialogtype == DIALOGTYPE.YES_NO) { + addYesNoButton(buttonComp); + } else if (dialogtype == DIALOGTYPE.SAVE) { + addSaveButton(buttonComp); + } - buttonComp.addPaintListener(new PaintListener() { + return returnType; + } + + private void addOKButton(Composite buttonComp) { + // OK button + okButton = new Button(buttonComp, SWT.NONE); + okButton.addSelectionListener(new SelectionListener() { @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); + public void widgetSelected(SelectionEvent e) { + returnType = true; + shell.dispose(); } - }); - 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); + @Override + public void widgetDefaultSelected(SelectionEvent e) { - // OK button - okButton = new DAButton(buttonComp, SWT.NONE); - okButton.addClickListener(okButtonListener); + } + }); + okButton.setFont(FontResources.DIALOG_BUTTON_FONT); okButton.setText(WidgetLabels.OK); - okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT); FormData okData = new FormData(); - okData.top = new FormAttachment(0, 11); - okData.right = new FormAttachment(100, -9); + okData.top = new FormAttachment(0, button_top); + okData.right = new FormAttachment(100, -20); okData.width = DesignConstants.DA_BUTTON_WIDTH; okData.height = DesignConstants.DA_BUTTON_HEIGHT; okButton.setLayoutData(okData); + } + + private void addExportButton(Composite buttonComp) { + exportButton = new Button(buttonComp, SWT.NONE); + exportButton.setText(WidgetLabels.EXPORT_LOGS); + + FormData exportData = new FormData(); + exportData.top = new FormAttachment(0, button_top); + exportData.left = new FormAttachment(0, 20); + exportData.width = DesignConstants.DA_BUTTON_WIDTH; + exportData.height = DesignConstants.DA_BUTTON_HEIGHT; + exportButton.setLayoutData(exportData); + } + + private void addYesNoButton(Composite buttonComp) { + noButton = new Button(buttonComp, SWT.NONE); + noButton.setFont(FontResources.DIALOG_BUTTON_FONT); + noButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + returnType = false; + shell.dispose(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + + } + }); + noButton.setText(WidgetLabels.NO); + + FormData fromdata = new FormData(); + fromdata.top = new FormAttachment(0, button_top); + fromdata.right = new FormAttachment(100, 20); + fromdata.width = DesignConstants.DA_BUTTON_WIDTH; + fromdata.height = DesignConstants.DA_BUTTON_HEIGHT; + noButton.setLayoutData(fromdata); - // Export button - if(isExport){ - exportButton = new DAButton(buttonComp, SWT.NONE); - exportButton.setText("ExportLogs"); - exportButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT); - - FormData exportData = new FormData(); - exportData.top = new FormAttachment(0, 11); - exportData.right = new FormAttachment(okButton,-220, SWT.LEFT); - exportData.width = DesignConstants.DA_BUTTON_WIDTH; - exportData.height = DesignConstants.DA_BUTTON_HEIGHT; - exportButton.setLayoutData(exportData); - } - return returnType; + yesButton = new Button(buttonComp, SWT.NONE); + yesButton.setFont(FontResources.DIALOG_BUTTON_FONT); + yesButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + returnType = true; + shell.dispose(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + + } + }); + yesButton.setText(WidgetLabels.YES); + + fromdata = new FormData(); + fromdata.top = new FormAttachment(0, button_top); + fromdata.right = new FormAttachment(noButton, gapwithbuttons); + fromdata.width = DesignConstants.DA_BUTTON_WIDTH; + fromdata.height = DesignConstants.DA_BUTTON_HEIGHT; + yesButton.setLayoutData(fromdata); + yesButton.setFocus(); } - public void open(){ + private void addSaveButton(Composite buttonComp) { + discardButton = new Button(buttonComp, SWT.NONE); + discardButton.setFont(FontResources.DIALOG_BUTTON_FONT); + discardButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + returnType = true; + shell.dispose(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + + } + }); + discardButton.setText(WidgetLabels.DISCARD); + + FormData fromdata = new FormData(); + fromdata.top = new FormAttachment(0, button_top); + fromdata.right = new FormAttachment(100, -20); + fromdata.width = DesignConstants.DA_BUTTON_WIDTH; + fromdata.height = DesignConstants.DA_BUTTON_HEIGHT; + discardButton.setLayoutData(fromdata); + + saveButton = new Button(buttonComp, SWT.NONE); + saveButton.setFont(FontResources.DIALOG_BUTTON_FONT); + saveButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + returnType = true; + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + + } + }); + saveButton.setText(WidgetLabels.SAVE); + + fromdata = new FormData(); + fromdata.top = new FormAttachment(0, button_top); + fromdata.right = new FormAttachment(discardButton, gapwithbuttons); + fromdata.width = DesignConstants.DA_BUTTON_WIDTH; + fromdata.height = DesignConstants.DA_BUTTON_HEIGHT; + saveButton.setLayoutData(fromdata); + + saveButton.setFocus(); + } + + public void open() { shell.open(); Display display = Display.getCurrent(); @@ -198,7 +364,7 @@ public class DADialog { shell.dispose(); } - + public void setMessage(String msg) { message = msg; } @@ -211,7 +377,15 @@ public class DADialog { titleText = title; } - public DACustomButton getExportButton(){ + public boolean getResult() { + return this.returnType; + } + + public Button getExportButton() { return exportButton; } + + public Button getSaveButton() { + return saveButton; + } } diff --git a/org.tizen.dynamicanalyzer.appearance/theme/flat/img/dialog_error.png b/org.tizen.dynamicanalyzer.appearance/theme/flat/img/dialog_error.png index 74c509652c38f974541a4554dcfc79bb3a08b06a..0977ff43b24d30606dcc8d66f7da2022d0e3c39b 100644 GIT binary patch literal 1318 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s1|*Ak?@s|zk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzX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Ihf6pl*l=dZ*P6AYuKutf%g>Sr=ObA$_p-{Bd8`yHD4g z*{pl|4qfwpL~%hP);mJik?^Eg#=U6SgB1Z#+h z=hH^yPfl>oPBobyFbm|4fdDQu)>x+~pYHGI+_SQ-{3uJxCC7tzTf% ziLgI?N9sLOT?vILX44dpBux;aj1~+~+BEH0ova-Bti9t<>6NA$J+TRfg}OjkxQo~* zxFG}_9-oVQk5z_3q!dPkO}7loGk2t9=h*GpDQ45?1W`=43PP%xkVKIXN64EioO=V5 zUFo3oVxyv*JK^`AdZV$aS_h}3!WQ0qI1hEeSXc&04hiI_??~efK1~_Zp1B@Ex zC&VZ%fQIdF7Ax?0&IJa72&RM7dYsabFpCL0$-0g}ej`8|-U7G6xc#@e+XUR=<9`DH Xbm_sA)&Jp`00000NkvXXu0mjf0tKp( diff --git a/org.tizen.dynamicanalyzer.appearance/theme/flat/img/dialog_warning.png b/org.tizen.dynamicanalyzer.appearance/theme/flat/img/dialog_warning.png index d649383d1a377633698c651c7fed0d0dc1db2ae0..d317f5e90bdf178051f2ae2966fec74b5e6e2f93 100644 GIT binary patch literal 1414 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s1|*Ak?@s|zk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxSU1_g&``n5OwZ87 z)XdCKN5ROz&`93^h|F{iO{`4Ktc=VRpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$ zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`f(~1RD^r68eAMwS&*t9 zlvv ztM~P_^2{qPNz6-5^>ndS0-B(gnVDi`VQ6IRY;0^{?BZx?Xy|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o&|5D46>?vp)47GUd07X97Mo=2 zQ2`iD4HSBG3T+(BWh;Yb!YPdaQ0C(p>^KQHch{(zWpxi#)B2%UyR>8=073}(OUzV?qnD#m)Z|kZa1q~@ zXQUm2vb8N$BHg@Bv`>l*-!)<(8H6^m5(I6RVjBj+5E(w>wpDglSUF=;eQVHQh#$KH@v_%uA2 zY71Lce%}=aLI_m&O{97}1F8kb*3n9X6l?va=`7Uvu(U0mIo_1j?d^P4-kbIqTM+6hO$ZwR&N-^aMUjaf z2!c%1K2iX8s;7Xa?3JM}E|K$xw{)MXu+Rnvv?lKTL+Fm*x?vem}~Hec<~YtnD$6{9xg7>5nA2V7GGv(;{lHAs{o8WtCSfN$FbH-8GE>ef!1_( z7|prt1z2p+v${#%o{JXr!XLor-%2?7n~auv6VJ`JFk@0~yg(wf1DKHu4sfNt&$g&b z0tPi?LspI)IqSixi)B!aa-6zYh9hS^$c0{;5T{>1Y^==|0N2xQ zaw+_NKYV^a{C+>qT`tXOC`d#HFMntRvjw2f_4lpxv}K$2Vx?uO30YCV7=x@RXqjr} z%mex!v#Y74MLC)EH!fD{CRehRl*5+8t1iUzU@AUDrM; zISk-RCIC3GuWwi+KQEL0bSFove!PkL@ize680r~g)=QDF8$es80H^>w0fSA+#pr1? z7K!9jBQ^*C&K--tZ;GFD9G@d57RQ-PDnX~;_t~Pq{t<807*qoM6N<$f(zb1761SM diff --git a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java index 796ac91..38ebf18 100644 --- a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java +++ b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java @@ -83,11 +83,11 @@ private Display m_display; // check for tizen sdk installation boolean pathValidness = PathManager.checkTizenPathValidation(); if (pathValidness == false) { - DADialog dialog = new DADialog(new Shell(m_display), SWT.NONE); + DADialog dialog = new DADialog(new Shell(m_display), DADialog.DIALOGTYPE.ERROR, SWT.NONE); dialog.setTitleText(WorkbenchLabels.TIZEN_SDK_PATH_ERROR_TITLE); dialog.setMessage(WorkbenchLabels.TIZEN_SDK_PATH_ERROR); dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); - dialog.setDialog(false); + dialog.setDialog(); dialog.open(); return IApplication.EXIT_OK; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALogExport.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALogExport.java index d70421b..a0c92e3 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALogExport.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALogExport.java @@ -15,6 +15,7 @@ import java.util.zip.ZipOutputStream; import org.tizen.dynamicanalyzer.common.path.PathManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; +import org.tizen.dynamicanalyzer.nl.ConfigureLabels; import org.tizen.dynamicanalyzer.ui.common.explorer.FileExplorerDialog; import org.tizen.dynamicanalyzer.util.CommonUtil; import org.tizen.dynamicanalyzer.util.Logger; @@ -25,107 +26,110 @@ public class DALogExport { private String LogexportPath; private String LogZipPath; private String ExportLogName; - + public DALogExport() { Boolean result = false; result = exportPathDialog(); if (result != true) { - Logger.info("selected export path is wrong"); + Logger.debug("selected export path is wrong"); + return; } result = exportDALog(); if (result != true) { - Logger.info("export DAConsoleLog failed"); + Logger.debug("export DAConsoleLog failed"); } result = exportDaemonLog(); if (result != true) { - Logger.info("export DaemonLog failed"); + Logger.debug("export DaemonLog failed"); } result = exportDataLog(); if (result != true) { - Logger.info("export DataLog failed"); + Logger.debug("export DataLog failed"); } result = exportControlLog(); if (result != true) { - Logger.info("export ControlLog failed"); + Logger.debug("export ControlLog failed"); } result = compressLogs(); if (result != true) { - Logger.info("compress Logs failed"); + Logger.debug("compress Logs failed"); } result = removeTemp(); if (result != true) { - Logger.info("remove temp failed"); + Logger.debug("remove temp failed"); } } - + /// User Select Directory to export Logs - public Boolean exportPathDialog(){ + private Boolean exportPathDialog() { FileExplorerDialog dialog = new FileExplorerDialog(WorkbenchUtil.getWorkbenchWindow().getShell()); - dialog.setTitle("Select export path"); + dialog.setTitle(ConfigureLabels.EXPORT_DIALOG_SELECT_EXPORT_PATH); dialog.getExplorer().setRoot(CommonUtil.getHomeDirectory()); Object result = dialog.open(); - LogexportPath = result.toString(); - - if(LogexportPath==null){ + + if (result == null) { return false; } - + + if (result instanceof Boolean) { + if ((Boolean) result == false) { + return false; + } + } + + LogexportPath = result.toString(); + int cutStart = LogexportPath.indexOf("["); int cutEnd = LogexportPath.indexOf("]"); - String tmpPath = LogexportPath.substring(cutStart+1, cutEnd); - - SimpleDateFormat format = new SimpleDateFormat( - "yyyy_MM_dd_HH-mm-ss", Locale.KOREA); //$NON-NLS-1$ + String tmpPath = LogexportPath.substring(cutStart + 1, cutEnd); + + SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH-mm-ss", Locale.KOREA); //$NON-NLS-1$ Date date = new Date(); String logPostFix = format.format(date); - ExportLogName = "DALogs_"+ logPostFix; + ExportLogName = "DALogs_" + logPostFix; LogZipPath = tmpPath; - LogexportPath = tmpPath+"/"+ExportLogName; - + + setLogExportPath(tmpPath + "/" + ExportLogName); + return true; } - + // / set LogExportPath - public void setLogExportPath(String path) { + private void setLogExportPath(String path) { LogexportPath = path; } - // / get LogExportPath - public String getLogExportPath(String path) { - return LogexportPath; - } - // / Export DA Log - public Boolean exportDALog() { + private Boolean exportDALog() { File src = getLastDALog(PathManager.DA_LOG_PATH); File dirCheck = new File(LogexportPath); File dest = new File(LogexportPath + "/" + "da_console.log"); - - if(!checkDirectory(dirCheck)){ + + if (!checkDirectory(dirCheck)) { return false; } - - if(!copyLogFile(src, dest)){ + + if (!copyLogFile(src, dest)) { return false; } - + return true; } // / Export Daemon Log - public Boolean exportDaemonLog() { + private Boolean exportDaemonLog() { DACommunicator.exportCustomPathDaemonLog(LogexportPath); return true; } // / Export DATA Log - public Boolean exportDataLog() { + private Boolean exportDataLog() { File src = new File(PathManager.DA_DEBUG_DATA_CHANNEL_LOG_FILE); File dest = new File(LogexportPath + "/" + "da_data.log"); - if(!copyLogFile(src, dest)){ + if (!copyLogFile(src, dest)) { return false; } @@ -133,18 +137,18 @@ public class DALogExport { } // / Export Control Log - public Boolean exportControlLog() { + private Boolean exportControlLog() { File src = new File(PathManager.DA_DEBUG_CONTROL_CHANNEL_LOG_FILE); File dest = new File(LogexportPath + "/" + "da_control.log"); - if(!copyLogFile(src, dest)){ + if (!copyLogFile(src, dest)) { return false; } return true; } - private Boolean copyLogFile(File source, File dest){ + private Boolean copyLogFile(File source, File dest) { InputStream input = null; OutputStream output = null; @@ -160,12 +164,10 @@ public class DALogExport { output.write(buf, 0, bytesRead); } - } - catch(IOException e){ + } catch (IOException e) { e.printStackTrace(); return false; - } - finally { + } finally { try { if (input != null) { input.close(); @@ -178,11 +180,11 @@ public class DALogExport { e.printStackTrace(); return false; } - } + } return true; } - public File getLastDALog(String dir) { + private File getLastDALog(String dir) { File fl = new File(dir); File[] files = fl.listFiles(new FileFilter() { public boolean accept(File file) { @@ -203,12 +205,12 @@ public class DALogExport { } /// CompressLogs - public Boolean compressLogs(){ + private Boolean compressLogs() { ZipOutputStream zip = null; FileOutputStream fileWriter = null; String srcFolder = LogexportPath; String destZipFile = LogZipPath + "/" + ExportLogName + ".zip"; - + try { fileWriter = new FileOutputStream(destZipFile); zip = new ZipOutputStream(fileWriter); @@ -218,8 +220,8 @@ public class DALogExport { e.printStackTrace(); return false; } - - if(zip!=null){ + + if (zip != null) { try { zip.flush(); zip.close(); @@ -228,59 +230,59 @@ public class DALogExport { e.printStackTrace(); } } - + return true; } /// Make zip from file. - private void addFileToZip(String path, String srcFile,ZipOutputStream zip){ + private void addFileToZip(String path, String srcFile, ZipOutputStream zip) { File folder = new File(srcFile); if (folder.isDirectory()) { addFolderToZip(path, srcFile, zip); - } else { - byte[] buf = new byte[1024]; - int len; - FileInputStream in; - try { - in = new FileInputStream(srcFile); - zip.putNextEntry(new ZipEntry(path + "/" + folder.getName())); - while ((len = in.read(buf)) > 0) { - zip.write(buf, 0, len); - } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } else { + byte[] buf = new byte[1024]; + int len; + FileInputStream in; + try { + in = new FileInputStream(srcFile); + zip.putNextEntry(new ZipEntry(path + "/" + folder.getName())); + while ((len = in.read(buf)) > 0) { + zip.write(buf, 0, len); } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } - + } /// Compress Files in folder - private void addFolderToZip(String path, String srcFolder,ZipOutputStream zip){ + private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) { File folder = new File(srcFolder); for (String fileName : folder.list()) { - addFileToZip(folder.getName(), srcFolder + "/" + fileName, zip); + addFileToZip(folder.getName(), srcFolder + "/" + fileName, zip); } } - - private boolean checkDirectory(File file){ + + private boolean checkDirectory(File file) { if (!file.exists()) { - if(!file.mkdirs()){ + if (!file.mkdirs()) { return false; } } else { File[] destroy = file.listFiles(); for (File des : destroy) { - if(!des.delete()){ + if (!des.delete()) { return false; } } } return true; } - - private boolean removeTemp(){ + + private boolean removeTemp() { File file = new File(LogexportPath); checkDirectory(file); file.delete(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java index f75bdbc..a322428 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/UIAction.java @@ -33,12 +33,14 @@ import java.util.List; import java.util.Set; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.tizen.dynamicanalyzer.common.DALogExport; import org.tizen.dynamicanalyzer.common.DAResult; import org.tizen.dynamicanalyzer.constant.CommonConstants; -import org.tizen.dynamicanalyzer.nl.SummaryLabels; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.setting.SettingConstants; import org.tizen.dynamicanalyzer.setting.SettingDataManager; @@ -54,7 +56,6 @@ import org.tizen.dynamicanalyzer.ui.network.NetworkPage; import org.tizen.dynamicanalyzer.ui.opengl.GLPage; import org.tizen.dynamicanalyzer.ui.page.BaseView; import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; -import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView; import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView; import org.tizen.dynamicanalyzer.ui.thread.ThreadPage; import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; @@ -65,8 +66,6 @@ import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; import org.tizen.dynamicanalyzer.util.Logger; import org.tizen.dynamicanalyzer.util.WorkbenchUtil; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; -import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; -import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; import org.tizen.dynamicanalyzer.widgets.da.base.DADialog; import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite; @@ -126,11 +125,11 @@ public class UIAction { @Override public void run() { Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); - DADialog dialog = new DADialog(shell, SWT.NONE, width, height); - dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR_WITH_EXPORT, SWT.NONE, width, height); + dialog.setIcon(ImageResources.DIALOG_ERROR_ICON); dialog.setMessage(message); - dialog.setDialog(true); - dialog.getExportButton().addClickListener(exportListener); + dialog.setDialog(); + dialog.getExportButton().addSelectionListener(exportButtonListener); dialog.open(); } }); @@ -145,25 +144,11 @@ public class UIAction { @Override public void run() { Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); - DADialog dialog = new DADialog(shell, SWT.NONE); - dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR_WITH_EXPORT, SWT.NONE); + dialog.setIcon(ImageResources.DIALOG_ERROR_ICON); dialog.setMessage(message); - dialog.setDialog(true); - dialog.getExportButton().addClickListener(exportListener); - dialog.open(); - } - }); - } - - public static void showWarning(final String title, final String message) { - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); - DADialog dialog = new DADialog(shell, SWT.NONE); - dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); - dialog.setTitleText(title); - dialog.setMessage(message); + dialog.setDialog(); + dialog.getExportButton().addSelectionListener(exportButtonListener); dialog.open(); } }); @@ -178,11 +163,11 @@ public class UIAction { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { - DADialog dialog = new DADialog(shell, SWT.NONE); - dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR_WITH_EXPORT, SWT.NONE); + dialog.setIcon(ImageResources.DIALOG_ERROR_ICON); dialog.setMessage(message); - dialog.setDialog(true); - dialog.getExportButton().addClickListener(exportListener); + dialog.setDialog(); + dialog.getExportButton().addSelectionListener(exportButtonListener); dialog.open(); } }); @@ -302,10 +287,19 @@ public class UIAction { }); } - private static DACustomButtonClickEventListener exportListener = new DACustomButtonClickEventListener() { + private static SelectionListener exportButtonListener = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + new DALogExport(); + if(e.getSource() != null && e.getSource() instanceof Button) { + ((Button)e.getSource()).getParent().getParent().dispose(); + } + } + @Override - public void handleClickEvent(DACustomButton button) { - DALogExport export = new DALogExport(); + public void widgetDefaultSelected(SelectionEvent e) { } + }; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java index ec9dd11..b8ec459 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.java @@ -244,6 +244,8 @@ public class ConfigureLabels extends NLS { public static String FEATURE_OVERHEAD_RANKING_MIDDLE; public static String FEATURE_OVERHEAD_RANKING_HIGH; public static String FEATURE_OVERHEAD_RANKING_INPUT_VALUE; + + public static String EXPORT_DIALOG_SELECT_EXPORT_PATH; static { NLS.initializeMessages(BUNDLE_NAME, ConfigureLabels.class); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties index f4d032c..9b81c72 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ConfigureLabels.properties @@ -213,3 +213,5 @@ FEATURE_OVERHEAD_RANKING_NORMAL=Overhead level: Normal FEATURE_OVERHEAD_RANKING_MIDDLE=Overhead level: Middle FEATURE_OVERHEAD_RANKING_HIGH=Overhead level: High FEATURE_OVERHEAD_RANKING_INPUT_VALUE=The feature overhead may occur depending on the input value + +EXPORT_DIALOG_SELECT_EXPORT_PATH=Select export path diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java index 6d97d70..02efa6d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java @@ -157,7 +157,9 @@ public class Project { private boolean availableMemps = false; private String daStartTime = ""; - private boolean isSavedData = false; + + private boolean isLoadedData = false; + private boolean isSaved = false; static { // register DB table @@ -1223,11 +1225,19 @@ public class Project { return this.daStartTime; } - public void setSavedProject (boolean save) { - this.isSavedData = save; + public void setSavedData(boolean saved) { + this.isSaved = saved; + } + + public boolean getIsSavedData() { + return this.isSaved; + } + + public void setLoadedProject (boolean save) { + this.isLoadedData = save; } - public boolean isSaveProject() { - return this.isSavedData; + public boolean isLoadedProject() { + return this.isLoadedData; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/explorer/FileExplorerDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/explorer/FileExplorerDialog.java index 46895e7..e659ae1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/explorer/FileExplorerDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/explorer/FileExplorerDialog.java @@ -128,6 +128,7 @@ public class FileExplorerDialog extends DAMessageBox { @Override public void handleClickEvent(DACustomButton button) { + result = (Boolean)false; shell.dispose(); } }); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/HierarchyTreeView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/HierarchyTreeView.java index 50646d5..fa90c8f 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/HierarchyTreeView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/HierarchyTreeView.java @@ -131,10 +131,10 @@ public class HierarchyTreeView extends DAViewComposite { restructTree(); } else { Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); - DADialog dialog = new DADialog(shell, SWT.NONE); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR, SWT.NONE); dialog.setIcon(ImageResources.DIALOG_ERROR_ICON); dialog.setMessage(UIHierarchyPageLabels.UIHIERARCHY_DIALOG_ERROR_GET_HIERARCHY); - dialog.setDialog(false); + dialog.setDialog(); dialog.open(); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/tool/HierarchyTreeExporter.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/tool/HierarchyTreeExporter.java index daaf189..8f1db57 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/tool/HierarchyTreeExporter.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/tree/tool/HierarchyTreeExporter.java @@ -106,11 +106,11 @@ public class HierarchyTreeExporter { private static void showErrorDialog() { Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); - DADialog dialog = new DADialog(shell, SWT.NONE); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR, SWT.NONE); dialog.setTitleText(UIHierarchyPageLabels.UIHIERARCHY_EXPORT_DIALOG_TITLE); dialog.setMessage(UIHierarchyPageLabels.UIHIERARCHY_EXPORT_DIALOG_ERROR_MESSAGE); dialog.setIcon(ImageResources.DIALOG_ERROR_ICON); - dialog.setDialog(false); + dialog.setDialog(); dialog.open(); } 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 ed0513b..5b7fb77 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 @@ -30,6 +30,7 @@ import java.util.ArrayList; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Menu; @@ -46,6 +47,7 @@ import org.tizen.dynamicanalyzer.handlers.UIAction; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.nl.MenuBarLabels; import org.tizen.dynamicanalyzer.project.Project; +import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.setting.SettingDataManager; import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; import org.tizen.dynamicanalyzer.ui.file.FileChartView; @@ -78,6 +80,7 @@ import org.tizen.dynamicanalyzer.util.WorkbenchUtil; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard; import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardManager; +import org.tizen.dynamicanalyzer.widgets.da.base.DADialog; import org.tizen.dynamicanalyzer.widgets.scale.DAScale; public class MenuBar { @@ -151,11 +154,6 @@ public class MenuBar { analyzePreferences.setText(MenuBarLabels.ANALYZE_PREFENCES); analyzePreferences.addSelectionListener(anlysisMenuListener); - MenuItem analyzeDefault = new MenuItem(analyzeMenu, SWT.PUSH); - analyzeDefault.setText(MenuBarLabels.ANALYZE_SET_AS_DEFAULT); - analyzeDefault.addSelectionListener(anlysisMenuListener); - analyzeDefault.setEnabled(false); - // view menu Menu viewMenu = new Menu(currentShell, SWT.DROP_DOWN); viewItem.setMenu(viewMenu); @@ -246,74 +244,60 @@ public class MenuBar { } if (menuName.equals(MenuBarLabels.FILE_NEW)) { - CommonAction.clear(); - Toolbar.INSTANCE.clearMarkerTimeList(); - RangeDataManager.getInstance().clearMarkerTime(); - RangeDataManager.getInstance().clearTimelineMarker(); - - // change UI state - Toolbar.INSTANCE.changeUIState(DAState.INIT); - Toolbar.INSTANCE.setScaleSelection(DAScale.DEFAULT_SCALE_INDEX); - - FlatFeatureDialog featureDialog = new FlatFeatureDialog(currentShell); - featureDialog.open(); - - /// if Feature Select changed and OK, is NewSetting is true. - if(SettingDataManager.INSTANCE.isNewSetting()){ - // reset checks on ReportMenu items - resetReportItemCheck(); - } - - } else if (menuName.equals(MenuBarLabels.FILE_LOAD)) { - FileDialog dialog = new FileDialog(currentShell, SWT.OPEN); - dialog.setFilterNames(new String[] { "Zip file" }); - dialog.setFilterExtensions(new String[] { "*.zip" }); - dialog.setText(MenuBarLabels.FILE_LOAD_DIALOG_TITLE); + if (showSaveWarning() == true) { + setMenuItemEnable(MenuBarLabels.FILE_SAVE, false); - final Object result = dialog.open(); - if (null != result) { + CommonAction.clear(); Toolbar.INSTANCE.clearMarkerTimeList(); RangeDataManager.getInstance().clearMarkerTime(); RangeDataManager.getInstance().clearTimelineMarker(); - Thread loadthread = new Thread(new Runnable() { - @Override - public void run() { - String decompresspath = CommandAction.loadFromZip((String) result); + // change UI state + Toolbar.INSTANCE.changeUIState(DAState.INIT); + Toolbar.INSTANCE.setScaleSelection(DAScale.DEFAULT_SCALE_INDEX); - OpenTraceProgressManager.getInstance().setSavePath(decompresspath); - OpenTraceProgressManager.getInstance().startOpenTraceThread(); - } - }); - - loadthread.run(); - } - } else if (menuName.equals(MenuBarLabels.FILE_SAVE)) { - Project project = Global.getProject(); - if (project == null) { - return; + FlatFeatureDialog featureDialog = new FlatFeatureDialog(currentShell); + featureDialog.open(); + + /// if Feature Select changed and OK, is NewSetting is true. + if(SettingDataManager.INSTANCE.isNewSetting()){ + // reset checks on ReportMenu items + resetReportItemCheck(); + } } - - project.save(); - DataManagerRegistry.saveData(); - - String savefilename = project.getSavePath() - .substring(project.getSavePath().lastIndexOf(File.separator) + 1); - - FileDialog dialog = new FileDialog(currentShell, SWT.SAVE); - dialog.setFilterNames(new String[] { "Zip file" }); - dialog.setFilterExtensions(new String[] { "*.zip" }); - dialog.setFileName(savefilename + ".zip"); - dialog.setText(MenuBarLabels.FILE_SAVE_DIALOG_TITLE); - - Object result = dialog.open(); - if (null != result) { - if (!CommandAction.saveToZip((String) result)) { - UIAction.showWarning(AnalyzerLabels.SAVE_FAILED); + + } else if (menuName.equals(MenuBarLabels.FILE_LOAD)) { + if (showSaveWarning() == true) { + FileDialog dialog = new FileDialog(currentShell, SWT.OPEN); + dialog.setFilterNames(new String[] { "Zip file" }); + dialog.setFilterExtensions(new String[] { "*.zip" }); + dialog.setText(MenuBarLabels.FILE_LOAD_DIALOG_TITLE); + + final Object result = dialog.open(); + if (null != result) { + Toolbar.INSTANCE.clearMarkerTimeList(); + RangeDataManager.getInstance().clearMarkerTime(); + RangeDataManager.getInstance().clearTimelineMarker(); + Thread loadthread = new Thread(new Runnable() { + + @Override + public void run() { + String decompresspath = CommandAction.loadFromZip((String) result); + + OpenTraceProgressManager.getInstance().setSavePath(decompresspath); + OpenTraceProgressManager.getInstance().startOpenTraceThread(); + } + }); + + loadthread.run(); } } + } else if (menuName.equals(MenuBarLabels.FILE_SAVE)) { + showSaveDialog(); } else if (menuName.equals(MenuBarLabels.FILE_EXIT)) { - currentShell.close(); + if (showSaveWarning() == true) { + currentShell.close(); + } } } }; @@ -712,8 +696,6 @@ public class MenuBar { } public boolean resetReportItemCheck() { - - // reset check on Report MENU for (int i = 0; i < menubar.getItems().length; i++) { MenuItem menuitem = menubar.getItem(i); @@ -733,4 +715,67 @@ public class MenuBar { return false; } + + private boolean showSaveWarning() { + boolean clear = true; + + if (Global.getProject() != null && Global.getProject().getIsSavedData() == false) { + Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell(); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.SAVE, SWT.NONE); + dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + dialog.setMessage("Tracing data is not saved.\nAre you sure to remove it?"); + dialog.setDialog(); + dialog.getSaveButton().addSelectionListener(saveButtonListener); + dialog.open(); + clear = dialog.getResult(); + } + + return clear; + } + + private void showSaveDialog() { + Project project = Global.getProject(); + if (project == null) { + return; + } + + project.save(); + DataManagerRegistry.saveData(); + + String savefilename = project.getSavePath() + .substring(project.getSavePath().lastIndexOf(File.separator) + 1); + + FileDialog dialog = new FileDialog(currentShell, SWT.SAVE); + dialog.setFilterNames(new String[] { "Zip file" }); + dialog.setFilterExtensions(new String[] { "*.zip" }); + dialog.setFileName(savefilename + ".zip"); + dialog.setText(MenuBarLabels.FILE_SAVE_DIALOG_TITLE); + + Object result = dialog.open(); + if (null != result) { + if (!CommandAction.saveToZip((String) result)) { + UIAction.showWarning(AnalyzerLabels.SAVE_FAILED); + } + else { + setMenuItemEnable(MenuBarLabels.FILE_SAVE, false); + project.setSavedData(true); + } + } + } + + private SelectionListener saveButtonListener = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + showSaveDialog(); + if(e.getSource() != null && e.getSource() instanceof Button) { + ((Button)e.getSource()).getParent().getParent().dispose(); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + + }; } \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/dlog/DlogTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/dlog/DlogTable.java index 4b193f4..d31ee34 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/dlog/DlogTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/dlog/DlogTable.java @@ -252,7 +252,7 @@ public class DlogTable extends DATableComposite { return output; } - if(Global.getProject().isSaveProject() == false) { + if(Global.getProject().isLoadedProject() == false) { if(!DLogDataManager.getInstance().getDlogKill()){ return output; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java index a22f0e9..f920842 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java @@ -210,7 +210,8 @@ public class OpenTraceProgressManager implements Runnable { Project project = Project.getProjectFromFile(getInstance().getSavePath()); if (project != null) { Global.setProject(project); - Global.getProject().setSavedProject(true); + Global.getProject().setLoadedProject(true); + Global.getProject().setSavedData(true); AnalyzerUtil.executeCommand(OpenTraceHandler.ID); } else { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java index b8d4016..55049cc 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java @@ -144,8 +144,7 @@ public class SettingDialog extends DAMessageBox { } private void doWarningMessage() { - UIAction.showWarning(ConfigureLabels.SETTING_WARNING_MESSAGE_SETTING_INVALID_INPUT_VALUE, - 550, 153); + UIAction.showWarning(ConfigureLabels.SETTING_WARNING_MESSAGE_SETTING_INVALID_INPUT_VALUE); } protected boolean run() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FilterDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FilterDialog.java index a1b9891..828e5ed 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FilterDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FilterDialog.java @@ -354,10 +354,10 @@ public class FilterDialog extends DAMessageBox { String keyWord = filterInputRowList.get(i).getKeyWord(); // check for keyword validation about null or empty string value if (keyWord == null || keyWord.isEmpty()) { - DADialog dialog = new DADialog(shell, SWT.NONE); - dialog.setTitleText(WidgetLabels.DA_WARNING); + DADialog dialog = new DADialog(shell, DADialog.DIALOGTYPE.ERROR, SWT.NONE); dialog.setMessage(AnalyzerLabels.FILTER_DLG_KEYWORD_VERIFICATION_MESSAGE); dialog.setIcon(ImageResources.DIALOG_WARNING_ICON); + dialog.setDialog(); dialog.open(); return; } else { -- 2.7.4