Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 131571 Details for
Bug 238222
[DataBinding] Round-tripping converted values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
The ValidatorRoundtrip class
ValidatorRoundtrip.java (text/plain), 1.35 KB, created by
Sylvere Richard
on 2009-04-12 13:27:24 EDT
(
hide
)
Description:
The ValidatorRoundtrip class
Filename:
MIME Type:
Creator:
Sylvere Richard
Created:
2009-04-12 13:27:24 EDT
Size:
1.35 KB
patch
obsolete
>package org.eclipse.swt.snippets; > >import org.eclipse.core.databinding.Binding; >import org.eclipse.core.databinding.observable.Realm; >import org.eclipse.core.databinding.validation.IValidator; >import org.eclipse.core.runtime.IStatus; > >/** > * > * @author sylvere richard > * > */ >public abstract class ValidatorRoundtrip implements IValidator { > > private final Binding b; > private final Realm realm; > > public ValidatorRoundtrip(Realm realm, Binding b) { > this.realm = realm; > this.b = b; > } > > /** > * Method declared final. Validation logic must be put in method > * ValidatorRoundtrip.doValidation > * > * > * Will call doValidation. > * > * If the IStatus returned by doValidation is an error > * or a cancel, it will force a refresh of the target by calling updateModelToTarget() > * to restore the previous value on screen. > * Otherwise, the process flow is unchanged. > */ > @Override > public final IStatus validate(Object value) { > final IStatus res = doValidation(value); > if (res.matches(IStatus.INFO | IStatus.WARNING) || res.isOK()) { > return res; > } > > realm.asyncExec(new Runnable() { > > @Override > public void run() { > b.updateModelToTarget(); > } > }); > return res; > } > > /** > * Puts validation logic here > * @param value > * @return > */ > public abstract IStatus doValidation(Object value); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 238222
: 131571 |
131572
|
132350
|
132819