Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "E4/CSS/SWT Mapping"
Line 34: | Line 34: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td> | + | <td>setCursor(Cursor)</td> |
<td>cursor</td> | <td>cursor</td> | ||
<td>Shell { cursor:crosshair }</td> | <td>Shell { cursor:crosshair }</td> | ||
Line 127: | Line 127: | ||
<th>CSS Pseudo Selector</th> | <th>CSS Pseudo Selector</th> | ||
<th>CSS Example</th> | <th>CSS Example</th> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 162: | Line 147: | ||
<td>:disabled</td> | <td>:disabled</td> | ||
<td>Text:disabled { background-color: ##FF0000; } | <td>Text:disabled { background-color: ##FF0000; } | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Shell</td> | ||
+ | <td>:active</td> | ||
+ | <td>Shell:active { background-color: ##FF0000; } | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Button</td> | ||
+ | <td>:checked</td> | ||
+ | <td>Button:checked { background-color: ##FF0000; } | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>CTabFolder</td> | ||
+ | <td>:selected</td> | ||
+ | <td>CTabFolder:selected { background-color: ##FF0000; } | ||
</tr> | </tr> | ||
</table> | </table> |
Revision as of 12:45, 6 March 2009
How to style SWT widgets using CSS
Widget: Control
SWT Method | CSS Property Name | CSS Example |
---|---|---|
setBackground(Color) | background-color | Button { background-color: #FF0000 } |
setBackgroundImage(Image) | background-image | Button { background-image: some url } |
border-color | Button { border-color: ##FF0000; } | |
border-width | Button { border-width: 3 } | |
border-style | Button { border-style: dotted } | |
setCursor(Cursor) | cursor | Shell { cursor:crosshair } |
setFont(Font) | font-style font-size |
Label { font-style: italic; font-size: 12; |
setForeground(Color) | color | Button { color: #FF0000 } |
Widget: CTabFolder
SWT Method | CSS Property Name | CSS Example |
---|---|---|
setBorderVisible(Boolean) | border-visible | CTabFolder { border-visible: true } |
setMaximized(Boolean) | maximized | CTabFolder { maximized: true } |
setMinimized(Boolean) | minimized | CTabFolder { minimized: true } |
setMaximizeVisible(Boolean) | maximize-visible | CTabFolder { maximize-visible: true } |
setMinimizeVisible(Boolean) | minimize-visible | CTabFolder { minimize-visible: true } |
setMRUVisible(Boolean) | mru-visible | CTabFolder { mru-visible: true } |
setShowClose(Boolean) | show-close | CTabFolder { show-close: true } |
setSimple(Boolean) | simple | CTabFolder { simple: true } |
setSingle(Boolean) | single | CTabFolder { single: true } |
setUnselectedCloseVisible(Boolean) | unselected-close-visible | CTabFolder { unselected-close-visible: true } |
setUnselectedImageVisible(Boolean) | unselected-image-visible | CTabFolder { unselected-image-visible: true } |
Pseudo classes which can be used in CSS to style SWT widgets
SWT Widgets | CSS Pseudo Selector | CSS Example |
---|---|---|
Control | :focus | CTabFolder:focus { background-color: ##FF0000; } |
Control | :visible | Shell:visible { background-color: ##FF0000; } |
Control | :enabled | Text:enabled { background-color: ##FF0000; } |
Control | :disabled | Text:disabled { background-color: ##FF0000; } |
Shell | :active | Shell:active { background-color: ##FF0000; } |
Button | :checked | Button:checked { background-color: ##FF0000; } |
CTabFolder | :selected | CTabFolder:selected { background-color: ##FF0000; } |