use of com.robotoworks.mechanoid.sharedprefs.sharedPreferencesModel.Literal in project mechanoid by robotoworks.
the class PreferenceImpl method basicSetDefaultValue.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDefaultValue(Literal newDefaultValue, NotificationChain msgs) {
Literal oldDefaultValue = defaultValue;
defaultValue = newDefaultValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SharedPreferencesModelPackage.PREFERENCE__DEFAULT_VALUE, oldDefaultValue, newDefaultValue);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.robotoworks.mechanoid.sharedprefs.sharedPreferencesModel.Literal in project mechanoid by robotoworks.
the class SharedPreferencesModelJavaValidator method checkDefaultValue.
@Check
public void checkDefaultValue(Preference preference) {
PreferenceType type = preference.getType();
Literal defaultValue = preference.getDefaultValue();
if (defaultValue == null) {
return;
}
switch(type) {
case STRING:
if (!(defaultValue instanceof StringLiteral)) {
error("Type mismatch", SharedPreferencesModelPackage.Literals.PREFERENCE__DEFAULT_VALUE);
}
break;
case BOOLEAN:
if (!(defaultValue instanceof BooleanLiteral)) {
error("Type mismatch", SharedPreferencesModelPackage.Literals.PREFERENCE__DEFAULT_VALUE);
}
break;
case FLOAT:
case INTEGER:
case LONG:
if (!(defaultValue instanceof NumericLiteral)) {
error("Type mismatch", SharedPreferencesModelPackage.Literals.PREFERENCE__DEFAULT_VALUE);
}
break;
}
}
Aggregations