|
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) { |