Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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 1: | Line 1: | ||
+ | <font size="4" face="Times">How to style SWT widgets using CSS</font> | ||
+ | <br><br> | ||
<table cellpadding="10" border="1"> | <table cellpadding="10" border="1"> | ||
<tr> | <tr> | ||
Line 127: | Line 129: | ||
</tr> | </tr> | ||
</table> | </table> | ||
− | < | + | <br><br><br><br> |
− | <table> | + | <font size="4" face="Times">Pseudo classes which can be used in CSS to style SWT widgets</font> |
+ | <br><br> | ||
+ | <table cellpadding="10" border="1"> | ||
<tr> | <tr> | ||
<th>SWT Widgets</th> | <th>SWT Widgets</th> | ||
− | |||
<th>CSS Pseudo Selector</th> | <th>CSS Pseudo Selector</th> | ||
<th>CSS Example</th> | <th>CSS Example</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>CTabFolder</td> | ||
+ | <td>:selected</td> | ||
+ | <td>CTabFolder:selected { background-color: ##FF0000; } | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>Shell</td> | ||
+ | <td>:active</td> | ||
+ | <td>Shell:active { background-color: ##FF0000; } | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>any control</td> | ||
+ | <td>:focus</td> | ||
+ | <td>CTabFolder:focus { background-color: ##FF0000; } | ||
</tr> | </tr> | ||
</table> | </table> |
Revision as of 15:52, 25 February 2009
How to style SWT widgets using CSS
SWT Widgets | SWT Method | CSS Property Name | CSS Example |
---|---|---|---|
any control | setBackground(Color) | background-color | Button { background-color: #FF0000 } |
any control | setBackgroundImage(Image) | background-image | Button { background-image: some url } |
any control | border-color | Button { border-color: ##FF0000; } | |
any control | border-width | Button { border-width: 3 } | |
any control | border-style | Button { border-style: dotted } | |
any control | setCurosr(Cursor) | cursor | Shell { cursor:crosshair } |
any control | setFont(Font) | font-style font-size |
Label { font-style: italic; font-size: 12; |
any control | setForeground(Color) | color | Button { color: #FF0000 } |
CTabFolder | setBorderVisible(Boolean) | borderVisible | CTabFolder { borderVisible: true } |
CTabFolder | setMaximized(Boolean) | maximized | CTabFolder { maximized: true } |
CTabFolder | setMinimized(Boolean) | minimized | CTabFolder { minimized: true } |
CTabFolder | setMaximizeVisible(Boolean) | maximizeVisible | CTabFolder { maximizeVisible: true } |
CTabFolder | setMinimizeVisible(Boolean) | minimizeVisible | CTabFolder { minimizeVisible: true } |
CTabFolder | setMRUVisible(Boolean) | mruVisible | CTabFolder { mruVisible: true } |
CTabFolder | setShowClose(Boolean) | showClose | CTabFolder { showClose: true } |
CTabFolder | setSimple(Boolean) | simple | CTabFolder { simple: true } |
CTabFolder | setSingle(Boolean) | single | CTabFolder { single: true } |
CTabFolder | setUnselectedCloseVisible(Boolean) | unselectedCloseVisible | CTabFolder { unselectedCloseVisible: true } |
CTabFolder | setUnselectedImageVisible(Boolean) | unselectedImageVisible | CTabFolder { unselectedImageVisible: true } |
Pseudo classes which can be used in CSS to style SWT widgets
SWT Widgets | CSS Pseudo Selector | CSS Example |
---|---|---|
CTabFolder | :selected | CTabFolder:selected { background-color: ##FF0000; } |
Shell | :active | Shell:active { background-color: ##FF0000; } |
any control | :focus | CTabFolder:focus { background-color: ##FF0000; } |