View | Details | Raw Unified | Return to bug 303155
Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/actions/JarImportWizardAction.java (-4 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 87-95 Link Here
87
					final IPackageFragmentRoot root= (IPackageFragmentRoot) element;
87
					final IPackageFragmentRoot root= (IPackageFragmentRoot) element;
88
					try {
88
					try {
89
						final IClasspathEntry entry= root.getRawClasspathEntry();
89
						final IClasspathEntry entry= root.getRawClasspathEntry();
90
						if (entry != null) {
90
						if (JarImportWizard.isValidClassPathEntry(entry) && JarImportWizard.isValidJavaProject(root.getJavaProject())
91
							if (JarImportWizard.isValidClassPathEntry(entry) && JarImportWizard.isValidJavaProject(root.getJavaProject()))
91
								&& root.getResolvedClasspathEntry().getReferencingEntry() == null) {
92
								fSelection= structured;
92
							fSelection= structured;
93
						}
93
						}
94
					} catch (JavaModelException exception) {
94
					} catch (JavaModelException exception) {
95
						JavaPlugin.log(exception);
95
						JavaPlugin.log(exception);
(-)ui/org/eclipse/jdt/internal/ui/jarimport/JarImportWizard.java (-2 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 383-389 Link Here
383
				final IPackageFragmentRoot root= (IPackageFragmentRoot) element;
383
				final IPackageFragmentRoot root= (IPackageFragmentRoot) element;
384
				try {
384
				try {
385
					final IClasspathEntry entry= root.getRawClasspathEntry();
385
					final IClasspathEntry entry= root.getRawClasspathEntry();
386
					if (isValidClassPathEntry(entry))
386
					if (isValidClassPathEntry(entry)
387
							&& root.getResolvedClasspathEntry().getReferencingEntry() == null)
387
						fImportData.setPackageFragmentRoot(root);
388
						fImportData.setPackageFragmentRoot(root);
388
				} catch (JavaModelException exception) {
389
				} catch (JavaModelException exception) {
389
					JavaPlugin.log(exception);
390
					JavaPlugin.log(exception);
(-)ui/org/eclipse/jdt/internal/ui/jarimport/JarImportWizardPage.java (-3 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 52-57 Link Here
52
52
53
import org.eclipse.ltk.core.refactoring.RefactoringCore;
53
import org.eclipse.ltk.core.refactoring.RefactoringCore;
54
54
55
import org.eclipse.jdt.core.IClasspathEntry;
55
import org.eclipse.jdt.core.IJavaElement;
56
import org.eclipse.jdt.core.IJavaElement;
56
import org.eclipse.jdt.core.IJavaModel;
57
import org.eclipse.jdt.core.IJavaModel;
57
import org.eclipse.jdt.core.IJavaProject;
58
import org.eclipse.jdt.core.IJavaProject;
Lines 199-206 Link Here
199
				final Set set= new HashSet();
200
				final Set set= new HashSet();
200
				final IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();
201
				final IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();
201
				for (int offset= 0; offset < roots.length; offset++) {
202
				for (int offset= 0; offset < roots.length; offset++) {
202
					if (JarImportWizard.isValidClassPathEntry(roots[offset].getRawClasspathEntry()))
203
					IPackageFragmentRoot root= roots[offset];
203
						set.add(roots[offset]);
204
					IClasspathEntry entry= root.getRawClasspathEntry();
205
					if (JarImportWizard.isValidClassPathEntry(entry)
206
							&& root.getResolvedClasspathEntry().getReferencingEntry() == null)
207
						set.add(root);
204
				}
208
				}
205
				return set.toArray();
209
				return set.toArray();
206
			}
210
			}
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveFromBuildpathAction.java (-4 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 44-49 Link Here
44
import org.eclipse.jdt.internal.corext.buildpath.BuildpathDelta;
44
import org.eclipse.jdt.internal.corext.buildpath.BuildpathDelta;
45
import org.eclipse.jdt.internal.corext.buildpath.CPJavaProject;
45
import org.eclipse.jdt.internal.corext.buildpath.CPJavaProject;
46
import org.eclipse.jdt.internal.corext.buildpath.ClasspathModifier;
46
import org.eclipse.jdt.internal.corext.buildpath.ClasspathModifier;
47
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
47
import org.eclipse.jdt.internal.corext.util.Messages;
48
import org.eclipse.jdt.internal.corext.util.Messages;
48
49
49
import org.eclipse.jdt.ui.JavaElementLabels;
50
import org.eclipse.jdt.ui.JavaElementLabels;
Lines 254-263 Link Here
254
						return false;
255
						return false;
255
256
256
				} else if (element instanceof IPackageFragmentRoot) {
257
				} else if (element instanceof IPackageFragmentRoot) {
257
					IClasspathEntry entry= ((IPackageFragmentRoot) element).getRawClasspathEntry();
258
					IClasspathEntry entry= JavaModelUtil.getClasspathEntry((IPackageFragmentRoot) element);
258
					if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
259
					if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER)
260
						return false;
261
					if (entry.getReferencingEntry() != null)
259
						return false;
262
						return false;
260
					}
261
				} else if (element instanceof ClassPathContainer) {
263
				} else if (element instanceof ClassPathContainer) {
262
					return true;
264
					return true;
263
				} else {
265
				} else {

Return to bug 303155