Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [databinding] ControlDecorationSupport idea
[databinding] ControlDecorationSupport idea [message #22945] Wed, 22 July 2009 19:31 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
I'm experimenting with ControlDecorationSupport and it is quite handy! I
created a custom ControlDecorationUpdater because I wanted the feature for
required fields that:
- uses "FieldDecorationRegistry.DEC_REQUIRED" the first time
- uses "FieldDecorationRegistry.DEC_ERROR" if the status goes ok and then
back to error

This is a good practice for wizards, etc so users doesn't see a glaring red
X before they even have a chance to provide a value. To do this, I had to
override update() instead of getImage() because I needed access to the
decoration.

new ControlDecorationUpdater() {
protected void update(ControlDecoration decoration,
IStatus status) {
if (status == null || status.isOK()) {
decoration.hide();
} else {
if (decoration.getImage() == null
&& status instanceof RequiredStatus)
{ // my custom error IStatus
decoration
.setImage(FieldDecorationRegistry
.getDefault()
.getFieldDecoration(
FieldDecorationRegistry.DEC_REQUIRED).getImage());
} else {
decoration.setImage(getImage(status));
}
decoration
.setDescriptionText(getDescriptionText(status));
decoration.show();
}
}
}

I'm mentioning this as a use case to provide feedback. Has anyone else done
something similar? Would this concept be useful to add to the framework
level (maybe through other means)?

-Will
Re: [databinding] ControlDecorationSupport idea [message #23319 is a reply to message #22945] Wed, 22 July 2009 21:52 Go to previous messageGo to next message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Will Horn wrote:
> I'm experimenting with ControlDecorationSupport and it is quite handy!
> I created a custom ControlDecorationUpdater because I wanted the feature
> for required fields that:
> - uses "FieldDecorationRegistry.DEC_REQUIRED" the first time
> - uses "FieldDecorationRegistry.DEC_ERROR" if the status goes ok and
> then back to error
I am with you Will. That really bugs me with Databinding too. You always
get to see the "X" error decoration before the user can enter a value.
All fields that require User input should marked as required first and
only after the user changed the control the marker should turn to error
or warning.

I filed a question about how to achieve that with databinding a few days
ago her in the group but the response was not satisfying.

Maybe you have more luck and post your results here.

Phil
Re: [databinding] ControlDecorationSupport idea [message #23450 is a reply to message #23319] Thu, 23 July 2009 06:48 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Philipp Kursawe wrote:
> I filed a question about how to achieve that with databinding a few days
> ago her in the group but the response was not satisfying.

I was pretty confused by your question, and wasn't really sure if I knew
what you were asking for. If you were asking about
ControlDecorationSupport, I can imagine my response was not that helpful.

Would you file a bug report in bugzilla for this? This behavior is
probably expected under the Eclipse UI guidelines anyway.

Matthew
Re: [databinding] ControlDecorationSupport idea [message #23492 is a reply to message #23450] Thu, 23 July 2009 08:49 Go to previous messageGo to next message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Matthew Hall wrote:
> Philipp Kursawe wrote:
>> I filed a question about how to achieve that with databinding a few
>> days ago her in the group but the response was not satisfying.
>
> I was pretty confused by your question, and wasn't really sure if I knew
> what you were asking for. If you were asking about
> ControlDecorationSupport, I can imagine my response was not that helpful.
>
> Would you file a bug report in bugzilla for this? This behavior is
> probably expected under the Eclipse UI guidelines anyway.
>
> Matthew

I am sorry if it was not clear in my question back then. The issue was,
that the user should not be hit by validation before he had a chance to
enter some data. And that means that he must have a chance to enter some
data into each field of a DataBindingContext before the the validator
turns from "required" to "error".

I have filee a bugreport and made screenshots.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=284384

Phil
Re: [databinding] ControlDecorationSupport idea [message #23535 is a reply to message #22945] Thu, 23 July 2009 08:50 Go to previous message
Philipp Kursawe is currently offline Philipp KursaweFriend
Messages: 135
Registered: July 2009
Senior Member
Will Horn wrote:
> I'm experimenting with ControlDecorationSupport and it is quite handy!
> I created a custom ControlDecorationUpdater because I wanted the feature
> for required fields that:
> - uses "FieldDecorationRegistry.DEC_REQUIRED" the first time
> - uses "FieldDecorationRegistry.DEC_ERROR" if the status goes ok and
> then back to error
I filed a bug report for that under
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284384
Previous Topic:MultiValidator disposal
Next Topic:[databinding] ControlDecorationSupport feedback: provide access to the ControlDecoration
Goto Forum:
  


Current Time: Thu Mar 28 15:30:17 GMT 2024

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

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

Back to the top