[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Problem in opening a new file in the editor.

that problem seems to have nothing to do with GEF (the subject of this newsgroup). Your chances will be much better under emf or platform.

chris

Brahma Somanchi wrote:
HI,

I have implemented an action that creates a new file under a project and tries to open it in an UMLEditor. This action is throwing a "Wrapped exception"

What I have done is -

1) In the action, I am creating a new file under a project
IFile file = project.getFile( fileName );
file.create( null, false, null );
2) Open the new file in an UMLEditor
IEditorPart editorPart = IDE.openEditor( page, file, true );
3) The control comes back to MyEditor.setInput(). In this method I am getting ResourceSet of the project and then trying to get the resource
for the file


  IFile file = ( (IFileEditorInput) input ).getFile();
 URI uri = URI.createPlatformResourceURI( file.getFullPath().toString() );
  resourceSet.getResource( uri, true );

4) The getResource() method throws Wrapped Exception complaining that the file that I created is not local. See the error trace below.
Is there anything that I am missing? How do I get rid of this problem?


Brahma



Wrapped exception
org.eclipse.core.internal.resources.ResourceException: Resource /Ford/Appearance.uml is not local.
at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:316)
at org.eclipse.core.internal.resources.File.getContents(File.java:293)
at org.eclipse.core.internal.resources.File.getContents(File.java:283)
at org.eclipse.emf.ecore.resource.impl.URIConverterImpl$WorkbenchHelper.createPlatformResourceInputStream(URIConverterImpl.java:195)


at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createPlatformResourceInputStream(URIConverterImpl.java:533)

at org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createInputStream(URIConverterImpl.java:442)

at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:829)

at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:249)

at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:264)

at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:349)

at com.bmide.model.util.TcResourceSetImpl.getResource(TcResourceSetImpl.java:66)

at com.bmide.uml.ui.editor.UMLEditor.testLoad(UMLEditor.java:413)
at com.bmide.uml.ui.editor.UMLEditor.setInput(UMLEditor.java:345)
at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEditor.java:292)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:773)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:572)


at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:365)

at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)

at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:258)

at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1216)

at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.java:944)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)


at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.EditorManager.restoreState(EditorManager.java:939)
at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2535)
at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1819)


at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2566)
at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2515)
at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1514)
at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:1263)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346)


at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:447)


at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1258)

at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1512)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1491)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1374)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)


at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1318)
at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183)


at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:700)

at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)


at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)


at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)