Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Property change does not make the editor dirty
Property change does not make the editor dirty [message #85548] Thu, 26 June 2003 15:42 Go to next message
Naveen Valluri is currently offline Naveen ValluriFriend
Messages: 7
Registered: July 2009
Junior Member
I have looked at the Logic example, I dont see any special handling to
make the editor dirty when a property changes. But yet magically this
seems to happen. I have done the same, but the property change does not
make the editor dirty in my case.

any ideas?
Re: Property change does not make the editor dirty [message #85583 is a reply to message #85548] Thu, 26 June 2003 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

A property change is an executed command, which dirties the editor.
look for getAdapter(IPropertySheetPage.class) on IEditorPart

"Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
news:bdf49f$l8o$1@rogue.oti.com...
> I have looked at the Logic example, I dont see any special handling to
> make the editor dirty when a property changes. But yet magically this
> seems to happen. I have done the same, but the property change does not
> make the editor dirty in my case.
>
> any ideas?
>
Re: Property change does not make the editor dirty [message #85683 is a reply to message #85583] Thu, 26 June 2003 22:44 Go to previous messageGo to next message
Naveen Valluri is currently offline Naveen ValluriFriend
Messages: 7
Registered: July 2009
Junior Member
Randy Hudson wrote:

> A property change is an executed command, which dirties the editor.
> look for getAdapter(IPropertySheetPage.class) on IEditorPart

> "Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
> news:bdf49f$l8o$1@rogue.oti.com...
> > I have looked at the Logic example, I dont see any special handling to
> > make the editor dirty when a property changes. But yet magically this
> > seems to happen. I have done the same, but the property change does not
> > make the editor dirty in my case.
> >
> > any ideas?
> >

But, I'm still not sure how it gets invoked. In my case, I change a
property value, which firesPropertyChange, but it is still not making the
editor dirty. I have tried to step through and the only noticeable
difference is that, in the logic example the celleditor has the
UndoablePropertySheetEntry as a listener. In my case the propertysheet
entry class is the listener. Even this is not set by me. So what gets
invoked is it governed by the edit policies, edit part or the editor.

since the graphical editor class already has the getAdapter method's
default implementation, I'm assuming it should get called and make the
editor dirty.

regards,
Naveen
Re: Property change does not make the editor dirty [message #85703 is a reply to message #85683] Thu, 26 June 2003 23:14 Go to previous messageGo to next message
Eric Bordeau is currently offline Eric BordeauFriend
Messages: 259
Registered: July 2009
Senior Member
applyEditorValue() in UndoablePropertySheetEntry gets called when the value is
changed. This method calls setValue(...) which calls valueChanged(...). The
valueChanged(...) method creates a command which gets executed on the command
stack, dirtying the editor.

Naveen Valluri wrote:
> Randy Hudson wrote:
>
>
>>A property change is an executed command, which dirties the editor.
>>look for getAdapter(IPropertySheetPage.class) on IEditorPart
>
>
>>"Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
>>news:bdf49f$l8o$1@rogue.oti.com...
>>
>>>I have looked at the Logic example, I dont see any special handling to
>>>make the editor dirty when a property changes. But yet magically this
>>>seems to happen. I have done the same, but the property change does not
>>>make the editor dirty in my case.
>>>
>>>any ideas?
>>>
>
>
> But, I'm still not sure how it gets invoked. In my case, I change a
> property value, which firesPropertyChange, but it is still not making the
> editor dirty. I have tried to step through and the only noticeable
> difference is that, in the logic example the celleditor has the
> UndoablePropertySheetEntry as a listener. In my case the propertysheet
> entry class is the listener. Even this is not set by me. So what gets
> invoked is it governed by the edit policies, edit part or the editor.
>
> since the graphical editor class already has the getAdapter method's
> default implementation, I'm assuming it should get called and make the
> editor dirty.
>
> regards,
> Naveen
>
>
>
>
>
Re: Property change does not make the editor dirty [message #85717 is a reply to message #85683] Fri, 27 June 2003 01:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> editor dirty. I have tried to step through and the only noticeable
> difference is that, in the logic example the celleditor has the
> UndoablePropertySheetEntry as a listener. In my case the propertysheet

Which is why I said look at getAdapter(IPropertySheetPage.class). In the
case of Logic example, it inherits from GraphicalEditor:


public Object getAdapter(Class type) {

if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) {

PropertySheetPage page = new PropertySheetPage();

page.setRootEntry(GEFPlugin.createUndoablePropertySheetEntry (getCommandStack
()));

return page;

}

....

....


> entry class is the listener. Even this is not set by me. So what gets
> invoked is it governed by the edit policies, edit part or the editor.
>
> since the graphical editor class already has the getAdapter method's
> default implementation, I'm assuming it should get called and make the
> editor dirty.
>
> regards,
> Naveen
>
>
>
>
>
Re: Property change does not make the editor dirty [message #85848 is a reply to message #85683] Fri, 27 June 2003 18:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jwoods.journee.com

HOW are you changing the property value? If you do it through the property
sheet, then it will be done with a command run on the editor's command stack
(which makes the editor dirty - unless your editor is broken somehow). If
you are changing the value somehow else (not doing the change through a
command run through the editor's command stack) - then that's your problem.

If you ARE changing the property through the prop sheet, make sure you have
something like the following in your editor's getAdapter() method:

if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class)

{

PropertySheetPage page = new PropertySheetPage();


page.setRootEntry(new UndoablePropertySheetEntry(getCommandStack()));

return page;

}

- Jason


"Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
news:bdft0r$c9j$1@rogue.oti.com...
> Randy Hudson wrote:
>
> > A property change is an executed command, which dirties the editor.
> > look for getAdapter(IPropertySheetPage.class) on IEditorPart
>
> > "Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
> > news:bdf49f$l8o$1@rogue.oti.com...
> > > I have looked at the Logic example, I dont see any special handling to
> > > make the editor dirty when a property changes. But yet magically this
> > > seems to happen. I have done the same, but the property change does
not
> > > make the editor dirty in my case.
> > >
> > > any ideas?
> > >
>
> But, I'm still not sure how it gets invoked. In my case, I change a
> property value, which firesPropertyChange, but it is still not making the
> editor dirty. I have tried to step through and the only noticeable
> difference is that, in the logic example the celleditor has the
> UndoablePropertySheetEntry as a listener. In my case the propertysheet
> entry class is the listener. Even this is not set by me. So what gets
> invoked is it governed by the edit policies, edit part or the editor.
>
> since the graphical editor class already has the getAdapter method's
> default implementation, I'm assuming it should get called and make the
> editor dirty.
>
> regards,
> Naveen
>
>
>
>
>
Re: Property change does not make the editor dirty [message #86290 is a reply to message #85703] Wed, 02 July 2003 05:50 Go to previous message
Naveen Valluri is currently offline Naveen ValluriFriend
Messages: 7
Registered: July 2009
Junior Member
Eric Bordeau wrote:

> applyEditorValue() in UndoablePropertySheetEntry gets called when the value
is
> changed. This method calls setValue(...) which calls valueChanged(...).
The
> valueChanged(...) method creates a command which gets executed on the
command
> stack, dirtying the editor.

> Naveen Valluri wrote:
> > Randy Hudson wrote:
> >
> >
> >>A property change is an executed command, which dirties the editor.
> >>look for getAdapter(IPropertySheetPage.class) on IEditorPart
> >
> >
> >>"Naveen Valluri" <naveen.valluri@commerceone.com> wrote in message
> >>news:bdf49f$l8o$1@rogue.oti.com...
> >>
> >>>I have looked at the Logic example, I dont see any special handling to
> >>>make the editor dirty when a property changes. But yet magically this
> >>>seems to happen. I have done the same, but the property change does not
> >>>make the editor dirty in my case.
> >>>
> >>>any ideas?
> >>>
> >
> >
> > But, I'm still not sure how it gets invoked. In my case, I change a
> > property value, which firesPropertyChange, but it is still not making the
> > editor dirty. I have tried to step through and the only noticeable
> > difference is that, in the logic example the celleditor has the
> > UndoablePropertySheetEntry as a listener. In my case the propertysheet
> > entry class is the listener. Even this is not set by me. So what gets
> > invoked is it governed by the edit policies, edit part or the editor.
> >
> > since the graphical editor class already has the getAdapter method's
> > default implementation, I'm assuming it should get called and make the
> > editor dirty.
> >
> > regards,
> > Naveen
> >
> >
> >
> >
> >


Thanks a ton guys!. The problem was that my root editor was a multipage
editor which was calling someother getAdapter method, I was expecting the
active editor's getAdapter method to be called. The problem got fixed,
when I added the getAdapter method my multipage editor.

regards,
Naveen
Previous Topic:[REPOST] Keyboard shortcuts not working in Multipageeditor
Next Topic:[draw2d] EventDispatcher/Paint Problem
Goto Forum:
  


Current Time: Sat Oct 19 16:15:20 GMT 2024

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

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

Back to the top