Skip to main content



      Home
Home » Eclipse Projects » JFace » Linking Databinding Validation with WizardPage [WizardPageSupport]
Linking Databinding Validation with WizardPage [WizardPageSupport] [message #527437] Thu, 15 April 2010 05:04 Go to next message
Eclipse UserFriend
Hi there!

I am trying to figure out how to use Databinding within wizardpages of
jface wizards. I found the snippet Snppet014WizardDialog in the
databinding example snippets
(http://wiki.eclipse.org/JFace_Data_Binding/Snippets).

Unfortunately, I don't get it how to adjust the snippet that it also
validates for empty input, so that the next and finish buttons are
disabled right from the start when the wizard pops up and no value has
been provided by the user yet.

Any hints?

Thanks
Kris
Re: Linking Databinding Validation with WizardPage [WizardPageSupport] [message #532521 is a reply to message #527437] Mon, 10 May 2010 07:32 Go to previous message
Eclipse UserFriend
change ValidationStatus.info in ValidationStatus.error:

private final class SingleDigitValidator implements IValidator
        {
            public IStatus validate(Object value)
            {
                Integer i = (Integer) value;
                if (i == null)
                {
                    return ValidationStatus.error("Please enter a value.");
                }
                if (i.intValue() < 0 || i.intValue() > 9)
                {
                    return ValidationStatus.error("Value must be between 0 and 9.");
                }
                return ValidationStatus.ok();
            }
        }


please read the tutorials and faqs about the DataBinding Framework !!

[Updated on: Mon, 10 May 2010 12:27] by Moderator

Previous Topic:Extend ElementListSeletionDialog
Next Topic:Eclipse 3.2 Databinding -> Realm is null
Goto Forum:
  


Current Time: Sun Jul 06 17:00:11 EDT 2025

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

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

Back to the top