Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » EditorPart setPartName
EditorPart setPartName [message #219430] Thu, 13 July 2006 09:14 Go to next message
Eclipse UserFriend
Originally posted by: xavier.benveniste.wexlog.com

Hi,

When calling setPartName method on an EditorPart, I would like to mark my
editor as dirty.
Is there an easy way to create a Command from this method and then execute
it by the CommandStack ?
Or can it be done in a different way ?

Regards,
Re: EditorPart setPartName [message #219438 is a reply to message #219430] Thu, 13 July 2006 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

Xavier Benveniste wrote:

> Hi,
>
> When calling setPartName method on an EditorPart, I would like to mark my
> editor as dirty.
> Is there an easy way to create a Command from this method and then execute
> it by the CommandStack ?
> Or can it be done in a different way ?
>
> Regards,


Why do you need a command in this case? Commands are for undo/redo support.
If this is some action that causes the partname to change and the part to
be dirty, make a command to that effect. Dont have setPartName call the
command have the command call setPartName.



--
Respectfully,

CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
Re: EditorPart setPartName [message #219445 is a reply to message #219438] Thu, 13 July 2006 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xavier.benveniste.wexlog.com

Hi,

In my case, I plugged my GEF plug-in into a rcp application, and my plug-in
is notified of some kind of propertychange events to which it has to react.
For instance, the name of the object that is the root content of my editor's
plug-in can be changed in the rcp application. In reaction, what I would
like to achieve is that my plug-in changes the partname and causes the part
to be dirty.
Thus, if I understand you well, when my plug-in is notified that the
object's name has been changed, I should create a command that calls
setPartName.
Am I correct ?

Regards.

"CL [dnoyeb] Gilbert" <lamont_gilbert@rigidsoftware.com> a
Re: EditorPart setPartName [message #219462 is a reply to message #219445] Thu, 13 July 2006 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

If your plugin changes the model from underneath so to speak, then this is
not undoable. (certainly not undoable by the editor) As a result I would
not create a command. In the listener that hears the change event I would
simply call the methods to change the editor name and set the editor as
dirty. You want to be sure to execute these calls in the GUI thread.

However, this behavior does not look right to me. The editor should be
marked as dirty only with respect to those things the editor can change.
If the editor can not change the model's name, then the editor should not
be marked as dirty when the model's name changes. (or whatever property is
changing) You should make the presentation change in the editor for the
property, but since its not editable by the editor, don't mark the editor
as dirty.


CL


Xavier Benveniste wrote:

> Hi,
>
> In my case, I plugged my GEF plug-in into a rcp application, and my
> plug-in is notified of some kind of propertychange events to which it has
> to react. For instance, the name of the object that is the root content of
> my editor's plug-in can be changed in the rcp application. In reaction,
> what I would like to achieve is that my plug-in changes the partname and
> causes the part to be dirty.
> Thus, if I understand you well, when my plug-in is notified that the
> object's name has been changed, I should create a command that calls
> setPartName.
> Am I correct ?
>
> Regards.
>
> "CL [dnoyeb] Gilbert" <lamont_gilbert@rigidsoftware.com> a écrit dans le
> message de news: e95agg$mlv$1@utils.eclipse.org...
>> Xavier Benveniste wrote:
>>
>>> Hi,
>>>
>>> When calling setPartName method on an EditorPart, I would like to mark
>>> my editor as dirty.
>>> Is there an easy way to create a Command from this method and then
>>> execute
>>> it by the CommandStack ?
>>> Or can it be done in a different way ?
>>>
>>> Regards,
>>
>>
>> Why do you need a command in this case? Commands are for undo/redo
>> support.
>> If this is some action that causes the partname to change and the part to
>> be dirty, make a command to that effect. Dont have setPartName call the
>> command have the command call setPartName.
>>
>>
>>
>> --
>> Respectfully,
>>
>> CL Gilbert
>> "Verily, verily, I say unto you, He that entereth not by the door() into
>> the
>> sheepfold{}, but climbeth up some other *way, the same is a thief and a
>> robber."
>>

--
Respectfully,

CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
Re: EditorPart setPartName [message #219496 is a reply to message #219462] Fri, 14 July 2006 09:51 Go to previous message
Eclipse UserFriend
Originally posted by: xavier.benveniste.wexlog.com

Hi,

Thanks for your answers.
I think that your remarks are totally pertinent, and I'm going to follow
your advice.
Thanks again.
Regards

"CL [dnoyeb] Gilbert" <lamont_gilbert@rigidsoftware.com> a
Previous Topic:Two Diagrams From Single Request
Next Topic:feature request
Goto Forum:
  


Current Time: Mon May 13 23:09:15 GMT 2024

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

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

Back to the top