Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Parsing InstanceSpecification Classifier
Parsing InstanceSpecification Classifier [message #476335] Tue, 10 March 2009 18:21 Go to next message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Hi,
I have a little Problem and hope someone can help me.
I want to set the Slots with the definingFeatures of the corresponding
classifier Class when the Classifier is set. I added a little method to
the lookupResolve in the InstanceSpecificationParser of the common
plugin. This works fine. The problem is that when i change the Name with
the parser the Methode overwrite all Slots and their values. I tried
to check if the slotList is empty but the parser gets the element
without the corresponding slots. Any better Point to insert this method?
Re: Parsing InstanceSpecification Classifier [message #476336 is a reply to message #476335] Wed, 11 March 2009 15:10 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Peter,

Your task is very natural. There are several ways to implement it:

1) Initialize Slots on demand:
Add custom action to the context menu of Instance Specification.
How to create custom action to UML2 Tools is described here - http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F


2) Listen to InstanceSpecification#classifiers property:
Create a proper NotificationListener and add it to InstanceSpecificationEditPart#addSemanticListeners()
method.

Best wishes,
Tanya.

> Hi,
> I have a little Problem and hope someone can help me.
> I want to set the Slots with the definingFeatures of the corresponding
> classifier Class when the Classifier is set. I added a little method
> to
> the lookupResolve in the InstanceSpecificationParser of the common
> plugin. This works fine. The problem is that when i change the Name
> with
> the parser the Methode overwrite all Slots and their values. I tried
> to check if the slotList is empty but the parser gets the element
> without the corresponding slots. Any better Point to insert this
> method?
>
Re: Parsing InstanceSpecification Classifier [message #476339 is a reply to message #476336] Thu, 12 March 2009 12:52 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Hi Tanya,
thank you! Now everything works as expected.
Hava a nice day.
Peter


> Hello Peter,
>
> Your task is very natural. There are several ways to implement it:
>
> 1) Initialize Slots on demand:
> Add custom action to the context menu of Instance Specification. How to
> create custom action to UML2 Tools is described here -
> http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F
>
>
> 2) Listen to InstanceSpecification#classifiers property:
> Create a proper NotificationListener and add it to
> InstanceSpecificationEditPart#addSemanticListeners() method.
> Best wishes,
> Tanya.
>
>> Hi,
>> I have a little Problem and hope someone can help me.
>> I want to set the Slots with the definingFeatures of the corresponding
>> classifier Class when the Classifier is set. I added a little method
>> to
>> the lookupResolve in the InstanceSpecificationParser of the common
>> plugin. This works fine. The problem is that when i change the Name
>> with
>> the parser the Methode overwrite all Slots and their values. I tried
>> to check if the slotList is empty but the parser gets the element
>> without the corresponding slots. Any better Point to insert this
>> method?
>>
>
>
Re: Parsing InstanceSpecification Classifier [message #476366 is a reply to message #476336] Thu, 02 April 2009 15:30 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Hi,
I also want to set a NotificationListener to the Body of the
OpaqueExpression nested in the Constraint Elements.
Can someone tell me the right way to do this?
Thanks
Peter


> Hello Peter,
>
> Your task is very natural. There are several ways to implement it:
>
> 1) Initialize Slots on demand:
> Add custom action to the context menu of Instance Specification. How to
> create custom action to UML2 Tools is described here -
> http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F
>
>
> 2) Listen to InstanceSpecification#classifiers property:
> Create a proper NotificationListener and add it to
> InstanceSpecificationEditPart#addSemanticListeners() method.
> Best wishes,
> Tanya.
Re: Parsing InstanceSpecification Classifier [message #476368 is a reply to message #476366] Fri, 03 April 2009 12:10 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Peter,

Adding such method to ConstraintEditPart should help:

/**
* @NOT generated
*/
protected void addSemanticListeners() {
super.addSemanticListeners();
Constraint constraint = (Constraint) resolveSemanticElement();
ValueSpecification s = constraint.getSpecification();
if (s != null && s instanceof OpaqueExpression) {
addListenerFilter("SemanticModel_BodyListener", this, s, UMLPackage.eINSTANCE.getOpaqueExpression_Body());
}
}

Tanya.

> Hi,
> I also want to set a NotificationListener to the Body of the
> OpaqueExpression nested in the Constraint Elements.
> Can someone tell me the right way to do this?
> Thanks
> Peter
Re: Parsing InstanceSpecification Classifier [message #476369 is a reply to message #476368] Fri, 03 April 2009 13:21 Go to previous message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Thank you Tanya!


> Hello Peter,
>
> Adding such method to ConstraintEditPart should help:
>
> /**
> * @NOT generated
> */
> protected void addSemanticListeners() {
> super.addSemanticListeners();
> Constraint constraint = (Constraint) resolveSemanticElement();
> ValueSpecification s = constraint.getSpecification();
> if (s != null && s instanceof OpaqueExpression) {
> addListenerFilter("SemanticModel_BodyListener", this, s,
> UMLPackage.eINSTANCE.getOpaqueExpression_Body());
> }
> }
>
> Tanya.
>
>> Hi,
>> I also want to set a NotificationListener to the Body of the
>> OpaqueExpression nested in the Constraint Elements.
>> Can someone tell me the right way to do this?
>> Thanks
>> Peter
>
>
Re: Parsing InstanceSpecification Classifier [message #623621 is a reply to message #476335] Wed, 11 March 2009 15:10 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Peter,

Your task is very natural. There are several ways to implement it:

1) Initialize Slots on demand:
Add custom action to the context menu of Instance Specification.
How to create custom action to UML2 Tools is described here - http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F


2) Listen to InstanceSpecification#classifiers property:
Create a proper NotificationListener and add it to InstanceSpecificationEditPart#addSemanticListeners()
method.

Best wishes,
Tanya.

> Hi,
> I have a little Problem and hope someone can help me.
> I want to set the Slots with the definingFeatures of the corresponding
> classifier Class when the Classifier is set. I added a little method
> to
> the lookupResolve in the InstanceSpecificationParser of the common
> plugin. This works fine. The problem is that when i change the Name
> with
> the parser the Methode overwrite all Slots and their values. I tried
> to check if the slotList is empty but the parser gets the element
> without the corresponding slots. Any better Point to insert this
> method?
>
Re: Parsing InstanceSpecification Classifier [message #623624 is a reply to message #476336] Thu, 12 March 2009 12:52 Go to previous message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Hi Tanya,
thank you! Now everything works as expected.
Hava a nice day.
Peter


> Hello Peter,
>
> Your task is very natural. There are several ways to implement it:
>
> 1) Initialize Slots on demand:
> Add custom action to the context menu of Instance Specification. How to
> create custom action to UML2 Tools is described here -
> http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F
>
>
> 2) Listen to InstanceSpecification#classifiers property:
> Create a proper NotificationListener and add it to
> InstanceSpecificationEditPart#addSemanticListeners() method.
> Best wishes,
> Tanya.
>
>> Hi,
>> I have a little Problem and hope someone can help me.
>> I want to set the Slots with the definingFeatures of the corresponding
>> classifier Class when the Classifier is set. I added a little method
>> to
>> the lookupResolve in the InstanceSpecificationParser of the common
>> plugin. This works fine. The problem is that when i change the Name
>> with
>> the parser the Methode overwrite all Slots and their values. I tried
>> to check if the slotList is empty but the parser gets the element
>> without the corresponding slots. Any better Point to insert this
>> method?
>>
>
>
Re: Parsing InstanceSpecification Classifier [message #623630 is a reply to message #476336] Thu, 02 April 2009 15:30 Go to previous message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Hi,
I also want to set a NotificationListener to the Body of the
OpaqueExpression nested in the Constraint Elements.
Can someone tell me the right way to do this?
Thanks
Peter


> Hello Peter,
>
> Your task is very natural. There are several ways to implement it:
>
> 1) Initialize Slots on demand:
> Add custom action to the context menu of Instance Specification. How to
> create custom action to UML2 Tools is described here -
> http://wiki.eclipse.org/MDT-UML2Tools_FAQ#I_want_to_add_my_c ustom_actions_to_the_UML2Tools_class_diagram._How_can_I_do_i t.3F
>
>
> 2) Listen to InstanceSpecification#classifiers property:
> Create a proper NotificationListener and add it to
> InstanceSpecificationEditPart#addSemanticListeners() method.
> Best wishes,
> Tanya.
Re: Parsing InstanceSpecification Classifier [message #623632 is a reply to message #476366] Fri, 03 April 2009 12:10 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Peter,

Adding such method to ConstraintEditPart should help:

/**
* @NOT generated
*/
protected void addSemanticListeners() {
super.addSemanticListeners();
Constraint constraint = (Constraint) resolveSemanticElement();
ValueSpecification s = constraint.getSpecification();
if (s != null && s instanceof OpaqueExpression) {
addListenerFilter("SemanticModel_BodyListener", this, s, UMLPackage.eINSTANCE.getOpaqueExpression_Body());
}
}

Tanya.

> Hi,
> I also want to set a NotificationListener to the Body of the
> OpaqueExpression nested in the Constraint Elements.
> Can someone tell me the right way to do this?
> Thanks
> Peter
Re: Parsing InstanceSpecification Classifier [message #623633 is a reply to message #476368] Fri, 03 April 2009 13:21 Go to previous message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Thank you Tanya!


> Hello Peter,
>
> Adding such method to ConstraintEditPart should help:
>
> /**
> * @NOT generated
> */
> protected void addSemanticListeners() {
> super.addSemanticListeners();
> Constraint constraint = (Constraint) resolveSemanticElement();
> ValueSpecification s = constraint.getSpecification();
> if (s != null && s instanceof OpaqueExpression) {
> addListenerFilter("SemanticModel_BodyListener", this, s,
> UMLPackage.eINSTANCE.getOpaqueExpression_Body());
> }
> }
>
> Tanya.
>
>> Hi,
>> I also want to set a NotificationListener to the Body of the
>> OpaqueExpression nested in the Constraint Elements.
>> Can someone tell me the right way to do this?
>> Thanks
>> Peter
>
>
Previous Topic:Template Parameter Binding to UML Classes and Ecore Primitive Types
Next Topic:How do I model the Package description in component diagram?
Goto Forum:
  


Current Time: Thu Oct 23 11:16:46 GMT 2014

Powered by FUDForum. Page generated in 0.02254 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software