|
Re: Real set up for DataBinding in an RCP app [message #464565 is a reply to message #464434] |
Fri, 09 March 2007 11:16 |
Marko Topolnik Messages: 42 Registered: July 2009 |
Member |
|
|
The probable reason nobody is answering you is that what you're asking
is not (or seems not to be) an Eclipse question. To get from what Brad
has already given you to a correct solution, all that is needed is
elementary Java knowledge. If beforehand you had
Realm.setDefault(SWTObservables.getRealm(display));
final int returnCode =
PlatformUI.createAndRunWorkbench(display, advisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
}
return IPlatformRunnable.EXIT_OK;
now you need
final int[] returnCode = {0};
Realm.runWithDefault(
SWTObservables.getRealm(display), new Runnable() {
public void run() {
returnCode[0] =
PlatformUI.createAndRunWorkbench(display, advisor);
}
});
if (returnCode[0] == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
}
return IPlatformRunnable.EXIT_OK;
Regards,
Marko Topolnik, Ph.D.
CROZ d.o.o.
mtopolnik@croz.net
Ali Naddaf wrote:
> All,
>
> I have asked this question on eclipse.platform as well but haven't
> received only one response that couldn't get me going. Since it is in an
> RCP app, I am sending this question to this list as well.
>
> I am planing to update to the latest databinding from CVS (I am
> currently using an earlier version) but noticed that Realm set up has
> also changed. My question is how to set up the Realm in an RCP app? Brad
> Reynolds was kind enough to suggest something along the following lines
> (on platform mailing list) but this doesn't work the way it is (void
> run() is returning an object).
>
> ------------------------------
>
> Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
> public void run() {
> try {
> int returnCode = PlatformUI.createAndRunWorkbench(display,
> new ApplicationWorkbenchAdvisor());
> if (returnCode == PlatformUI.RETURN_RESTART) {
> return IPlatformRunnable.EXIT_RESTART;
> }
> return IPlatformRunnable.EXIT_OK;
> } finally {
> display.dispose();
> }
> }
> });
> ----------------------------
>
>
> Could someone who has done it please let me know the proper set up?
>
> Many thanks,
> Ali.
|
|
|
Re: Real set up for DataBinding in an RCP app [message #464569 is a reply to message #464565] |
Fri, 09 March 2007 12:34 |
Marko Topolnik Messages: 42 Registered: July 2009 |
Member |
|
|
I forgot to mention the most important thing: as of 3.3M5eh, you don't
need to do anything Realm-related in your code because the new
implementation of createAndRunWorkbench takes care it for you -- as Brad
has shown us in his last post to the thread "Real in RCP"
(eclipse.platform).
Marko Topolnik, Ph.D.
CROZ d.o.o.
mtopolnik@croz.net
Marko Topolnik wrote:
> The probable reason nobody is answering you is that what you're asking
> is not (or seems not to be) an Eclipse question. To get from what Brad
> has already given you to a correct solution, all that is needed is
> elementary Java knowledge. If beforehand you had
>
> Realm.setDefault(SWTObservables.getRealm(display));
> final int returnCode =
> PlatformUI.createAndRunWorkbench(display, advisor);
> if (returnCode == PlatformUI.RETURN_RESTART) {
> return IPlatformRunnable.EXIT_RESTART;
> }
> return IPlatformRunnable.EXIT_OK;
>
>
> now you need
>
> final int[] returnCode = {0};
> Realm.runWithDefault(
> SWTObservables.getRealm(display), new Runnable() {
> public void run() {
> returnCode[0] =
> PlatformUI.createAndRunWorkbench(display, advisor);
> }
> });
> if (returnCode[0] == PlatformUI.RETURN_RESTART) {
> return IPlatformRunnable.EXIT_RESTART;
> }
> return IPlatformRunnable.EXIT_OK;
>
>
> Regards,
>
> Marko Topolnik, Ph.D.
> CROZ d.o.o.
> mtopolnik@croz.net
>
>
>
> Ali Naddaf wrote:
>> All,
>>
>> I have asked this question on eclipse.platform as well but haven't
>> received only one response that couldn't get me going. Since it is in
>> an RCP app, I am sending this question to this list as well.
>>
>> I am planing to update to the latest databinding from CVS (I am
>> currently using an earlier version) but noticed that Realm set up has
>> also changed. My question is how to set up the Realm in an RCP app?
>> Brad Reynolds was kind enough to suggest something along the following
>> lines (on platform mailing list) but this doesn't work the way it is
>> (void run() is returning an object).
>>
>> ------------------------------
>>
>> Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
>> public void run() {
>> try {
>> int returnCode = PlatformUI.createAndRunWorkbench(display,
>> new ApplicationWorkbenchAdvisor());
>> if (returnCode == PlatformUI.RETURN_RESTART) {
>> return IPlatformRunnable.EXIT_RESTART;
>> }
>> return IPlatformRunnable.EXIT_OK;
>> } finally {
>> display.dispose();
>> }
>> }
>> });
>> ----------------------------
>>
>>
>> Could someone who has done it please let me know the proper set up?
>>
>> Many thanks,
>> Ali.
|
|
|
Powered by
FUDForum. Page generated in 0.05354 seconds