Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Howto] [jface] open an editor from within a Wizard?
[Howto] [jface] open an editor from within a Wizard? [message #1492] Mon, 21 April 2003 14:56 Go to next message
Eclipse UserFriend
R2.0.2, Win2K

One can open an editor with the following code, where _site is an
IWorkbenchPartSite (ViewSite or EditorSite) and _ifile is a valid IFile
known to Eclipse.

final IWorkbenchPage page =
_site.getWorkbenchWindow().getActivePage();
try {
if (page != null) {
page.openEditor(_ifile);
}

} catch (PartInitException e) {
e.printStackTrace();
}

Since Wizards have no (access to any) IWorkbenchPartSite, is it possible

as one of the effects of a Wizard to open an editor? If not, what is
the theoretical reason, if any, for not allowing that?

thanks,
Paul K
Re: [Howto] [jface] open an editor from within a Wizard? [message #1567 is a reply to message #1492] Sun, 20 April 2003 16:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gsrt.terra.com.br

I'm not quite sure if it will work, or even if it is possible, but have you
tried the code ?

PlaformUI.getWorkbench().getActiveWorkbenchWindow().getActiv ePage().openEditor(IFile);

[]s
Glauco Reis


"Paul T. Keyser" wrote:

> R2.0.2, Win2K
>
> One can open an editor with the following code, where _site is an
> IWorkbenchPartSite (ViewSite or EditorSite) and _ifile is a valid IFile
> known to Eclipse.
>
> final IWorkbenchPage page =
> _site.getWorkbenchWindow().getActivePage();
> try {
> if (page != null) {
> page.openEditor(_ifile);
> }
>
> } catch (PartInitException e) {
> e.printStackTrace();
> }
>
> Since Wizards have no (access to any) IWorkbenchPartSite, is it possible
>
> as one of the effects of a Wizard to open an editor? If not, what is
> the theoretical reason, if any, for not allowing that?
>
> thanks,
> Paul K
Re: [Howto] [jface] open an editor from within a Wizard? [message #2829 is a reply to message #1567] Tue, 22 April 2003 11:48 Go to previous message
Eclipse UserFriend
Perfect! Thanks!

Paul K

Glauco Reis wrote:

> I'm not quite sure if it will work, or even if it is possible, but have you
> tried the code ?
>
> PlaformUI.getWorkbench().getActiveWorkbenchWindow().getActiv ePage().openEditor(IFile);
>
> []s
> Glauco Reis
>
> "Paul T. Keyser" wrote:
>
> > R2.0.2, Win2K
> >
> > One can open an editor with the following code, where _site is an
> > IWorkbenchPartSite (ViewSite or EditorSite) and _ifile is a valid IFile
> > known to Eclipse.
> >
> > final IWorkbenchPage page =
> > _site.getWorkbenchWindow().getActivePage();
> > try {
> > if (page != null) {
> > page.openEditor(_ifile);
> > }
> >
> > } catch (PartInitException e) {
> > e.printStackTrace();
> > }
> >
> > Since Wizards have no (access to any) IWorkbenchPartSite, is it possible
> >
> > as one of the effects of a Wizard to open an editor? If not, what is
> > the theoretical reason, if any, for not allowing that?
> >
> > thanks,
> > Paul K
Previous Topic:how 2 access perspectives, views programatically.
Next Topic:PDE Help
Goto Forum:
  


Current Time: Fri May 09 17:48:11 EDT 2025

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

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

Back to the top