Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Modifying SWT look and feel for disabled elements
Modifying SWT look and feel for disabled elements [message #1082139] Thu, 08 August 2013 06:09 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I've shown our customer a first version of what the user interface of their new application might look like. They liked most of it but we will have several situations where users will have read only rights for certain forms and our customer found that the grey labels and grey field text on white background was on the one hand not easy to read on some screens and also not distinctly "disabled" enough for their taste.

I am now wondering about a few things to improve this:

  • is it easily possible to assign a different foreground and/or background colour to a field in disabled state?
  • is it possible to not have the label "greyed out" for disabled fields?


Is there a way to "configure" the SWT look and feel to take the above into consideration? Or is my only solution to extend the SwtScout*Field classes? If the latter, any hints on what methods to overwrite?
Re: Modifying SWT look and feel for disabled elements [message #1085093 is a reply to message #1082139] Mon, 12 August 2013 12:47 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 128
Registered: March 2010
Senior Member
Hi Urs

You can use the look&feel extension point to adjust the foreground color. Just add it to the plugin.xml of your swt plugin.

<extension point="org.eclipse.scout.rt.ui.swt.lookAndFeel">
  <properties
        scope="global">
     <property
           name="color.forground.disabled"
           value="ff0000">
     </property>
  </properties>
</extension>


At the moment it always uses the same color for the label and the field itself. To change it you may extend StatusLabelEx. See ScoutFormToolkit#createStatusLabel.

Adjusting the background color is not possible yet, but there's already a bug raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=407261

Hope it helps
Claudio
Re: Modifying SWT look and feel for disabled elements [message #1089821 is a reply to message #1085093] Mon, 19 August 2013 09:38 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Claudio

Thanks, this works for the foreground colour, I'll have a look at separating the label colour.

I assume that the patch provided for the background colour in may was not integrated into Scout 3.9.0, is there any way to find out, when it might be integrated?
Re: Modifying SWT look and feel for disabled elements [message #1089831 is a reply to message #1089821] Mon, 19 August 2013 09:51 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
I've just looked at StatusLabelEx and it's obvious how I would need to change it customize the label representation for disabled state.

However, I'm not sure what extension point to use to replace this class? Which leads me to a general question:

-> is there a way to find all the existing scout extension points or to find the extension point to replace a specific class?
-> similarly, is there a way to find all the supported SWT look and feel properties?
Re: Modifying SWT look and feel for disabled elements [message #1090648 is a reply to message #1089831] Tue, 20 August 2013 12:51 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 128
Registered: March 2010
Senior Member
Hi Urs

Quote:

-> is there a way to find all the existing scout extension points or to find the extension point to replace a specific class?
-> similarly, is there a way to find all the supported SWT look and feel properties?

Both is possible by using the eclipse editor:
index.php/fa/15952/0/

To replace the statusLabel you need to register a custom ScoutFormToolkit. This can be done by overriding createScoutFormToolkit of your SwtEnvironment. There is no extension point available.

Regarding the open ticket: I don't know when it is planned for. You may vote if you need it and also add yourself to the cc list. Both can be done on the ticket itself.

Best regards
Claudio

[Updated on: Tue, 20 August 2013 12:53]

Report message to a moderator

Re: Modifying SWT look and feel for disabled elements [message #1090697 is a reply to message #1090648] Tue, 20 August 2013 14:13 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Thanks Claudio, I should have thought about the eclipse editor (what do they say about trees and forests? Wink

Thanks also for the hint about createScoutFormToolkit, I'll try this out and I will go and vote on the background ticket.
Re: Modifying SWT look and feel for disabled elements [message #1108276 is a reply to message #1089821] Fri, 13 September 2013 16:06 Go to previous messageGo to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Urs Beeli wrote on Mon, 19 August 2013 05:38
I assume that the patch provided for the background colour in may was not integrated into Scout 3.9.0, is there any way to find out, when it might be integrated?


Urs, I targeted and resolved bug 407261 for Scout 3.10 Luna M2. Since this is a new feature that is necessary for one of our Scout 3.8 projects, I backported this feature to Scout 3.8.3. However, I don't have to intention to backport it to Scout 3.9, unless you need this feature for Scout 3.9. In this case I could commit the change for Kepler SR2 (but not for Kepler SR1 that will be released in the two upcoming week).
Re: Modifying SWT look and feel for disabled elements [message #1109949 is a reply to message #1108276] Mon, 16 September 2013 06:56 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Ken, thanks for the update. I will need to have a look at the various milestones and discuss this in our project to see if Luna M2 is ok for us or if we need it in Kepler SR2. Should we need it in Kepler, I'll let you know.
Re: Modifying SWT look and feel for disabled elements [message #1111002 is a reply to message #1109949] Tue, 17 September 2013 16:25 Go to previous message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Urs Beeli wrote on Mon, 16 September 2013 02:56
Should we need it in Kepler, I'll let you know.


Sure, just write it into the bugzilla ticket.


Previous Topic:Call Scout Service from webpage
Next Topic:New project wizard doesn't create all assets
Goto Forum:
  


Current Time: Sun Dec 21 16:41:12 GMT 2014

Powered by FUDForum. Page generated in 0.01971 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software