Skip to content

Commit d6c80a4

Browse files
committed
Provide an option to disable the search dialog via Strg-F on list and tables #1830
add SWT.NO_SEARCH flag used in Table, Tree and List to prevent the interactive search (popup) in a GTK environment when set to true.
1 parent da081e9 commit d6c80a4

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

binaries/org.eclipse.swt.gtk.linux.x86_64/.settings/.api_filters

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515
<message_argument value="IE"/>
1616
</message_arguments>
1717
</filter>
18+
<filter id="336658481">
19+
<message_arguments>
20+
<message_argument value="org.eclipse.swt.SWT"/>
21+
<message_argument value="NO_SEARCH"/>
22+
</message_arguments>
23+
</filter>
24+
<filter id="1141899266">
25+
<message_arguments>
26+
<message_argument value="3.130"/>
27+
<message_argument value="3.129"/>
28+
<message_argument value="NO_SEARCH"/>
29+
</message_arguments>
30+
</filter>
1831
</resource>
1932
<resource path="META-INF/MANIFEST.MF">
2033
<filter id="926941240">

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,19 @@ public class SWT {
15641564
*/
15651565
public static final int SEARCH = 1 << 7;
15661566

1567+
/**
1568+
* Style constant for disabling GTK interactive search popup (value is 1&lt;&lt;10).
1569+
* <p><b>Used By:</b></p>
1570+
* <ul>
1571+
* <li><code>List</code></li>
1572+
* <li><code>Table</code></li>
1573+
* <li><code>Tree</code></li>
1574+
* </ul>
1575+
*
1576+
* @since 3.130
1577+
*/
1578+
public static final int NO_SEARCH = 1 << 10;
1579+
15671580
/**
15681581
* Style constant for simple (not drop down) behavior (value is 1&lt;&lt;6).
15691582
* <br>Note that this is a <em>HINT</em>.

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* when a string is selected. A list may be single or multi select.
2929
* <dl>
3030
* <dt><b>Styles:</b></dt>
31-
* <dd>SINGLE, MULTI</dd>
31+
* <dd>SINGLE, MULTI, NO_SEARCH</dd>
3232
* <dt><b>Events:</b></dt>
3333
* <dd>Selection, DefaultSelection</dd>
3434
* </dl>
@@ -258,6 +258,9 @@ void createHandle (int index) {
258258
if ((getShell ().style & SWT.ON_TOP) != 0) {
259259
GTK.gtk_tree_view_set_search_column (handle, -1);
260260
}
261+
if ((style & SWT.NO_SEARCH) != 0) {
262+
GTK.gtk_tree_view_set_search_column(handle, -1);
263+
}
261264
// In GTK 3 font description is inherited from parent widget which is not how SWT has always worked,
262265
// reset to default font to get the usual behavior
263266
setFontDescription(defaultFont().handle);

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* </p>
6060
* <dl>
6161
* <dt><b>Styles:</b></dt>
62-
* <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION, VIRTUAL, NO_SCROLL</dd>
62+
* <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION, VIRTUAL, NO_SCROLL, NO_SEARCH</dd>
6363
* <dt><b>Events:</b></dt>
6464
* <dd>Selection, DefaultSelection, SetData, MeasureItem, EraseItem, PaintItem</dd>
6565
* </dl>
@@ -3247,8 +3247,8 @@ void reskinChildren (int flags) {
32473247
}
32483248

32493249
boolean searchEnabled () {
3250-
/* Disable searching when using VIRTUAL */
3251-
if ((style & SWT.VIRTUAL) != 0) return false;
3250+
/* Disable searching when using VIRTUAL or NO_SEARCH */
3251+
if ((style & SWT.VIRTUAL) != 0 || (style & SWT.NO_SEARCH) != 0) return false;
32523252
return true;
32533253
}
32543254

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* </p>
6868
* <dl>
6969
* <dt><b>Styles:</b></dt>
70-
* <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, VIRTUAL, NO_SCROLL</dd>
70+
* <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, VIRTUAL, NO_SCROLL, NO_SEARCH</dd>
7171
* <dt><b>Events:</b></dt>
7272
* <dd>Selection, DefaultSelection, Collapse, Expand, SetData, MeasureItem, EraseItem, PaintItem, EmptinessChanged</dd>
7373
* </dl>
@@ -3449,8 +3449,8 @@ void reskinChildren (int flags) {
34493449
super.reskinChildren (flags);
34503450
}
34513451
boolean searchEnabled () {
3452-
/* Disable searching when using VIRTUAL */
3453-
if ((style & SWT.VIRTUAL) != 0) return false;
3452+
/* Disable searching when using VIRTUAL or NO_SEARCH */
3453+
if ((style & SWT.VIRTUAL) != 0 || (style & SWT.NO_SEARCH) != 0) return false;
34543454
return true;
34553455
}
34563456
/**

0 commit comments

Comments
 (0)