diff options
author | jungwook.ryu <jungwook.ryu@samsung.com> | 2016-01-29 17:28:48 +0900 |
---|---|---|
committer | jungwook.ryu <jungwook.ryu@samsung.com> | 2016-02-01 17:04:48 +0900 |
commit | 50a6f5169f3c1ec2eb927c90ccb69672cb8d6dc5 (patch) | |
tree | e2f13ae9fac1be6544adbea53bd3b22d437867b7 /org.tizen.dynamicanalysis.ide.eplugin | |
parent | 344d82cb4c3ca8e73669ae80505437346d080fff (diff) | |
download | dynamic-analysis-ide-eplugin-50a6f5169f3c1ec2eb927c90ccb69672cb8d6dc5.tar.gz dynamic-analysis-ide-eplugin-50a6f5169f3c1ec2eb927c90ccb69672cb8d6dc5.tar.bz2 dynamic-analysis-ide-eplugin-50a6f5169f3c1ec2eb927c90ccb69672cb8d6dc5.zip |
Block context menu for CheckPoint.
Menu is only shown in *.c file of Native project.
Change-Id: Ic8d276df0180f82bfa8116808cfcce8c70e0c4c0
Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
Diffstat (limited to 'org.tizen.dynamicanalysis.ide.eplugin')
4 files changed, 76 insertions, 6 deletions
diff --git a/org.tizen.dynamicanalysis.ide.eplugin/META-INF/MANIFEST.MF b/org.tizen.dynamicanalysis.ide.eplugin/META-INF/MANIFEST.MF index 4a482d2..ff9822e 100644 --- a/org.tizen.dynamicanalysis.ide.eplugin/META-INF/MANIFEST.MF +++ b/org.tizen.dynamicanalysis.ide.eplugin/META-INF/MANIFEST.MF @@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.ui;bundle-version="5.3.2", org.eclipse.cdt.launch, org.tizen.nativeplatform;bundle-version="1.0.0", - org.eclipse.cdt.debug.core + org.eclipse.cdt.debug.core, + org.eclipse.core.expressions;bundle-version="3.4.501" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Import-Package: org.eclipse.cdt.debug.core.sourcelookup, diff --git a/org.tizen.dynamicanalysis.ide.eplugin/plugin.xml b/org.tizen.dynamicanalysis.ide.eplugin/plugin.xml index 2892e5c..ac3b600 100755 --- a/org.tizen.dynamicanalysis.ide.eplugin/plugin.xml +++ b/org.tizen.dynamicanalysis.ide.eplugin/plugin.xml @@ -145,20 +145,36 @@ sourcepath="/on-demand"> </tools> </extension> - + + <extension + point="org.eclipse.core.expressions.propertyTesters"> + <propertyTester + class="org.tizen.dynamicanalysis.ide.eplugin.popup.actions.PluginPropertyTester" + id="org.tizen.dynamicanalysis.PluginPropertyTester" + namespace="org.tizen.dynamicanalysis" + properties="isCoreProject" + type="org.eclipse.ui.part.FileEditorInput"> + </propertyTester> + </extension> + <extension point="org.eclipse.ui.popupMenus"> - <viewerContribution + <objectContribution id="org.tizen.dynamicanalysis.ide.eplugin.contribution" - targetID="#CEditorContext"> + objectClass="org.eclipse.ui.part.FileEditorInput" + nameFilter="*.c"> <action class="org.tizen.dynamicanalysis.ide.eplugin.popup.actions.AddProfileVariableActionDelegate" id="org.tizen.dynamicanalysis.ide.eplugin.contribution.editor.action" label="Add to Checkpoint of Dynamic Analyzer" menubarPath="additions"> </action> - </viewerContribution> + <enablement> + <test property="org.tizen.dynamicanalysis.isCoreProject" /> + </enablement> + </objectContribution> </extension> + <extension id="org.tizen.dynamicanalysis.ide.eplugin.interactivemarker" point="org.eclipse.core.resources.markers"> <super type="org.eclipse.core.resources.marker"/> <attribute name="variableName" /> diff --git a/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/launch/TizenNativeApplicationDADelegate.java b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/launch/TizenNativeApplicationDADelegate.java index 5147504..6a9164b 100644 --- a/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/launch/TizenNativeApplicationDADelegate.java +++ b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/launch/TizenNativeApplicationDADelegate.java @@ -235,7 +235,7 @@ public class TizenNativeApplicationDADelegate extends TizenLaunchDelegate { } if (!isLaunchFailed && isDAReady()) { - runDynamicAnalyzer(device, projectType, binaryOfTarget, executablePath, localPackagePathList, null, null); + runDynamicAnalyzer(device, projectType, binaryOfTarget, executablePath, localPackagePathList, getProfileVariableInfos(project, config), null); } } else { // Case : Native application try { diff --git a/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/popup/actions/PluginPropertyTester.java b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/popup/actions/PluginPropertyTester.java new file mode 100644 index 0000000..9ebe3c0 --- /dev/null +++ b/org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/popup/actions/PluginPropertyTester.java @@ -0,0 +1,53 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jungwook Ryu <jungwook.ryu@samsung.com> + * WooJin Jung <woojin2.jung@samsung.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.dynamicanalysis.ide.eplugin.popup.actions; + +import org.eclipse.cdt.ui.newui.PropertyTester; +import org.eclipse.ui.part.FileEditorInput; +import org.tizen.common.TizenProjectType; +import org.tizen.nativecommon.ProjectUtil; + +public class PluginPropertyTester extends PropertyTester { + @Override + public boolean test(Object receiver, String property, Object[] args, + Object expectedValue) { + if (property.equals("isCoreProject")) { + // Because of this routine, you can only see the context menu for CheckPoint + // ("Add to CheckPoint of Dynamic Analyzer") in source code of Native project. + // source file in Platform or Web project do not show the menu. + if (receiver instanceof FileEditorInput) { + FileEditorInput fileEditor = (FileEditorInput) receiver; + TizenProjectType type = ProjectUtil + .getTizenProjectType(fileEditor.getFile().getProject()); + if (type != null && type.isCoreProject()) { + return true; + } + } + } + return false; + } +} |