| 
| How to exit RCP during start up? [message #332671] | Tue, 04 November 2008 10:19  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 In an RCP application I am building I have to check for the existence of a
 resource and if it does not exist display a dialog to the user to select one
 from the file system. If the user fails to select a valid resource, i.e.
 they press Cancel, then I want to exit the application. In this case the
 workbench should never be instantiated.
 
 Any suggestions on how to implement this use case?
 
 Thanks,
 Joel
 --
 Joel Rosi-Schwartz
 Etish Limited [http://www.etish.org]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ^...^
 /  o,o  \             The proud parents of Useme & ORMF
 |) ::: (|           Open Requirements Management Framework
 ====w=w====             [http://www.eclipse.org/ormf/]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 |  |  |  | 
|  | 
|  | 
|  | 
| 
| Re: How to exit RCP during start up? [message #332680 is a reply to message #332679] | Tue, 04 November 2008 13:16   |  | 
| Eclipse User  |  |  |  |  | On 04/11/2008 18:03, in article geq2q5$pav$1@build.eclipse.org, "Eric Rizzo" <eclipse-news@rizzoweb.com> wrote:
 
 > On 11/4/2008 12:44 PM, Joel Rosi-Schwartz wrote:
 >> I also have a further issue. My architecture is split up with an app, core
 >> and ui bundles. I would really not like to pollute the app bundle with UI
 >> stuff if I can help it. Once I pull this File dialog into the app bundle, I
 >> also have to pull up my preferences. This means that all of my dialogs that
 >> access preferences also (and I have not many but a few) these have be pulled
 >> up to access the plug-ins preference store. This is getting too sloppy for
 >> my taste.
 >>
 >> The only solution I have come up with so far is to put the resource check in
 >> the Activator.start() method of my ui bundle. This also seems brutish,
 >> but...
 >>
 >> Anyone have a idea for a cleaner solution?
 >
 > You could define your own extension point in the app bundle and have it
 > delegate to some interface (defined by that extension point) to do the
 > real work. Something like ResourceSelectionHandler. Then your UI plugin
 > implements that extension point and provides and implementation of the
 > interface.
 >
 > You could also do it with a fragment that is hosted by the app plugin;
 > the fragment can have UI dependencies but keep them out of the plugin
 > itself.
 >
 > Hope this helps,
 > Eric
 
 The first is a very interesting idea, I will give it whirl. The second, i.e.
 using a fragment, doesn't actually solve my issues.
 
 Thanks,
 Joel
 |  |  |  | 
| 
| Re: How to exit RCP during start up? [message #332681 is a reply to message #332680] | Tue, 04 November 2008 14:18   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: subs._nospam_consertum.com 
 Does
 PlatformUI.getWorkbench().close();
 
 do what you want?
 
 Joel Rosi-Schwartz wrote:
 > On 04/11/2008 18:03, in article geq2q5$pav$1@build.eclipse.org, "Eric Rizzo"
 > <eclipse-news@rizzoweb.com> wrote:
 >
 >> On 11/4/2008 12:44 PM, Joel Rosi-Schwartz wrote:
 >>> I also have a further issue. My architecture is split up with an app, core
 >>> and ui bundles. I would really not like to pollute the app bundle with UI
 >>> stuff if I can help it. Once I pull this File dialog into the app bundle, I
 >>> also have to pull up my preferences. This means that all of my dialogs that
 >>> access preferences also (and I have not many but a few) these have be pulled
 >>> up to access the plug-ins preference store. This is getting too sloppy for
 >>> my taste.
 >>>
 >>> The only solution I have come up with so far is to put the resource check in
 >>> the Activator.start() method of my ui bundle. This also seems brutish,
 >>> but...
 >>>
 >>> Anyone have a idea for a cleaner solution?
 >> You could define your own extension point in the app bundle and have it
 >> delegate to some interface (defined by that extension point) to do the
 >> real work. Something like ResourceSelectionHandler. Then your UI plugin
 >> implements that extension point and provides and implementation of the
 >> interface.
 >>
 >> You could also do it with a fragment that is hosted by the app plugin;
 >> the fragment can have UI dependencies but keep them out of the plugin
 >> itself.
 >>
 >> Hope this helps,
 >> Eric
 >
 > The first is a very interesting idea, I will give it whirl. The second, i.e.
 > using a fragment, doesn't actually solve my issues.
 >
 > Thanks,
 > Joel
 >
 
 
 --
 Derek
 |  |  |  | 
| 
| Re: How to exit RCP during start up? [message #332698 is a reply to message #332681] | Wed, 05 November 2008 10:24  |  | 
| Eclipse User  |  |  |  |  | Thanks Derek, that is exactly what I was looking for. 
 Cheers,
 Joel
 
 On 04/11/2008 19:18, in article geq770$a4h$1@build.eclipse.org, "Derek"
 <subs@_nospam_consertum.com> wrote:
 
 > Does
 > PlatformUI.getWorkbench().close();
 >
 > do what you want?
 >
 > Joel Rosi-Schwartz wrote:
 >> On 04/11/2008 18:03, in article geq2q5$pav$1@build.eclipse.org, "Eric Rizzo"
 >> <eclipse-news@rizzoweb.com> wrote:
 >>
 >>> On 11/4/2008 12:44 PM, Joel Rosi-Schwartz wrote:
 >>>> I also have a further issue. My architecture is split up with an app, core
 >>>> and ui bundles. I would really not like to pollute the app bundle with UI
 >>>> stuff if I can help it. Once I pull this File dialog into the app bundle, I
 >>>> also have to pull up my preferences. This means that all of my dialogs that
 >>>> access preferences also (and I have not many but a few) these have be
 >>>> pulled
 >>>> up to access the plug-ins preference store. This is getting too sloppy for
 >>>> my taste.
 >>>>
 >>>> The only solution I have come up with so far is to put the resource check
 >>>> in
 >>>> the Activator.start() method of my ui bundle. This also seems brutish,
 >>>> but...
 >>>>
 >>>> Anyone have a idea for a cleaner solution?
 >>> You could define your own extension point in the app bundle and have it
 >>> delegate to some interface (defined by that extension point) to do the
 >>> real work. Something like ResourceSelectionHandler. Then your UI plugin
 >>> implements that extension point and provides and implementation of the
 >>> interface.
 >>>
 >>> You could also do it with a fragment that is hosted by the app plugin;
 >>> the fragment can have UI dependencies but keep them out of the plugin
 >>> itself.
 >>>
 >>> Hope this helps,
 >>> Eric
 >>
 >> The first is a very interesting idea, I will give it whirl. The second, i.e.
 >> using a fragment, doesn't actually solve my issues.
 >>
 >> Thanks,
 >> Joel
 >>
 >
 
 --
 Joel Rosi-Schwartz
 Etish Limited [http://www.etish.org]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ^...^
 /  o,o  \             The proud parents of Useme & ORMF
 |) ::: (|           Open Requirements Management Framework
 ====w=w====             [http://www.eclipse.org/ormf/]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.04892 seconds