CCombo Examples
The CCombo class represents a selectable user interface object that combines a text field and a list and issues notification when an item is selected from the list.
Alignment Snippet
CCombo with different text alignments
CComboAlignmentSnippet.java
Border Snippet
CCombo with different border styles
CComboBorderSnippet.java
Colors Snippet
CCombo with custom colors
CComboColorsSnippet.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
Dark Theme Snippet
CCombo under a dark theme, with and without application-supplied colors.
A themed application colors its own controls, handing each one a color it read from
Display#getSystemColor. Every row is the same CCombo; only where its background and
foreground come from differs. Open each dropdown and compare the closed field, the
dropdown panel and the item text against each other and against the dark surface.
CComboDarkThemeSnippet.java
Editable Snippet
CCombo Editable - Shows editable CCombo where user can type custom text
Key difference: Regular Combo READ_ONLY can't be made editable on all platforms
CCombo allows switching between editable and read-only at runtime
CComboEditableSnippet.java
Keyboard Snippet
Drives a READ_ONLY and an editable CCombo from the keyboard, reached with Tab. Alt+Down opens the
list; moving with Down and pressing Enter puts the item into the text, fires Selection and closes
the list; Enter on the closed CCombo fires DefaultSelection. After every step the selection index,
text and list visibility are printed. Every event is printed with a [repro] prefix. Run with
{@code --drive} to send the keys with java.awt.Robot. For the native baseline, call
Config.defaultToEclipse() in place of the useEquo lines and run it with runEmbedExample.
CComboKeyboardSnippet.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
Modify Snippet
When a CCombo fires Modify, getText() already returns the new text. The listener prints getText()
for each Modify while the selection is changed from the keyboard and while text is typed. Every
event is printed with a [repro] prefix. Run with {@code --drive} to send the keys with
java.awt.Robot. For the native baseline, call
Config.defaultToEclipse() in place of the useEquo lines and run it with runEmbedExample.
CComboModifySnippet.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
Pinned Width Snippet
CCombo values at widths the application pins, the way a toolbar contribution does.
Each row pins a width through RowData and selects the value that has to survive it. The
value must be readable in full at every pinned width, exactly as a native CCombo shows it.
The last row pins nothing, so the combo takes its own preferred width.
Toggle Config.useEclipse(CCombo.class) below to compare against native SWT.
CComboPinnedWidthSnippet.java
Tooltip Snippet
CCombo per-item tooltips (issue #610): tooltip strings are delivered through
{@code setData("org.eclipse.swt.custom.CCombo.itemToolTips", String[])} and rendered by the
Flutter dropdown. Open the dropdown and hover an item to see its documentation panel.








