Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom property-sheet elements
Custom property-sheet elements [message #176553] Mon, 10 March 2008 11:23 Go to next message
Eclipse UserFriend
Originally posted by: mlooise.planet.nl

Hello all,

I would like to know whether it is possible to programmatically add a few
property-entries to the property-view, when selecting an element in my
GMF-generated editor. I read some of the posts about this subject, but they
where not very clear to me.
( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html)

What is the first step in order to have propertyProviders actually present
in my generated editor? At the moment I don't see any classes for me to
override with my own custom behaviour. I basically want to add some
properties to the property-view bases on a selection made in the editor.
This information has to come from code outside the generated editor, so
therefore I need to implement this programatically, and not using the
genmodel (I think?).

But where is the place to cut in-between the code of GMF, in order to
deliver a specialised PropertyProvider ?

Does anyone have any experience with this?

Kind regards,

Martin
Re: Custom property-sheet elements [message #176559 is a reply to message #176553] Mon, 10 March 2008 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlooise.planet.nl

To maybe answer my own question:

I''ve achieved this behaviour by overriding : PropertySource , being created
in : diagram.sheet.YourAPPPropertySection (getPropertySource(Object
object)). Here I have overridden the getPropertyDescriptors and
getPropertyValue to respond to my own inserted PropertyDescriptor.

To check if the right element is selected, the 'object' object can be used
to check which element it is.

I think i'm sticking to my own sollution, unless ofcourse it is very very
evil :-D

Regards,

Martin

"Martin Looise" <mlooise@planet.nl> schreef in bericht
news:fr35oe$8p2$1@build.eclipse.org...
> Hello all,
>
> I would like to know whether it is possible to programmatically add a few
> property-entries to the property-view, when selecting an element in my
> GMF-generated editor. I read some of the posts about this subject, but
> they where not very clear to me.
> ( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html)
>
> What is the first step in order to have propertyProviders actually present
> in my generated editor? At the moment I don't see any classes for me to
> override with my own custom behaviour. I basically want to add some
> properties to the property-view bases on a selection made in the editor.
> This information has to come from code outside the generated editor, so
> therefore I need to implement this programatically, and not using the
> genmodel (I think?).
>
> But where is the place to cut in-between the code of GMF, in order to
> deliver a specialised PropertyProvider ?
>
> Does anyone have any experience with this?
>
> Kind regards,
>
> Martin
>
Re: Custom property-sheet elements [message #176560 is a reply to message #176553] Mon, 10 March 2008 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlooise.planet.nl

To maybe answer my own question

To display the custom property-view i've did the following:

- In the .diagram.sheet.youAPPPropertySection i've changed the
getPropertySource(Object object) method to use my custom PropertySource
class
- I've overwritten myPropertySource extending PropertySource, and
implemented the getPropertyDescriptors and getPropertyValue functions.
- These two functions add my own PropertyDescriptor , and respond to a
requiest on this descriptor.

I think it works ok.

I can even check the kind of element which is requisting the properties by
checking the class of the 'object' object.

I will stick to this, unless it is very very evil to do it in this way :-D

Regards,

Martin



"Martin Looise" <mlooise@planet.nl> schreef in bericht
news:fr35oe$8p2$1@build.eclipse.org...
> Hello all,
>
> I would like to know whether it is possible to programmatically add a few
> property-entries to the property-view, when selecting an element in my
> GMF-generated editor. I read some of the posts about this subject, but
> they where not very clear to me.
> ( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html)
>
> What is the first step in order to have propertyProviders actually present
> in my generated editor? At the moment I don't see any classes for me to
> override with my own custom behaviour. I basically want to add some
> properties to the property-view bases on a selection made in the editor.
> This information has to come from code outside the generated editor, so
> therefore I need to implement this programatically, and not using the
> genmodel (I think?).
>
> But where is the place to cut in-between the code of GMF, in order to
> deliver a specialised PropertyProvider ?
>
> Does anyone have any experience with this?
>
> Kind regards,
>
> Martin
>
Re: Custom property-sheet elements [message #176561 is a reply to message #176560] Mon, 10 March 2008 13:54 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------040707050700030708010309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

Typically you'd do this directly in the generated EMF.Edit item
providers so your changes would be specific to each type of object and
would appear in all editors based on them. Not sure if that applies for
GMF, but I think it does...


Martin Looise wrote:
> To maybe answer my own question
>
> To display the custom property-view i've did the following:
>
> - In the .diagram.sheet.youAPPPropertySection i've changed the
> getPropertySource(Object object) method to use my custom PropertySource
> class
> - I've overwritten myPropertySource extending PropertySource, and
> implemented the getPropertyDescriptors and getPropertyValue functions.
> - These two functions add my own PropertyDescriptor , and respond to a
> requiest on this descriptor.
>
> I think it works ok.
>
> I can even check the kind of element which is requisting the properties by
> checking the class of the 'object' object.
>
> I will stick to this, unless it is very very evil to do it in this way :-D
>
> Regards,
>
> Martin
>
>
>
> "Martin Looise" <mlooise@planet.nl> schreef in bericht
> news:fr35oe$8p2$1@build.eclipse.org...
>
>> Hello all,
>>
>> I would like to know whether it is possible to programmatically add a few
>> property-entries to the property-view, when selecting an element in my
>> GMF-generated editor. I read some of the posts about this subject, but
>> they where not very clear to me.
>> ( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html)
>>
>> What is the first step in order to have propertyProviders actually present
>> in my generated editor? At the moment I don't see any classes for me to
>> override with my own custom behaviour. I basically want to add some
>> properties to the property-view bases on a selection made in the editor.
>> This information has to come from code outside the generated editor, so
>> therefore I need to implement this programatically, and not using the
>> genmodel (I think?).
>>
>> But where is the place to cut in-between the code of GMF, in order to
>> deliver a specialised PropertyProvider ?
>>
>> Does anyone have any experience with this?
>>
>> Kind regards,
>>
>> Martin
>>
>>
>
>
>


--------------040707050700030708010309
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
Typically you'd do this directly in the generated EMF.Edit item
providers so your changes would be specific to each type of object and
would appear in all editors based on them.&nbsp; Not sure if that applies
for GMF, but I think it does...<br>
<br>
<br>
Martin Looise wrote:
<blockquote cite="mid:fr3du6$g4v$2@build.eclipse.org" type="cite">
<pre wrap="">To maybe answer my own question

To display the custom property-view i've did the following:

- In the .diagram.sheet.youAPPPropertySection i've changed the
getPropertySource(Object object) method to use my custom PropertySource
class
- I've overwritten myPropertySource extending PropertySource, and
implemented the getPropertyDescriptors and getPropertyValue functions.
- These two functions add my own PropertyDescriptor , and respond to a
requiest on this descriptor.

I think it works ok.

I can even check the kind of element which is requisting the properties by
checking the class of the 'object' object.

I will stick to this, unless it is very very evil to do it in this way :-D

Regards,

Martin



"Martin Looise" <a class="moz-txt-link-rfc2396E" href="mailto:mlooise@planet.nl">&lt;mlooise@planet.nl&gt;</a> schreef in bericht
<a class="moz-txt-link-freetext" href="news:fr35oe$8p2$1@build.eclipse.org">news:fr35oe$8p2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hello all,

I would like to know whether it is possible to programmatically add a few
property-entries to the property-view, when selecting an element in my
GMF-generated editor. I read some of the posts about this subject, but
they where not very clear to me.
(<a class="moz-txt-link-freetext" href=" http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html"> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00890.html</a>)

What is the first step in order to have propertyProviders actually present
in my generated editor? At the moment I don't see any classes for me to
override with my own custom behaviour. I basically want to add some
properties to the property-view bases on a selection made in the editor.
This information has to come from code outside the generated editor, so
therefore I need to implement this programatically, and not using the
genmodel (I think?).

But where is the place to cut in-between the code of GMF, in order to
deliver a specialised PropertyProvider ?

Does anyone have any experience with this?

Kind regards,

Martin

</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------040707050700030708010309--
Previous Topic:custom generation of UUID at save
Next Topic:Link Constraints Not Working After Reopening The Diagram
Goto Forum:
  


Current Time: Fri Apr 26 22:13:59 GMT 2024

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

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

Back to the top