Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » about selection action
about selection action [message #203918] Tue, 29 November 2005 09:11 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #204073 is a reply to message #204059] Wed, 30 November 2005 09:07 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Magic wrote:
> 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.

Mhm. I don't understand your problem. There is a change in your
underlying model. GEF can't know about this change until you tell GEF to
refresh. Same goes for the actions.

Cu, Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: about selection action [message #204204 is a reply to message #203966] Thu, 01 December 2005 04:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: XXX.cn.ibm.com

Hi, Pratik

After go through the code of selectionAction, we found when the undergroud
model is changed, we could invoke refresh() method to get the status to
update.:)
"Pratik Shah" <none@unknown.com> д
Re: about selection action [message #204303 is a reply to message #204059] Thu, 01 December 2005 19:37 Go to previous message
Eclipse UserFriend
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/
>
>
Previous Topic:contentassist-like Popup menu
Next Topic:any suggestion for an 'ExpandAnimatedFigure'
Goto Forum:
  


Current Time: Wed Jan 22 09:14:44 GMT 2025

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

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

Back to the top