Home » Eclipse Projects » GEF » about selection action
about selection action [message #203918] |
Tue, 29 November 2005 09:11 |
Eclipse User |
|
|
|
Originally posted by: XXX.cn.ibm.com
Hi, pals
what should i do if I want my selection actions to correctly update the
status(enable/disable) when
the selection changes. For example, at the begining, i selected node one,
and at the same time, action A
enabled. while in the GEF editor, i keep selecting node one, after serveral
second, the attribute of node one
updated by underlined something, and action A should be disable.
thx a lot.
|
|
|
Re: about selection action [message #203941 is a reply to message #203918] |
Tue, 29 November 2005 10:32 |
|
Magic wrote:
> what should i do if I want my selection actions to correctly update the
> status(enable/disable) when
> the selection changes. For example, at the begining, i selected node one,
> and at the same time, action A
> enabled. while in the GEF editor, i keep selecting node one, after serveral
> second, the attribute of node one
> updated by underlined something, and action A should be disable.
Sounds like you need to hook a listener that listens to you model for
such changes and updates all selection actions if a property changed and
the element is currently selected.
Cu, Gunnar
--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
|
|
|
Re: about selection action [message #203966 is a reply to message #203918] |
Tue, 29 November 2005 13:55 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Look at LogicEditor#createActions(). Make sure you register your actions as
selection actions, and their update() method will be invoked whenever the
selection changes.
"Magic" <XXX@cn.ibm.com> wrote in message
news:dmh606$d0$1@news.eclipse.org...
> Hi, pals
>
> what should i do if I want my selection actions to correctly update the
> status(enable/disable) when
> the selection changes. For example, at the begining, i selected node one,
> and at the same time, action A
> enabled. while in the GEF editor, i keep selecting node one, after
serveral
> second, the attribute of node one
> updated by underlined something, and action A should be disable.
>
> thx a lot.
>
>
|
|
|
Re: about selection action [message #204059 is a reply to message #203941] |
Wed, 30 November 2005 05:47 |
Eclipse User |
|
|
|
Originally posted by: XXX.cn.ibm.com
Yes, maybe we have to do it in this way. :(
and w'r used to hope there will be a better way in GEF.
anyway, thx a lot.
"Gunnar Wagenknecht" <gunnar@wagenknecht.org>
??????:dmhao5$77v$2@news.eclipse.org...
> Magic wrote:
>> what should i do if I want my selection actions to correctly update the
>> status(enable/disable) when
>> the selection changes. For example, at the begining, i selected node one,
>> and at the same time, action A
>> enabled. while in the GEF editor, i keep selecting node one, after
>> serveral
>> second, the attribute of node one
>> updated by underlined something, and action A should be disable.
>
> Sounds like you need to hook a listener that listens to you model for
> such changes and updates all selection actions if a property changed and
> the element is currently selected.
>
> Cu, Gunnar
>
> --
> Gunnar Wagenknecht
> gunnar@wagenknecht.org
> http://wagenknecht.org/
|
|
| | |
Re: about selection action [message #204303 is a reply to message #204059] |
Thu, 01 December 2005 19:37 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You should hook the action to the command stack. Whenever a command is
executed, undone, etc., refresh the action's enablement. And also keep it as
a selection listener too.
"Magic" <XXX@cn.ibm.com> wrote in message
news:dmjedi$8ff$1@news.eclipse.org...
> Yes, maybe we have to do it in this way. :(
> and w'r used to hope there will be a better way in GEF.
> anyway, thx a lot.
>
>
> "Gunnar Wagenknecht" <gunnar@wagenknecht.org>
> ??????:dmhao5$77v$2@news.eclipse.org...
>> Magic wrote:
>>> what should i do if I want my selection actions to correctly update the
>>> status(enable/disable) when
>>> the selection changes. For example, at the begining, i selected node
>>> one,
>>> and at the same time, action A
>>> enabled. while in the GEF editor, i keep selecting node one, after
>>> serveral
>>> second, the attribute of node one
>>> updated by underlined something, and action A should be disable.
>>
>> Sounds like you need to hook a listener that listens to you model for
>> such changes and updates all selection actions if a property changed and
>> the element is currently selected.
>>
>> Cu, Gunnar
>>
>> --
>> Gunnar Wagenknecht
>> gunnar@wagenknecht.org
>> http://wagenknecht.org/
>
>
|
|
|
Goto Forum:
Current Time: Wed Jan 22 09:14:44 GMT 2025
Powered by FUDForum. Page generated in 0.04034 seconds
|