Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » custom drawn property sheet cells
custom drawn property sheet cells [message #443516] Fri, 31 July 2009 14:58 Go to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi,

Is it possible to add custom drawn cells to a properties view to display
something other than the image and text returned by the label provider? If
so, could someone please share some information on how this is done?

E.g. I have an EMF object with a colour property and I would like to fill
the relevant cell in the properties sheet with a rectangle of the given
colour when the object is selected.

Thanks,
Jose
Re: custom drawn property sheet cells [message #443518 is a reply to message #443516] Fri, 31 July 2009 15:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Jose,

I kind of doubt it. Generating an image of the right color perhaps with
the RBG value as the text might be a better bet. I wonder how
ColorCellEditor works. The EMF recipes describe how to support a
customized property editor...


Jose Hernandez wrote:
> Hi,
>
> Is it possible to add custom drawn cells to a properties view to display
> something other than the image and text returned by the label provider? If
> so, could someone please share some information on how this is done?
>
> E.g. I have an EMF object with a colour property and I would like to fill
> the relevant cell in the properties sheet with a rectangle of the given
> colour when the object is selected.
>
> Thanks,
> Jose
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: custom drawn property sheet cells [message #443807 is a reply to message #443518] Fri, 31 July 2009 15:35 Go to previous messageGo to next message
Jose Hernandez is currently offline Jose HernandezFriend
Messages: 32
Registered: July 2009
Member
Hi Ed,

Thanks for the quick reply. The custom property editor itself is quite
straightforward to implement from the example in the EMF recipes. What I
don't seem to be able to do is provide a custom draw label provider to
render the contents of the property cell when the cell editor goes away.



The colour selector is one example but I am also interested in achieving
other effects such as changing the background or the font depending on the
value of the EMF structural feature. Say, make mandatory fields appear with
a light yellow background or read-only features appear with a light gray
background to give the user additional visual cues.



Regards,

Jose



"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:h4v13e$v37$1@build.eclipse.org...
> Jose,
>
> I kind of doubt it. Generating an image of the right color perhaps with
> the RBG value as the text might be a better bet. I wonder how
> ColorCellEditor works. The EMF recipes describe how to support a
> customized property editor...
>
>
> Jose Hernandez wrote:
>> Hi,
>>
>> Is it possible to add custom drawn cells to a properties view to display
>> something other than the image and text returned by the label provider?
>> If so, could someone please share some information on how this is done?
>>
>> E.g. I have an EMF object with a colour property and I would like to fill
>> the relevant cell in the properties sheet with a rectangle of the given
>> colour when the object is selected.
>>
>> Thanks,
>> Jose
>>
>>
>>
Re: custom drawn property sheet cells [message #443949 is a reply to message #443807] Fri, 31 July 2009 15:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040806000109010300040500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jose,

I don't think the properties view API provides anything to support
custom drawing, fonts, or colors.


Jose Hernandez wrote:
> Hi Ed,
>
> Thanks for the quick reply. The custom property editor itself is quite
> straightforward to implement from the example in the EMF recipes. What I
> don't seem to be able to do is provide a custom draw label provider to
> render the contents of the property cell when the cell editor goes away.
>
>
>
> The colour selector is one example but I am also interested in achieving
> other effects such as changing the background or the font depending on the
> value of the EMF structural feature. Say, make mandatory fields appear with
> a light yellow background or read-only features appear with a light gray
> background to give the user additional visual cues.
>
>
>
> Regards,
>
> Jose
>
>
>
> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:h4v13e$v37$1@build.eclipse.org...
>
>> Jose,
>>
>> I kind of doubt it. Generating an image of the right color perhaps with
>> the RBG value as the text might be a better bet. I wonder how
>> ColorCellEditor works. The EMF recipes describe how to support a
>> customized property editor...
>>
>>
>> Jose Hernandez wrote:
>>
>>> Hi,
>>>
>>> Is it possible to add custom drawn cells to a properties view to display
>>> something other than the image and text returned by the label provider?
>>> If so, could someone please share some information on how this is done?
>>>
>>> E.g. I have an EMF object with a colour property and I would like to fill
>>> the relevant cell in the properties sheet with a rectangle of the given
>>> colour when the object is selected.
>>>
>>> Thanks,
>>> Jose
>>>
>>>
>>>
>>>
>
>
>

--------------040806000109010300040500
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">
Jose,<br>
<br>
I don't think the properties view API provides anything to support
custom drawing, fonts, or colors. <br>
<br>
<br>
Jose Hernandez wrote:
<blockquote cite="mid:h4v30r$hnf$1@build.eclipse.org" type="cite">
<pre wrap="">Hi Ed,

Thanks for the quick reply. The custom property editor itself is quite
straightforward to implement from the example in the EMF recipes. What I
don't seem to be able to do is provide a custom draw label provider to
render the contents of the property cell when the cell editor goes away.



The colour selector is one example but I am also interested in achieving
other effects such as changing the background or the font depending on the
value of the EMF structural feature. Say, make mandatory fields appear with
a light yellow background or read-only features appear with a light gray
background to give the user additional visual cues.



Regards,

Jose



"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:h4v13e$v37$1@build.eclipse.org">news:h4v13e$v37$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Jose,

I kind of doubt it. Generating an image of the right color perhaps with
the RBG value as the text might be a better bet. I wonder how
ColorCellEditor works. The EMF recipes describe how to support a
customized property editor...


Jose Hernandez wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,

Is it possible to add custom drawn cells to a properties view to display
something other than the image and text returned by the label provider?
If so, could someone please share some information on how this is done?

E.g. I have an EMF object with a colour property and I would like to fill
the relevant cell in the properties sheet with a rectangle of the given
colour when the object is selected.

Thanks,
Jose



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

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

--------------040806000109010300040500--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EcoreResourceImpl ?
Next Topic:[CDO] No suitable mapping found from EMF type CUSTOM to DB type DBType
Goto Forum:
  


Current Time: Tue Apr 23 14:20:08 GMT 2024

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

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

Back to the top