Home » Modeling » EMF » Save Button not activated on property change
| | | |
Re: Save Button not activated on property change [message #414347 is a reply to message #414344] |
Thu, 01 November 2007 11:01 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------000807040106000404080506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Biju,
Yes, your part needs to be save able. Also keep in mind that this
method in ItemPropertyDescriptor needs to be able to find the editing
domain in order to be able to access its command stack so make sure
that's working properly.
public EditingDomain getEditingDomain(Object object)
{
EObject eObject = (EObject)object;
EditingDomain result =
AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
if (result == null)
{
if (adapterFactory instanceof IEditingDomainProvider)
{
result =
((IEditingDomainProvider)adapterFactory).getEditingDomain();
}
if (result == null && adapterFactory instanceof
ComposeableAdapterFactory)
{
AdapterFactory rootAdapterFactory =
((ComposeableAdapterFactory)adapterFactory).getRootAdapterFa ctory();
if (rootAdapterFactory instanceof IEditingDomainProvider)
{
result =
((IEditingDomainProvider)rootAdapterFactory).getEditingDomai n();
}
}
}
return result;
}
If you aren't using the resource set form the editor domain or you are
setting your own to the editing doma, you'll want to add an adapter that
implements IEditingDomainProvider to your resource set.
biju wrote:
> Hi Ed Merks,
>
> On Inspecting the hierarchy of the generated Editor , I
> found it is also an ISaveablePart. So do I need to implement the
> ISaveablePart interface in my view to solve my problem..?
>
> Thanks for your help Biju
>
> Ed Merks wrote:
>> Biju,
>>
>> Do you have something hooked up to the command stack to listen to
>> commands being executed like the generated editor has?
>>
>>
>> biju wrote:
>>> Hi All,
>>>
>>>
>>> I am displaying my emf model objects as a tree using a jface
>>> TreeViewer in a View. I am using the "property view" to show the
>>> properties of the objects in my tree. I am also able to edit it in
>>> "property view" but on edit the 'save button' is not getting enabled
>>> and the changes is not made to my model.
>>>
>>> I have created adapter factories and editing domain in my view
>>> and is also passing it to ExtendedPropertySheetPage.
>>>
>>> What I might have missed to do..? Any Ideas..?
>>>
>>>
>>> Thanks for any help , Biju
--------------000807040106000404080506
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Biju,<br>
<br>
Yes, your part needs to be save able. Also keep in mind that this
method in ItemPropertyDescriptor needs to be able to find the editing
domain in order to be able to access its command stack so make sure
that's working properly. <br>
<blockquote><small> public EditingDomain getEditingDomain(Object
object)<br>
{<br>
EObject eObject = (EObject)object;<br>
EditingDomain result =
AdapterFactoryEditingDomain.getEditingDomainFor(eObject);<br >
if (result == null)<br>
{<br>
if (adapterFactory instanceof IEditingDomainProvider)<br>
{<br>
result =
((IEditingDomainProvider)adapterFactory).getEditingDomain(); <br>
}<br>
<br>
if (result == null && adapterFactory instanceof
ComposeableAdapterFactory)<br>
{<br>
AdapterFactory rootAdapterFactory =
((ComposeableAdapterFactory)adapterFactory).getRootAdapterFa ctory(); <br>
if (rootAdapterFactory instanceof IEditingDomainProvider)<br>
{<br>
result =
((IEditingDomainProvider)rootAdapterFactory).getEditingDomai n(); <br>
}<br>
}<br>
}<br>
return result;<br>
}</small><br>
</blockquote>
If you aren't using the resource set form the editor domain or you are
setting your own to the editing doma, you'll want to add an adapter
that implements IEditingDomainProvider to your resource set.<br>
<br>
biju wrote:
<blockquote cite="mid:fgc69i$bgt$1@build.eclipse.org" type="cite">Hi Ed
Merks,
<br>
<br>
On Inspecting the hierarchy of the generated Editor , I
found it is also an ISaveablePart. So do I need to implement the
ISaveablePart interface in my view to solve my problem..?
<br>
<br>
Thanks for your help &n bsp; &n bsp; Biju
<br>
<br>
Ed Merks wrote:
<br>
<blockquote type="cite">Biju,
<br>
<br>
Do you have something hooked up to the command stack to listen to
commands being executed like the generated editor has?
<br>
<br>
<br>
biju wrote:
<br>
<blockquote type="cite">Hi All,
<br>
<br>
<br>
I am displaying my emf model objects as a tree using a jface
TreeViewer in a View. I am using the "property view" to show the
properties of the objects in my tree. I am also able to edit it in
"property view" but on edit the 'save button' is not getting enabled
and the changes is not made to my model.
<br>
<br>
I have created adapter factories and editing domain in my view
and is also passing it to ExtendedPropertySheetPage.
<br>
<br>
What I might have missed to do..? Any Ideas..?
<br>
<br>
<br>
Thanks for any help ,   ;   ; Biju
<br>
</blockquote>
</blockquote>
</blockquote>
<br>
</body>
</html>
--------------000807040106000404080506--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Save Button not activated on property change [message #414348 is a reply to message #414347] |
Thu, 01 November 2007 13:58 |
biju Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi Ed Merks,
Thanks for your reply,
Its working now, I made my view part save able and the save
functionality is working. I am having another problem now , that is
after editing the properties of a selected node in the view, the
selection of the node is gone. It happens after editing any property in
property sheet.
I am investigating on this, mean while do you have any Idea
what might be wrong.
Thanks for the help Biju
Ed Merks wrote:
> Biju,
>
> Yes, your part needs to be save able. Also keep in mind that this
> method in ItemPropertyDescriptor needs to be able to find the editing
> domain in order to be able to access its command stack so make sure
> that's working properly.
>
> public EditingDomain getEditingDomain(Object object)
> {
> EObject eObject = (EObject)object;
> EditingDomain result =
> AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
> if (result == null)
> {
> if (adapterFactory instanceof IEditingDomainProvider)
> {
> result =
> ((IEditingDomainProvider)adapterFactory).getEditingDomain();
> }
>
> if (result == null && adapterFactory instanceof
> ComposeableAdapterFactory)
> {
> AdapterFactory rootAdapterFactory =
> ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFa ctory();
> if (rootAdapterFactory instanceof IEditingDomainProvider)
> {
> result =
> ((IEditingDomainProvider)rootAdapterFactory).getEditingDomai n();
> }
> }
> }
> return result;
> }
>
> If you aren't using the resource set form the editor domain or you are
> setting your own to the editing doma, you'll want to add an adapter that
> implements IEditingDomainProvider to your resource set.
>
> biju wrote:
>> Hi Ed Merks,
>>
>> On Inspecting the hierarchy of the generated Editor , I
>> found it is also an ISaveablePart. So do I need to implement the
>> ISaveablePart interface in my view to solve my problem..?
>>
>> Thanks for your help Biju
>>
>> Ed Merks wrote:
>>> Biju,
>>>
>>> Do you have something hooked up to the command stack to listen to
>>> commands being executed like the generated editor has?
>>>
>>>
>>> biju wrote:
>>>> Hi All,
>>>>
>>>>
>>>> I am displaying my emf model objects as a tree using a jface
>>>> TreeViewer in a View. I am using the "property view" to show the
>>>> properties of the objects in my tree. I am also able to edit it in
>>>> "property view" but on edit the 'save button' is not getting enabled
>>>> and the changes is not made to my model.
>>>>
>>>> I have created adapter factories and editing domain in my view
>>>> and is also passing it to ExtendedPropertySheetPage.
>>>>
>>>> What I might have missed to do..? Any Ideas..?
>>>>
>>>>
>>>> Thanks for any help , Biju
>
|
|
|
Re: Save Button not activated on property change [message #414349 is a reply to message #414348] |
Thu, 01 November 2007 14:17 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Biju,
In the generated editor, the selection is set to match the
"affectedObjects" returned by the command and setSelectionToViewer is
called to make that selection so maybe something is going wrong in how
you've hooked up this behavior...
biju wrote:
> Hi Ed Merks,
>
> Thanks for your reply,
>
> Its working now, I made my view part save able and the
> save functionality is working. I am having another problem now , that
> is after editing the properties of a selected node in the view, the
> selection of the node is gone. It happens after editing any property
> in property sheet.
>
> I am investigating on this, mean while do you have any
> Idea what might be wrong.
>
> Thanks for the help Biju
>
> Ed Merks wrote:
>> Biju,
>>
>> Yes, your part needs to be save able. Also keep in mind that this
>> method in ItemPropertyDescriptor needs to be able to find the editing
>> domain in order to be able to access its command stack so make sure
>> that's working properly.
>> public EditingDomain getEditingDomain(Object object)
>> {
>> EObject eObject = (EObject)object;
>> EditingDomain result =
>> AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
>> if (result == null)
>> {
>> if (adapterFactory instanceof IEditingDomainProvider)
>> {
>> result =
>> ((IEditingDomainProvider)adapterFactory).getEditingDomain();
>> }
>>
>> if (result == null && adapterFactory instanceof
>> ComposeableAdapterFactory)
>> {
>> AdapterFactory rootAdapterFactory =
>> ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFa ctory();
>> if (rootAdapterFactory instanceof IEditingDomainProvider)
>> {
>> result =
>> ((IEditingDomainProvider)rootAdapterFactory).getEditingDomai n();
>> }
>> }
>> }
>> return result;
>> }
>>
>> If you aren't using the resource set form the editor domain or you
>> are setting your own to the editing doma, you'll want to add an
>> adapter that implements IEditingDomainProvider to your resource set.
>>
>> biju wrote:
>>> Hi Ed Merks,
>>>
>>> On Inspecting the hierarchy of the generated Editor , I
>>> found it is also an ISaveablePart. So do I need to implement the
>>> ISaveablePart interface in my view to solve my problem..?
>>>
>>> Thanks for your help Biju
>>>
>>> Ed Merks wrote:
>>>> Biju,
>>>>
>>>> Do you have something hooked up to the command stack to listen to
>>>> commands being executed like the generated editor has?
>>>>
>>>>
>>>> biju wrote:
>>>>> Hi All,
>>>>>
>>>>>
>>>>> I am displaying my emf model objects as a tree using a jface
>>>>> TreeViewer in a View. I am using the "property view" to show the
>>>>> properties of the objects in my tree. I am also able to edit it in
>>>>> "property view" but on edit the 'save button' is not getting
>>>>> enabled and the changes is not made to my model.
>>>>>
>>>>> I have created adapter factories and editing domain in my
>>>>> view and is also passing it to ExtendedPropertySheetPage.
>>>>>
>>>>> What I might have missed to do..? Any Ideas..?
>>>>>
>>>>>
>>>>> Thanks for any help , Biju
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Save Button not activated on property change [message #414364 is a reply to message #414349] |
Fri, 02 November 2007 12:00 |
biju Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi Ed Merks,
Thanks for your valuable help
Its working now.. On selecting a node in my tree viewer, the
PropertyView gets the selectionChanged event, where I was changing the
selection to the child of the actually selected node, by creating my own
selection(Which is my requirement). So in setSelectionToViewer() call on
commandStackChanged() call back the selection of this child was set to
my TreeViewer which actually was not in the tree.
I tried hiding the setSelectionToViewer() call from
commandStackChanged() call back and Its working fine now.
Thanks again, Biju
Ed Merks wrote:
> Biju,
>
> In the generated editor, the selection is set to match the
> "affectedObjects" returned by the command and setSelectionToViewer is
> called to make that selection so maybe something is going wrong in how
> you've hooked up this behavior...
>
>
> biju wrote:
>> Hi Ed Merks,
>>
>> Thanks for your reply,
>>
>> Its working now, I made my view part save able and the
>> save functionality is working. I am having another problem now , that
>> is after editing the properties of a selected node in the view, the
>> selection of the node is gone. It happens after editing any property
>> in property sheet.
>>
>> I am investigating on this, mean while do you have any
>> Idea what might be wrong.
>>
>> Thanks for the help Biju
>>
>> Ed Merks wrote:
>>> Biju,
>>>
>>> Yes, your part needs to be save able. Also keep in mind that this
>>> method in ItemPropertyDescriptor needs to be able to find the editing
>>> domain in order to be able to access its command stack so make sure
>>> that's working properly.
>>> public EditingDomain getEditingDomain(Object object)
>>> {
>>> EObject eObject = (EObject)object;
>>> EditingDomain result =
>>> AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
>>> if (result == null)
>>> {
>>> if (adapterFactory instanceof IEditingDomainProvider)
>>> {
>>> result =
>>> ((IEditingDomainProvider)adapterFactory).getEditingDomain();
>>> }
>>>
>>> if (result == null && adapterFactory instanceof
>>> ComposeableAdapterFactory)
>>> {
>>> AdapterFactory rootAdapterFactory =
>>> ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFa ctory();
>>> if (rootAdapterFactory instanceof IEditingDomainProvider)
>>> {
>>> result =
>>> ((IEditingDomainProvider)rootAdapterFactory).getEditingDomai n();
>>> }
>>> }
>>> }
>>> return result;
>>> }
>>>
>>> If you aren't using the resource set form the editor domain or you
>>> are setting your own to the editing doma, you'll want to add an
>>> adapter that implements IEditingDomainProvider to your resource set.
>>>
>>> biju wrote:
>>>> Hi Ed Merks,
>>>>
>>>> On Inspecting the hierarchy of the generated Editor , I
>>>> found it is also an ISaveablePart. So do I need to implement the
>>>> ISaveablePart interface in my view to solve my problem..?
>>>>
>>>> Thanks for your help Biju
>>>>
>>>> Ed Merks wrote:
>>>>> Biju,
>>>>>
>>>>> Do you have something hooked up to the command stack to listen to
>>>>> commands being executed like the generated editor has?
>>>>>
>>>>>
>>>>> biju wrote:
>>>>>> Hi All,
>>>>>>
>>>>>>
>>>>>> I am displaying my emf model objects as a tree using a jface
>>>>>> TreeViewer in a View. I am using the "property view" to show the
>>>>>> properties of the objects in my tree. I am also able to edit it in
>>>>>> "property view" but on edit the 'save button' is not getting
>>>>>> enabled and the changes is not made to my model.
>>>>>>
>>>>>> I have created adapter factories and editing domain in my
>>>>>> view and is also passing it to ExtendedPropertySheetPage.
>>>>>>
>>>>>> What I might have missed to do..? Any Ideas..?
>>>>>>
>>>>>>
>>>>>> Thanks for any help , Biju
>>>
|
|
|
Goto Forum:
Current Time: Thu Apr 25 09:25:34 GMT 2024
Powered by FUDForum. Page generated in 0.04404 seconds
|