Home » Eclipse Projects » GEF » EditorPart setPartName
EditorPart setPartName [message #219430] |
Thu, 13 July 2006 09:14 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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."
|
|
| |
Goto Forum:
Current Time: Fri Jan 17 03:20:33 GMT 2025
Powered by FUDForum. Page generated in 0.03113 seconds
|