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 158996 Details for
Bug 300794
Text field listeners
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
this is a helper needed by the submitted patch
NotificationHelper.java (text/x-java-source), 2.33 KB, created by
thalesepm
on 2010-02-12 11:03:30 EST
(
hide
)
Description:
this is a helper needed by the submitted patch
Filename:
MIME Type:
Creator:
thalesepm
Created:
2010-02-12 11:03:30 EST
Size:
2.33 KB
patch
obsolete
>package ... > >import org.eclipse.emf.ecore.EObject; >import org.eclipse.emf.ecore.EStructuralFeature; > >import com.thalesgroup.mde.mdsofa.common.constant.ICommonConstants; > >public class NotificationHelper { > /** > * Empty string constant. > */ > public static final String EMPTY_STRING = ""; //$NON-NLS-1$ > > /** > * Is a notification required (something has changed)? > * @param object_p > * @param feature_p the feature. > * @param value_p the current text value. > * @return <code>true</code> means a notification has to be sent. > */ > static public boolean isNotificationRequired(EObject object_p, EStructuralFeature feature_p, String value_p) { > boolean isNotificationRequired = false; > // Get the feature value. > Object featureValue = object_p.eGet(feature_p); > // If the feature value is unset, check the new value is not empty. > if ((null == featureValue) && !ICommonConstants.EMPTY_STRING.equals(value_p)) { > isNotificationRequired = true; > } > // The feature is set, compare the text value with the current feature value. > // A notification is required only if values are different ones. > if (null != featureValue) { > isNotificationRequired = !featureValue.equals(value_p); > } > return isNotificationRequired; > } > > /** > * Is a notification required (something has changed)? > * @param object_p > * @param feature_p the feature. > * @param value_p the current value. > * @return <code>true</code> means a notification has to be sent. > */ > static public boolean isNotificationRequired(EObject object_p, EStructuralFeature feature_p, Object value_p) { > if (value_p instanceof String) { > return isNotificationRequired(object_p, feature_p, (String) value_p); > } > boolean isNotificationRequired = false; > // Get the feature value. > Object featureValue = object_p.eGet(feature_p); > // If the feature value is unset, check the new value is not null. > if ((null == featureValue) && (null != value_p)) { > isNotificationRequired = true; > } > // The feature is set, compare the current value with the current feature value. > // A notification is required only if values are different ones. > if (null != featureValue) { > isNotificationRequired = !featureValue.equals(value_p); > } > return isNotificationRequired; > } >}
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 300794
:
157601
|
157602
|
158996
|
158998