How to assign disabled state icon?

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to assign disabled state icon?

Postby ryan_dunn » Fri Mar 26, 2010 7:30 am

The Eclipse UI Guidelines (http://wiki.eclipse.org/User_Interface_Guidelines) suggest creating disabled states for icons (Guideline 2.5). How do I assign a disabled state icon to a button, image hyperlink, or any other control?

Thanks,
Ryan
ryan_dunn
 
Posts: 9
Joined: Thu Nov 12, 2009 7:35 am

Re: How to assign disabled state icon?

Postby Eric Clayberg » Fri Mar 26, 2010 7:57 am

When you disable the widget, change its icon as well.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: How to assign disabled state icon?

Postby ryan_dunn » Fri Mar 26, 2010 9:06 am

Ok, that's what I figured. I just wanted to be sure I wasn't missing something. It would be nice if widgets had a disabledImage property that it would use on it's own. I guess if I need it that bad, I can just create a custom widget.
ryan_dunn
 
Posts: 9
Joined: Thu Nov 12, 2009 7:35 am

Re: How to assign disabled state icon?

Postby Eric Clayberg » Fri Mar 26, 2010 1:00 pm

If that property existed, it would already show up in SWT Designer.

You should make that suggestion on the Eclipse SWT newsgroup.

Creating your own custom subclass would be very easy as well.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: How to assign disabled state icon?

Postby ryan_dunn » Fri Mar 26, 2010 1:25 pm

After looking at it a bit more, I think what I ultimately want to do is have a button that is linked to an Action or a Command. Actions have a disabled image discriptor, so I'm not sure how they manage the enabled state of the button. It seems when you setEnabled to false, it always applies a gray filter to your icon. Any tips on using Actions or Commands in a forms API based editor?
ryan_dunn
 
Posts: 9
Joined: Thu Nov 12, 2009 7:35 am

Re: How to assign disabled state icon?

Postby ryan_dunn » Fri Mar 26, 2010 1:46 pm

Eric Clayberg wrote:If that property existed, it would already show up in SWT Designer.

You should make that suggestion on the Eclipse SWT newsgroup.

Creating your own custom subclass would be very easy as well.


It looks like IBM has one already, an SButton. http://publib.boulder.ibm.com/infocente ... utton.html
ryan_dunn
 
Posts: 9
Joined: Thu Nov 12, 2009 7:35 am

Re: How to assign disabled state icon?

Postby Eric Clayberg » Fri Mar 26, 2010 1:59 pm

Very good!
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests