[Title]change da build config name
authorsanghyunnim.lee <sanghyunnim.lee@samsung.com>
Mon, 15 Apr 2013 05:57:54 +0000 (14:57 +0900)
committersanghyunnim.lee <sanghyunnim.lee@samsung.com>
Mon, 15 Apr 2013 05:57:54 +0000 (14:57 +0900)
[Desc.]
[Issue]

org.tizen.dynamicanalysis.ide.eplugin/plugin.xml
org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/Activator.java
org.tizen.dynamicanalysis.ide.eplugin/src/org/tizen/dynamicanalysis/ide/eplugin/launch/TizenNativeApplicationProfileShortcut.java

index 14aa621..6b54764 100755 (executable)
@@ -49,7 +49,7 @@
              <configuration
                     buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug"
                    id="org.tizen.nativecpp.config.sbi.gcc45.app.debug.da" 
-                   name="Profile
+                   name="Dynamic Analyzer
                    parent="org.tizen.nativecpp.config.sbi.gcc45.app.debug">
                 <toolChain
                       id="org.tizen.nativecpp.toolchain.sbi.gcc45.app.debug.da"
index 9b23b75..56259cd 100644 (file)
@@ -35,7 +35,7 @@ import org.tizen.nativecommon.build.ui.IPlatformChangedListener;
 
 public class Activator implements BundleActivator {
        public static final String PLUGIN_ID = "org.tizen.dynamicanalyzer";//$NON-NLS-1$
-       public static final String PROFILE_BUILD_CONFIGURATION_NAME = "Profile";//$NON-NLS-1$
+       public static final String PROFILE_BUILD_CONFIGURATION_NAME = "Dynamic Analyzer";//$NON-NLS-1$
        public static final String PROFILE_MODE = "profile";//$NON-NLS-1$
 
        private static BundleContext context;
index 9ba61c6..67f0db8 100755 (executable)
@@ -59,12 +59,20 @@ public class TizenNativeApplicationProfileShortcut extends TizenLaunchShortcut
 
        @Override
        public void launch(ISelection selection, String mode) {
-               IResource resource = (IResource) ((IStructuredSelection) selection)
-                               .getFirstElement();
+               IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+               Object firstElement = structuredSelection.getFirstElement();
+
+               IProject project = null;
+               if (firstElement instanceof IBinary) {
+                       IBinary binary = (IBinary) firstElement;
+                       project = binary.getCProject().getProject();
+               } else if (firstElement instanceof IResource) {
+                       IResource resource = (IResource) firstElement;
+                       project = resource.getProject();
+               }
 
                try {
-                       DebugUITools.launch(
-                                       createLaunchConfiguration(resource.getProject()),
+                       DebugUITools.launch(createLaunchConfiguration(project),
                                        Activator.PROFILE_MODE);
                } catch (CoreException e) {
                        DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, e.getMessage());
@@ -74,8 +82,12 @@ public class TizenNativeApplicationProfileShortcut extends TizenLaunchShortcut
        @Override
        public void launch(IEditorPart editor, String mode) {
                IFileEditorInput input = (IFileEditorInput) editor.getEditorInput();
-               new TizenNativeApplicationProfileDelegate().profileStart(input
-                               .getFile().getProject());
+               try {
+                       DebugUITools.launch(createLaunchConfiguration(input.getFile()
+                                       .getProject()), Activator.PROFILE_MODE);
+               } catch (CoreException e) {
+                       DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, e.getMessage());
+               }
        }
 
        @Override
@@ -114,7 +126,7 @@ public class TizenNativeApplicationProfileShortcut extends TizenLaunchShortcut
                                projectName);
                wc.setMappedResources(new IResource[] { project });
                wc.setAttribute(
-                               ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");
+                               ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "");//$NON-NLS-1$
                wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID,
                                TizenLaunchConfigurationConstants.DEBUGGER_ID);