Changeset 3467 for devel-tools
- Timestamp:
- Mar 7, 2008, 2:56:03 PM (13 years ago)
- Location:
- devel-tools/trunk/eclipse/org.refal.plus.rfpdt.launch/src/org/refal/plus/rfpdt/launch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.plus.rfpdt.launch/src/org/refal/plus/rfpdt/launch/IRfpLaunchConfigurationConstants.java
r3449 r3467 8 8 */ 9 9 public interface IRfpLaunchConfigurationConstants /* extends IJavaLaunchConfigurationConstants */{ 10 public static final String ATTR_PROJECT_NAME = "org.refal.plus.rfpdt.launch.project_name"; 10 public static final String ATTR_PROJECT_NAME = "org.refal.plus.rfpdt.launch.project_name"; // FIXME: Project is not JavaProject, must be IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME 11 11 public static final String ATTR_MODULE_NAME = IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME; 12 12 public static final String PLUGIN_ID = "org.refal.plus.rfpdt.launch"; -
devel-tools/trunk/eclipse/org.refal.plus.rfpdt.launch/src/org/refal/plus/rfpdt/launch/ui/RfpLaunchShortcut.java
r3449 r3467 18 18 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 19 19 import org.eclipse.jdt.launching.IRuntimeClasspathEntry; 20 import org.eclipse.jdt.launching.JavaRuntime;21 20 import org.eclipse.jface.dialogs.ErrorDialog; 22 21 import org.eclipse.jface.dialogs.MessageDialog; … … 95 94 getModuleName(module)) 96 95 && config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "").equals( 97 this.getWorkingDirectory(module))) {96 getWorkingDirectory(module))) { 98 97 candidateConfigs.add(config); 99 98 } … … 159 158 } 160 159 161 public void setClasspathDefaults (ILaunchConfigurationWorkingCopy configuration) {162 try {163 IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedRuntimeClasspath(configuration);164 // Set ATTR_DEFAULT_CLASSPATH to false here, because we want to use165 // a custom class path.166 configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);167 configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, this.asMementos(entries));168 } catch (CoreException e) {169 // CorePlugin.log(e); // TODO can we do better? Like:170 // JDIDebugUIPlugin.errorDialog(LauncherMessages.getString("JavaClasspathTab.Unable_to_save_classpath_1"),171 // e); //$NON-NLS-1$172 return;173 }174 }175 176 160 protected List<String> asMementos (IRuntimeClasspathEntry[] entries) throws CoreException { 177 161 List<String> mementos = new ArrayList<String>(entries.length); … … 202 186 wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, 203 187 IRfpLaunchConfigurationConstants.CLASSPATH_PROVIDER); 204 setClasspathDefaults(wc); 205 wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, this.getWorkingDirectory(module)); 188 wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, getWorkingDirectory(module)); 206 189 try { 207 190 config = wc.doSave(); … … 210 193 } 211 194 return config; 212 }213 214 protected String getWorkingDirectory (IFile rfFile) {215 return rfFile.getParent().getFullPath().makeRelative().toString();216 195 } 217 196 … … 237 216 } 238 217 218 static String getWorkingDirectory (IFile module) { 219 return module.getParent().getFullPath().makeRelative().toString(); 220 } 221 239 222 static String getModuleName (IFile module) { 240 223 return module.getProjectRelativePath().removeFileExtension().toString().replace('/', '.'); -
devel-tools/trunk/eclipse/org.refal.plus.rfpdt.launch/src/org/refal/plus/rfpdt/launch/ui/RfpTabGroup.java
r3449 r3467 29 29 public void setDefaults (ILaunchConfigurationWorkingCopy config) { 30 30 super.setDefaults(config); 31 RfpLaunchShortcut helper = new RfpLaunchShortcut();32 31 IProject project = null; 33 32 IFile resource = this.getResource(); … … 37 36 config.setAttribute(IRfpLaunchConfigurationConstants.ATTR_MODULE_NAME, RfpLaunchShortcut 38 37 .getModuleName(resource)); 39 config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, helper38 config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, RfpLaunchShortcut 40 39 .getWorkingDirectory(resource)); 41 40 } 42 41 config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, 43 42 IRfpLaunchConfigurationConstants.CLASSPATH_PROVIDER); 44 helper.setClasspathDefaults(config);43 // helper.setClasspathDefaults(config); 45 44 // This is tricky: without setting ATTR_PROJECT_NAME to the empty 46 45 // string, the project is expected to be a Java project, which in our 47 46 // case is not necessarily so, and some methods validate on the 48 47 // existance of a Java project with that name. 49 config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");48 //config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); 50 49 } 51 50
Note: See TracChangeset
for help on using the changeset viewer.