Changing child element attribute on change of Parenet element attribute [message #54633] |
Mon, 25 September 2006 04:47  |
Eclipse User |
|
|
|
Originally posted by: vikas.goyal.hp.com
Hi,
I want to modify the attribute of child depends on Parent node
attribute. My requirnment is like this:
When I change Node A attribute from Customizabel to false then for
all the child elements of Node A i.e Node B , Node C, Node D Attribute
Customizable should become false.
<Node A>
<Customizable = "true">
<Node B>
<Customizable="true" >
</Node B>
<Node C>
<Customizable="true" >
<Node D>
<Customizable="true" >
</Node D>
</Node C>
</Node A>
For this I am trying to manipulate ItemProvider class in edit package. In
this class I have notifyChanged() method and which is firing
fireNotifyChanged method.
Please advice is this the write method to manipulate and how to
proceed on this.
Thanks & Regards,
Vikas
|
|
|
|
|
|
Re: Changing child element attribute on change of Parenet element attribute [message #55867 is a reply to message #54633] |
Tue, 26 September 2006 10:25  |
Eclipse User |
|
|
|
Vikas Goyal wrote:
Another way to achieve this behavior is to make the feature Unsettable
And the feature is unset by default. Then in the getter Method you check
if the feature is set or not; if it is set you return the value it had ;
other wise you return the parents.getter.
The getCustomizable should look like this
if (!isSetCustomizable()){
EObject container = eContainer();
if (container instanceof Node) {
Node node = (Node) container;
return node.getCustomizable();
}
}else {
return customizable;
}
so, as soon as you set the value on a parent, the getters of the
children will return the same value a the parent unless it is set in the
child, and so on
> Hi,
> I want to modify the attribute of child depends on Parent node
> attribute. My requirnment is like this:
> When I change Node A attribute from Customizabel to false then for
> all the child elements of Node A i.e Node B , Node C, Node D Attribute
> Customizable should become false.
>
>
> <Node A>
> <Customizable = "true">
> <Node B>
> <Customizable="true" >
> </Node B>
> <Node C>
> <Customizable="true" > <Node D>
> <Customizable="true" > </Node D>
> </Node C> </Node A>
> For this I am trying to manipulate ItemProvider class in edit package.
> In this class I have notifyChanged() method and which is firing
> fireNotifyChanged method.
> Please advice is this the write method to manipulate and how to
> proceed on this.
>
>
> Thanks & Regards,
> Vikas
|
|
|
Powered by
FUDForum. Page generated in 0.05295 seconds