From: yser.lee Date: Mon, 7 Nov 2011 21:24:30 +0000 (+0900) Subject: [Title] Add device combo and application combo. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=081ce66b014bee99715e1f1bd08b3a0ce5d21568;p=sdk%2Ftools%2Fdynamic-analyzer.git [Title] Add device combo and application combo. [Type] Feature [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/com.samsung.dynamicanalyzer.workbench/icons/more.jpg b/com.samsung.dynamicanalyzer.workbench/icons/pickaxe.jpg similarity index 100% rename from com.samsung.dynamicanalyzer.workbench/icons/more.jpg rename to com.samsung.dynamicanalyzer.workbench/icons/pickaxe.jpg diff --git a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java index daf2d21..5086ade 100644 --- a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java +++ b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java @@ -1,63 +1,17 @@ package com.samsung.dynamicanalyzer.workbench; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.application.ActionBarAdvisor; import org.eclipse.ui.application.IActionBarConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchWindowAdvisor; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -import com.samsung.dynamicanalyzer.services.RecordStateSourceProvider; -import com.samsung.dynamicanalyzer.utils.AnalyzerUtil; public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { public static final int width = 1024; public static final int height = 768; - private Button startButton; - private Button moreButton; - - private Image bgImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", - "icons/ToolbarBackground.jpg").createImage(); - - private Image startImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", "icons/start.jpg") - .createImage(); - - private Image stopImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", "icons/stop.jpg") - .createImage(); - - private Image saveImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", "icons/save_record.jpg") - .createImage(); - - private Image loadImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", "icons/load_record.jpg") - .createImage(); - - private Image moreImage = AbstractUIPlugin.imageDescriptorFromPlugin( - "com.samsung.dynamicanalyzer.workbench", "icons/more.jpg") - .createImage(); - public ApplicationWorkbenchWindowAdvisor( IWorkbenchWindowConfigurer configurer) { super(configurer); @@ -74,212 +28,13 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); configurer.setInitialSize(new Point(width, height)); configurer.setShowCoolBar(true); + configurer.setShowMenuBar(true); configurer.setShowStatusLine(false); } @Override public void createWindowContents(Shell shell) { - - final IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); - - final FormLayout layout = new FormLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - shell.setLayout(layout); - - Composite toolbar = new Composite(getWindowConfigurer().getWindow() - .getShell(), SWT.NONE); - - final GridLayout gLayout = new GridLayout(3, false); - gLayout.horizontalSpacing = 0; - gLayout.marginHeight = 0; - gLayout.marginWidth = 0; - gLayout.verticalSpacing = 0; - toolbar.setLayout(gLayout); - - Composite toolbarLine = new Composite(getWindowConfigurer().getWindow() - .getShell(), SWT.NONE); - toolbarLine.setBackgroundImage(bgImage); - toolbarLine.setLayout(gLayout); - - FormLayout formLayout = new FormLayout(); - formLayout.marginHeight = 0; - formLayout.marginWidth = 0; - formLayout.spacing = 0; - - Composite control = new Composite(toolbar, SWT.NONE); - control.setBackground(new Color(null, 51, 51, 51)); - control.setForeground(new Color(null, 255, 255, 255)); - control.setLayout(formLayout); - - createControl(control); - - Composite perspective = new Composite(toolbar, SWT.NONE); - GridData gd = new GridData(SWT.END, SWT.CENTER, true, false); - perspective.setLayout(new GridLayout(3, false)); - perspective.setLayoutData(gd); - - createPerspective(perspective); - - setLayout(configurer, shell, toolbar, toolbarLine); + new CoolbarArea(getWindowConfigurer(), shell); } - private void createControl(Composite composite) { - Combo combo = new Combo(composite, SWT.READ_ONLY); - combo.setForeground(new Color(null, 255, 255, 255)); - combo.setBackground(new Color(null, 51, 51, 51)); - combo.add("Application 1"); - combo.add("Application 2"); - combo.add("Application 3"); - combo.add("Application 4"); - FormData data = new FormData(); - data.left = new FormAttachment(0, 5); - data.width = 200; - data.height = 32; - combo.setLayoutData(data); - final FormLayout layout = new FormLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - combo.setLayout(layout); - - startButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); - startButton.setImage(startImage); - startButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - - AnalyzerUtil - .executeCommand("com.samsung.dynamicanalyzer.commands.startStopTrace"); - String state = AnalyzerUtil.getRecordState(); - if (state.equals(RecordStateSourceProvider.RECORD_READY)) { - AnalyzerUtil - .setRecordState(RecordStateSourceProvider.RECORD_RECORDING); - startButton.setImage(stopImage); - } else { - AnalyzerUtil - .setRecordState(RecordStateSourceProvider.RECORD_READY); - startButton.setImage(startImage); - } - } - }); - - startButton.setBackground(new Color(null, 51, 51, 51)); - data = new FormData(); - data.left = new FormAttachment(combo, 70, SWT.RIGHT); - data.width = 32; - data.height = 32; - startButton.setLayoutData(data); - - Composite timeArea = new Composite(composite, SWT.NONE); - timeArea.setBackground(new Color(null, 90, 90, 90)); - data = new FormData(); - data.left = new FormAttachment(startButton, 0, SWT.RIGHT); - data.width = 200; - data.height = 32; - timeArea.setLayoutData(data); - - Button saveRecordButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); - saveRecordButton.setImage(saveImage); - saveRecordButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - - AnalyzerUtil - .executeCommand("com.samsung.dynamicanalyzer.commands.saveTrace"); - - } - }); - saveRecordButton.setBackground(new Color(null, 51, 51, 51)); - data = new FormData(); - data.left = new FormAttachment(timeArea, 0, SWT.RIGHT); - data.width = 40; - data.height = 32; - saveRecordButton.setLayoutData(data); - - Button loadRecordButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); - loadRecordButton.setImage(loadImage); - loadRecordButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - - AnalyzerUtil - .executeCommand("com.samsung.dynamicanalyzer.commands.openTrace"); - - } - }); - loadRecordButton.setBackground(new Color(null, 51, 51, 51)); - data = new FormData(); - data.left = new FormAttachment(saveRecordButton, 0, SWT.RIGHT); - data.width = 40; - data.height = 32; - loadRecordButton.setLayoutData(data); - - moreButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); - moreButton.setImage(moreImage); - moreButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - AnalyzerUtil - .executeCommand("com.samsung.dynamicanalyzer.commands.testInput"); - - } - }); - moreButton.setBackground(new Color(null, 51, 51, 51)); - data = new FormData(); - data.left = new FormAttachment(loadRecordButton, 0, SWT.RIGHT); - data.width = 28; - data.height = 32; - moreButton.setLayoutData(data); - } - - // private String getState() { - // return AnalyzerUtil - // .getRecordState(RecordStateSourceProvider.RECORD_STATE); - // } - - private void createPerspective(Composite composite) { - - Label realtimeLabel = new Label(composite, SWT.NONE); - realtimeLabel.setForeground(new Color(null, 255, 255, 255)); - realtimeLabel.setText("realtime"); - - Label ntimeLabel = new Label(composite, SWT.NONE); - ntimeLabel.setForeground(new Color(null, 255, 255, 255)); - ntimeLabel.setText("N-time"); - - Label batteryLabel = new Label(composite, SWT.NONE); - batteryLabel.setForeground(new Color(null, 255, 255, 255)); - batteryLabel.setText("battery"); - } - - private void setLayout(IWorkbenchWindowConfigurer configurer, Shell shell, - Composite toolbar, Composite toolbarLine) { - Control page = configurer.createPageComposite(shell); - - FormData data = new FormData(); - data.top = new FormAttachment(0, 5); - data.left = new FormAttachment(0, 5); - data.right = new FormAttachment(100, -5); - toolbar.setLayoutData(data); - - data = new FormData(); - data.top = new FormAttachment(toolbar, 0, SWT.BOTTOM); - data.left = new FormAttachment(0, 0); - data.right = new FormAttachment(100, 0); - data.bottom = new FormAttachment(toolbar, 4, SWT.BOTTOM); - toolbarLine.setLayoutData(data); - - data = new FormData(); - data.top = new FormAttachment(toolbarLine, 2, SWT.BOTTOM); - data.left = new FormAttachment(0, 5); - data.right = new FormAttachment(100, -5); - data.bottom = new FormAttachment(100, -5); - page.setLayoutData(data); - - getWindowConfigurer().getWindow().getShell().layout(true); - if (page != null) { - ((Composite) page).layout(true); - } - - } } diff --git a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/BatteryPerspective.java b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/BatteryPerspective.java index 64638b9..0e07aef 100644 --- a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/BatteryPerspective.java +++ b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/BatteryPerspective.java @@ -5,6 +5,8 @@ import org.eclipse.ui.IPerspectiveFactory; public class BatteryPerspective implements IPerspectiveFactory { + public static final String ID = "com.samsung.dynamicanalyzer.batteryPerspective"; //$NON-NLS-1$ + @Override public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(false); diff --git a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/CoolbarArea.java b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/CoolbarArea.java new file mode 100644 index 0000000..d2743db --- /dev/null +++ b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/CoolbarArea.java @@ -0,0 +1,300 @@ +package com.samsung.dynamicanalyzer.workbench; + +import java.util.List; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.samsung.dynamicanalyzer.AnalyzerConstants; +import com.samsung.dynamicanalyzer.SDBManager; +import com.samsung.dynamicanalyzer.handlers.OpenTraceHandler; +import com.samsung.dynamicanalyzer.handlers.SaveTraceHandler; +import com.samsung.dynamicanalyzer.handlers.StartStopTraceHandler; +import com.samsung.dynamicanalyzer.handlers.TestInputHandler; +import com.samsung.dynamicanalyzer.nl.AnalyzerLabels; +import com.samsung.dynamicanalyzer.services.RecordStateSourceProvider; +import com.samsung.dynamicanalyzer.utils.AnalyzerUtil; + +public class CoolbarArea { + + private Combo deviceCombo; + private Combo appCombo; + private Button startButton; + private Button pickaxeButton; + + private Image bgImage = createImage("ToolbarBackground"); //$NON-NLS-1$ + private Image startImage = createImage("start"); //$NON-NLS-1$ + private Image stopImage = createImage("stop"); //$NON-NLS-1$ + private Image saveImage = createImage("save_record"); //$NON-NLS-1$ + private Image openImage = createImage("load_record"); //$NON-NLS-1$ + private Image pickaxeImage = createImage("pickaxe"); //$NON-NLS-1$ + + private Color blackColor = new Color(null, 51, 51, 51); + private Color whiteColor = new Color(null, 255, 255, 255); + + private static final String ID = "com.samsung.dynamicanalyzer.workbench"; //$NON-NLS-1$ + + public CoolbarArea(IWorkbenchWindowConfigurer configurer, Shell shell) { + final FormLayout layout = new FormLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + shell.setLayout(layout); + + Composite mainComposite = new Composite(shell, SWT.NONE); + + final GridLayout gridLayout = new GridLayout(3, false); + gridLayout.horizontalSpacing = 0; + gridLayout.marginHeight = 0; + gridLayout.marginWidth = 0; + gridLayout.verticalSpacing = 0; + mainComposite.setLayout(gridLayout); + + Composite lineComposite = new Composite(shell, SWT.NONE); + lineComposite.setBackgroundImage(bgImage); + lineComposite.setLayout(gridLayout); + + FormLayout formLayout = new FormLayout(); + formLayout.marginHeight = 0; + formLayout.marginWidth = 0; + formLayout.spacing = 0; + + Composite toolbarComposite = new Composite(mainComposite, SWT.NONE); + toolbarComposite.setBackground(blackColor); + toolbarComposite.setForeground(whiteColor); + toolbarComposite.setLayout(formLayout); + + createToolbar(toolbarComposite); + + Composite perspectiveBarComposite = new Composite(mainComposite, + SWT.NONE); + GridData gd = new GridData(SWT.END, SWT.CENTER, true, false); + perspectiveBarComposite.setLayout(new GridLayout(3, false)); + perspectiveBarComposite.setLayoutData(gd); + + createPerspectiveBar(perspectiveBarComposite); + + setLayout(configurer, shell, mainComposite, lineComposite); + } + + private void createToolbar(Composite composite) { + deviceCombo = new Combo(composite, SWT.READ_ONLY); + deviceCombo.setForeground(whiteColor); + deviceCombo.setBackground(blackColor); + deviceCombo.add(AnalyzerConstants.EMPTY); + FormData data = new FormData(); + data.left = new FormAttachment(0, 5); + data.width = 200; + data.height = 32; + deviceCombo.setLayoutData(data); + final FormLayout layout = new FormLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + deviceCombo.setLayout(layout); + + deviceCombo.addListener(SWT.FocusIn, new Listener() { + @Override + public void handleEvent(Event event) { + List devices = SDBManager.getDevices(); + deviceCombo.removeAll(); + int devicesSize = devices.size(); + for (int i = 0; i < devicesSize; i++) { + deviceCombo.add(devices.get(i)); + } + } + }); + + deviceCombo.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // Sets device name. + SDBManager.setSerial(deviceCombo.getText()); + + appCombo.removeAll(); + + List apps = SDBManager.getAppList(); + if (null == apps) { + return; + } + int appsSize = apps.size(); + for (int i = 0; i < appsSize; i++) { + appCombo.add(apps.get(i)); + } + } + }); + + appCombo = new Combo(composite, SWT.READ_ONLY); + appCombo.setForeground(whiteColor); + appCombo.setBackground(blackColor); + FormData appComboData = new FormData(); + appComboData.left = new FormAttachment(deviceCombo, 5, SWT.RIGHT); + appComboData.width = 200; + appComboData.height = 32; + appCombo.setLayoutData(appComboData); + final FormLayout appComboLayout = new FormLayout(); + appComboLayout.marginWidth = 0; + appComboLayout.marginHeight = 0; + appCombo.setLayout(appComboLayout); + + appCombo.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // Sets application name. + SDBManager.setAppName(appCombo.getText()); + } + }); + + startButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); + startButton.setImage(startImage); + startButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AnalyzerUtil.executeCommand(StartStopTraceHandler.ID); + String state = AnalyzerUtil.getRecordState(); + if (state.equals(RecordStateSourceProvider.RECORD_READY)) { + AnalyzerUtil + .setRecordState(RecordStateSourceProvider.RECORD_RECORDING); + startButton.setImage(stopImage); + } else { + AnalyzerUtil + .setRecordState(RecordStateSourceProvider.RECORD_READY); + startButton.setImage(startImage); + } + } + }); + + startButton.setBackground(blackColor); + data = new FormData(); + data.left = new FormAttachment(appCombo, 30, SWT.RIGHT); + data.width = 32; + data.height = 32; + startButton.setLayoutData(data); + + Composite timeArea = new Composite(composite, SWT.NONE); + timeArea.setBackground(new Color(null, 90, 90, 90)); + data = new FormData(); + data.left = new FormAttachment(startButton, 0, SWT.RIGHT); + data.width = 200; + data.height = 32; + timeArea.setLayoutData(data); + + Button saveTraceButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); + saveTraceButton.setImage(saveImage); + saveTraceButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AnalyzerUtil.executeCommand(SaveTraceHandler.ID); + } + }); + saveTraceButton.setBackground(blackColor); + data = new FormData(); + data.left = new FormAttachment(timeArea, 0, SWT.RIGHT); + data.width = 40; + data.height = 32; + saveTraceButton.setLayoutData(data); + + Button openTraceButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); + openTraceButton.setImage(openImage); + openTraceButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AnalyzerUtil.executeCommand(OpenTraceHandler.ID); + } + }); + openTraceButton.setBackground(blackColor); + data = new FormData(); + data.left = new FormAttachment(saveTraceButton, 0, SWT.RIGHT); + data.width = 40; + data.height = 32; + openTraceButton.setLayoutData(data); + + pickaxeButton = new Button(composite, SWT.FLAT | SWT.NO_FOCUS); + pickaxeButton.setImage(pickaxeImage); + pickaxeButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AnalyzerUtil.executeCommand(TestInputHandler.ID); + } + }); + pickaxeButton.setBackground(blackColor); + data = new FormData(); + data.left = new FormAttachment(openTraceButton, 0, SWT.RIGHT); + data.width = 28; + data.height = 32; + pickaxeButton.setLayoutData(data); + } + + private Image createImage(String imageName) { + return AbstractUIPlugin.imageDescriptorFromPlugin( + ID, + AnalyzerConstants.ICON_FOLDER_NAME + imageName + + AnalyzerConstants.EXTENSION_JPG_IMAGE).createImage(); + } + + // private String getState() { + // return AnalyzerUtil + // .getRecordState(RecordStateSourceProvider.RECORD_STATE); + // } + + private void createPerspectiveBar(Composite composite) { + Label realtimeLabel = new Label(composite, SWT.NONE); + realtimeLabel.setForeground(whiteColor); + realtimeLabel.setText(AnalyzerLabels.REALTIME); + + Label batteryLabel = new Label(composite, SWT.NONE); + batteryLabel.setForeground(whiteColor); + batteryLabel.setText(AnalyzerLabels.BATTERY); + + Label ntimeLabel = new Label(composite, SWT.NONE); + ntimeLabel.setForeground(whiteColor); + ntimeLabel.setText(AnalyzerLabels.NTIME); + } + + private void setLayout(IWorkbenchWindowConfigurer configurer, Shell shell, + Composite toolbar, Composite toolbarLine) { + Control page = configurer.createPageComposite(shell); + + FormData data = new FormData(); + data.top = new FormAttachment(0, 5); + data.left = new FormAttachment(0, 5); + data.right = new FormAttachment(100, -5); + toolbar.setLayoutData(data); + + data = new FormData(); + data.top = new FormAttachment(toolbar, 0, SWT.BOTTOM); + data.left = new FormAttachment(0, 0); + data.right = new FormAttachment(100, 0); + data.bottom = new FormAttachment(toolbar, 4, SWT.BOTTOM); + toolbarLine.setLayoutData(data); + + data = new FormData(); + data.top = new FormAttachment(toolbarLine, 2, SWT.BOTTOM); + data.left = new FormAttachment(0, 5); + data.right = new FormAttachment(100, -5); + data.bottom = new FormAttachment(100, -5); + page.setLayoutData(data); + + configurer.getWindow().getShell().layout(true); + if (null != page) { + ((Composite) page).layout(true); + } + } + +} diff --git a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/NtimePerspective.java b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/NtimePerspective.java index 9f507eb..b32b717 100644 --- a/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/NtimePerspective.java +++ b/com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/NtimePerspective.java @@ -5,6 +5,8 @@ import org.eclipse.ui.IPerspectiveFactory; public class NtimePerspective implements IPerspectiveFactory { + public static final String ID = "com.samsung.dynamicanalyzer.ntimePerspective"; //$NON-NLS-1$ + @Override public void createInitialLayout(IPageLayout layout) { layout.setEditorAreaVisible(false); diff --git a/com.samsung.dynamicanalyzer/plugin.xml b/com.samsung.dynamicanalyzer/plugin.xml index eecaf29..cf23e95 100644 --- a/com.samsung.dynamicanalyzer/plugin.xml +++ b/com.samsung.dynamicanalyzer/plugin.xml @@ -1,429 +1,414 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + point="org.eclipse.ui.commands"> + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/AnalyzerConstants.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/AnalyzerConstants.java index 1c8d48d..ab61cbb 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/AnalyzerConstants.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/AnalyzerConstants.java @@ -1,10 +1,9 @@ package com.samsung.dynamicanalyzer; - public class AnalyzerConstants { public static final String VERSION = "0.1"; //$NON-NLS-1$ - + // special character public static final String EMPTY = ""; //$NON-NLS-1$ public static final String SPACE = " "; //$NON-NLS-1$ @@ -33,10 +32,11 @@ public class AnalyzerConstants { public static final String SAVE_FOLDER_PATH = DEFAULT_DIR_PATH_DYNAMICANALYZER + SLASH + SAVE_FOLDER_NAME; public static final String TEMP_FOLDER_NAME = "temp"; //$NON-NLS-1$ - public static final String TEMP_FOLDER_PATH = SAVE_FOLDER_PATH - + SLASH + AnalyzerConstants.TEMP_FOLDER_NAME; + public static final String TEMP_FOLDER_PATH = SAVE_FOLDER_PATH + SLASH + + AnalyzerConstants.TEMP_FOLDER_NAME; public static final String SDK_DYNAMICANALYZER_NAME = "/samsung-sdk/DynamicAnalysis"; - public static final String IMAGE_FOLDER_NAME = "/img"; + public static final String IMAGE_FOLDER_NAME = "/img"; //$NON-NLS-1$ + public static final String ICON_FOLDER_NAME = "icons/"; //$NON-NLS-1$ public static final String CLASS = "class"; //$NON-NLS-1$ public static final String ZERO = "0"; //$NON-NLS-1$ @@ -66,21 +66,21 @@ public class AnalyzerConstants { // log parsing size public static final int DATABASE_READ_SIZE = 100; - + // project save index public static final int PROJECT_VERSION_INDEX = 0; public static final int PROJECT_NAME_INDEX = 1; public static final int PROJECT_DEVICE_INDEX = 2; public static final int PROJECT_LAST_DATA_INDEX = 3; - + // Shell command - public static final String REMOVE_RECURSIVE_FORCE="rm -rf ";//$NON-NLS-1$ + public static final String REMOVE_RECURSIVE_FORCE = "rm -rf ";//$NON-NLS-1$ public static final String EXTENSION_LOG_CENTER = ".logc"; //$NON-NLS-1$ public static final String EXTENSION_JPG_IMAGE = ".jpg";//$NON-NLS-1$ public static final String EXTENSION_PNG_IMAGE = ".png";//$NON-NLS-1$ public static final String DATABASE_NAME = "da.trace"; //$NON-NLS-1$ - + private AnalyzerConstants() { } diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenTraceHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenTraceHandler.java index 066dfef..2fd3af9 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenTraceHandler.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenTraceHandler.java @@ -11,12 +11,15 @@ import com.samsung.dynamicanalyzer.utils.AnalyzerUtil; public class OpenTraceHandler extends AbstractHandler { + public static final String ID = "com.samsung.dynamicanalyzer.commands.openTrace"; //$NON-NLS-1$ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { AnalyzerManager.setNew(false); Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); OpenTraceDialog dialog = new OpenTraceDialog(shell, 0); dialog.open(); + return null; } diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/SaveTraceHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/SaveTraceHandler.java index c42e15b..76b88f2 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/SaveTraceHandler.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/SaveTraceHandler.java @@ -16,6 +16,8 @@ import com.samsung.dynamicanalyzer.utils.AnalyzerUtil; public class SaveTraceHandler extends AbstractHandler { + public static final String ID = "com.samsung.dynamicanalyzer.commands.saveTrace"; //$NON-NLS-1$ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { // copy temp save file to save folder @@ -57,6 +59,7 @@ public class SaveTraceHandler extends AbstractHandler { // TODO Auto-generated catch block e.printStackTrace(); } + return null; } diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/StartStopTraceHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/StartStopTraceHandler.java index 0101701..6526c94 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/StartStopTraceHandler.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/StartStopTraceHandler.java @@ -15,6 +15,8 @@ import com.samsung.dynamicanalyzer.utils.AnalyzerUtil; public class StartStopTraceHandler extends AbstractHandler { + public static final String ID = "com.samsung.dynamicanalyzer.commands.startStopTrace"; //$NON-NLS-1$ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { String state = AnalyzerUtil.getRecordState(); @@ -22,7 +24,7 @@ public class StartStopTraceHandler extends AbstractHandler { // record start Project old = AnalyzerManager.getProject(); - //TODO: delete + // TODO: delete // test code old.setName("testApp"); old.setDevice("testEmul"); diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/TestInputHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/TestInputHandler.java index db10812..217ab37 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/TestInputHandler.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/TestInputHandler.java @@ -13,6 +13,8 @@ import com.samsung.dynamicanalyzer.model.Project; public class TestInputHandler extends AbstractHandler { + public static final String ID = "com.samsung.dynamicanalyzer.commands.testInput"; //$NON-NLS-1$ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { Project old = AnalyzerManager.getProject(); @@ -32,6 +34,7 @@ public class TestInputHandler extends AbstractHandler { input.add("5`,9`,close`,59342`,19`,0`,0`,2`,`,0`,0`,0`,"); input.add("5`,10`,open`,59904`,/opt/var/kdb/db/menu_widget/language,0`,19`,0`,2`,`,19`,0`,0`,"); LogSpliter.logSlicing(input); + return null; } diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.java index 969fa56..62fbf18 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.java +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.java @@ -6,6 +6,11 @@ public class AnalyzerLabels { private static final String BUNDLE_NAME = "com.samsung.dynamicanalyzer.nl.AnalyzerLabels"; //$NON-NLS-1$ + // Open Perspective toolbar name + public static String REALTIME; + public static String BATTERY; + public static String NTIME; + static { NLS.initializeMessages(BUNDLE_NAME, AnalyzerLabels.class); } diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.properties b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.properties index e69de29..f293806 100644 --- a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.properties +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/nl/AnalyzerLabels.properties @@ -0,0 +1,4 @@ +#Open Perspective toolbar name +REALTIME=Realtime +BATTERY=Battery +NTIME=N-time