[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: property with File Browser Dialog

Thanks Khai, I use your advise and now I can change Property Descriptors, but I have a problem because the object in

"IPropertySource getPropertySource(Object object)" represents value of property in sheet property page (for example object of type Integer or other depends of type value) and later in section :

"public IPropertyDescriptor[] getPropertyDescriptors() {
        ColorPropertyDescriptor descriptor;
        descriptor = new ColorPropertyDescriptor(object, PropertyName); ",

and I can not get the name of the property and category !!
I do not know how to do it.

Regards, Atanas.

Khai M Nguyen wrote:
This is a bit of a stretch because I haven't implemented any of this but
this is what I think you'd need to do for the GMF Properties View.

GMF uses tabbed sheets and sections... in your case specifically
org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection



It's this class that you would need to extend and override; the method getPropertySourceProvider() is where you would return your custom provider.

The rest of the information mentioned earlier in this thread should still be applicable.


Additionally you would have to override the contribution in the plugin.xml to use your 'custom' AdvancedPropertySection.


There is a thread in this same newsgroup under "Adding underline and strikethrough in appereance" where I'd posted some suggestions on how to
override the default contributions.



Hopes this help. -- Khai --


Atanas wrote:
I have the same problem,
    John did you find some solution to problem ?

Regards,
Atanas.

Ed Merks wrote:
John,

That's sounds like a GMF question I don't know the answer to...


John Watson wrote:
Hi Ed,

Thank you for the link. I tryed to use some of the solutions but it didn't help me very much.
For example:


The editor has this:

propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));

so you can override the the content provider to create a derived
property source:

   protected IPropertySource createPropertySource(Object object,
   IItemPropertySource itemPropertySource)
   {
     return new PropertySource(object, itemPropertySource);
   }

and you can override the property source to create a derived property
descriptor:

   protected IPropertyDescriptor
   createPropertyDescriptor(IItemPropertyDescriptor
   itemPropertyDescriptor)
   {
     return new PropertyDescriptor(object, itemPropertyDescriptor);
   }

And there you can implement whatever logic you want to produce
alternative cell editors in whatever situations they would be appropriate.




I change the propertySheetPage.setPropertySourceProviderto use my own class (new CustomAdapterFactoryContentProvider(adapterFactory));

But it's not called from Diagram. I noticed that GMF uses %Model%PropertyProvider extends GenericEMFPropertiesProvider

and only the addImagePropertyDescriptor {itemPropertyDescriptors.add(..)} from ItemProvider


and I don't know how to chnage that method to achieve the desired result




Ed Merks wrote:

John,

Try searching the EMF newsgroup like this:

http://www.eclipse.org/search/search.cgi?q=custom+cell+editor+file+dialog&cmd=Search%21&form=extended&wf=574a74&ps=10&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=News&t=Mail

<http://www.eclipse.org/search/search.cgi?q=custom+cell+editor+file+dialog&cmd=Search%21&form=extended&wf=574a74&ps=10&m=all&t=5&ul=%2Fnewslists%2Fnews.eclipse.tools.emf&wm=wrd&t=News&t=Mail>



John Watson wrote:

Hi,

I need a property where to store filename. How can I make choose the file by file browser dialog?

Thanks in advance!

John