+ Shell shell = SlcUiLaunchPlugin.getDefault().getWorkbench()\r
+ .getActiveWorkbenchWindow().getShell();\r
+ ErrorDialog.openError(shell, "Error",\r
+ "Cannot execute SLC launch shortcut", e.getStatus());\r
+ }\r
+\r
+ }\r
+\r
+ protected String generateName(IFile file) {\r
+ IPath relativePath = file.getProjectRelativePath();\r
+ String name = relativePath.toString();\r
+ int idx = name.lastIndexOf(".xml");\r
+ if (idx > 0)\r
+ name = name.substring(0, idx);\r
+\r
+ if (name.startsWith("src/main/slc/root/"))\r
+ name = name.substring("src/main/slc/root/".length());\r
+ else if (name.startsWith("src/main/slc/"))\r
+ name = name.substring("src/main/slc/".length());\r
+\r
+ name = name.replace('/', '.');// otherwise not properly saved\r
+ return name;\r
+ }\r
+\r
+ protected ILaunchConfiguration findLaunchConfiguration(\r
+ String configLocation, ILaunchConfiguration[] configs)\r
+ throws CoreException {\r
+ for (ILaunchConfiguration config : configs) {\r
+ String loc = config.getAttribute(SlcScriptUtils.ATTR_SCRIPT, "");\r
+ if (loc.equals(configLocation)) {\r
+ return config;\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+ protected void launch(ILaunchConfiguration configuration, String mode)\r
+ throws CoreException {\r
+ if (showDialog) {\r
+ IStatus status = new Status(IStatus.INFO, SlcUiLaunchPlugin.ID,\r
+ "Configure SLC Launch");\r
+ String groupId;\r
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {\r
+ groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP;\r
+ } else {\r
+ groupId = IDebugUIConstants.ID_RUN_LAUNCH_GROUP;\r
+ }\r
+ DebugUITools.openLaunchConfigurationDialog(SlcUiLaunchPlugin\r
+ .getDefault().getWorkbench().getActiveWorkbenchWindow()\r
+ .getShell(), configuration, groupId, status);\r
+ } else {\r
+ DebugUITools.launch(configuration, mode);\r