mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
2004-08-27 Alain Magloire
Fix for 72135 * src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java * src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java * src/org/eclipse/cdt/internal/ui/wizards/TreeListDialgField.java
This commit is contained in:
parent
cc31ff6aa4
commit
8348117fc0
4 changed files with 20 additions and 31 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-08-27 Alain Magloire
|
||||||
|
|
||||||
|
Fix for 72135
|
||||||
|
* src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathBasePage.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathSourceEntryPage.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/wizards/TreeListDialgField.java
|
||||||
|
|
||||||
2004-08-26 Alain Magloire
|
2004-08-26 Alain Magloire
|
||||||
Be on the same length as the Java Editor and Ant Editor
|
Be on the same length as the Java Editor and Ant Editor
|
||||||
for the Preference page. Misc warning removes, when
|
for the Preference page. Misc warning removes, when
|
||||||
|
|
|
@ -28,10 +28,13 @@ public abstract class CPathBasePage extends AbstractCOptionPage {
|
||||||
super(title, image);
|
super(title, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fixNestingConflicts(List newEntries, List existing, Set modifiedSourceEntries) {
|
protected void fixNestingConflicts(List newEntries, List existingList, Set modifiedSourceEntries) {
|
||||||
|
ArrayList existing = new ArrayList(existingList);
|
||||||
for (int i = 0; i < newEntries.size(); i++) {
|
for (int i = 0; i < newEntries.size(); i++) {
|
||||||
CPElement curr = (CPElement) newEntries.get(i);
|
CPElement curr = (CPElement) newEntries.get(i);
|
||||||
addExclusionPatterns(curr, existing, modifiedSourceEntries);
|
addExclusionPatterns(curr, existing, modifiedSourceEntries);
|
||||||
|
// add the entry to the existing list so it can be analyse also.
|
||||||
|
existing.add(curr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,39 +208,18 @@ public class CPathSourceEntryPage extends CPathBasePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasFolders(IContainer container) {
|
|
||||||
try {
|
|
||||||
IResource[] members = container.members();
|
|
||||||
for (int i = 0; i < members.length; i++) {
|
|
||||||
if (members[i] instanceof IContainer) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void sourcePageCustomButtonPressed(DialogField field, int index) {
|
protected void sourcePageCustomButtonPressed(DialogField field, int index) {
|
||||||
if (field == fFoldersList) {
|
if (field == fFoldersList) {
|
||||||
if (index == IDX_ADD) {
|
if (index == IDX_ADD) {
|
||||||
List elementsToAdd = new ArrayList(10);
|
List elementsToAdd = new ArrayList(10);
|
||||||
IProject project = fCurrCProject.getProject();
|
IProject project = fCurrCProject.getProject();
|
||||||
if (project.exists()) {
|
if (project.exists()) {
|
||||||
if (hasFolders(project)) {
|
|
||||||
CPElement[] srcentries = openSourceContainerDialog(null);
|
CPElement[] srcentries = openSourceContainerDialog(null);
|
||||||
if (srcentries != null) {
|
if (srcentries != null) {
|
||||||
for (int i = 0; i < srcentries.length; i++) {
|
for (int i = 0; i < srcentries.length; i++) {
|
||||||
elementsToAdd.add(srcentries[i]);
|
elementsToAdd.add(srcentries[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
CPElement entry = openNewSourceContainerDialog(null, true);
|
|
||||||
if (entry != null) {
|
|
||||||
elementsToAdd.add(entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
CPElement entry = openNewSourceContainerDialog(null, false);
|
CPElement entry = openNewSourceContainerDialog(null, false);
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
|
@ -372,7 +351,7 @@ public class CPathSourceEntryPage extends CPathBasePage {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sourcePageDialogFieldChanged(DialogField field) {
|
void sourcePageDialogFieldChanged(DialogField field) {
|
||||||
if (fCurrCProject == null) {
|
if (fCurrCProject == null) {
|
||||||
// not initialized
|
// not initialized
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -67,13 +67,13 @@ public class TreeListDialogField extends DialogField {
|
||||||
|
|
||||||
private Label fLastSeparator;
|
private Label fLastSeparator;
|
||||||
|
|
||||||
private Tree fTreeControl;
|
Tree fTreeControl;
|
||||||
private Composite fButtonsControl;
|
private Composite fButtonsControl;
|
||||||
private ISelection fSelectionWhenEnabled;
|
private ISelection fSelectionWhenEnabled;
|
||||||
|
|
||||||
private ITreeListAdapter fTreeAdapter;
|
ITreeListAdapter fTreeAdapter;
|
||||||
|
|
||||||
private Object fParentElement;
|
Object fParentElement;
|
||||||
private int fTreeExpandLevel;
|
private int fTreeExpandLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -389,7 +389,7 @@ public class TreeListDialogField extends DialogField {
|
||||||
return fButtonsControl;
|
return fButtonsControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doButtonSelected(SelectionEvent e) {
|
void doButtonSelected(SelectionEvent e) {
|
||||||
if (fButtonControls != null) {
|
if (fButtonControls != null) {
|
||||||
for (int i = 0; i < fButtonControls.length; i++) {
|
for (int i = 0; i < fButtonControls.length; i++) {
|
||||||
if (e.widget == fButtonControls[i]) {
|
if (e.widget == fButtonControls[i]) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue