Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Sticking buttons inside a node figure - moving from figure to command
Sticking buttons inside a node figure - moving from figure to command [message #180712] Mon, 09 May 2005 21:53 Go to next message
Eclipse UserFriend
Originally posted by: Pachwork.hotmail.com

Hi,

I'm looking for advice on how to proceed with putting buttons inside the
nodes in my graph. I would like to have buttons inside the nodes for
expanding and collapsing them, hiding them, and connecting them.

One piece of advice I've come across is
http://eclipsewiki.editme.com/GefDescription
In section 4.7 it describes creating sub-editparts to control sub-parts of
figures. Is that what I need to do? I'm still not quite sure what
EditPolicy one would need to install for the functionality of just a
button.

I expected that there would be a simple way to connect a button to call
getCommand(Request request) from inside the figure belonging to an
editPart, but I don't see how. (Or perhaps there is something even more
direct that I am missing. This all seems a bit heavy-weight for my
goals.)

I'd appreciate any advice people can give.

Thank you,
John
Re: Sticking buttons inside a node figure - moving from figure to command [message #180764 is a reply to message #180712] Tue, 10 May 2005 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gslade.no.spam.us.ibm.com

I implemented a collapsable edit part a few weeks back.... which ended
up being a complete waste of time because I not going to end up using
it... however, this is what I did.....

I had a single editpart which had a single container figure. Depending
on whether the edit part was collapsed or expanded a different complex
figure was added to the simple container figure. i.e if it went from
collapsed to expanded then I removed the collapsed complex figure from
the simple container figure and then added the complex expanded figure.

The two complex figures contained a label figure. This was where the
user would click to expand or collapse. The edit part builds the two
complex figures during instanciation and adds a mouse listener to the
two figures the user can click on. The mouse listener responds to
mousePressed by flipping the complex figures and refreshing visuals.

If you poke around in this newsgroup you will find other threads on this
topic and in one Randy recommends using a Clickable Figure (see
Clickable). You can look at that and figure out if or how to work it in.

Guy


John Pacheco wrote:
> Hi,
>
> I'm looking for advice on how to proceed with putting buttons inside the
> nodes in my graph. I would like to have buttons inside the nodes for
> expanding and collapsing them, hiding them, and connecting them.
> One piece of advice I've come across is
> http://eclipsewiki.editme.com/GefDescription
> In section 4.7 it describes creating sub-editparts to control sub-parts
> of figures. Is that what I need to do? I'm still not quite sure what
> EditPolicy one would need to install for the functionality of just a
> button.
>
> I expected that there would be a simple way to connect a button to call
> getCommand(Request request) from inside the figure belonging to an
> editPart, but I don't see how. (Or perhaps there is something even more
> direct that I am missing. This all seems a bit heavy-weight for my
> goals.)
> I'd appreciate any advice people can give.
>
> Thank you,
> John
>
Re: Sticking buttons inside a node figure - moving from figure to command [message #180837 is a reply to message #180764] Tue, 10 May 2005 18:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Pachwork.hotmail.com

Yes, I understand how to do that. If all the information was inside a
single figure (and it's model) then that would definately work, but that
isn't the case.

I need to gain access to the Command Stack so the opperations can be
undo-able, and I need to have the operation affect multiple figures (to be
hidden or shown). I'm not sure I can do that using the method you
described.

If you have any more advice I would appreciate it.

Thanks,
John

Guy Slade wrote:

> I implemented a collapsable edit part a few weeks back.... which ended
> up being a complete waste of time because I not going to end up using
> it... however, this is what I did.....

> I had a single editpart which had a single container figure. Depending
> on whether the edit part was collapsed or expanded a different complex
> figure was added to the simple container figure. i.e if it went from
> collapsed to expanded then I removed the collapsed complex figure from
> the simple container figure and then added the complex expanded figure.

> The two complex figures contained a label figure. This was where the
> user would click to expand or collapse. The edit part builds the two
> complex figures during instanciation and adds a mouse listener to the
> two figures the user can click on. The mouse listener responds to
> mousePressed by flipping the complex figures and refreshing visuals.

> If you poke around in this newsgroup you will find other threads on this
> topic and in one Randy recommends using a Clickable Figure (see
> Clickable). You can look at that and figure out if or how to work it in.

> Guy


> John Pacheco wrote:
>> Hi,
>>
>> I'm looking for advice on how to proceed with putting buttons inside the
>> nodes in my graph. I would like to have buttons inside the nodes for
>> expanding and collapsing them, hiding them, and connecting them.
>> One piece of advice I've come across is
>> http://eclipsewiki.editme.com/GefDescription
>> In section 4.7 it describes creating sub-editparts to control sub-parts
>> of figures. Is that what I need to do? I'm still not quite sure what
>> EditPolicy one would need to install for the functionality of just a
>> button.
>>
>> I expected that there would be a simple way to connect a button to call
>> getCommand(Request request) from inside the figure belonging to an
>> editPart, but I don't see how. (Or perhaps there is something even more
>> direct that I am missing. This all seems a bit heavy-weight for my
>> goals.)
>> I'd appreciate any advice people can give.
>>
>> Thank you,
>> John
>>
Re: Sticking buttons inside a node figure - moving from figure to command [message #180895 is a reply to message #180837] Wed, 11 May 2005 13:59 Go to previous message
Eclipse UserFriend
Originally posted by: gslade.no.spam.us.ibm.com

If your edit parts have access to the editor that contains them then you
can call getAdapter() and get the command stack (see
GraphicalEditor.getAdapter()). It's not difficult to give them a handle
to the editor.

So you can still implement the buttons as the clickable figures that I
described before and in the code that handles the mouse click (in the
edit part) a command(s) can be generate to perform whatever it is you
want to perform, then you ask the command stack to execute the command.

Guy




John Pacheco wrote:
> Yes, I understand how to do that. If all the information was inside a
> single figure (and it's model) then that would definately work, but that
> isn't the case.
> I need to gain access to the Command Stack so the opperations can be
> undo-able, and I need to have the operation affect multiple figures (to
> be hidden or shown). I'm not sure I can do that using the method you
> described.
>
> If you have any more advice I would appreciate it.
>
> Thanks,
> John
>
> Guy Slade wrote:
>
>> I implemented a collapsable edit part a few weeks back.... which ended
>> up being a complete waste of time because I not going to end up using
>> it... however, this is what I did.....
>
>
>> I had a single editpart which had a single container figure. Depending
>> on whether the edit part was collapsed or expanded a different complex
>> figure was added to the simple container figure. i.e if it went from
>> collapsed to expanded then I removed the collapsed complex figure from
>> the simple container figure and then added the complex expanded figure.
>
>
>> The two complex figures contained a label figure. This was where the
>> user would click to expand or collapse. The edit part builds the two
>> complex figures during instanciation and adds a mouse listener to the
>> two figures the user can click on. The mouse listener responds to
>> mousePressed by flipping the complex figures and refreshing visuals.
>
>
>> If you poke around in this newsgroup you will find other threads on
>> this topic and in one Randy recommends using a Clickable Figure (see
>> Clickable). You can look at that and figure out if or how to work it in.
>
>
>> Guy
>
>
>
>> John Pacheco wrote:
>>
>>> Hi,
>>>
>>> I'm looking for advice on how to proceed with putting buttons inside
>>> the nodes in my graph. I would like to have buttons inside the nodes
>>> for expanding and collapsing them, hiding them, and connecting them.
>>> One piece of advice I've come across is
>>> http://eclipsewiki.editme.com/GefDescription
>>> In section 4.7 it describes creating sub-editparts to control
>>> sub-parts of figures. Is that what I need to do? I'm still not
>>> quite sure what EditPolicy one would need to install for the
>>> functionality of just a button.
>>>
>>> I expected that there would be a simple way to connect a button to
>>> call getCommand(Request request) from inside the figure belonging to
>>> an editPart, but I don't see how. (Or perhaps there is something even
>>> more direct that I am missing. This all seems a bit heavy-weight for
>>> my goals.) I'd appreciate any advice people can give.
>>>
>>> Thank you,
>>> John
>>>
>
Previous Topic:Drawing Button/Combobox/checkbox in editor
Next Topic:Double-click on editpart - need to invoke editor command
Goto Forum:
  


Current Time: Sat Feb 04 03:42:16 GMT 2023

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

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

Back to the top