Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] About the workbench selection

I tried to look at this way Yves, thank you, but I get back an org.eclipse.jface.viewers.StructuredSelection object from the SelectionService and not an IJavaInstance. And the StructuredSelection class doesn't have the getAllStructuralFeatures() method.
Are you sure of your IJavaInstance ? Is it return by the Visual Editor or another part ?

Many thanks.

Nicolas.



2008/8/7 Yves YANG <yves.yang@xxxxxxxxxxx>

The Handle of UI element is a type of IJavaInstance: a subclass of EObject. You can call getAllStructuralFeatures() to get all properties.

 

Yves YANG

Soyatec - Eclipse OutSourcing & XAML for java

http://www.soyatec.com

Tel: +33 1 60 13 06 67

Mobile: +33 6 20 74 39 45

Fax: +33 9 58 07 06 67


From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx] On Behalf Of Nicolas DRUT
Sent: Thursday, August 07, 2008 3:51 PM
To: richkulp@xxxxxxxxxx
Cc: Discussions people developing code for the Visual Editor project
Subject: Re: [ve-dev] About the workbench selection

 

Hi,

Many thanks for your answer Rich;
So apparently there isn't any method to get back an handle on my JButton ?
But if we look at the properties view, it seems to me that it does a part of it; because when you click on your item, it shows the properties of the item and it can modify the class, call his method, etc ...  Do you think we can find something looking at source of the Properties view ?

Nicolas

2008/8/7 Rich Kulp <richkulp@xxxxxxxxxx>


Hi,

I don't remember the specifics, but you are not really clicking on a JButton. The JButton instance doesn't even exist in Eclipse. In the VE the JButton is modeled by a BeanProxy object that models an actual JButton. I believe what is returned from the selection event handler is actually an IPropertySource which wrappers the JButton VE  model object.

Rich



"Nicolas DRUT" <nicolas.drut@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

08/07/2008 08:30 AM

Please respond to
Discussions people developing code for the Visual Editor project        <ve-dev@xxxxxxxxxxx>

To

"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>

cc

 

Subject

[ve-dev] About the workbench selection

 

 

 




Hi,

This is me again with Visual Editor.
I am now trying to develop a new view to use it with VE. My view needs to know witch item is selected on the workbench. For example, if user clic on a JButton called myButton, I would like to be able to get an handle on the myButton class (in order to read his attributes for example).
I have tried to follow this tutorial : http://www.eclipse.org/articles/Article-WorkbenchSelections/article.html

, I managed to get back something but it is an Object type class whereas the item I clicked was a JButton. I tried to cast it in the JButton type but it failed, it seems to me that this is totally an other object ... Could you please help to find out how to get an handle on this JButton ?



I don't really know if it is a VE problem but perhaps some of you have tried to do the same someday, I hope.

Thank you very much for your help and looking forward to hearing from you.

Cheers,

Nicolas._______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev

 


_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev



Back to the top