Collapsible Label [message #671902] |
Thu, 19 May 2011 06:06  |
Eclipse User |
|
|
|
Hello eclipse community!
I've been trying for hours now to create a collapsible label with the GMF framework. The result shall look like this:
+--------------------------+
| Title Label |
+--------------------------+
| ^ collapsible multiline |
| label..... |
+--------------------------+
| ^ |
| (collapsible drag'n' |
| drop compartment) |
| |
+--------------------------+
I have a rounded rectangle with border layout, the title label at the BEGINNING, then a nested rectangle containing the (should-be) collapsible label and a compartment (which contains other elements and is collapsible, this works).
So far, I tried to map the label to an own compartment to use the built-in collapse functionality, but this does not work (although the +/- signs are being displayed and are clickable) - the label text is always visible.
Then I tried to add a custom MouseListener to the Label EditPart, with which I did not succeed either.
I would highly appreciate any help regarding this issue! Google search did not bring any usable results, unfortunately. Given the case that I solve this problem, I'll go and publish the result in my blog to help other people avoid time-consuming work on such stuff.
Thanks!
Dominic.
[Updated on: Fri, 20 May 2011 11:52] by Moderator
|
|
|
|
Re: Collapsible Label [message #757671 is a reply to message #672307] |
Mon, 21 November 2011 03:47  |
Eclipse User |
|
|
|
Hello Dominic,
i have the same issue and i'll try out your solution but i need some clarification about the steps you've applied. You said that you made the rectangle a collapsible compartment. Did you change the ecore model to achieve that? As far as i know, one can not create a compartment with nested elements without having a class in the model which is declared as a containment. Could you please explain your approach in more details? My problem is that the diagram doesn't resize automatically when hiding the label. It seems that the label still requires the space in the diagram, although it is invisible. Can you clarify that?
thx & regards
bj
|
|
|
Powered by
FUDForum. Page generated in 0.06493 seconds