NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Change Topcomponent tab color

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Wim de Jong



Joined: 01 Jun 2011
Posts: 2

PostPosted: Fri Jun 03, 2011 4:44 pm    Post subject: Change Topcomponent tab color Reply with quote

Hi all, i'm pretty new at the netbeans platform and using the 6.9.1 IDE.

Let's say i place 5 instances of a topcomponent in editor mode. Because we will only see the screen of the topcomponent which is currently on top, i want to change the color of the other tab(s) to red, to tell the user that there occur some error in one of more instances of the topcomponent.

I'm searching the internet for some time now, but never found a clear answer to my question: Is it possible to change the tabcolor of a topcomponent?

Any help is welcome.
Back to top
Tim Boudreau
Posted via mailing list.





PostPosted: Tue Jun 07, 2011 12:46 pm    Post subject: [platform-dev] Re: Change Topcomponent tab color Reply with quote

On Fri, Jun 3, 2011 at 12:44 PM, Wim de Jong <address-removed> wrote:
Quote:
Hi all, i'm  pretty new at the netbeans platform and using the 6.9.1 IDE.

Let's say i place 5 instances of a topcomponent in editor mode. Because we will only see the screen of the topcomponent which is currently on top, i want to change the color of the other tab(s) to red, to tell the user that there occur some error in one of more instances of the topcomponent.

I'm searching the internet for some time now, but never found a clear answer to my question: Is it possible to change the tabcolor of a topcomponent?

Any help is welcome.

No. You can set it globally for the all tab controls in the VM; that's all.

A few things that you can do, though:
- Use HTML in the display name to turn the text red (fire a property
change from your TC when an error is found, and again when it is
cleared)
- Use an error badge image (like the X on the source files with
errors in the IDE), such as is used for source files in the IDE - see
ImageUtilities.mergeImages() for how to make an image with your error
badge over your regular icon (and again, fire a change when the status
changes)
- Use TopComponent.requestAttention(true) to make tabs with errors
blink a few times

-Tim
Back to top
Wim de Jong



Joined: 01 Jun 2011
Posts: 2

PostPosted: Tue Jun 07, 2011 6:55 pm    Post subject: Re: [platform-dev] Re: Change Topcomponent tab color Reply with quote

Tim Boudreau wrote:
On Fri, Jun 3, 2011 at 12:44 PM, Wim de Jong <address-removed> wrote:
Quote:
Hi all, i'm  pretty new at the netbeans platform and using the 6.9.1 IDE.

Let's say i place 5 instances of a topcomponent in editor mode. Because we will only see the screen of the topcomponent which is currently on top, i want to change the color of the other tab(s) to red, to tell the user that there occur some error in one of more instances of the topcomponent.

I'm searching the internet for some time now, but never found a clear answer to my question: Is it possible to change the tabcolor of a topcomponent?

Any help is welcome.

No. You can set it globally for the all tab controls in the VM; that's all.

A few things that you can do, though:
- Use HTML in the display name to turn the text red (fire a property
change from your TC when an error is found, and again when it is
cleared)
- Use an error badge image (like the X on the source files with
errors in the IDE), such as is used for source files in the IDE - see
ImageUtilities.mergeImages() for how to make an image with your error
badge over your regular icon (and again, fire a change when the status
changes)
- Use TopComponent.requestAttention(true) to make tabs with errors
blink a few times

-Tim


Hi Tim, thank you very much for you help. I wasn't aware of those functions. I override the method getHtmlDisplayName() for changing the DisplayName color in combination with TopComponent.requestAttention(true). This works even better then where i was searching for.
@Wim
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo