/** * @see JavaSourceLocator#getSourceLocations() */ public IJavaSourceLocation[] getSourceLocations() { return fSourceLocator.getSourceLocations(); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaSourceLocator"); //$NON-NLS-1$ doc.appendChild(node); IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { Element child = doc.createElement("javaSourceLocation"); //$NON-NLS-1$ child.setAttribute("class", locations[i].getClass().getName()); //$NON-NLS-1$ child.setAttribute("memento", locations[i].getMemento()); //$NON-NLS-1$ node.appendChild(child); } return DebugPlugin.serializeDocument(doc); }
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaSourceLocator"); //$NON-NLS-1$ doc.appendChild(node); IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { Element child = doc.createElement("javaSourceLocation"); //$NON-NLS-1$ child.setAttribute("class", locations[i].getClass().getName()); //$NON-NLS-1$ child.setAttribute("memento", locations[i].getMemento()); //$NON-NLS-1$ node.appendChild(child); } return DebugPlugin.serializeDocument(doc); }
@Override public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration); IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration); setSourceLocations(getSourceLocations(resolved)); }
@Override public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration); IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration); setSourceLocations(getSourceLocations(resolved)); }
IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { try {
IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { try {
IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { try {
IJavaSourceLocation[] locations = getSourceLocations(); for (int i = 0; i < locations.length; i++) { try {
/** * Returns a default collection of source locations for * the given Java project. Default source locations consist * of the given project and all of its required projects . * * @param project Java project * @return a collection of source locations for all required * projects * @exception CoreException if an exception occurs reading * computing the default locations */ public static IJavaSourceLocation[] getDefaultSourceLocations(IJavaProject project) throws CoreException { // create a temporary launch config ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION); ILaunchConfigurationWorkingCopy config = type.newInstance(null, project.getElementName()); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getElementName()); JavaSourceLocator locator = new JavaSourceLocator(); locator.initializeDefaults(config); return locator.getSourceLocations(); }
/** * Returns a default collection of source locations for * the given Java project. Default source locations consist * of the given project and all of its required projects . * * @param project Java project * @return a collection of source locations for all required * projects * @exception CoreException if an exception occurs reading * computing the default locations */ public static IJavaSourceLocation[] getDefaultSourceLocations(IJavaProject project) throws CoreException { // create a temporary launch config ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION); ILaunchConfigurationWorkingCopy config = type.newInstance(null, project.getElementName()); config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getElementName()); JavaSourceLocator locator = new JavaSourceLocator(); locator.initializeDefaults(config); return locator.getSourceLocations(); }