Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Modifying properties view (combo box value)
Modifying properties view (combo box value) [message #503466] Mon, 14 December 2009 11:11 Go to next message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Hello,

I want to modify the behaviour of the properties view.
When you make double click in a property value which is a combo box, the view shows all the available values. If the property is
a reference, combo box shows all objects which can be targeted for those elements.

Maybe the project was: "org.eclipse.emf.edit.ui", and teh class "AdapterFactoryContentProvider"... but I'm not sure...

Please, what class and what EMF project do I have to modify for getting the combo box only load the values I want (basically a filter on the default combo values)?

Have you got any suggestion about this issue?

Thanks in advance.
Best regards.

Re: Modifying properties view (combo box value) [message #503474 is a reply to message #503466] Mon, 14 December 2009 06:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30620
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040200030908080407010903
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Carlos,

There's an example in EReferenceItemProvider.

protected void addEOppositePropertyDescriptor(Object object)
{
itemPropertyDescriptors.add
(new ItemPropertyDescriptor

(((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
getResourceLocator(),
getString("_UI_EReference_eOpposite_feature"),
getString("_UI_EReference_eOpposite_description"),
EcorePackage.Literals.EREFERENCE__EOPPOSITE,
true,
false,
true,
null,
null,
null)
{
@Override
public Collection<?> *getChoiceOfValues*(Object object)
{

I.e., specialize getChoiceOfValues of the property descriptor.


Carlos wrote:
> Hello,
>
> I want to modify the behaviour of the properties view.
> When you make double click in a property value which is a combo box,
> the view shows all the available values. If the property is a
> reference, combo box shows all objects which can be targeted for those
> elements.
>
> Maybe the project was: "org.eclipse.emf.edit.ui", and teh class
> "AdapterFactoryContentProvider"... but I'm not sure...
>
> Please, what class and what EMF project do I have to modify for
> getting the combo box only load the values I want (basically a filter
> on the default combo values)?
>
> Have you got any suggestion about this issue?
>
> Thanks in advance.
> Best regards.
>
>

--------------040200030908080407010903
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Carlos,<br>
<br>
There's an example in EReferenceItemProvider.<br>
<br>
<small>  protected void addEOppositePropertyDescriptor(Object object)<br>
  {<br>
    itemPropertyDescriptors.add<br>
      (new ItemPropertyDescriptor<br>
       
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(), <br>
         getResourceLocator(),<br>
         getString("_UI_EReference_eOpposite_feature"),<br>
         getString("_UI_EReference_eOpposite_description"),<br>
         EcorePackage.Literals.EREFERENCE__EOPPOSITE,<br>
         true,<br>
         false,<br>
         true,<br>
         null,<br>
         null,<br>
         null)<br>
        {<br>
          @Override<br>
          public Collection&lt;?&gt; <b>getChoiceOfValues</b>(Object
object)<br>
          {</small><br>
<br>
I.e., specialize getChoiceOfValues of the property descriptor.<br>
<br>
<br>
Carlos wrote:
<blockquote cite="mid:hg56h6$3a9$1@build.eclipse.org" type="cite">Hello,
<br>
<br>
I want to modify the behaviour of the properties view.
<br>
When you make double click in a property value which is a combo box,
the view shows all the available values. If the property is a
reference, combo box shows all objects which can be targeted for those
elements.
<br>
<br>
Maybe the project was: "org.eclipse.emf.edit.ui", and teh class
"AdapterFactoryContentProvider"... but I'm not sure...
<br>
<br>
Please, what class and what EMF project do I have to modify for getting
the combo box only load the values I want (basically a filter on the
default combo values)?
<br>
<br>
Have you got any suggestion about this issue?
<br>
<br>
Thanks in advance.
<br>
Best regards.
<br>
<br>
<br>
</blockquote>
</body>
</html>

--------------040200030908080407010903--
Re: Modifying properties view (combo box value) [message #503520 is a reply to message #503474] Mon, 14 December 2009 15:17 Go to previous message
Carlos  is currently offline Carlos Friend
Messages: 52
Registered: September 2009
Member
Hi Ed.

I have imported the project "org.eclipse.emf.ecore.edit" and I also have modified the class "EReferenceItemProvider" as you told me but it seems that the method has never invoked.
After I make the changes in the class code, the file is not marked like 'dirty' but I don't know why... (The file name is blue in the package navigator: what does it mean? Can that project be modified?).

I have explored other way. In the project "org.eclipse.emf.edit", in the class "ItemPropertyDescriptor" there is other method "getChoiceOfValues". I think that I can filter the combo box values at this point...

What is your opinion?

Thank you very much.
Best regards.
Carlos.
Previous Topic:EMF Validation, RollBack on error
Next Topic:[CDO] Using 3.0
Goto Forum:
  


Current Time: Tue Nov 12 08:24:10 GMT 2019

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

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

Back to the top