本文整理汇总了Java中org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil类的典型用法代码示例。如果您正苦于以下问题:Java EEFConverterUtil类的具体用法?Java EEFConverterUtil怎么用?Java EEFConverterUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EEFConverterUtil类属于org.eclipse.emf.eef.runtime.impl.utils包,在下文中一共展示了EEFConverterUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSemanticModel
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public void updateSemanticModel(final IPropertiesEditionEvent event) {
SoftwareTimerResource softwareTimerResource = (SoftwareTimerResource)semanticObject;
if (SrmViewsRepository.Timing.Properties.duration == event.getAffectedEditor()) {
softwareTimerResource.setDuration((EEFConverterUtil.createFloatFromString(EcorePackage.Literals.EFLOAT, (String)event.getNewValue())));
}
if (SrmViewsRepository.Timing.Properties.isPeriodic == event.getAffectedEditor()) {
softwareTimerResource.setIsPeriodic((Boolean)event.getNewValue());
}
if (SrmViewsRepository.Timing.Properties.durationElements == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.SET) {
softwareTimerResource.getDurationElements().clear();
softwareTimerResource.getDurationElements().addAll(((EList) event.getNewValue()));
}
}
}
开发者ID:polarsys,项目名称:time4sys,代码行数:21,代码来源:SoftwareTimerResourceTimingPropertiesEditionComponent.java
示例2: initPart
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Gaussian gaussian = (Gaussian)elt;
final GaussianPropertiesEditionPart basePart = (GaussianPropertiesEditionPart)editingPart;
// init values
if (isAccessible(MetamodelViewsRepository.Gaussian.Properties.location)) {
basePart.setLocation(EEFConverterUtil.convertToString(EcorePackage.Literals.EDOUBLE, gaussian.getLocation()));
}
if (isAccessible(MetamodelViewsRepository.Gaussian.Properties.scale))
basePart.setScale(EEFConverterUtil.convertToString(MetamodelPackage.Literals.POSITIVE_DOUBLE_NOT_NULL, gaussian.getScale()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例3: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (SrmViewsRepository.Timing.Properties.accessPolicy == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(SrmPackage.eINSTANCE.getDeviceBroker_AccessPolicy().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(SrmPackage.eINSTANCE.getDeviceBroker_AccessPolicy().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例4: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
* @generated
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (AnalysisViewsRepository.ResultContainer.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例5: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (MetamodelViewsRepository.Poisson.Properties.interval == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例6: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (HrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例7: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (MetamodelViewsRepository.Scalar.Properties.value == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例8: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (MetamodelViewsRepository.Model.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getModel_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getModel_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例9: initPart
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final Query query = (Query)elt;
final QueryPropertiesEditionPart basePart = (QueryPropertiesEditionPart)editingPart;
// init values
if (isAccessible(MetamodelViewsRepository.Query.Properties.name))
basePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, query.getName()));
if (isAccessible(MetamodelViewsRepository.Query.Properties.value))
basePart.setValue(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, query.getValue()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例10: initPart
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ResourceService resourceService = (ResourceService)elt;
final GeneralPropertiesEditionPart generalPart = (GeneralPropertiesEditionPart)editingPart;
// init values
if (isAccessible(GrmViewsRepository.General.Properties.name))
generalPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, resourceService.getName()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例11: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (HrmViewsRepository.Other.Properties.instWidth == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(HrmPackage.eINSTANCE.getHardwareIsa_InstWidth().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(HrmPackage.eINSTANCE.getHardwareIsa_InstWidth().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例12: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (GrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}
示例13: initPart
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ResourcePort resourcePort = (ResourcePort)elt;
final GeneralPropertiesEditionPart generalPart = (GeneralPropertiesEditionPart)editingPart;
// init values
if (isAccessible(GrmViewsRepository.General.Properties.name))
generalPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, resourcePort.getName()));
if (isAccessible(GrmViewsRepository.General.Properties.packetSize)) {
generalPart.setPacketSize(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, resourcePort.getPacketSize()));
}
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例14: updateSemanticModel
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public void updateSemanticModel(final IPropertiesEditionEvent event) {
UsageDemand usageDemand = (UsageDemand)semanticObject;
if (GrmViewsRepository.General.Properties.usage == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
if (event.getNewValue() instanceof ResourceUsage) {
usageSettings.addToReference((EObject) event.getNewValue());
}
} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
usageSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
usageSettings.move(event.getNewIndex(), (ResourceUsage) event.getNewValue());
}
}
if (GrmViewsRepository.General.Properties.event == event.getAffectedEditor()) {
usageDemand.setEvent((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
}
}
示例15: validateValue
import org.eclipse.emf.eef.runtime.impl.utils.EEFConverterUtil; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public Diagnostic validateValue(IPropertiesEditionEvent event) {
Diagnostic ret = Diagnostic.OK_INSTANCE;
if (event.getNewValue() != null) {
try {
if (GrmViewsRepository.General.Properties.event == event.getAffectedEditor()) {
Object newValue = event.getNewValue();
if (newValue instanceof String) {
newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), (String)newValue);
}
ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), newValue);
}
} catch (IllegalArgumentException iae) {
ret = BasicDiagnostic.toDiagnostic(iae);
} catch (WrappedException we) {
ret = BasicDiagnostic.toDiagnostic(we);
}
}
return ret;
}