how can I change the standard property dialog for a multivalued attribute? [message #170950] |
Thu, 31 January 2008 18:40 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hi all,
I would like to open a custom dialog when I select a multivalued attribute
from the PropertyView. The standard dialog lists all the objects from the
resource that match the type of the selected attribute but I would like to
limit this list only to those objects that fullfil some condition. I do not
know where the property dialog is defined neither how to change it.
Some hint will be very wellcome!!
Best regards,
Bego
|
|
|
|
Re: how can I change the standard property dialog for a multivalued attribute? [message #171130 is a reply to message #171023] |
Fri, 01 February 2008 13:51 |
Eclipse User |
|
|
|
Originally posted by: nospam.nospam.com
This is for a single valued attribute with a drop down list of possible
choices (not sure if you really meant multi valued).
You can try this code in XXX.edit/src/XXX/provider/XXXItemProvider:
protected void addXXXPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(new ItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterF actory(),
getResourceLocator(),
getString("_UI_XXX_XXX_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_XXX_XXX_feature",
"_UI_XXX_type"),
XXXPackage.Literals.XXX__XXX,
true,
false,
true,
null,
null,
null) {
public Collection<?> getChoiceOfValues(Object object) {
Collection<?> result = new
ArrayList<Object>(super.getChoiceOfValues(object));
// ...limit the choices from result
// or create a new result Collection
return result;
}
});
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03673 seconds