Lines 1234-1241
Link Here
|
1234 |
} |
1234 |
} |
1235 |
} |
1235 |
} |
1236 |
if (index < 0 || index >= count) return; |
1236 |
if (index < 0 || index >= count) return; |
1237 |
setSelection (index, true); |
1237 |
if (setSelection (index, true)) forceFocus(); |
1238 |
forceFocus(); |
|
|
1239 |
} |
1238 |
} |
1240 |
} |
1239 |
} |
1241 |
void onDispose(Event event) { |
1240 |
void onDispose(Event event) { |
Lines 1306-1313
Link Here
|
1306 |
if (mnemonic != '\0') { |
1305 |
if (mnemonic != '\0') { |
1307 |
if (Character.toLowerCase (key) == mnemonic) { |
1306 |
if (Character.toLowerCase (key) == mnemonic) { |
1308 |
if (doit) { |
1307 |
if (doit) { |
1309 |
setSelection(i, true); |
1308 |
if (setSelection(i, true)) forceFocus(); |
1310 |
forceFocus(); |
|
|
1311 |
} |
1309 |
} |
1312 |
return true; |
1310 |
return true; |
1313 |
} |
1311 |
} |
Lines 1409-1415
Link Here
|
1409 |
int index = indexOf(item); |
1407 |
int index = indexOf(item); |
1410 |
if (item.showing){ |
1408 |
if (item.showing){ |
1411 |
int oldSelectedIndex = selectedIndex; |
1409 |
int oldSelectedIndex = selectedIndex; |
1412 |
setSelection(index, true); |
1410 |
if (!setSelection(index, true)) return; |
1413 |
if (oldSelectedIndex == selectedIndex) { |
1411 |
if (oldSelectedIndex == selectedIndex) { |
1414 |
/* If the click is on the selected tabitem, then set focus to the tabfolder */ |
1412 |
/* If the click is on the selected tabitem, then set focus to the tabfolder */ |
1415 |
forceFocus(); |
1413 |
forceFocus(); |
Lines 2711-2717
Link Here
|
2711 |
showItem(selection); |
2709 |
showItem(selection); |
2712 |
redraw(); |
2710 |
redraw(); |
2713 |
} |
2711 |
} |
2714 |
void setSelection(int index, boolean notify) { |
2712 |
boolean setSelection(int index, boolean notify) { |
|
|
2713 |
if (notify && selectedIndex != index && index != -1) { |
2714 |
Event event = new Event(); |
2715 |
event.detail = selectedIndex; |
2716 |
event.item = getItem(index); |
2717 |
event.index = index; |
2718 |
notifyListeners(SWT.PreSelection, event); |
2719 |
if (!event.doit) return false; |
2720 |
} |
2721 |
|
2715 |
int oldSelectedIndex = selectedIndex; |
2722 |
int oldSelectedIndex = selectedIndex; |
2716 |
setSelection(index); |
2723 |
setSelection(index); |
2717 |
if (notify && selectedIndex != oldSelectedIndex && selectedIndex != -1) { |
2724 |
if (notify && selectedIndex != oldSelectedIndex && selectedIndex != -1) { |
Lines 2719-2724
Link Here
|
2719 |
event.item = getItem(selectedIndex); |
2726 |
event.item = getItem(selectedIndex); |
2720 |
notifyListeners(SWT.Selection, event); |
2727 |
notifyListeners(SWT.Selection, event); |
2721 |
} |
2728 |
} |
|
|
2729 |
return true; |
2722 |
} |
2730 |
} |
2723 |
/** |
2731 |
/** |
2724 |
* Sets the receiver's selection background color to the color specified |
2732 |
* Sets the receiver's selection background color to the color specified |