Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT + TableViewer + Retrieve Table Data(How to retrieve data that was modifed )
XWT + TableViewer + Retrieve Table Data [message #502600] Wed, 09 December 2009 02:15 Go to next message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
Have used XWT.open to show a Collection in a TableViewer.
When the user clicks on a menu item, I need to have access to the data to persist.
What is the best way to achieve this ?

Thanks
- Walter.
Re: XWT + TableViewer + Retrieve Table Data [message #502631 is a reply to message #502600] Tue, 08 December 2009 16:48 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
You can give a name to the TableViewer, and use
XWT.findElementByName(context, "<name>") and then you can get the collection
by calling getInput().

Best regards
Yves YANG
"Walter" <kwchess@gmail.com> wrote in message
news:hfn181$8sp$1@build.eclipse.org...
> Have used XWT.open to show a Collection in a TableViewer.
> When the user clicks on a menu item, I need to have access to the data to
> persist.
> What is the best way to achieve this ?
>
> Thanks
> - Walter.
>
Re: XWT + TableViewer + Retrieve Table Data [message #502724 is a reply to message #502631] Wed, 09 December 2009 14:34 Go to previous messageGo to next message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
I have following questions
1) how can I get a context in the stand alone program.
2) in case of eclipse product I have IEclipseContext but when an menu is
clicked then a "Handler class" is called which has a method
public void execute(IWorkbench workbench) {
System.out.println ( "Save Invoked") ;
}
I am unable to find a way to get the IEclipseContext object thru
IWorkbench object.

Thanks
-Walter

"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hfno4k$k8g$1@build.eclipse.org...
> You can give a name to the TableViewer, and use
> XWT.findElementByName(context, "<name>") and then you can get the
> collection by calling getInput().
>
> Best regards
> Yves YANG
> "Walter" <kwchess@gmail.com> wrote in message
> news:hfn181$8sp$1@build.eclipse.org...
>> Have used XWT.open to show a Collection in a TableViewer.
>> When the user clicks on a menu item, I need to have access to the data to
>> persist.
>> What is the best way to achieve this ?
>>
>> Thanks
>> - Walter.
>>
>
>
Re: XWT + TableViewer + Retrieve Table Data [message #504021 is a reply to message #502724] Wed, 16 December 2009 15:36 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
Hi Walter. From one e4 newbie to another...

Walter Prabhakar wrote:
> I have following questions
> 1) how can I get a context in the stand alone program.

You can create a context: see
org.eclipse.e4.core.services.context.EclipseContextFactory.


> 2) in case of eclipse product I have IEclipseContext but when an menu
> is clicked then a "Handler class" is called which has a method
> public void execute(IWorkbench workbench) {
> System.out.println ( "Save Invoked") ;
> }
> I am unable to find a way to get the IEclipseContext object thru
> IWorkbench object.
e4 uses injection and dynamic method calling. It has a set of known
methods that it looks for (e.g., a method called "execute") and then
examines its signature to provide the requested values. So if you want
the IEclipseContext, then you simply ask for it :-)

@Inject
public void execute(IEclipseContext context,
IWorkbench workbench) {
System.out.println(...);
}


With e4 1.0M2, you have to annotate the methods with @Inject for e4 to
consider them. You can also annotate them with @Optional (will be set
to null if not available), and others. See the
org.eclipse.e4.demo.contacts for examples.

Brian.
Re: XWT + TableViewer + Retrieve Table Data [message #505153 is a reply to message #504021] Mon, 28 December 2009 04:38 Go to previous message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
Thanks a lot. This solved my problem.

-Walter

"Brian de Alwis" <bsd@acm.org> wrote in message
news:hgbg50$2nb$1@build.eclipse.org...
> Hi Walter. From one e4 newbie to another...
>
> Walter Prabhakar wrote:
>> I have following questions
>> 1) how can I get a context in the stand alone program.
>
> You can create a context: see
> org.eclipse.e4.core.services.context.EclipseContextFactory.
>
>
>> 2) in case of eclipse product I have IEclipseContext but when an menu is
>> clicked then a "Handler class" is called which has a method
>> public void execute(IWorkbench workbench) {
>> System.out.println ( "Save Invoked") ;
>> }
>> I am unable to find a way to get the IEclipseContext object thru
>> IWorkbench object.
> e4 uses injection and dynamic method calling. It has a set of known
> methods that it looks for (e.g., a method called "execute") and then
> examines its signature to provide the requested values. So if you want
> the IEclipseContext, then you simply ask for it :-)
>
> @Inject
> public void execute(IEclipseContext context,
> IWorkbench workbench) {
> System.out.println(...);
> }
>
>
> With e4 1.0M2, you have to annotate the methods with @Inject for e4 to
> consider them. You can also annotate them with @Optional (will be set to
> null if not available), and others. See the org.eclipse.e4.demo.contacts
> for examples.
>
> Brian.
Re: XWT + TableViewer + Retrieve Table Data [message #565685 is a reply to message #502631] Wed, 09 December 2009 14:34 Go to previous message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
I have following questions
1) how can I get a context in the stand alone program.
2) in case of eclipse product I have IEclipseContext but when an menu is
clicked then a "Handler class" is called which has a method
public void execute(IWorkbench workbench) {
System.out.println ( "Save Invoked") ;
}
I am unable to find a way to get the IEclipseContext object thru
IWorkbench object.

Thanks
-Walter

"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hfno4k$k8g$1@build.eclipse.org...
> You can give a name to the TableViewer, and use
> XWT.findElementByName(context, "<name>") and then you can get the
> collection by calling getInput().
>
> Best regards
> Yves YANG
> "Walter" <kwchess@gmail.com> wrote in message
> news:hfn181$8sp$1@build.eclipse.org...
>> Have used XWT.open to show a Collection in a TableViewer.
>> When the user clicks on a menu item, I need to have access to the data to
>> persist.
>> What is the best way to achieve this ?
>>
>> Thanks
>> - Walter.
>>
>
>
Re: XWT + TableViewer + Retrieve Table Data [message #566170 is a reply to message #502724] Wed, 16 December 2009 20:32 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
Hi Walter. From one e4 newbie to another...

Walter Prabhakar wrote:
> I have following questions
> 1) how can I get a context in the stand alone program.

You can create a context: see
org.eclipse.e4.core.services.context.EclipseContextFactory.


> 2) in case of eclipse product I have IEclipseContext but when an menu
> is clicked then a "Handler class" is called which has a method
> public void execute(IWorkbench workbench) {
> System.out.println ( "Save Invoked") ;
> }
> I am unable to find a way to get the IEclipseContext object thru
> IWorkbench object.
e4 uses injection and dynamic method calling. It has a set of known
methods that it looks for (e.g., a method called "execute") and then
examines its signature to provide the requested values. So if you want
the IEclipseContext, then you simply ask for it :-)

@Inject
public void execute(IEclipseContext context,
IWorkbench workbench) {
System.out.println(...);
}


With e4 1.0M2, you have to annotate the methods with @Inject for e4 to
consider them. You can also annotate them with @Optional (will be set
to null if not available), and others. See the
org.eclipse.e4.demo.contacts for examples.

Brian.
Re: XWT + TableViewer + Retrieve Table Data [message #566722 is a reply to message #566170] Mon, 28 December 2009 04:38 Go to previous message
Walter Mising name is currently offline Walter Mising nameFriend
Messages: 128
Registered: July 2009
Senior Member
Thanks a lot. This solved my problem.

-Walter

"Brian de Alwis" <bsd@acm.org> wrote in message
news:hgbg50$2nb$1@build.eclipse.org...
> Hi Walter. From one e4 newbie to another...
>
> Walter Prabhakar wrote:
>> I have following questions
>> 1) how can I get a context in the stand alone program.
>
> You can create a context: see
> org.eclipse.e4.core.services.context.EclipseContextFactory.
>
>
>> 2) in case of eclipse product I have IEclipseContext but when an menu is
>> clicked then a "Handler class" is called which has a method
>> public void execute(IWorkbench workbench) {
>> System.out.println ( "Save Invoked") ;
>> }
>> I am unable to find a way to get the IEclipseContext object thru
>> IWorkbench object.
> e4 uses injection and dynamic method calling. It has a set of known
> methods that it looks for (e.g., a method called "execute") and then
> examines its signature to provide the requested values. So if you want
> the IEclipseContext, then you simply ask for it :-)
>
> @Inject
> public void execute(IEclipseContext context,
> IWorkbench workbench) {
> System.out.println(...);
> }
>
>
> With e4 1.0M2, you have to annotate the methods with @Inject for e4 to
> consider them. You can also annotate them with @Optional (will be set to
> null if not available), and others. See the org.eclipse.e4.demo.contacts
> for examples.
>
> Brian.
Previous Topic:XWT + DataBinding +HashMap
Next Topic:XWT + DataBinding +DataContext +Replace
Goto Forum:
  


Current Time: Fri Mar 29 12:29:02 GMT 2024

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

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

Back to the top