From 48cdddb6a80c9e52d621efa088fd912f57ed9635 Mon Sep 17 00:00:00 2001 From: "yser.lee" Date: Mon, 31 Oct 2011 16:47:44 +0900 Subject: [PATCH] [Title] Add perspective, view, toolbar. [Type] Feature [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- .../plugin.properties | 7 +- com.samsung.dynamicanalyzer.workbench/plugin.xml | 16 +- .../workbench/ApplicationWorkbenchAdvisor.java | 2 +- .../workbench/BatteryPerspective.java | 15 ++ .../workbench/NtimePerspective.java | 15 ++ .../workbench/ResourcePerspective.java | 30 +++ com.samsung.dynamicanalyzer/plugin.properties | 12 +- com.samsung.dynamicanalyzer/plugin.xml | 235 ++++++++++++++++++++- .../handlers/OpenBatteryPerspectiveHandler.java | 26 +++ .../handlers/OpenBottleNeckTabHandler.java | 14 ++ .../handlers/OpenMemoryTabHandler.java | 14 ++ .../handlers/OpenNtimePerspectiveHandler.java | 26 +++ .../handlers/OpenResourceLifecycleTabHandler.java | 14 ++ .../handlers/OpenResourcePerspectiveHandler.java | 26 +++ .../ui/views/BatteryAnalysisView.java | 19 ++ .../ui/views/NtimeAnalysisView.java | 19 ++ 16 files changed, 480 insertions(+), 10 deletions(-) create mode 100644 com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/BatteryPerspective.java create mode 100644 com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/NtimePerspective.java create mode 100644 com.samsung.dynamicanalyzer.workbench/src/com/samsung/dynamicanalyzer/workbench/ResourcePerspective.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBatteryPerspectiveHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBottleNeckTabHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenMemoryTabHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenNtimePerspectiveHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourceLifecycleTabHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourcePerspectiveHandler.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/BatteryAnalysisView.java create mode 100644 com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/NtimeAnalysisView.java diff --git a/com.samsung.dynamicanalyzer.workbench/plugin.properties b/com.samsung.dynamicanalyzer.workbench/plugin.properties index 179d988..de73593 100644 --- a/com.samsung.dynamicanalyzer.workbench/plugin.properties +++ b/com.samsung.dynamicanalyzer.workbench/plugin.properties @@ -3,5 +3,10 @@ pluginName=Dynamic Analyzer Workbench #Provider name providerName=Samsung Electronics -#Product name +#Product name, Application Name DynamicAnalyzer=Dynamic Analyzer + +#Perspective name +Resource=Resource +Battery=Battery +Ntime=N-time diff --git a/com.samsung.dynamicanalyzer.workbench/plugin.xml b/com.samsung.dynamicanalyzer.workbench/plugin.xml index 1bde71a..47574fc 100644 --- a/com.samsung.dynamicanalyzer.workbench/plugin.xml +++ b/com.samsung.dynamicanalyzer.workbench/plugin.xml @@ -14,9 +14,19 @@ + name="%Resource" + class="com.samsung.dynamicanalyzer.workbench.ResourcePerspective" + id="com.samsung.dynamicanalyzer.resourcePerspective"> + + + + + + + + + + + + + + + + @@ -38,6 +68,30 @@ class="com.samsung.dynamicanalyzer.handlers.OpenTraceHandler" commandId="com.samsung.dynamicanalyzer.commands.openTrace"> + + + + + + + + + + + + @@ -76,11 +130,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + targetID="com.samsung.dynamicanalyzer.resourcePerspective"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -182,5 +401,19 @@ name="%Log" restorable="true"> + + + + diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBatteryPerspectiveHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBatteryPerspectiveHandler.java new file mode 100644 index 0000000..891243f --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBatteryPerspectiveHandler.java @@ -0,0 +1,26 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; + +public class OpenBatteryPerspectiveHandler extends AbstractHandler { + + public static final String ID = "com.samsung.dynamicanalyzer.batteryPerspective"; //$NON-NLS-1$ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IWorkbench workbench = PlatformUI.getWorkbench(); + try { + workbench.showPerspective(ID, workbench.getActiveWorkbenchWindow()); + } catch (WorkbenchException e) { + e.printStackTrace(); + } + + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBottleNeckTabHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBottleNeckTabHandler.java new file mode 100644 index 0000000..7fae249 --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenBottleNeckTabHandler.java @@ -0,0 +1,14 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +public class OpenBottleNeckTabHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenMemoryTabHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenMemoryTabHandler.java new file mode 100644 index 0000000..8816b7b --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenMemoryTabHandler.java @@ -0,0 +1,14 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +public class OpenMemoryTabHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenNtimePerspectiveHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenNtimePerspectiveHandler.java new file mode 100644 index 0000000..823593a --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenNtimePerspectiveHandler.java @@ -0,0 +1,26 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; + +public class OpenNtimePerspectiveHandler extends AbstractHandler { + + public static final String ID = "com.samsung.dynamicanalyzer.ntimePerspective"; //$NON-NLS-1$ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IWorkbench workbench = PlatformUI.getWorkbench(); + try { + workbench.showPerspective(ID, workbench.getActiveWorkbenchWindow()); + } catch (WorkbenchException e) { + e.printStackTrace(); + } + + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourceLifecycleTabHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourceLifecycleTabHandler.java new file mode 100644 index 0000000..99de59c --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourceLifecycleTabHandler.java @@ -0,0 +1,14 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +public class OpenResourceLifecycleTabHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourcePerspectiveHandler.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourcePerspectiveHandler.java new file mode 100644 index 0000000..d31e35d --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/handlers/OpenResourcePerspectiveHandler.java @@ -0,0 +1,26 @@ +package com.samsung.dynamicanalyzer.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; + +public class OpenResourcePerspectiveHandler extends AbstractHandler { + + public static final String ID = "com.samsung.dynamicanalyzer.resourcePerspective"; //$NON-NLS-1$ + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IWorkbench workbench = PlatformUI.getWorkbench(); + try { + workbench.showPerspective(ID, workbench.getActiveWorkbenchWindow()); + } catch (WorkbenchException e) { + e.printStackTrace(); + } + + return null; + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/BatteryAnalysisView.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/BatteryAnalysisView.java new file mode 100644 index 0000000..72126c2 --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/BatteryAnalysisView.java @@ -0,0 +1,19 @@ +package com.samsung.dynamicanalyzer.ui.views; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; + +public class BatteryAnalysisView extends ViewPart { + + public BatteryAnalysisView() { + } + + @Override + public void createPartControl(Composite parent) { + } + + @Override + public void setFocus() { + } + +} diff --git a/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/NtimeAnalysisView.java b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/NtimeAnalysisView.java new file mode 100644 index 0000000..814b04a --- /dev/null +++ b/com.samsung.dynamicanalyzer/src/com/samsung/dynamicanalyzer/ui/views/NtimeAnalysisView.java @@ -0,0 +1,19 @@ +package com.samsung.dynamicanalyzer.ui.views; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; + +public class NtimeAnalysisView extends ViewPart { + + public NtimeAnalysisView() { + } + + @Override + public void createPartControl(Composite parent) { + } + + @Override + public void setFocus() { + } + +} -- 2.7.4