Home » Eclipse Projects » Eclipse Platform » RCP and IEditorPart, looking for minimal example
RCP and IEditorPart, looking for minimal example [message #278473] |
Mon, 03 January 2005 10:35  |
Eclipse User |
|
|
|
Originally posted by: mmaercker.tripper-bullet.com
Hi all,
I am looking for the smallest possible example that allows one to use an
editor in a rich client platform application. I tried doing this myself but
am stuck on how to load the editor in createInitialLayout(IPageLayout
layout). So maybe that isn't the place to do the loading, I need to somehow
get a file new wizard set up. But how do I connect the wizard with the
perspective?
I tried stepping through editor initialization in a "normal" plug-in but it
dives into the platform depths. I couldn't figure out which entities serve
as complements to the PlatformUI and PerspectiveFactory as used in RCP.
Maybe I am asking the wrong questions (that feeling in itself is not a good
sign ;). That's why I think it would probably help me most if I could
analyze a _minimal_ example that does nothing but allow one to start an RCP
application, launch an editor (preferably just a plain text editor), and
close it again. Any hints where I could find something like that? Any code
snippets that show the glue code leading from the extension point definition
to the availability of the editor in the workspace would also be much
appreciated.
Thanks in advance,
Martin Maercker
|
|
|
Re: RCP and IEditorPart, looking for minimal example [message #278491 is a reply to message #278473] |
Mon, 03 January 2005 18:52   |
Eclipse User |
|
|
|
Using IEditorPart in RCP is coloring outside the lines... so anyway, the
way to get a minimal example is to create a new plugin project (not an
RCP app) and choose the template example to create a plugin with an
editor. Try it out, make sure it works, and then start stripping it
down to get the barebones pieces you want.
-
Steve
Martin Maercker wrote:
> Hi all,
>
> I am looking for the smallest possible example that allows one to use an
> editor in a rich client platform application. I tried doing this myself but
> am stuck on how to load the editor in createInitialLayout(IPageLayout
> layout). So maybe that isn't the place to do the loading, I need to somehow
> get a file new wizard set up. But how do I connect the wizard with the
> perspective?
>
> I tried stepping through editor initialization in a "normal" plug-in but it
> dives into the platform depths. I couldn't figure out which entities serve
> as complements to the PlatformUI and PerspectiveFactory as used in RCP.
>
> Maybe I am asking the wrong questions (that feeling in itself is not a good
> sign ;). That's why I think it would probably help me most if I could
> analyze a _minimal_ example that does nothing but allow one to start an RCP
> application, launch an editor (preferably just a plain text editor), and
> close it again. Any hints where I could find something like that? Any code
> snippets that show the glue code leading from the extension point definition
> to the availability of the editor in the workspace would also be much
> appreciated.
>
>
> Thanks in advance,
>
> Martin Maercker
>
>
>
>
>
>
>
|
|
|
minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278492 is a reply to message #278491] |
Mon, 03 January 2005 22:41   |
Eclipse User |
|
|
|
Rather than say to create and strip down the Eclipse editor example I
should have pointed you to the RCP text editor example. There are links
to it in the RCP newsgroup. The editor area is part of the perspective
and you can control whether it is initially visible or not in your
workbench advisor.
You can open an IEditor on an IFile in an Eclipse plug in with something
like
myIEditorPart=PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow() .getActivePage()
..openEditor(new FileEditorInput(myIFile),"myEditorID");
-
Steve
Steve Blass wrote:
> Using IEditorPart in RCP is coloring outside the lines... so anyway, the
> way to get a minimal example is to create a new plugin project (not an
> RCP app) and choose the template example to create a plugin with an
> editor. Try it out, make sure it works, and then start stripping it
> down to get the barebones pieces you want.
>
> -
> Steve
>
>
>
> Martin Maercker wrote:
>
>> Hi all,
>>
>> I am looking for the smallest possible example that allows one to use an
>> editor in a rich client platform application. I tried doing this
>> myself but
>> am stuck on how to load the editor in createInitialLayout(IPageLayout
>> layout). So maybe that isn't the place to do the loading, I need to
>> somehow
>> get a file new wizard set up. But how do I connect the wizard with the
>> perspective?
>>
>> I tried stepping through editor initialization in a "normal" plug-in
>> but it
>> dives into the platform depths. I couldn't figure out which entities
>> serve
>> as complements to the PlatformUI and PerspectiveFactory as used in RCP.
>>
>> Maybe I am asking the wrong questions (that feeling in itself is not a
>> good
>> sign ;). That's why I think it would probably help me most if I could
>> analyze a _minimal_ example that does nothing but allow one to start
>> an RCP
>> application, launch an editor (preferably just a plain text editor), and
>> close it again. Any hints where I could find something like that? Any
>> code
>> snippets that show the glue code leading from the extension point
>> definition
>> to the availability of the editor in the workspace would also be much
>> appreciated.
>>
>>
>> Thanks in advance,
>>
>> Martin Maercker
>>
>>
>>
>>
>>
>>
>>
|
|
|
Re: minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278506 is a reply to message #278492] |
Tue, 04 January 2005 06:00   |
Eclipse User |
|
|
|
Originally posted by: mmaercker.tripper-bullet.com
Thanks Steve,
I'll look for the RCP text editor example and try starting from there.
I don't want to open up a can of worms, but I am curious: why do you say
that using IEditorPart in RCP is stretching things?
Best Regards,
Martin
"Steve Blass" <swb@aurora.phys.utk.edu> schrieb im Newsbeitrag
news:<crd38j$sno$1@www.eclipse.org>...
> Rather than say to create and strip down the Eclipse editor example I
> should have pointed you to the RCP text editor example. There are links
> to it in the RCP newsgroup. The editor area is part of the perspective
> and you can control whether it is initially visible or not in your
> workbench advisor.
>
> You can open an IEditor on an IFile in an Eclipse plug in with something
> like
>
> myIEditorPart=PlatformUI
> .getWorkbench()
> .getActiveWorkbenchWindow() .getActivePage()
> .openEditor(new FileEditorInput(myIFile),"myEditorID");
>
>
> -
> Steve
>
>
> Steve Blass wrote:
>
> > Using IEditorPart in RCP is coloring outside the lines... so anyway, the
> > way to get a minimal example is to create a new plugin project (not an
> > RCP app) and choose the template example to create a plugin with an
> > editor. Try it out, make sure it works, and then start stripping it
> > down to get the barebones pieces you want.
> >
> > -
> > Steve
> >
> >
> >
> > Martin Maercker wrote:
> >
> >> Hi all,
> >>
> >> I am looking for the smallest possible example that allows one to use
an
> >> editor in a rich client platform application. I tried doing this
> >> myself but
> >> am stuck on how to load the editor in createInitialLayout(IPageLayout
> >> layout). So maybe that isn't the place to do the loading, I need to
> >> somehow
> >> get a file new wizard set up. But how do I connect the wizard with the
> >> perspective?
> >>
> >> I tried stepping through editor initialization in a "normal" plug-in
> >> but it
> >> dives into the platform depths. I couldn't figure out which entities
> >> serve
> >> as complements to the PlatformUI and PerspectiveFactory as used in RCP.
> >>
> >> Maybe I am asking the wrong questions (that feeling in itself is not a
> >> good
> >> sign ;). That's why I think it would probably help me most if I could
> >> analyze a _minimal_ example that does nothing but allow one to start
> >> an RCP
> >> application, launch an editor (preferably just a plain text editor),
and
> >> close it again. Any hints where I could find something like that? Any
> >> code
> >> snippets that show the glue code leading from the extension point
> >> definition
> >> to the availability of the editor in the workspace would also be much
> >> appreciated.
> >>
> >>
> >> Thanks in advance,
> >>
> >> Martin Maercker
> >>
> >>
> >>
> >>
> >>
> >>
> >>
"Steve Blass" <swb@aurora.phys.utk.edu> schrieb im Newsbeitrag
news:crd38j$sno$1@www.eclipse.org...
> Rather than say to create and strip down the Eclipse editor example I
> should have pointed you to the RCP text editor example. There are links
> to it in the RCP newsgroup. The editor area is part of the perspective
> and you can control whether it is initially visible or not in your
> workbench advisor.
>
> You can open an IEditor on an IFile in an Eclipse plug in with something
> like
>
> myIEditorPart=PlatformUI
> .getWorkbench()
> .getActiveWorkbenchWindow() .getActivePage()
> .openEditor(new FileEditorInput(myIFile),"myEditorID");
>
>
> -
> Steve
>
>
> Steve Blass wrote:
>
> > Using IEditorPart in RCP is coloring outside the lines... so anyway, the
> > way to get a minimal example is to create a new plugin project (not an
> > RCP app) and choose the template example to create a plugin with an
> > editor. Try it out, make sure it works, and then start stripping it
> > down to get the barebones pieces you want.
> >
> > -
> > Steve
> >
> >
> >
> > Martin Maercker wrote:
> >
> >> Hi all,
> >>
> >> I am looking for the smallest possible example that allows one to use
an
> >> editor in a rich client platform application. I tried doing this
> >> myself but
> >> am stuck on how to load the editor in createInitialLayout(IPageLayout
> >> layout). So maybe that isn't the place to do the loading, I need to
> >> somehow
> >> get a file new wizard set up. But how do I connect the wizard with the
> >> perspective?
> >>
> >> I tried stepping through editor initialization in a "normal" plug-in
> >> but it
> >> dives into the platform depths. I couldn't figure out which entities
> >> serve
> >> as complements to the PlatformUI and PerspectiveFactory as used in RCP.
> >>
> >> Maybe I am asking the wrong questions (that feeling in itself is not a
> >> good
> >> sign ;). That's why I think it would probably help me most if I could
> >> analyze a _minimal_ example that does nothing but allow one to start
> >> an RCP
> >> application, launch an editor (preferably just a plain text editor),
and
> >> close it again. Any hints where I could find something like that? Any
> >> code
> >> snippets that show the glue code leading from the extension point
> >> definition
> >> to the availability of the editor in the workspace would also be much
> >> appreciated.
> >>
> >>
> >> Thanks in advance,
> >>
> >> Martin Maercker
> >>
> >>
> >>
> >>
> >>
> >>
> >>
|
|
|
Re: minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278561 is a reply to message #278492] |
Tue, 04 January 2005 14:00   |
Eclipse User |
|
|
|
Originally posted by: mmaercker.tripper-bullet.com
In the text editor example, they are integrating an RCP-specific text
editing framework. I was a bit surprised because I would have thought that
for text editing, of all things, reuse of non-RCP-specific components should
have been easy. Am I completely on the wrong track if I hope to be able to
develop editors that can be deployed in both a RCP and a "normal" Eclipse
context?
Regards and thanks in advance,
Martin
"Steve Blass" <swb@aurora.phys.utk.edu> schrieb im Newsbeitrag
news:crd38j$sno$1@www.eclipse.org...
> Rather than say to create and strip down the Eclipse editor example I
> should have pointed you to the RCP text editor example. There are links
> to it in the RCP newsgroup. The editor area is part of the perspective
> and you can control whether it is initially visible or not in your
> workbench advisor.
>
> You can open an IEditor on an IFile in an Eclipse plug in with something
> like
>
> myIEditorPart=PlatformUI
> .getWorkbench()
> .getActiveWorkbenchWindow() .getActivePage()
> .openEditor(new FileEditorInput(myIFile),"myEditorID");
>
>
> -
> Steve
>
>
> Steve Blass wrote:
>
> > Using IEditorPart in RCP is coloring outside the lines... so anyway, the
> > way to get a minimal example is to create a new plugin project (not an
> > RCP app) and choose the template example to create a plugin with an
> > editor. Try it out, make sure it works, and then start stripping it
> > down to get the barebones pieces you want.
> >
> > -
> > Steve
> >
> >
> >
> > Martin Maercker wrote:
> >
> >> Hi all,
> >>
> >> I am looking for the smallest possible example that allows one to use
an
> >> editor in a rich client platform application. I tried doing this
> >> myself but
> >> am stuck on how to load the editor in createInitialLayout(IPageLayout
> >> layout). So maybe that isn't the place to do the loading, I need to
> >> somehow
> >> get a file new wizard set up. But how do I connect the wizard with the
> >> perspective?
> >>
> >> I tried stepping through editor initialization in a "normal" plug-in
> >> but it
> >> dives into the platform depths. I couldn't figure out which entities
> >> serve
> >> as complements to the PlatformUI and PerspectiveFactory as used in RCP.
> >>
> >> Maybe I am asking the wrong questions (that feeling in itself is not a
> >> good
> >> sign ;). That's why I think it would probably help me most if I could
> >> analyze a _minimal_ example that does nothing but allow one to start
> >> an RCP
> >> application, launch an editor (preferably just a plain text editor),
and
> >> close it again. Any hints where I could find something like that? Any
> >> code
> >> snippets that show the glue code leading from the extension point
> >> definition
> >> to the availability of the editor in the workspace would also be much
> >> appreciated.
> >>
> >>
> >> Thanks in advance,
> >>
> >> Martin Maercker
> >>
> >>
> >>
> >>
> >>
> >>
> >>
|
|
|
Re: minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278574 is a reply to message #278506] |
Tue, 04 January 2005 16:46   |
Eclipse User |
|
|
|
Martin Maercker wrote:
> Thanks Steve,
>
> I'll look for the RCP text editor example and try starting from there.
>
> I don't want to open up a can of worms, but I am curious: why do you say
> that using IEditorPart in RCP is stretching things?
>
>
>
> Best Regards,
>
> Martin
>
The RCP faq says the ide plugin is not meant to be reused in RCP
applications. The resource model in the resources plugin is ok to use
but the UI parts that go with the kind of eclipse editors and new file
wizards you see in your development workbench start to pull in things
from the ide. That's where you begin to cross over into territory the
RCP platform isn't meant for. Things work but you acquire UI
contributions you may not want and then find that there is no API for
removing or disabling ide contributions like the Resource perspective,
and the Open External File menu item among others.
I tend to ignore the recommendation to not use IDE with RCP but I (now)
see the application as an Eclipse product rather than as an RCP
application.
Eclipse products can use the RCP methodology for managing start up and
workbench configuration. (three cheers for RCP) By the time you deploy
an Eclipse based product, whether RCP or not, you have accumulated so
many bits that the 700K or so that including the ide adds to your
deployment is trivial. What may not be trivial is fine tuning the
workbench to taste. You will be stuck with a File menu that includes
Project. You will need to create Projects to put Files in. There will
be error messages logged about missing and invalid extensions. The
upside is that you can re-use Editors, and the Navigator, and software
updates, and third party plug-ins. And you can build tools that plug
in to your custom application workbench and/or to a regular Eclipse
installation.
Pay your money, take your choices; and remember that beggars can't be
choosers. Eclipse is about contribution rather than disablement so
there's not a lot of help available for turning things off in an RCP
context when you choose to ignore RCP FAQ recommendations.
-
Steve
|
|
|
Re: minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278589 is a reply to message #278574] |
Wed, 05 January 2005 04:57   |
Eclipse User |
|
|
|
Originally posted by: mmaercker.tripper-bullet.com
It's good to have a notion of the contours of lines one might end up
coloring outside of. Thank you for sketching them!
Martin
Your post is
"Steve Blass" <swb@aurora.phys.utk.edu> schrieb im Newsbeitrag
news:crf2tr$csl$1@www.eclipse.org...
> Martin Maercker wrote:
> > Thanks Steve,
> >
> > I'll look for the RCP text editor example and try starting from there.
> >
> > I don't want to open up a can of worms, but I am curious: why do you say
> > that using IEditorPart in RCP is stretching things?
> >
> >
> >
> > Best Regards,
> >
> > Martin
> >
>
> The RCP faq says the ide plugin is not meant to be reused in RCP
> applications. The resource model in the resources plugin is ok to use
> but the UI parts that go with the kind of eclipse editors and new file
> wizards you see in your development workbench start to pull in things
> from the ide. That's where you begin to cross over into territory the
> RCP platform isn't meant for. Things work but you acquire UI
> contributions you may not want and then find that there is no API for
> removing or disabling ide contributions like the Resource perspective,
> and the Open External File menu item among others.
>
> I tend to ignore the recommendation to not use IDE with RCP but I (now)
> see the application as an Eclipse product rather than as an RCP
> application.
>
> Eclipse products can use the RCP methodology for managing start up and
> workbench configuration. (three cheers for RCP) By the time you deploy
> an Eclipse based product, whether RCP or not, you have accumulated so
> many bits that the 700K or so that including the ide adds to your
> deployment is trivial. What may not be trivial is fine tuning the
> workbench to taste. You will be stuck with a File menu that includes
> Project. You will need to create Projects to put Files in. There will
> be error messages logged about missing and invalid extensions. The
> upside is that you can re-use Editors, and the Navigator, and software
> updates, and third party plug-ins. And you can build tools that plug
> in to your custom application workbench and/or to a regular Eclipse
> installation.
>
> Pay your money, take your choices; and remember that beggars can't be
> choosers. Eclipse is about contribution rather than disablement so
> there's not a lot of help available for turning things off in an RCP
> context when you choose to ignore RCP FAQ recommendations.
>
> -
> Steve
>
|
|
|
Re: minimal example... Re: RCP and IEditorPart, looking for minimal example [message #278599 is a reply to message #278561] |
Wed, 05 January 2005 08:21  |
Eclipse User |
|
|
|
Originally posted by: mmaercker.tripper-bullet.com
Steve Blass answered my question in the subthread above.
Thanks again,
Martin
"Martin Maercker" <mmaercker@tripper-bullet.com> schrieb im Newsbeitrag
news:creovn$bjb$1@www.eclipse.org...
> In the text editor example, they are integrating an RCP-specific text
> editing framework. I was a bit surprised because I would have thought that
> for text editing, of all things, reuse of non-RCP-specific components
should
> have been easy. Am I completely on the wrong track if I hope to be able to
> develop editors that can be deployed in both a RCP and a "normal" Eclipse
> context?
>
>
> Regards and thanks in advance,
>
> Martin
>
>
>
>
> "Steve Blass" <swb@aurora.phys.utk.edu> schrieb im Newsbeitrag
> news:crd38j$sno$1@www.eclipse.org...
> > Rather than say to create and strip down the Eclipse editor example I
> > should have pointed you to the RCP text editor example. There are links
> > to it in the RCP newsgroup. The editor area is part of the perspective
> > and you can control whether it is initially visible or not in your
> > workbench advisor.
> >
> > You can open an IEditor on an IFile in an Eclipse plug in with something
> > like
> >
> > myIEditorPart=PlatformUI
> > .getWorkbench()
> > .getActiveWorkbenchWindow() .getActivePage()
> > .openEditor(new FileEditorInput(myIFile),"myEditorID");
> >
> >
> > -
> > Steve
> >
> >
> > Steve Blass wrote:
> >
> > > Using IEditorPart in RCP is coloring outside the lines... so anyway,
the
> > > way to get a minimal example is to create a new plugin project (not an
> > > RCP app) and choose the template example to create a plugin with an
> > > editor. Try it out, make sure it works, and then start stripping it
> > > down to get the barebones pieces you want.
> > >
> > > -
> > > Steve
> > >
> > >
> > >
> > > Martin Maercker wrote:
> > >
> > >> Hi all,
> > >>
> > >> I am looking for the smallest possible example that allows one to use
> an
> > >> editor in a rich client platform application. I tried doing this
> > >> myself but
> > >> am stuck on how to load the editor in createInitialLayout(IPageLayout
> > >> layout). So maybe that isn't the place to do the loading, I need to
> > >> somehow
> > >> get a file new wizard set up. But how do I connect the wizard with
the
> > >> perspective?
> > >>
> > >> I tried stepping through editor initialization in a "normal" plug-in
> > >> but it
> > >> dives into the platform depths. I couldn't figure out which entities
> > >> serve
> > >> as complements to the PlatformUI and PerspectiveFactory as used in
RCP.
> > >>
> > >> Maybe I am asking the wrong questions (that feeling in itself is not
a
> > >> good
> > >> sign ;). That's why I think it would probably help me most if I could
> > >> analyze a _minimal_ example that does nothing but allow one to start
> > >> an RCP
> > >> application, launch an editor (preferably just a plain text editor),
> and
> > >> close it again. Any hints where I could find something like that? Any
> > >> code
> > >> snippets that show the glue code leading from the extension point
> > >> definition
> > >> to the availability of the editor in the workspace would also be much
> > >> appreciated.
> > >>
> > >>
> > >> Thanks in advance,
> > >>
> > >> Martin Maercker
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
>
>
|
|
|
Goto Forum:
Current Time: Thu Sep 25 21:51:29 EDT 2025
Powered by FUDForum. Page generated in 0.04138 seconds
|