Java 类org.eclipse.emf.ecore.util.EcoreUtil 实例源码
项目:neoscada
文件:MasterImportImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMaster ( MasterServer newMaster )
{
if ( newMaster != eInternalContainer () || ( eContainerFeatureID () != InfrastructurePackage.MASTER_IMPORT__MASTER && newMaster != null ) )
{
if ( EcoreUtil.isAncestor ( this, newMaster ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newMaster != null )
msgs = ( (InternalEObject)newMaster ).eInverseAdd ( this, InfrastructurePackage.MASTER_SERVER__IMPORT_MASTER, MasterServer.class, msgs );
msgs = basicSetMaster ( newMaster, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, InfrastructurePackage.MASTER_IMPORT__MASTER, newMaster, newMaster ) );
}
项目:neoscada
文件:TaskImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefinition ( Definition newDefinition )
{
if ( newDefinition != eInternalContainer () || ( eContainerFeatureID () != RecipePackage.TASK__DEFINITION && newDefinition != null ) )
{
if ( EcoreUtil.isAncestor ( this, newDefinition ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newDefinition != null )
msgs = ( (InternalEObject)newDefinition ).eInverseAdd ( this, RecipePackage.DEFINITION__TASK, Definition.class, msgs );
msgs = basicSetDefinition ( newDefinition, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, RecipePackage.TASK__DEFINITION, newDefinition, newDefinition ) );
}
项目:time4sys
文件:PortImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParent(PortContainer newParent) {
if (newParent != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.PORT__PARENT && newParent != null)) {
if (EcoreUtil.isAncestor(this, newParent))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParent != null)
msgs = ((InternalEObject)newParent).eInverseAdd(this, AnalysisPackage.PORT_CONTAINER__PORTS, PortContainer.class, msgs);
msgs = basicSetParent(newParent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.PORT__PARENT, newParent, newParent));
}
项目:n4js
文件:N4MemberAnnotationListImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwner(N4ClassifierDefinition newOwner) {
if (newOwner != eInternalContainer() || (eContainerFeatureID() != N4JSPackage.N4_MEMBER_ANNOTATION_LIST__OWNER && newOwner != null)) {
if (EcoreUtil.isAncestor(this, newOwner))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwner != null)
msgs = ((InternalEObject)newOwner).eInverseAdd(this, N4JSPackage.N4_CLASSIFIER_DEFINITION__OWNED_MEMBERS_RAW, N4ClassifierDefinition.class, msgs);
msgs = basicSetOwner(newOwner, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.N4_MEMBER_ANNOTATION_LIST__OWNER, newOwner, newOwner));
}
项目:time4sys
文件:ProtectionParameterValuePropertiesEditionComponent.java
/**
* {@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()) {
ProtectionParameterValuePropertiesEditionPart basePart = (ProtectionParameterValuePropertiesEditionPart)editingPart;
if (AnalysisPackage.eINSTANCE.getProtectionParameterValue_Value().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.ProtectionParameterValue.Properties.value)) {
if (msg.getNewValue() != null) {
basePart.setValue(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setValue("");
}
}
if (AnalysisPackage.eINSTANCE.getProtectionParameterValue_Type().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.ProtectionParameterValue.Properties.type))
basePart.setType((EObject)msg.getNewValue());
}
}
项目:model-consistency
文件:VertexImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwner(Graph newOwner) {
if (newOwner != eInternalContainer() || (eContainerFeatureID() != GraphPackage.VERTEX__OWNER && newOwner != null)) {
if (EcoreUtil.isAncestor(this, newOwner))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwner != null)
msgs = ((InternalEObject)newOwner).eInverseAdd(this, GraphPackage.GRAPH__VERTICES, Graph.class, msgs);
msgs = basicSetOwner(newOwner, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GraphPackage.VERTEX__OWNER, newOwner, newOwner));
}
项目:neoscada
文件:DefaultValueArchiveServerImpl.java
@Override
public Profile getProfile ()
{
if ( this.profile == null )
{
final ResourceSet rs = new ResourceSetImpl ();
final Resource r = rs.createResource ( URI.createURI ( DEFAULT_URI ), "org.eclipse.scada.configuration.world.osgi.profile" );
try
{
r.load ( null );
}
catch ( final IOException e )
{
throw new RuntimeException ( e );
}
this.profile = (Profile)EcoreUtil.getObjectByType ( r.getContents (), ProfilePackage.Literals.PROFILE );
if ( this.profile == null )
{
throw new IllegalStateException ( String.format ( "Resource loaded from %s does not contain an object of type %s", DEFAULT_URI, Profile.class.getName () ) );
}
}
return this.profile;
}
项目:time4sys
文件:SchedulingParameterPropertiesEditionComponent.java
/**
* {@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.getSchedulingParameter_Value().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(GrmViewsRepository.General.Properties.value)) {
if (msg.getNewValue() != null) {
generalPart.setValue(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
generalPart.setValue("");
}
}
}
}
项目:neoscada
文件:DaveDriverImpl.java
/**
* @generated NOT
*/
@Override
public Profile getProfile ()
{
if ( this.profile == null )
{
final ResourceSet rs = new ResourceSetImpl ();
final Resource r = rs.createResource ( URI.createURI ( DEFAULT_URI ), "org.eclipse.scada.configuration.world.osgi.profile" );
try
{
r.load ( null );
}
catch ( final IOException e )
{
throw new RuntimeException ( e );
}
this.profile = (Profile)EcoreUtil.getObjectByType ( r.getContents (), ProfilePackage.Literals.PROFILE );
if ( this.profile == null )
{
throw new IllegalStateException ( String.format ( "Resource loaded from %s does not contain an object of type %s", DEFAULT_URI, Profile.class.getName () ) );
}
}
return this.profile;
}
项目:time4sys
文件:OutputPortPropertiesEditionComponent.java
/**
* {@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()) {
OutputPortPropertiesEditionPart basePart = (OutputPortPropertiesEditionPart)editingPart;
if (AnalysisPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.OutputPort.Properties.name)) {
if (msg.getNewValue() != null) {
basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setName("");
}
}
if (AnalysisPackage.eINSTANCE.getPort_Parent().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.OutputPort.Properties.parent_))
basePart.setParent_((EObject)msg.getNewValue());
if (AnalysisPackage.eINSTANCE.getOutputPort_SendTo().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.OutputPort.Properties.sendTo))
basePart.setSendTo((EObject)msg.getNewValue());
}
}
项目:n4js
文件:ASTGraphProvider.java
private void getConnectedEdgesForEObjectSingleCase(Node node, final List<Node> allNodes, final List<Edge> result,
EReference currRef, final Object target) {
final Node targetNode = GraphUtils.getNodeForElement(target, allNodes);
final String targetNodeExternal;
if (targetNode == null && ((EObject) target).eIsProxy())
targetNodeExternal = EcoreUtil.getURI((EObject) target).toString();
else
targetNodeExternal = null;
if (targetNode != null || targetNodeExternal != null) {
Edge edge = new Edge(
currRef.getName(),
!currRef.isContainment(),
node,
asCollection(targetNode),
asCollection(targetNodeExternal));
result.add(edge);
}
}
项目:neoscada
文件:EndpointImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNode ( Node newNode )
{
if ( newNode != eInternalContainer () || ( eContainerFeatureID () != WorldPackage.ENDPOINT__NODE && newNode != null ) )
{
if ( EcoreUtil.isAncestor ( this, newNode ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newNode != null )
msgs = ( (InternalEObject)newNode ).eInverseAdd ( this, WorldPackage.NODE__ENDPOINTS, Node.class, msgs );
msgs = basicSetNode ( newNode, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, WorldPackage.ENDPOINT__NODE, newNode, newNode ) );
}
项目:neoscada
文件:InfrastructureEditor.java
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
boolean hasErrors = !resource.getErrors ().isEmpty ();
if ( hasErrors || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic = new BasicDiagnostic ( hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, "org.eclipse.scada.configuration.infrastructure.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.infrastructure.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
项目:neoscada
文件:DaveBlockDefinitionImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setDevice ( DaveDevice newDevice )
{
if ( newDevice != eInternalContainer () || ( eContainerFeatureID () != DavePackage.DAVE_BLOCK_DEFINITION__DEVICE && newDevice != null ) )
{
if ( EcoreUtil.isAncestor ( this, newDevice ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newDevice != null )
msgs = ( (InternalEObject)newDevice ).eInverseAdd ( this, DavePackage.DAVE_DEVICE__BLOCKS, DaveDevice.class, msgs );
msgs = basicSetDevice ( newDevice, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, DavePackage.DAVE_BLOCK_DEFINITION__DEVICE, newDevice, newDevice ) );
}
项目:gemoc-studio
文件:StateImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwningFSM(StateMachine newOwningFSM) {
if (newOwningFSM != eInternalContainer() || (eContainerFeatureID() != FsmPackage.STATE__OWNING_FSM && newOwningFSM != null)) {
if (EcoreUtil.isAncestor(this, newOwningFSM))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwningFSM != null)
msgs = ((InternalEObject)newOwningFSM).eInverseAdd(this, FsmPackage.STATE_MACHINE__OWNED_STATES, StateMachine.class, msgs);
msgs = basicSetOwningFSM(newOwningFSM, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FsmPackage.STATE__OWNING_FSM, newOwningFSM, newOwningFSM));
}
项目:neoscada
文件:DeviceImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNode ( Node newNode )
{
if ( newNode != eInternalContainer () || ( eContainerFeatureID () != InfrastructurePackage.DEVICE__NODE && newNode != null ) )
{
if ( EcoreUtil.isAncestor ( this, newNode ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newNode != null )
msgs = ( (InternalEObject)newNode ).eInverseAdd ( this, InfrastructurePackage.NODE__DEVICES, Node.class, msgs );
msgs = basicSetNode ( newNode, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, InfrastructurePackage.DEVICE__NODE, newNode, newNode ) );
}
项目:SurveyDSL
文件:QueryITToXMIConverter.java
public static void convertERDSLtoXMI(String inputM, String outputM) {
Injector injector = new QueryITStandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
URI uri = URI.createURI(inputM);
Resource xtextResource = resourceSet.getResource(uri, true);
EcoreUtil.resolveAll(xtextResource);
Resource xmiResource = resourceSet.createResource(URI.createURI(outputM));
xmiResource.getContents().add(xtextResource.getContents().get(0));
try {
xmiResource.save(null);
System.out.println("Saved " + outputM);
System.out.println("QueryIT file converted successfully to XMI");
System.out.println("-------------------------------------");
} catch (IOException e) {
e.printStackTrace();
}
}
项目:n4js
文件:ConcreteSyntaxAwareReferenceFinder.java
@Override
protected EObject toValidInstanceOrNull(Resource resource, Predicate<URI> targetURIs, EObject value) {
EObject result = value;
if (result.eIsProxy()) {
URI proxyURI = EcoreUtil.getURI(result);
if (uriEncoder.isCrossLinkFragment(resource, proxyURI.fragment())) {
INode node = uriEncoder.decode(resource, proxyURI.fragment()).getThird();
String string = linkingHelper.getCrossRefNodeAsString(node, true);
if (((TargetURIs) targetURIs).getUserData(TargetURIKey.KEY).isMatchingConcreteSyntax(string)) {
result = resolveInternalProxy(value, resource);
} else {
result = null;
}
} else {
result = resolveInternalProxy(value, resource);
}
}
return result;
}
项目:n4js
文件:ContainerTypesHelper.java
private List<Type> getPolyfillTypesFromScope(QualifiedName fqn) {
IScope contextScope = polyfillScopeAccess.getRecordingPolyfillScope(contextResource);
List<Type> types = new ArrayList<>();
// contextScope.getElements(fqn) returns all polyfills, since shadowing is handled differently
// for them!
for (IEObjectDescription descr : contextScope.getElements(fqn)) {
Type polyfillType = (Type) descr.getEObjectOrProxy();
if (polyfillType.eIsProxy()) {
// TODO review: this seems odd... is this a test setup problem (since we do not use the
// index
// there and load the resource separately)?
polyfillType = (Type) EcoreUtil.resolve(polyfillType, contextResource);
if (polyfillType.eIsProxy()) {
throw new IllegalStateException("unexpected proxy");
}
}
types.add(polyfillType);
}
// }
return types;
}
项目:neoscada
文件:SetupEditor.java
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
boolean hasErrors = !resource.getErrors ().isEmpty ();
if ( hasErrors || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic = new BasicDiagnostic ( hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, "org.eclipse.scada.configuration.world.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.world.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
项目:time4sys
文件:SoftwareConcurrentResourceImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAdressSpace(MemoryPartition newAdressSpace) {
if (newAdressSpace != eInternalContainer() || (eContainerFeatureID() != SrmPackage.SOFTWARE_CONCURRENT_RESOURCE__ADRESS_SPACE && newAdressSpace != null)) {
if (EcoreUtil.isAncestor(this, newAdressSpace))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newAdressSpace != null)
msgs = ((InternalEObject)newAdressSpace).eInverseAdd(this, SrmPackage.MEMORY_PARTITION__CONCURRENT_RESOURCES, MemoryPartition.class, msgs);
msgs = basicSetAdressSpace(newAdressSpace, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SrmPackage.SOFTWARE_CONCURRENT_RESOURCE__ADRESS_SPACE, newAdressSpace, newAdressSpace));
}
项目:time4sys
文件:UsageDemandPropertiesEditionComponent.java
/**
* {@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.getUsageDemand_Usage().equals(msg.getFeature()) && isAccessible(GrmViewsRepository.General.Properties.usage))
generalPart.updateUsage();
if (GrmPackage.eINSTANCE.getUsageDemand_Event().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(GrmViewsRepository.General.Properties.event)) {
if (msg.getNewValue() != null) {
generalPart.setEvent(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
generalPart.setEvent("");
}
}
}
}
项目:neoscada
文件:CalculationComponentImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLevel ( Level newLevel )
{
if ( newLevel != eInternalContainer () || ( eContainerFeatureID () != ComponentPackage.CALCULATION_COMPONENT__LEVEL && newLevel != null ) )
{
if ( EcoreUtil.isAncestor ( this, newLevel ) )
throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
NotificationChain msgs = null;
if ( eInternalContainer () != null )
msgs = eBasicRemoveFromContainer ( msgs );
if ( newLevel != null )
msgs = ( (InternalEObject)newLevel ).eInverseAdd ( this, ComponentPackage.LEVEL__COMPONENTS, Level.class, msgs );
msgs = basicSetLevel ( newLevel, msgs );
if ( msgs != null )
msgs.dispatch ();
}
else if ( eNotificationRequired () )
eNotify ( new ENotificationImpl ( this, Notification.SET, ComponentPackage.CALCULATION_COMPONENT__LEVEL, newLevel, newLevel ) );
}
项目:neoscada
文件:ReleaseImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVersion(Version newVersion) {
if (newVersion != eInternalContainer() || (eContainerFeatureID() != WebPackage.RELEASE__VERSION && newVersion != null)) {
if (EcoreUtil.isAncestor(this, newVersion))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newVersion != null)
msgs = ((InternalEObject)newVersion).eInverseAdd(this, WebPackage.VERSION__RELEASES, Version.class, msgs);
msgs = basicSetVersion(newVersion, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WebPackage.RELEASE__VERSION, newVersion, newVersion));
}
项目:n4js
文件:ComposedContentImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwner(Composite newOwner) {
if (newOwner != eInternalContainer() || (eContainerFeatureID() != DomPackage.COMPOSED_CONTENT__OWNER && newOwner != null)) {
if (EcoreUtil.isAncestor(this, newOwner))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwner != null)
msgs = ((InternalEObject)newOwner).eInverseAdd(this, DomPackage.COMPOSITE__CONTENTS, Composite.class, msgs);
msgs = basicSetOwner(newOwner, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.COMPOSED_CONTENT__OWNER, newOwner, newOwner));
}
项目:SimQRI
文件:GaussianPropertiesEditionComponent.java
/**
* {@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()) {
GaussianPropertiesEditionPart basePart = (GaussianPropertiesEditionPart)editingPart;
if (MetamodelPackage.eINSTANCE.getGaussian_Location().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(MetamodelViewsRepository.Gaussian.Properties.location)) {
if (msg.getNewValue() != null) {
basePart.setLocation(EcoreUtil.convertToString(EcorePackage.Literals.EDOUBLE, msg.getNewValue()));
} else {
basePart.setLocation("");
}
}
if (MetamodelPackage.eINSTANCE.getGaussian_Scale().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(MetamodelViewsRepository.Gaussian.Properties.scale)) {
if (msg.getNewValue() != null) {
basePart.setScale(EcoreUtil.convertToString(MetamodelPackage.Literals.POSITIVE_DOUBLE_NOT_NULL, msg.getNewValue()));
} else {
basePart.setScale("");
}
}
}
}
项目:neoscada
文件:ChartEditor.java
/**
* Returns a diagnostic describing the errors and warnings listed in the
* resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public Diagnostic analyzeResourceProblems ( final Resource resource,
final Exception exception )
{
if ( !resource.getErrors ().isEmpty ()
|| !resource.getWarnings ().isEmpty () )
{
final BasicDiagnostic basicDiagnostic = new BasicDiagnostic (
Diagnostic.ERROR, "org.eclipse.scada.ui.chart.model.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource
: exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.ui.chart.model.editor", //$NON-NLS-1$
0, getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
项目:time4sys
文件:ResourceProtectionParameterValuePropertiesEditionComponent.java
/**
* {@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()) {
ResourceProtectionParameterValuePropertiesEditionPart basePart = (ResourceProtectionParameterValuePropertiesEditionPart)editingPart;
if (AnalysisPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.name)) {
if (msg.getNewValue() != null) {
basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setName("");
}
}
if (AnalysisPackage.eINSTANCE.getResourceProtectionParameterValue_Value().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.ResourceProtectionParameterValue.Properties.value)) {
if (msg.getNewValue() != null) {
basePart.setValue(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setValue("");
}
}
}
}
项目:xmontiarc
文件:ConnectorImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParent(ComponentType newParent) {
if (newParent != eInternalContainer() || (eContainerFeatureID() != XmontiarcPackage.CONNECTOR__PARENT && newParent != null)) {
if (EcoreUtil.isAncestor(this, newParent))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParent != null)
msgs = ((InternalEObject)newParent).eInverseAdd(this, XmontiarcPackage.COMPONENT_TYPE__CONNECTORS, ComponentType.class, msgs);
msgs = basicSetParent(newParent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XmontiarcPackage.CONNECTOR__PARENT, newParent, newParent));
}
项目:SimQRI
文件:QueryPropertiesEditionComponent.java
/**
* {@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()) {
QueryPropertiesEditionPart basePart = (QueryPropertiesEditionPart)editingPart;
if (MetamodelPackage.eINSTANCE.getQuery_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(MetamodelViewsRepository.Query.Properties.name)) {
if (msg.getNewValue() != null) {
basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setName("");
}
}
if (MetamodelPackage.eINSTANCE.getQuery_Value().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(MetamodelViewsRepository.Query.Properties.value)){
if (msg.getNewValue() != null) {
basePart.setValue(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setValue("");
}
}
}
}
项目:time4sys
文件:HardwarePinOtherPropertiesEditionComponent.java
/**
* {@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()) {
OtherPropertiesEditionPart otherPart = (OtherPropertiesEditionPart)editingPart;
if (HrmPackage.eINSTANCE.getHardwarePin_Width().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && otherPart != null && isAccessible(HrmViewsRepository.Other.Properties.width)) {
if (msg.getNewValue() != null) {
otherPart.setWidth(EcoreUtil.convertToString(EcorePackage.Literals.EINT, msg.getNewValue()));
} else {
otherPart.setWidth("");
}
}
if (HrmPackage.eINSTANCE.getHardwarePin_Direction().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && isAccessible(HrmViewsRepository.Other.Properties.direction))
otherPart.setDirection((Direction)msg.getNewValue());
}
}
项目:neoscada
文件:SecurityEditor.java
/**
* Returns a diagnostic describing the errors and warnings listed in the resource
* and the specified exception (if any).
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Diagnostic analyzeResourceProblems ( Resource resource, Exception exception )
{
if ( !resource.getErrors ().isEmpty () || !resource.getWarnings ().isEmpty () )
{
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
( Diagnostic.ERROR, "org.eclipse.scada.configuration.security.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception == null ? (Object)resource : exception } );
basicDiagnostic.merge ( EcoreUtil.computeDiagnostic ( resource, true ) );
return basicDiagnostic;
}
else if ( exception != null )
{
return new BasicDiagnostic ( Diagnostic.ERROR, "org.eclipse.scada.configuration.security.editor", //$NON-NLS-1$
0,
getString ( "_UI_CreateModelError_message", resource.getURI () ), //$NON-NLS-1$
new Object[] { exception } );
}
else
{
return Diagnostic.OK_INSTANCE;
}
}
项目:gemoc-studio-modeldebugging
文件:DSLThreadAdapter.java
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.model.IThread#getBreakpoints()
*/
public IBreakpoint[] getBreakpoints() {
final List<IBreakpoint> res = new ArrayList<IBreakpoint>();
if (isSuspended()) {
final URI instructionUri = EcoreUtil.getURI(getHost().getTopStackFrame().getCurrentInstruction());
for (IBreakpoint breakpoint : DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(
getModelIdentifier())) {
if (breakpoint instanceof DSLBreakpoint
&& (((DSLBreakpoint)breakpoint).getURI().equals(instructionUri))) {
res.add(breakpoint);
}
}
}
return res.toArray(new IBreakpoint[res.size()]);
}
项目:gemoc-studio-modeldebugging
文件:VariableImpl.java
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setFrame(StackFrame newFrame) {
if (newFrame != eInternalContainer() || (eContainerFeatureID() != DebugPackage.VARIABLE__FRAME
&& newFrame != null)) {
if (EcoreUtil.isAncestor(this, newFrame))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newFrame != null)
msgs = ((InternalEObject)newFrame).eInverseAdd(this, DebugPackage.STACK_FRAME__VARIABLES,
StackFrame.class, msgs);
msgs = basicSetFrame(newFrame, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DebugPackage.VARIABLE__FRAME, newFrame,
newFrame));
}
项目:time4sys
文件:RequiredSchedulingParameterImpl.java
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParent(Scheduler newParent) {
if (newParent != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.REQUIRED_SCHEDULING_PARAMETER__PARENT && newParent != null)) {
if (EcoreUtil.isAncestor(this, newParent))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParent != null)
msgs = ((InternalEObject)newParent).eInverseAdd(this, AnalysisPackage.SCHEDULER__REQUIRED_PARAMETERS, Scheduler.class, msgs);
msgs = basicSetParent(newParent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.REQUIRED_SCHEDULING_PARAMETER__PARENT, newParent, newParent));
}
项目:neoscada
文件:Hive.java
private static RootType parse ( final URI uri ) throws IOException
{
final ResourceSet rs = new ResourceSetImpl ();
rs.getResourceFactoryRegistry ().getExtensionToFactoryMap ().put ( "*", new ConfigurationResourceFactoryImpl () );
final Resource r = rs.createResource ( uri );
r.load ( null );
final DocumentRoot doc = (DocumentRoot)EcoreUtil.getObjectByType ( r.getContents (), ConfigurationPackage.Literals.DOCUMENT_ROOT );
if ( doc == null )
{
return null;
}
else
{
return doc.getRoot ();
}
}
项目:time4sys
文件:ProtectionParameterTimingPropertiesEditionComponent.java
/**
* {@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()) {
TimingPropertiesEditionPart timingPart = (TimingPropertiesEditionPart)editingPart;
if (GrmPackage.eINSTANCE.getProtectionParameter_PriorityCeiling().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(GrmViewsRepository.Timing.TimingProperties.priorityCeiling)) {
if (msg.getNewValue() != null) {
timingPart.setPriorityCeiling(EcoreUtil.convertToString(EcorePackage.Literals.EINT, msg.getNewValue()));
} else {
timingPart.setPriorityCeiling("");
}
}
if (GrmPackage.eINSTANCE.getProtectionParameter_PreemptionLevel().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && timingPart != null && isAccessible(GrmViewsRepository.Timing.TimingProperties.preemptionLevel)) {
if (msg.getNewValue() != null) {
timingPart.setPreemptionLevel(EcoreUtil.convertToString(EcorePackage.Literals.EINT, msg.getNewValue()));
} else {
timingPart.setPreemptionLevel("");
}
}
}
}
项目:time4sys
文件:SoftwareResourcePackagePropertiesEditionComponent.java
/**
* {@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(SrmViewsRepository.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(SrmViewsRepository.General.Properties.ownedElement))
generalPart.updateOwnedElement();
}
}
项目:time4sys
文件:MutualExclusionResourcePropertiesEditionComponent.java
/**
* {@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()) {
MutualExclusionResourcePropertiesEditionPart basePart = (MutualExclusionResourcePropertiesEditionPart)editingPart;
if (AnalysisPackage.eINSTANCE.getNamedElement_Name().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && basePart != null && isAccessible(AnalysisViewsRepository.MutualExclusionResource.Properties.name)) {
if (msg.getNewValue() != null) {
basePart.setName(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, msg.getNewValue()));
} else {
basePart.setName("");
}
}
if (AnalysisPackage.eINSTANCE.getMutualExclusionResource_Elements().equals(msg.getFeature()) && isAccessible(AnalysisViewsRepository.MutualExclusionResource.Properties.elements))
basePart.updateElements();
if (AnalysisPackage.eINSTANCE.getMutualExclusionResource_ProtectionParameters().equals(msg.getFeature()) && isAccessible(AnalysisViewsRepository.MutualExclusionResource.Properties.protectionParameters))
basePart.updateProtectionParameters();
if (AnalysisPackage.eINSTANCE.getMutualExclusionResource_ProtectedBy().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.MutualExclusionResource.Properties.protectedBy))
basePart.setProtectedBy((EObject)msg.getNewValue());
if (AnalysisPackage.eINSTANCE.getMutualExclusionResource_Parent().equals(msg.getFeature()) && basePart != null && isAccessible(AnalysisViewsRepository.MutualExclusionResource.Properties.parent_))
basePart.setParent_((EObject)msg.getNewValue());
}
}
项目:time4sys
文件:PeriodicPatternGeneralPropertiesEditionComponent.java
/**
* {@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 (GqamPackage.eINSTANCE.getPeriodicPattern_Occurences().equals(msg.getFeature()) && msg.getNotifier().equals(semanticObject) && generalPart != null && isAccessible(GqamViewsRepository.General.Properties.occurences)) {
if (msg.getNewValue() != null) {
generalPart.setOccurences(EcoreUtil.convertToString(EcorePackage.Literals.EINT, msg.getNewValue()));
} else {
generalPart.setOccurences("");
}
}
if (GqamPackage.eINSTANCE.getArrivalPattern_Parent().equals(msg.getFeature()) && generalPart != null && isAccessible(GqamViewsRepository.General.Properties.parent_))
generalPart.setParent_((EObject)msg.getNewValue());
if (GqamPackage.eINSTANCE.getArrivalPattern_Reference().equals(msg.getFeature()) && generalPart != null && isAccessible(GqamViewsRepository.General.Properties.reference))
generalPart.setReference((EObject)msg.getNewValue());
}
}