[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: Sorting Value List

Hi Ed..
Thank you very much for your help.
Now the pop-up list is sorted and drag and drop is working.

EMF is great!
I'm developing a configurator for our machines and I've been able
to complete a 6-month project in less than four weeks, and with better
results!

Thanks again.
-Maurizio 



> Maurizio,

> The collections of values is returned by
> ItemPropertyDescriptor.getChoiceOfValues.  In a derived property descriptor
you
> could sort the values before returning them.

> You can also try tailoring this method:

>        /**
>         * If this is defined to be something other than an empty list, it
>      is used to implement {@link #getSetFeature getSetFeature}
>         * and to deduce the EMF feature in the SetCommand {@link
>      #createCommand createCommand}.
>         * If you override those, then you don't need to implement this.
>         */
>        protected Collection getSetFeatures(Object object)
>        {
>          return Collections.EMPTY_LIST;
>        }

> This might allow you to "link drop" a source object into a target object so
> that the target will set a reference to the source.

> Pasting into the properties view is more difficult.  I'm not sure how you
could
> do that or even if you could do that.


> Maurizio Denna wrote:

> > Hi,
> >
> > I have a model where the value of an attribute has to be chosen
> > among the objects of a given type.
> > In this case EMF automatically generates the list of the objects
> > when I click in the value filed in the Property View.
> > The problem I have is that the list of objects is not alphabetically sorted
> > but the objects appear to be in random order.
> > This is acceptable when I have just a few objects to choose from,
> > but becomes unusable when the list contain hundreds of objects.
> >
> > What can I do to sort this list?
> >
> > Another very nice alternative would be to copy an object and paste
> > it in the value cell of the Property View, or use drag-and-drop.
> > Is it possible to do this with EMF?
> >
> > Many Thanks in advance
> > -Maurizio