Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Customized property widget
Customized property widget [message #1132749] Fri, 11 October 2013 07:14 Go to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Hi all,

if you set an attribute reference with a multiplicity of many, you get the following property widget:

index.php/fa/16442/0/

Now, I'ld like to customize this window respectively provide my own property widget. What I need is to display the element tree (with checkboxes), so that a user can choose attributes by checking the checkbox. See the following example:

Root
-- Object A
----Object B
-------Attribute D <-
--Attribute C <-
-- Object U
----Attribute F

In this case, a user has selected attributes C and D. The advantage here is that the user can see the hierarchal structure in contrast to the list displayed in the generated one.

Any ideas how to realise this? I reckon I could reuse the EMF Tree and attach checkboxes to it. But I still have no Idea how the property window is reliased in GMF and where are my hooks to start customizing.

Cheers,
Phil
Re: Customized property widget [message #1132768 is a reply to message #1132749] Fri, 11 October 2013 07:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25740
Registered: July 2009
Senior Member
Maybe http://wiki.eclipse.org/EMF/Recipes#Properties_Recipes helps. Note
you could do much to answer questions like this yourself. E.g., using
Alt-Shift-F1 (plugin spy) to determine that this a
org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog), you could set a
breakpoint in the constructor(s) to see what logic is used to create an
instance of this class, and therefore what you need to specialize and
where you need to put hooks to create your specialization.


On 11/10/2013 1:14 PM, Phil H wrote:
> Hi all,
>
> if you set an attribute reference with a multiplicity of many, you get the following property widget:
>
>
>
> Now, I'ld like to customize this window respectively provide my own property widget. What I need is to display the element tree (with checkboxes), so that a user can choose attributes by checking the checkbox. See the following example:
>
> Root
> -- Object A
> ----Object B
> -------Attribute D <-
> --Attribute C <-
> -- Object U
> ----Attribute F
>
> In this case, a user has selected attributes C and D. The advantage here is that the user can see the hierarchal structure in contrast to the list displayed in the generated one.
>
> Any ideas how to realise this? I reckon I could reuse the EMF Tree and attach checkboxes to it. But I still have no Idea how the property window is reliased in GMF and where are my hooks to start customizing.
>
> Cheers,
> Phil
Re: Customized property widget [message #1145230 is a reply to message #1132768] Sat, 19 October 2013 06:56 Go to previous messageGo to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Thx Ed for your suggestions..

I got it managed to provide my own dialog now, when a user clicks on the button in the property view (used this tutorial: http://gmfsamples.tuxfamily.org/wiki/doku.php?id=emf_tutorial5). This works fine so far.

I wonder now, what would be a clean way to implement the emf tree with check boxes into my dialog. What is the best way to acces the EMF Tree? Another requirement is that the user should only be able to click the checkboxes and not change (alter, delete tree items) the tree.

I think it's better to aks here, before implementing something which makes my editor/datas inconsistent.

Cheers,
phil
Re: Customized property widget [message #1162456 is a reply to message #1145230] Wed, 30 October 2013 07:39 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 695
Registered: November 2009
Senior Member
Hi,

when customizing the properties view you should look at this: http://www.eclipse.org/modeling/emft/?project=eef. If you want to have an EMF Tree Editor in a view you can copy the code from the generated .editor plugin. This should be a good starting point.

Ralph
Previous Topic:create .gmfmap in GMF
Next Topic:HELP! SELECTIO FIGURE (SHAPE)
Goto Forum:
  


Current Time: Thu Apr 17 00:12:45 EDT 2014

Powered by FUDForum. Page generated in 0.02336 seconds