| Summary: | [CTabItem] Styling the unfocused state | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Markus Wolf <markus> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Markus Wolf
In RCP, the CTabFolder colors are set by the workbench theme. If you're looking for a way to style the CTabFolders of active and inactive parts, you should use the workbench theming, not the RWT theming. See the extension point org.eclipse.ui.themes and search the Eclipse help for "theme". I don't think it makes sense to style a CTabFolder differently related to its focused state, since usually an active CTabFolder will not have the focus itself but any of its child controls. Please reopen and explain your use case if you disagree. The simple use case we have is that we do not use the workbench but an RWT only application.
Currently we style this with internal API like its done in the workbench code:
// XXX: This is hack and uses internal api
// It is used to track the active perspective part
ActivateEvent.addListener(this.tabFolder, new ActivateAdapter() {
@Override
public void activated(final ActivateEvent event) {
ViewPlaceholder.this.perspective.onActivatePlaceholder(ViewPlaceholder.this);
}
});
This is quite hacky and we could like to replace this with an official way.
Is that enough use case? ;)
Part activation is a Workbench concept and has nothing to do with the keyboard focus of the CTabFolder - actually, the CTabFolder does not even take the keyboard focus but one of its children does. We can not reflect the active Workbench part in the RWT theming. The unfocused state on Tree and Table is different as it really relates to the keyboard focus state of this widget. You should be able to use Workbench theming for your purpose. (In reply to comment #3) > You should be able to use Workbench theming for your purpose. Sorry, I forgot that you don't use the workbench. But in your case you could set a custom variant in an activate listener to your CTabFolder. You can use this variant to distinguish active from inactive parts in your CSS. Regarding the use of internal API, have you tried to use CTabFolder#addListener with SWT.Activate? Thank you. Useing addListener works well. :) That removed the hack and I'm fine with this now. |