Home » Eclipse Projects » Rich Client Platform (RCP) » How to change the appearance of an editor-tab
How to change the appearance of an editor-tab [message #528889] |
Thu, 22 April 2010 10:11 |
Rudi Missing name Messages: 17 Registered: July 2009 |
Junior Member |
|
|
Hello,
in my RCP-based app, there are multiple editors opened at the same time. Obviously just the content of the editor which has the focus is visible, the other editors are presented by a tab respectively, in the exact same manner as the code editors in Eclipse as an IDE.
The difference between the editors in my app and the code editors in Eclipse as an IDE is, that the content of the editors is not just modified by the user across the GUI by selecting the correspondent editor-tab, it is also modified by background threads when the editor hasn't the focus. In order that the user has not to check every tab for changes by clicking on it, I would like to indicate the change of a hidden editor in some way, for example by changing the font of the tab (size, color, type) or even better by changing the background of the tab to red. For example the console view of the Eclipse IDE does exactly this: when it is in the background and its content changes, the font on the tab is changed to bold.
Could you please give me a hint, how I can solve my problem?
thank you in advance,
Rudi
|
|
| |
Re: How to change the appearance of an editor-tab [message #529143 is a reply to message #528955] |
Fri, 23 April 2010 08:15 |
Rudi Missing name Messages: 17 Registered: July 2009 |
Junior Member |
|
|
Hi Paul,
thank you for the fast reply.
First I must make an important correction on my problem, it dosn't concern editors, it concerns views. But the problem is still the same.
Based on your hints I tried to use the IWorkbenchSiteProgressService. Unfortunately the method warnOfContentChange() has no effect. So I tested some other methods from the IWorkbenchSiteProgressService. By executing the following code, I got a result:
Job job = new Job("myJob") {
@Override
protected IStatus run(IProgressMonitor monitor) {
long now = System.currentTimeMillis();
while (System.currentTimeMillis() < now + 10000)
;
return Status.OK_STATUS;
}
};
job.setUser(true);
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService)this.getSite().getService(IWorkbenchSiteProgressService.class);
service.schedule(job);
Whith this code, the font of the tab of the respective view changes to italic, and after the job terminates it changes back to standard. This could be a solution, but the effect is to few, that is to say the user will not notice this change, the font should at least change the color or even better, the whole tab should change the color or start blinking.
If this is the way to go, could you please give me a hint, how I can have an impact on the change of the tab?
By searching the internet for this problem, I encountered the constant IPresentablePart.PROP_HIGHLIGHT_IF_BACK. I tried to execute firePropertyChange(IPresentablePart.PROP_HIGHLIGHT_IF_BACK) inside my view, but this has also no effect. Is it possible, that I must activate something on the IFolderLayout which contains my views, in order that PROP_HIGHLIGHT_IF_BACK has an effect?
I hope on your help, because this is an important requirement for me, or rather our customer
Thank you,
Rudi
|
|
| |
Re: How to change the appearance of an editor-tab [message #529797 is a reply to message #529230] |
Tue, 27 April 2010 09:24 |
Rudi Missing name Messages: 17 Registered: July 2009 |
Junior Member |
|
|
Paul Webster wrote on Fri, 23 April 2010 10:12 |
That fires firePropertyChange(IPresentablePart.PROP_HIGHLIGHT_IF_BACK);
which in the default presentation bolds the tab.
Just like if the Console view receives output while it's not on top.
|
Hi Paul,
this is exactly what I'm looking for. I have just one more problem. In my App all tabs of views and editors have already a bold font, so this mechanism dosn't work. Apart from this, the effect of changeing the font to bold is to few, because the user will not notice this change.
Is it possible to change the type of presentation, which is used to allert the user by firePropertyChange(IPresentablePart.PROP_HIGHLIGHT_IF_BACK) , for example instead of changeing the font to bold I would like that at least the font changes to a different color. Or even better, that the background of the whole tab changes. Do you have one more hint?
Thank you in advance,
Rudi
|
|
| | |
Goto Forum:
Current Time: Thu Sep 19 11:25:18 GMT 2024
Powered by FUDForum. Page generated in 0.04386 seconds
|