Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 312054 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/preferences/UserLibraryPreferencePage.java (-1 / +18 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 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 1080-1085 Link Here
1080
		if (dialog.open() == Window.OK) {
1081
		if (dialog.open() == Window.OK) {
1081
			CPUserLibraryElement newLibrary= dialog.getNewLibrary();
1082
			CPUserLibraryElement newLibrary= dialog.getNewLibrary();
1082
			if (element != null) {
1083
			if (element != null) {
1084
				setNewParentContainer(newLibrary);
1083
				fLibraryList.replaceElement(element, newLibrary);
1085
				fLibraryList.replaceElement(element, newLibrary);
1084
			} else {
1086
			} else {
1085
				fLibraryList.addElement(newLibrary);
1087
				fLibraryList.addElement(newLibrary);
Lines 1089-1094 Link Here
1089
		}
1091
		}
1090
	}
1092
	}
1091
1093
1094
	/**
1095
	 * Sets the parent container as the new library element for its children.
1096
	 * 
1097
	 * @param newLibrary the new parent container
1098
	 * @since 3.7
1099
	 */
1100
	private void setNewParentContainer(CPUserLibraryElement newLibrary) {
1101
		CPListElement[] elements= newLibrary.getChildren();
1102
		for (int i= 0; i < elements.length; i++) {
1103
			Object parent= elements[i].getParentContainer();
1104
			if (parent instanceof CPUserLibraryElement && !((CPUserLibraryElement)parent).equals(newLibrary)) {
1105
				elements[i].setParentContainer(newLibrary);
1106
			}
1107
		}
1108
	}
1109
1092
	private void editArchiveElement(CPListElement existingElement, CPUserLibraryElement parent) {
1110
	private void editArchiveElement(CPListElement existingElement, CPUserLibraryElement parent) {
1093
		CPListElement[] elements= openExtJarFileDialog(existingElement, parent);
1111
		CPListElement[] elements= openExtJarFileDialog(existingElement, parent);
1094
		if (elements != null) {
1112
		if (elements != null) {
(-)ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java (-1 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 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 394-399 Link Here
394
	}
394
	}
395
395
396
	/**
396
	/**
397
	 * Sets the parent container.
398
	 * 
399
	 * @param parent the parent container
400
	 * @since 3.7
401
	 */
402
	public void setParentContainer(CPUserLibraryElement parent) {
403
		fParentContainer= parent;
404
	}
405
406
	/**
397
	 * Notifies that an attribute has changed
407
	 * Notifies that an attribute has changed
398
	 *
408
	 *
399
	 * @param key the changed key
409
	 * @param key the changed key

Return to bug 312054