mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Bug #196805 : Can't add multiple source folders simultaneously
This commit is contained in:
parent
97ea58c661
commit
dd6ebbcaf5
1 changed files with 11 additions and 8 deletions
|
@ -168,15 +168,15 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buttonPressed(int x) {
|
public void buttonPressed(int x) {
|
||||||
String s;
|
|
||||||
Shell shell = usercomp.getShell();
|
Shell shell = usercomp.getShell();
|
||||||
TreeItem[] sel = tree.getTree().getSelection();
|
TreeItem[] sel = tree.getTree().getSelection();
|
||||||
switch (x) {
|
switch (x) {
|
||||||
// add
|
// add
|
||||||
case 0:
|
case 0:
|
||||||
s = getProjectDialog(shell, EMPTY_STR);
|
String[] ss = getProjectDialog(shell, EMPTY_STR);
|
||||||
if (s != null) {
|
if (ss != null) {
|
||||||
src.add(new _Entry(newEntry(new Path(s), new IPath[0], true)));
|
for (int i=0; i<ss.length; i++)
|
||||||
|
src.add(new _Entry(newEntry(new Path(ss[i]), new IPath[0], true)));
|
||||||
saveData();
|
saveData();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -265,7 +265,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
||||||
return page.isForProject();
|
return page.isForProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getProjectDialog(Shell shell, String text) {
|
private String[] getProjectDialog(Shell shell, String text) {
|
||||||
IPath path = new Path(text);
|
IPath path = new Path(text);
|
||||||
|
|
||||||
LocDialog dialog = new LocDialog(shell);
|
LocDialog dialog = new LocDialog(shell);
|
||||||
|
@ -281,9 +281,12 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
||||||
dialog.setTitle(WORKSPACE_DIR_DIALOG_TITLE);
|
dialog.setTitle(WORKSPACE_DIR_DIALOG_TITLE);
|
||||||
dialog.setMessage(WORKSPACE_DIR_DIALOG_MSG);
|
dialog.setMessage(WORKSPACE_DIR_DIALOG_MSG);
|
||||||
if (dialog.open() == Window.OK) {
|
if (dialog.open() == Window.OK) {
|
||||||
IResource resource = (IResource) dialog.getFirstResult();
|
Object[] resources = dialog.getResult();
|
||||||
if (resource != null) {
|
if (resources != null) {
|
||||||
return resource.getFullPath().toString();
|
String[] ss = new String[resources.length];
|
||||||
|
for (int i=0; i<resources.length; i++)
|
||||||
|
ss[i] = ((IResource)resources[i]).getFullPath().toString();
|
||||||
|
return ss;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue