mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
Bug # 72334 : Cannot select multiple include paths in project properties dialog
This commit is contained in:
parent
0888279e30
commit
686781efd0
1 changed files with 18 additions and 12 deletions
|
@ -102,7 +102,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
sashForm.setLayout(layout);
|
sashForm.setLayout(layout);
|
||||||
|
|
||||||
addTree(sashForm).setLayoutData(new GridData(GridData.FILL_VERTICAL));
|
addTree(sashForm).setLayoutData(new GridData(GridData.FILL_VERTICAL));
|
||||||
table = new Table(sashForm, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION);
|
table = new Table(sashForm, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.FULL_SELECTION);
|
||||||
GridData gd = new GridData(GridData.FILL_BOTH);
|
GridData gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.widthHint = 255;
|
gd.widthHint = 255;
|
||||||
table.setLayoutData(gd);
|
table.setLayoutData(gd);
|
||||||
|
@ -171,10 +171,11 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
*/
|
*/
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
int index = table.getSelectionIndex();
|
int index = table.getSelectionIndex();
|
||||||
|
int[] ids = table.getSelectionIndices();
|
||||||
boolean canAdd = langTree.getItemCount() > 0;
|
boolean canAdd = langTree.getItemCount() > 0;
|
||||||
boolean canExport = index != -1;
|
boolean canExport = index != -1;
|
||||||
boolean canEdit = canExport;
|
boolean canEdit = canExport && ids.length == 1;
|
||||||
boolean canDelete = canEdit;
|
boolean canDelete = canExport;
|
||||||
if (canExport) {
|
if (canExport) {
|
||||||
ICLanguageSettingEntry ent = (ICLanguageSettingEntry)(table.getItem(index).getData());
|
ICLanguageSettingEntry ent = (ICLanguageSettingEntry)(table.getItem(index).getData());
|
||||||
if (ent.isBuiltIn() || ent.isReadOnly()) canEdit = false;
|
if (ent.isBuiltIn() || ent.isReadOnly()) canEdit = false;
|
||||||
|
@ -346,6 +347,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
ICLanguageSettingEntry ent;
|
ICLanguageSettingEntry ent;
|
||||||
ICLanguageSettingEntry old;
|
ICLanguageSettingEntry old;
|
||||||
int n = table.getSelectionIndex();
|
int n = table.getSelectionIndex();
|
||||||
|
int ids[] = table.getSelectionIndices();
|
||||||
|
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0: // add
|
case 0: // add
|
||||||
|
@ -377,19 +379,23 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
break;
|
break;
|
||||||
case 2: // delete
|
case 2: // delete
|
||||||
if (n == -1) return;
|
if (n == -1) return;
|
||||||
old = (ICLanguageSettingEntry)(table.getItem(n).getData());
|
for (int x=ids.length-1; x>=0; x--) {
|
||||||
if (old.isReadOnly()) return;
|
old = (ICLanguageSettingEntry)(table.getItem(ids[x]).getData());
|
||||||
incs.remove(old);
|
if (old.isReadOnly()) continue;
|
||||||
|
incs.remove(old);
|
||||||
|
}
|
||||||
setSettingEntries(getKind(), incs, false);
|
setSettingEntries(getKind(), incs, false);
|
||||||
update();
|
update();
|
||||||
break;
|
break;
|
||||||
case 3: // toggle export
|
case 3: // toggle export
|
||||||
if (n == -1) return;
|
if (n == -1) return;
|
||||||
old = (ICLanguageSettingEntry)(table.getItem(n).getData());
|
for (int x=ids.length-1; x>=0; x--) {
|
||||||
if (exported.contains(old)) {
|
old = (ICLanguageSettingEntry)(table.getItem(ids[x]).getData());
|
||||||
deleteExportSetting(old);
|
if (exported.contains(old)) {
|
||||||
} else {
|
deleteExportSetting(old);
|
||||||
page.getResDesc().getConfiguration().createExternalSetting(new String[] {lang.getId()}, null, null, new ICLanguageSettingEntry[] {old});
|
} else {
|
||||||
|
page.getResDesc().getConfiguration().createExternalSetting(new String[] {lang.getId()}, null, null, new ICLanguageSettingEntry[] {old});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateExport();
|
updateExport();
|
||||||
update();
|
update();
|
||||||
|
|
Loading…
Add table
Reference in a new issue