本文整理汇总了Java中org.eclipse.emf.ecore.EcorePackage类的典型用法代码示例。如果您正苦于以下问题:Java EcorePackage类的具体用法?Java EcorePackage怎么用?Java EcorePackage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EcorePackage类属于org.eclipse.emf.ecore包,在下文中一共展示了EcorePackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSemanticModel
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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: updateSemanticModel
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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) {
WorkloadEvent workloadEvent = (WorkloadEvent)semanticObject;
if (GqamViewsRepository.General.Properties.name == event.getAffectedEditor()) {
workloadEvent.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
}
if (GqamViewsRepository.General.Properties.effect == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.SET) {
effectSettings.setToReference((BehaviorScenario)event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.ADD) {
BehaviorScenario eObject = GqamFactory.eINSTANCE.createBehaviorScenario();
EObjectPropertiesEditionContext context = new EObjectPropertiesEditionContext(editingContext, this, eObject, editingContext.getAdapterFactory());
PropertiesEditingProvider provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(eObject, PropertiesEditingProvider.class);
if (provider != null) {
PropertiesEditingPolicy policy = provider.getPolicy(context);
if (policy != null) {
policy.execute();
}
}
effectSettings.setToReference(eObject);
}
}
}
示例3: rewriteNumberLiterals
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
private static void rewriteNumberLiterals(N4JSGrammarAccess ga,
ImmutableMap.Builder<AbstractElement, Integer> builder) {
for (ParserRule rule : GrammarUtil.allParserRules(ga.getGrammar())) {
for (EObject obj : EcoreUtil2.eAllContents(rule.getAlternatives())) {
if (obj instanceof Assignment) {
Assignment assignment = (Assignment) obj;
AbstractElement terminal = assignment.getTerminal();
if (terminal instanceof RuleCall) {
AbstractRule calledRule = ((RuleCall) terminal).getRule();
EClassifier classifier = calledRule.getType().getClassifier();
if (classifier == EcorePackage.Literals.EBIG_DECIMAL) {
builder.put(assignment, NUMBER_LITERAL_TOKEN);
}
}
}
}
}
}
示例4: init
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link DomPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static DomPackage init() {
if (isInited) return (DomPackage)EPackage.Registry.INSTANCE.getEPackage(DomPackage.eNS_URI);
// Obtain or create and register package
DomPackageImpl theDomPackage = (DomPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DomPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DomPackageImpl());
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
theDomPackage.createPackageContents();
// Initialize created meta-data
theDomPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theDomPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(DomPackage.eNS_URI, theDomPackage);
return theDomPackage;
}
示例5: initPart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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 HardwarePin hardwarePin = (HardwarePin)elt;
final OtherPropertiesEditionPart otherPart = (OtherPropertiesEditionPart)editingPart;
// init values
if (isAccessible(HrmViewsRepository.Other.Properties.width)) {
otherPart.setWidth(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, hardwarePin.getWidth()));
}
if (isAccessible(HrmViewsRepository.Other.Properties.direction)) {
otherPart.initDirection(EEFUtils.choiceOfValues(hardwarePin, HrmPackage.eINSTANCE.getHardwarePin_Direction()), hardwarePin.getDirection());
}
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例6: updateSemanticModel
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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) {
Duration duration = (Duration)semanticObject;
if (NfpViewsRepository.General.Properties.value == event.getAffectedEditor()) {
duration.setValue((EEFConverterUtil.createDoubleFromString(EcorePackage.Literals.EDOUBLE, (String)event.getNewValue())));
}
if (NfpViewsRepository.General.Properties.unit == event.getAffectedEditor()) {
duration.setUnit((TimeUnitKind)event.getNewValue());
}
if (NfpViewsRepository.General.Properties.best == event.getAffectedEditor()) {
duration.setBest((EEFConverterUtil.createDoubleFromString(EcorePackage.Literals.EDOUBLE, (String)event.getNewValue())));
}
if (NfpViewsRepository.General.Properties.worst == event.getAffectedEditor()) {
duration.setWorst((EEFConverterUtil.createDoubleFromString(EcorePackage.Literals.EDOUBLE, (String)event.getNewValue())));
}
if (NfpViewsRepository.General.Properties.clock == event.getAffectedEditor()) {
duration.setClock((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
}
if (NfpViewsRepository.General.Properties.precision == event.getAffectedEditor()) {
duration.setPrecision((EEFConverterUtil.createDoubleFromString(EcorePackage.Literals.EDOUBLE, (String)event.getNewValue())));
}
}
示例7: updatePart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
*/
public void updatePart(Notification msg) {
super.updatePart(msg);
if (editingPart.isVisible()) {
GeneralPropertiesEditionPart generalPart = (GeneralPropertiesEditionPart)editingPart;
if (GrmPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(GrmViewsRepository.General.Properties.name)) {
if (msg.getNewValue() != null) {
generalPart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
generalPart.setName("");
}
}
if (GrmPackage.eINSTANCE.getCommunicationEndPoint_PacketSize().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(GrmViewsRepository.General.Properties.packetSize)) {
if (msg.getNewValue() != null) {
generalPart.setPacketSize(EcoreUtil.convertToString(EcorePackage.Literals.EINT, msg.getNewValue()));
} else {
generalPart.setPacketSize("");
}
}
}
}
示例8: updatePart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
*/
public void updatePart(Notification msg) {
super.updatePart(msg);
if (editingPart.isVisible()) {
GeneralPropertiesEditionPart generalPart = (GeneralPropertiesEditionPart)editingPart;
if (GrmPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(HrmViewsRepository.General.Properties.name)) {
if (msg.getNewValue() != null) {
generalPart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
generalPart.setName("");
}
}
if (GrmPackage.eINSTANCE.getResourcePackage_OwnedElement().equals(msg.getFeature()) && isAccessible(HrmViewsRepository.General.Properties.ownedElement))
generalPart.updateOwnedElement();
}
}
示例9: initPart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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 UsageTypedAmount usageTypedAmount = (UsageTypedAmount)elt;
final TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
// init values
if (isAccessible(GrmViewsRepository.Timing.TimingProperties.execTime)) {
timingPart.setExecTime(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, usageTypedAmount.getExecTime()));
}
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
示例10: updatePart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
*/
public void updatePart(Notification msg) {
super.updatePart(msg);
if (editingPart.isVisible()) {
OffsetPropertiesEditionPart basePart = (OffsetPropertiesEditionPart)editingPart;
if (AnalysisPackage.eINSTANCE.getOffset_EventModel().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.Offset.Properties.eventModel))
basePart.setEventModel((EObject)msg.getNewValue());
if (AnalysisPackage.eINSTANCE.getOffset_Value().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.Offset.Properties.value)) {
if (msg.getNewValue() != null) {
basePart.setValue(EcoreUtil.convertToString(AnalysisPackage.Literals.NFP_DURATION, msg.getNewValue()));
} else {
basePart.setValue("");
}
}
if (AnalysisPackage.eINSTANCE.getOffset_Reference().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.Offset.Properties.reference)) {
if (msg.getNewValue() != null) {
basePart.setReference(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setReference("");
}
}
}
}
示例11: init
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link GexpressionsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static GexpressionsPackage init() {
if (isInited) return (GexpressionsPackage)EPackage.Registry.INSTANCE.getEPackage(GexpressionsPackage.eNS_URI);
// Obtain or create and register package
GexpressionsPackageImpl theGexpressionsPackage = (GexpressionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GexpressionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new GexpressionsPackageImpl());
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
theGexpressionsPackage.createPackageContents();
// Initialize created meta-data
theGexpressionsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theGexpressionsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(GexpressionsPackage.eNS_URI, theGexpressionsPackage);
return theGexpressionsPackage;
}
示例12: updatePart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updatePart(org.eclipse.emf.common.notify.Notification)
*/
public void updatePart(Notification msg) {
super.updatePart(msg);
if (editingPart.isVisible()) {
DesignModelPropertiesEditionPart basePart = (DesignModelPropertiesEditionPart)editingPart;
if (DesignPackage.eINSTANCE.getDesignModel_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(DesignViewsRepository.DesignModel.Properties.name)) {
if (msg.getNewValue() != null) {
basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setName("");
}
}
if (DesignPackage.eINSTANCE.getDesignModel_EndToEndFlows().equals(msg.getFeature()) && isAccessible(DesignViewsRepository.DesignModel.Properties.endToEndFlows))
basePart.updateEndToEndFlows();
}
}
示例13: interpret
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的package包/类
public static EObject interpret(String groovyScript) {
EDataType data = EcorePackage.eINSTANCE.getEString();
Binding binding = new Binding();
//Binding setVariable allow to pass a variable from the moonti arc model to the groovy interpreter
//binding.setVariable(name, value);
GroovyShell shell = new GroovyShell(binding);
Object result = shell.evaluate(groovyScript);
//Binding.getVariable get the new value of this variable.
// binding.getVariable(name)
// data.setName(""+(rand.nextInt(100)+1));
data.setName(""+result);
return data;
}
示例14: initPart
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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);
}
示例15: updateSemanticModel
import org.eclipse.emf.ecore.EcorePackage; //导入依赖的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) {
HardwarePort hardwarePort = (HardwarePort)semanticObject;
if (HrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
hardwarePort.setName((java.lang.String)EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String)event.getNewValue()));
}
if (HrmViewsRepository.General.Properties.type == event.getAffectedEditor()) {
hardwarePort.setType((PortType)event.getNewValue());
}
if (HrmViewsRepository.General.Properties.realizedBy == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
if (event.getNewValue() instanceof HardwarePin) {
realizedBySettings.addToReference((EObject) event.getNewValue());
}
} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
realizedBySettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
realizedBySettings.move(event.getNewIndex(), (HardwarePin) event.getNewValue());
}
}
}