mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +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);
|
||||
|
||||
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);
|
||||
gd.widthHint = 255;
|
||||
table.setLayoutData(gd);
|
||||
|
@ -171,10 +171,11 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
*/
|
||||
protected void updateButtons() {
|
||||
int index = table.getSelectionIndex();
|
||||
int[] ids = table.getSelectionIndices();
|
||||
boolean canAdd = langTree.getItemCount() > 0;
|
||||
boolean canExport = index != -1;
|
||||
boolean canEdit = canExport;
|
||||
boolean canDelete = canEdit;
|
||||
boolean canEdit = canExport && ids.length == 1;
|
||||
boolean canDelete = canExport;
|
||||
if (canExport) {
|
||||
ICLanguageSettingEntry ent = (ICLanguageSettingEntry)(table.getItem(index).getData());
|
||||
if (ent.isBuiltIn() || ent.isReadOnly()) canEdit = false;
|
||||
|
@ -346,7 +347,8 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
ICLanguageSettingEntry ent;
|
||||
ICLanguageSettingEntry old;
|
||||
int n = table.getSelectionIndex();
|
||||
|
||||
int ids[] = table.getSelectionIndices();
|
||||
|
||||
switch (i) {
|
||||
case 0: // add
|
||||
toAllCfgs = false;
|
||||
|
@ -377,19 +379,23 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
break;
|
||||
case 2: // delete
|
||||
if (n == -1) return;
|
||||
old = (ICLanguageSettingEntry)(table.getItem(n).getData());
|
||||
if (old.isReadOnly()) return;
|
||||
incs.remove(old);
|
||||
for (int x=ids.length-1; x>=0; x--) {
|
||||
old = (ICLanguageSettingEntry)(table.getItem(ids[x]).getData());
|
||||
if (old.isReadOnly()) continue;
|
||||
incs.remove(old);
|
||||
}
|
||||
setSettingEntries(getKind(), incs, false);
|
||||
update();
|
||||
break;
|
||||
case 3: // toggle export
|
||||
if (n == -1) return;
|
||||
old = (ICLanguageSettingEntry)(table.getItem(n).getData());
|
||||
if (exported.contains(old)) {
|
||||
deleteExportSetting(old);
|
||||
} else {
|
||||
page.getResDesc().getConfiguration().createExternalSetting(new String[] {lang.getId()}, null, null, new ICLanguageSettingEntry[] {old});
|
||||
for (int x=ids.length-1; x>=0; x--) {
|
||||
old = (ICLanguageSettingEntry)(table.getItem(ids[x]).getData());
|
||||
if (exported.contains(old)) {
|
||||
deleteExportSetting(old);
|
||||
} else {
|
||||
page.getResDesc().getConfiguration().createExternalSetting(new String[] {lang.getId()}, null, null, new ICLanguageSettingEntry[] {old});
|
||||
}
|
||||
}
|
||||
updateExport();
|
||||
update();
|
||||
|
|
Loading…
Add table
Reference in a new issue