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] Tue, 08 December 2009 21:15 Go to next message
Walter Mising name is currently offline Walter Mising name
Messages: 126
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 11:48 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANG
Messages: 687
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 09:34 Go to previous messageGo to next message
Walter Mising name is currently offline Walter Mising name
Messages: 126
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 10:36 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
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] Sun, 27 December 2009 23:38 Go to previous message
Walter Mising name is currently offline Walter Mising name
Messages: 126
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 09:34 Go to previous message
Walter Mising name is currently offline Walter Mising name
Messages: 126
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 15:32 Go to previous message
Brian de Alwis is currently offline Brian de Alwis
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] Sun, 27 December 2009 23:38 Go to previous message
Walter Mising name is currently offline Walter Mising name
Messages: 126
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: Thu Apr 17 20:48:31 EDT 2014

Powered by FUDForum. Page generated in 0.01749 seconds