Changeset 3467


Ignore:
Timestamp:
Mar 7, 2008, 2:56:03 PM (13 years ago)
Author:
yura
Message:
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  
    88 */
    99public 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
    1111    public static final String ATTR_MODULE_NAME = IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME;
    1212    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  
    1818import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
    1919import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
    20 import org.eclipse.jdt.launching.JavaRuntime;
    2120import org.eclipse.jface.dialogs.ErrorDialog;
    2221import org.eclipse.jface.dialogs.MessageDialog;
     
    9594                        getModuleName(module))
    9695                        && config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "").equals(
    97                                 this.getWorkingDirectory(module))) {
     96                                getWorkingDirectory(module))) {
    9897                    candidateConfigs.add(config);
    9998                }
     
    159158    }
    160159
    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 use
    165             // 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 
    176160    protected List<String> asMementos (IRuntimeClasspathEntry[] entries) throws CoreException {
    177161        List<String> mementos = new ArrayList<String>(entries.length);
     
    202186        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
    203187                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));
    206189        try {
    207190            config = wc.doSave();
     
    210193        }
    211194        return config;
    212     }
    213 
    214     protected String getWorkingDirectory (IFile rfFile) {
    215         return rfFile.getParent().getFullPath().makeRelative().toString();
    216195    }
    217196
     
    237216    }
    238217
     218    static String getWorkingDirectory (IFile module) {
     219        return module.getParent().getFullPath().makeRelative().toString();
     220    }
     221
    239222    static String getModuleName (IFile module) {
    240223        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  
    2929    public void setDefaults (ILaunchConfigurationWorkingCopy config) {
    3030        super.setDefaults(config);
    31         RfpLaunchShortcut helper = new RfpLaunchShortcut();
    3231        IProject project = null;
    3332        IFile resource = this.getResource();
     
    3736            config.setAttribute(IRfpLaunchConfigurationConstants.ATTR_MODULE_NAME, RfpLaunchShortcut
    3837                    .getModuleName(resource));
    39             config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, helper
     38            config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, RfpLaunchShortcut
    4039                    .getWorkingDirectory(resource));
    4140        }
    4241        config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
    4342                IRfpLaunchConfigurationConstants.CLASSPATH_PROVIDER);
    44         helper.setClasspathDefaults(config);
     43        // helper.setClasspathDefaults(config);
    4544        // This is tricky: without setting ATTR_PROJECT_NAME to the empty
    4645        // string, the project is expected to be a Java project, which in our
    4746        // case is not necessarily so, and some methods validate on the
    4847        // existance of a Java project with that name.
    49         config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
     48        //config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
    5049    }
    5150
Note: See TracChangeset for help on using the changeset viewer.