Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [JFace] - Programmatically launching an editor throws an exception.
[JFace] - Programmatically launching an editor throws an exception. [message #114241] Thu, 21 August 2003 19:13 Go to next message
Eclipse UserFriend
I am trying to create an editor on a file within a perspective but I get
an error of type org.eclipse.ui.PartInitException.

The message that the error gives me also makes no sense:

IWAW0109E Failed to create model.

The code I am using to create the error is given below:

public void performAction(String name)
{
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkbench bench = PlatformUI.getWorkbench();
IWorkspaceRoot rootSpace = workspace.getRoot();
IWorkbenchPage activePage;
IFile resourceToEdit = null;

try {
IResource[] projects = rootSpace.members();
for ( int i = 0; i < projects.length; i++ )
{
try {
IProject project =(IProject)projects[i];
resourceToEdit = project.getFile(name);

if ( resourceToEdit != null )
{
activePage =
bench.getActiveWorkbenchWindow().getActivePage();
activePage.openEditor(resourceToEdit);
}
} catch ( CoreException ce ) {
System.out.println(ce.getClass().getName() + " " +
ce.getMessage());
resourceToEdit = null;
continue;
}
}



} catch ( CoreException ce ) {
System.out.println("Core Exception while getting the projects");
}
}

The name passed in is <filename>.htm

Any ideas on what the error means or a possible solution are greatly
appreciated.

Thanks.
Re: [JFace] - Programmatically launching an editor throws an exception. [message #114321 is a reply to message #114241] Fri, 22 August 2003 01:34 Go to previous messageGo to next message
Eclipse UserFriend
When is performAction called? In other words, do you have a stack trace for
the PartInitException?

Chris

"Philip Denno" <pdenno@rational.com> wrote in message
news:bi3jjq$smh$1@eclipse.org...
> I am trying to create an editor on a file within a perspective but I get
> an error of type org.eclipse.ui.PartInitException.
>
> The message that the error gives me also makes no sense:
>
> IWAW0109E Failed to create model.
>
> The code I am using to create the error is given below:
>
> public void performAction(String name)
> {
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IWorkbench bench = PlatformUI.getWorkbench();
> IWorkspaceRoot rootSpace = workspace.getRoot();
> IWorkbenchPage activePage;
> IFile resourceToEdit = null;
>
> try {
> IResource[] projects = rootSpace.members();
> for ( int i = 0; i < projects.length; i++ )
> {
> try {
> IProject project =(IProject)projects[i];
> resourceToEdit = project.getFile(name);
>
> if ( resourceToEdit != null )
> {
> activePage =
> bench.getActiveWorkbenchWindow().getActivePage();
> activePage.openEditor(resourceToEdit);
> }
> } catch ( CoreException ce ) {
> System.out.println(ce.getClass().getName() + " " +
> ce.getMessage());
> resourceToEdit = null;
> continue;
> }
> }
>
>
>
> } catch ( CoreException ce ) {
> System.out.println("Core Exception while getting the projects");
> }
> }
>
> The name passed in is <filename>.htm
>
> Any ideas on what the error means or a possible solution are greatly
> appreciated.
>
> Thanks.
>
Re: [JFace] - Programmatically launching an editor throws an exception. [message #114564 is a reply to message #114241] Fri, 22 August 2003 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

Look at the .lof file for the stack trace

Simon :-)

"Philip Denno" <pdenno@rational.com> wrote in message
news:bi3jjq$smh$1@eclipse.org...
> I am trying to create an editor on a file within a perspective but I get
> an error of type org.eclipse.ui.PartInitException.
>
> The message that the error gives me also makes no sense:
>
> IWAW0109E Failed to create model.
>
> The code I am using to create the error is given below:
>
> public void performAction(String name)
> {
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IWorkbench bench = PlatformUI.getWorkbench();
> IWorkspaceRoot rootSpace = workspace.getRoot();
> IWorkbenchPage activePage;
> IFile resourceToEdit = null;
>
> try {
> IResource[] projects = rootSpace.members();
> for ( int i = 0; i < projects.length; i++ )
> {
> try {
> IProject project =(IProject)projects[i];
> resourceToEdit = project.getFile(name);
>
> if ( resourceToEdit != null )
> {
> activePage =
> bench.getActiveWorkbenchWindow().getActivePage();
> activePage.openEditor(resourceToEdit);
> }
> } catch ( CoreException ce ) {
> System.out.println(ce.getClass().getName() + " " +
> ce.getMessage());
> resourceToEdit = null;
> continue;
> }
> }
>
>
>
> } catch ( CoreException ce ) {
> System.out.println("Core Exception while getting the projects");
> }
> }
>
> The name passed in is <filename>.htm
>
> Any ideas on what the error means or a possible solution are greatly
> appreciated.
>
> Thanks.
>
Re: [JFace] - Programmatically launching an editor throws an exception. [message #114593 is a reply to message #114564] Fri, 22 August 2003 09:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.ibm.oti.lab

Sorry I meant .log file (not .lof file)

Simon :-)

"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:bi54vv$4rg$1@eclipse.org...
> Look at the .lof file for the stack trace
>
> Simon :-)
>
> "Philip Denno" <pdenno@rational.com> wrote in message
> news:bi3jjq$smh$1@eclipse.org...
> > I am trying to create an editor on a file within a perspective but I get
> > an error of type org.eclipse.ui.PartInitException.
> >
> > The message that the error gives me also makes no sense:
> >
> > IWAW0109E Failed to create model.
> >
> > The code I am using to create the error is given below:
> >
> > public void performAction(String name)
> > {
> > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > IWorkbench bench = PlatformUI.getWorkbench();
> > IWorkspaceRoot rootSpace = workspace.getRoot();
> > IWorkbenchPage activePage;
> > IFile resourceToEdit = null;
> >
> > try {
> > IResource[] projects = rootSpace.members();
> > for ( int i = 0; i < projects.length; i++ )
> > {
> > try {
> > IProject project =(IProject)projects[i];
> > resourceToEdit = project.getFile(name);
> >
> > if ( resourceToEdit != null )
> > {
> > activePage =
> > bench.getActiveWorkbenchWindow().getActivePage();
> > activePage.openEditor(resourceToEdit);
> > }
> > } catch ( CoreException ce ) {
> > System.out.println(ce.getClass().getName() + " " +
> > ce.getMessage());
> > resourceToEdit = null;
> > continue;
> > }
> > }
> >
> >
> >
> > } catch ( CoreException ce ) {
> > System.out.println("Core Exception while getting the projects");
> > }
> > }
> >
> > The name passed in is <filename>.htm
> >
> > Any ideas on what the error means or a possible solution are greatly
> > appreciated.
> >
> > Thanks.
> >
>
>
Re: [JFace] - Programmatically launching an editor throws an exception. [message #114868 is a reply to message #114593] Fri, 22 August 2003 12:14 Go to previous messageGo to next message
Eclipse UserFriend
> Sorry I meant .log file (not .lof file)

Best is to place a link on that file and erase it every time you
checked it (it gets huge realy fast ;).

Martin (Kersten)

>
> Simon :-)
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:bi54vv$4rg$1@eclipse.org...
> > Look at the .lof file for the stack trace
> >
> > Simon :-)
> >
> > "Philip Denno" <pdenno@rational.com> wrote in message
> > news:bi3jjq$smh$1@eclipse.org...
> > > I am trying to create an editor on a file within a perspective but I
get
> > > an error of type org.eclipse.ui.PartInitException.
> > >
> > > The message that the error gives me also makes no sense:
> > >
> > > IWAW0109E Failed to create model.
> > >
> > > The code I am using to create the error is given below:
> > >
> > > public void performAction(String name)
> > > {
> > > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > > IWorkbench bench = PlatformUI.getWorkbench();
> > > IWorkspaceRoot rootSpace = workspace.getRoot();
> > > IWorkbenchPage activePage;
> > > IFile resourceToEdit = null;
> > >
> > > try {
> > > IResource[] projects = rootSpace.members();
> > > for ( int i = 0; i < projects.length; i++ )
> > > {
> > > try {
> > > IProject project =(IProject)projects[i];
> > > resourceToEdit = project.getFile(name);
> > >
> > > if ( resourceToEdit != null )
> > > {
> > > activePage =
> > > bench.getActiveWorkbenchWindow().getActivePage();
> > > activePage.openEditor(resourceToEdit);
> > > }
> > > } catch ( CoreException ce ) {
> > > System.out.println(ce.getClass().getName() + " " +
> > > ce.getMessage());
> > > resourceToEdit = null;
> > > continue;
> > > }
> > > }
> > >
> > >
> > >
> > > } catch ( CoreException ce ) {
> > > System.out.println("Core Exception while getting the projects");
> > > }
> > > }
> > >
> > > The name passed in is <filename>.htm
> > >
> > > Any ideas on what the error means or a possible solution are greatly
> > > appreciated.
> > >
> > > Thanks.
> > >
> >
> >
>
>
Finding the .log file, was Re: [JFace] - Programmatically launching an editor throws an exception. [message #114909 is a reply to message #114868] Fri, 22 August 2003 12:55 Go to previous messageGo to next message
Eclipse UserFriend
Finding the workspace .log file:

Alternative 1:
Window > Show View > PDE Runtime > Error Log
This gives you a view with the contents of the .log file.

Alternative 2:
Help > About Eclipse Platform > Configuration Details

Alternative 3:
locate the file yourself, <yourworkspace>/.metadata/.log

Chris

"Martin Kersten" <Martin.Kersten@student.uni-magdeburg.de> wrote in message
news:bi5fbt$gma$1@eclipse.org...
> > Sorry I meant .log file (not .lof file)
>
> Best is to place a link on that file and erase it every time you
> checked it (it gets huge realy fast ;).
>
> Martin (Kersten)
>
> >
> > Simon :-)
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:bi54vv$4rg$1@eclipse.org...
> > > Look at the .lof file for the stack trace
> > >
> > > Simon :-)
> > >
> > > "Philip Denno" <pdenno@rational.com> wrote in message
> > > news:bi3jjq$smh$1@eclipse.org...
> > > > I am trying to create an editor on a file within a perspective but I
> get
> > > > an error of type org.eclipse.ui.PartInitException.
> > > >
> > > > The message that the error gives me also makes no sense:
> > > >
> > > > IWAW0109E Failed to create model.
> > > >
> > > > The code I am using to create the error is given below:
> > > >
> > > > public void performAction(String name)
> > > > {
> > > > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > > > IWorkbench bench = PlatformUI.getWorkbench();
> > > > IWorkspaceRoot rootSpace = workspace.getRoot();
> > > > IWorkbenchPage activePage;
> > > > IFile resourceToEdit = null;
> > > >
> > > > try {
> > > > IResource[] projects = rootSpace.members();
> > > > for ( int i = 0; i < projects.length; i++ )
> > > > {
> > > > try {
> > > > IProject project =(IProject)projects[i];
> > > > resourceToEdit = project.getFile(name);
> > > >
> > > > if ( resourceToEdit != null )
> > > > {
> > > > activePage =
> > > > bench.getActiveWorkbenchWindow().getActivePage();
> > > > activePage.openEditor(resourceToEdit);
> > > > }
> > > > } catch ( CoreException ce ) {
> > > > System.out.println(ce.getClass().getName() + " " +
> > > > ce.getMessage());
> > > > resourceToEdit = null;
> > > > continue;
> > > > }
> > > > }
> > > >
> > > >
> > > >
> > > > } catch ( CoreException ce ) {
> > > > System.out.println("Core Exception while getting the
projects");
> > > > }
> > > > }
> > > >
> > > > The name passed in is <filename>.htm
> > > >
> > > > Any ideas on what the error means or a possible solution are greatly
> > > > appreciated.
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> >
> >
>
>
Re: Finding the .log file, was Re: [JFace] - Programmatically launching an editor throws an except [message #115074 is a reply to message #114909] Fri, 22 August 2003 15:39 Go to previous messageGo to next message
Eclipse UserFriend
> Alternative 1:
> Window > Show View > PDE Runtime > Error Log
> This gives you a view with the contents of the .log file.

This Error log view is great. Never used that (I didn't even know it exists
;).

Thanks Chris

Martin (Kersten)
>
> Alternative 2:
> Help > About Eclipse Platform > Configuration Details
>
> Alternative 3:
> locate the file yourself, <yourworkspace>/.metadata/.log
>
> Chris
>
> "Martin Kersten" <Martin.Kersten@student.uni-magdeburg.de> wrote in
message
> news:bi5fbt$gma$1@eclipse.org...
> > > Sorry I meant .log file (not .lof file)
> >
> > Best is to place a link on that file and erase it every time you
> > checked it (it gets huge realy fast ;).
> >
> > Martin (Kersten)
> >
> > >
> > > Simon :-)
> > >
> > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > news:bi54vv$4rg$1@eclipse.org...
> > > > Look at the .lof file for the stack trace
> > > >
> > > > Simon :-)
> > > >
> > > > "Philip Denno" <pdenno@rational.com> wrote in message
> > > > news:bi3jjq$smh$1@eclipse.org...
> > > > > I am trying to create an editor on a file within a perspective but
I
> > get
> > > > > an error of type org.eclipse.ui.PartInitException.
> > > > >
> > > > > The message that the error gives me also makes no sense:
> > > > >
> > > > > IWAW0109E Failed to create model.
> > > > >
> > > > > The code I am using to create the error is given below:
> > > > >
> > > > > public void performAction(String name)
> > > > > {
> > > > > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > > > > IWorkbench bench = PlatformUI.getWorkbench();
> > > > > IWorkspaceRoot rootSpace = workspace.getRoot();
> > > > > IWorkbenchPage activePage;
> > > > > IFile resourceToEdit = null;
> > > > >
> > > > > try {
> > > > > IResource[] projects = rootSpace.members();
> > > > > for ( int i = 0; i < projects.length; i++ )
> > > > > {
> > > > > try {
> > > > > IProject project =(IProject)projects[i];
> > > > > resourceToEdit = project.getFile(name);
> > > > >
> > > > > if ( resourceToEdit != null )
> > > > > {
> > > > > activePage =
> > > > > bench.getActiveWorkbenchWindow().getActivePage();
> > > > > activePage.openEditor(resourceToEdit);
> > > > > }
> > > > > } catch ( CoreException ce ) {
> > > > > System.out.println(ce.getClass().getName() + " " +
> > > > > ce.getMessage());
> > > > > resourceToEdit = null;
> > > > > continue;
> > > > > }
> > > > > }
> > > > >
> > > > >
> > > > >
> > > > > } catch ( CoreException ce ) {
> > > > > System.out.println("Core Exception while getting the
> projects");
> > > > > }
> > > > > }
> > > > >
> > > > > The name passed in is <filename>.htm
> > > > >
> > > > > Any ideas on what the error means or a possible solution are
greatly
> > > > > appreciated.
> > > > >
> > > > > Thanks.
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Finding the .log file, was Re: [JFace] - Programmatically launching an editor throws an except [message #115099 is a reply to message #115074] Fri, 22 August 2003 15:41 Go to previous messageGo to next message
Eclipse UserFriend
Yeah. All it needs is a "Flush Contents" button <g>


"Martin Kersten" <Martin.Kersten@student.uni-magdeburg.de> wrote in message
news:bi5rd2$tt2$1@eclipse.org...
> > Alternative 1:
> > Window > Show View > PDE Runtime > Error Log
> > This gives you a view with the contents of the .log file.
>
> This Error log view is great. Never used that (I didn't even know it
exists
> ;).
>
> Thanks Chris
>
> Martin (Kersten)
> >
> > Alternative 2:
> > Help > About Eclipse Platform > Configuration Details
> >
> > Alternative 3:
> > locate the file yourself, <yourworkspace>/.metadata/.log
> >
> > Chris
> >
> > "Martin Kersten" <Martin.Kersten@student.uni-magdeburg.de> wrote in
> message
> > news:bi5fbt$gma$1@eclipse.org...
> > > > Sorry I meant .log file (not .lof file)
> > >
> > > Best is to place a link on that file and erase it every time you
> > > checked it (it gets huge realy fast ;).
> > >
> > > Martin (Kersten)
> > >
> > > >
> > > > Simon :-)
> > > >
> > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > news:bi54vv$4rg$1@eclipse.org...
> > > > > Look at the .lof file for the stack trace
> > > > >
> > > > > Simon :-)
> > > > >
> > > > > "Philip Denno" <pdenno@rational.com> wrote in message
> > > > > news:bi3jjq$smh$1@eclipse.org...
> > > > > > I am trying to create an editor on a file within a perspective
but
> I
> > > get
> > > > > > an error of type org.eclipse.ui.PartInitException.
> > > > > >
> > > > > > The message that the error gives me also makes no sense:
> > > > > >
> > > > > > IWAW0109E Failed to create model.
> > > > > >
> > > > > > The code I am using to create the error is given below:
> > > > > >
> > > > > > public void performAction(String name)
> > > > > > {
> > > > > > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > > > > > IWorkbench bench = PlatformUI.getWorkbench();
> > > > > > IWorkspaceRoot rootSpace = workspace.getRoot();
> > > > > > IWorkbenchPage activePage;
> > > > > > IFile resourceToEdit = null;
> > > > > >
> > > > > > try {
> > > > > > IResource[] projects = rootSpace.members();
> > > > > > for ( int i = 0; i < projects.length; i++ )
> > > > > > {
> > > > > > try {
> > > > > > IProject project =(IProject)projects[i];
> > > > > > resourceToEdit = project.getFile(name);
> > > > > >
> > > > > > if ( resourceToEdit != null )
> > > > > > {
> > > > > > activePage =
> > > > > > bench.getActiveWorkbenchWindow().getActivePage();
> > > > > > activePage.openEditor(resourceToEdit);
> > > > > > }
> > > > > > } catch ( CoreException ce ) {
> > > > > > System.out.println(ce.getClass().getName() + " " +
> > > > > > ce.getMessage());
> > > > > > resourceToEdit = null;
> > > > > > continue;
> > > > > > }
> > > > > > }
> > > > > >
> > > > > >
> > > > > >
> > > > > > } catch ( CoreException ce ) {
> > > > > > System.out.println("Core Exception while getting the
> > projects");
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > The name passed in is <filename>.htm
> > > > > >
> > > > > > Any ideas on what the error means or a possible solution are
> greatly
> > > > > > appreciated.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Finding the .log file, was Re: [JFace] - Programmatically launching an editor throws an except [message #117008 is a reply to message #115099] Tue, 26 August 2003 21:17 Go to previous message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

The red X erases the whole file, and you can also filter to just show the
current session (in 3.0).

--
Ed Burnette, co-author Eclipse in Action (www.manning.com/gallardo)


"Chris Laffra" <Chris_Laffra@oti.com> wrote in message
news:bi5rlm$u75$1@eclipse.org...
> Yeah. All it needs is a "Flush Contents" button <g>
>
>
Previous Topic:Workspace corrupted due to problems in org.eclipse.core.resources?
Next Topic:Examples cause large pauses/cpu utilization in 3.0 stream
Goto Forum:
  


Current Time: Thu May 08 06:39:42 EDT 2025

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

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

Back to the top