Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how can I change the standard property dialog for a multivalued attribute?
how can I change the standard property dialog for a multivalued attribute? [message #170950] Thu, 31 January 2008 18:40 Go to next message
Eclipse UserFriend
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 #171023 is a reply to message #170950] Fri, 01 February 2008 10:05 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Begoa,

See ???ItemProvider class generated for you by EMF. You have to modify appropriate
itemPropertyDescriptor..

-----------------
Alex Shatalin
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 Go to previous messageGo to next message
Eclipse UserFriend
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;
}
});
}
Re: how can I change the standard property dialog for a multivalued attribute? [message #171286 is a reply to message #171130] Sun, 03 February 2008 19:39 Go to previous message
Eclipse UserFriend
Originally posted by: bmoros.um.es

Thank you very much!!!!

I have managed to do what I wanted to do.

Best regards,
Bego
Previous Topic:How to customize enablement in popups
Next Topic:Compartment ScrollBar not coming
Goto Forum:
  


Current Time: Thu Apr 25 20:42:14 GMT 2024

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

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

Back to the top