Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2004-05-28 12:44:00 -0400
committerDavid Inglis2004-05-28 12:44:00 -0400
commit7a38ea6afbc67479bedae1382c51acd2a3caa9a2 (patch)
tree6a30131fb4f6a361c206a16e7205eb790c4fabe7
parentcc06054a0a26c0e1d9b294c40bd2c94974a75182 (diff)
downloadorg.eclipse.cdt-7a38ea6afbc67479bedae1382c51acd2a3caa9a2.tar.gz
org.eclipse.cdt-7a38ea6afbc67479bedae1382c51acd2a3caa9a2.tar.xz
org.eclipse.cdt-7a38ea6afbc67479bedae1382c51acd2a3caa9a2.zip
fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=64458
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java37
1 files changed, 13 insertions, 24 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java
index d0a873b5d8..aa3145928c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerEntryPage.java
@@ -238,15 +238,13 @@ public class CPathContainerEntryPage extends CPathBasePage {
}
for (int i = 0; i < selElements.size(); i++) {
Object elem = selElements.get(i);
- if (elem instanceof CPElementAttribute) {
- if ( ((CPElementAttribute)elem).getValue() == null) {
- return false;
- }
- } else if (elem instanceof CPElement) {
+ if (elem instanceof CPElement) {
CPElement curr = (CPElement)elem;
if (curr.getParentContainer() != null) {
return false;
}
+ } else {
+ return false;
}
}
return true;
@@ -254,20 +252,7 @@ public class CPathContainerEntryPage extends CPathBasePage {
private void removeEntry() {
List selElements = fContainersList.getSelectedElements();
- for (int i = selElements.size() - 1; i >= 0; i--) {
- Object elem = selElements.get(i);
- if (elem instanceof CPElementAttribute) {
- CPElementAttribute attrib = (CPElementAttribute)elem;
- attrib.getParent().setAttribute(attrib.getKey(), null);
- selElements.remove(i);
- }
- }
- if (selElements.isEmpty()) {
- fContainersList.refresh();
- fCPathList.dialogFieldChanged(); // validate
- } else {
- fContainersList.removeElements(selElements);
- }
+ fContainersList.removeElements(selElements);
}
private boolean canExport(List selElements) {
@@ -281,6 +266,8 @@ public class CPathContainerEntryPage extends CPathBasePage {
if (curr.getParentContainer() != null) {
return false;
}
+ } else {
+ return false;
}
}
return true;
@@ -288,14 +275,16 @@ public class CPathContainerEntryPage extends CPathBasePage {
private void exportEntry() {
List selElements = fContainersList.getSelectedElements();
- if (selElements.size() != 1) {
+ if (selElements.size() == 0) {
return;
}
- Object elem = selElements.get(0);
- if (fContainersList.getIndexOfElement(elem) != -1) {
- ((CPElement)elem).setExported(! ((CPElement)elem).isExported()); // toggle export
- fContainersList.refresh(elem);
+ for (int i = 0; i < selElements.size(); i++) {
+ Object elem = selElements.get(i);
+ if (elem instanceof CPElement) {
+ ((CPElement)elem).setExported(! ((CPElement)elem).isExported()); // toggle export
+ }
}
+ fContainersList.refresh();
}
/**

Back to the top