Author Topic: Exception trying to open editor with FileStoreEditorInput  (Read 9012 times)

drea

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Exception trying to open editor with FileStoreEditorInput
« on: February 27, 2009, 01:57:27 pm »
Hello,

I am trying to open the SlickEdit Editor with a FileStoreEditorInput.  Here is the call I am making:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new FileStoreEditorInput(fileStore), editorID);


where editorID is the ID of the SlickEdit Editor.

When this executes, the SlickEdit Editor appears with the name of the FileStore, but the editor is empty.  I get no errors in the Eclipse Workbench, but I see this in my Workspace's .log file:

!ENTRY com.slickedit.core 4 0 2009-02-27 07:56:23.208
!MESSAGE Exception Occurred
!SUBENTRY 1 com.slickedit.core 4 0 2009-02-27 07:56:23.208
!MESSAGE Plug-In Provider: SlickEdit Inc.
!SUBENTRY 1 com.slickedit.core 4 0 2009-02-27 07:56:23.208
!MESSAGE Plug-In Name:     SlickEdit Core Plug-in
!SUBENTRY 1 com.slickedit.core 4 0 2009-02-27 07:56:23.208
!MESSAGE Plug-In ID:       com.slickedit.core
!SUBENTRY 1 com.slickedit.core 4 0 2009-02-27 07:56:23.208
!MESSAGE Plug-In Version:  3.4.0
!SUBENTRY 1 com.slickedit.core 4 4 2009-02-27 07:56:23.208
!MESSAGE Error Location: VisualSlickEditorPart::openFile()
!SUBENTRY 1 com.slickedit.core 4 4 2009-02-27 07:56:23.208
!MESSAGE Error Detail: Unable to open file
!STACK 0
com.slickedit.core.file.FileHandlerException: com.slickedit.core.file.FileHandlerException: Unable to open file: vsFileOpen failed.
   at com.slickedit.core.file.FileStoreEditorInputHandler.open(FileStoreEditorInputHandler.java:82)
   at com.slickedit.editor.delegates.EditorTextEditorImpl.openFile(EditorTextEditorImpl.java:453)
   at com.slickedit.editor.delegates.EditorTextEditorImpl.createPartControl(EditorTextEditorImpl.java:270)
   at com.slickedit.swt.VisualSlickEditorPart.createPartControl(VisualSlickEditorPart.java:846)
   at com.slickedit.swt.PluginEditorPart.createPartControl(PluginEditorPart.java:34)
   at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
   at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)
   at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
   at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:266)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2820)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2729)
   at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2721)
   at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2673)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2652)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2635)
        .
        .


Is this a bug?  Is the SlickEdit Editor not meant to work with FileStore Objects?

Thanks,
drea

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #1 on: February 27, 2009, 03:44:37 pm »
No, that should work...the SlickEdit editor supports file inputs of type FileStoreEditorInput.  vsFileOpen (which is a native SlickEdit function used to open files) is failing on the name it's being given for some reason.  Unfortunately it doesn't look like there's a whole lot of useful trace statements inserted in this code path, so turning on tracing won't be much of a help.

Is there anything you can tell me about the file?  Are you on Linux or Windows?  Permissions?  Local or Remote? etc.

I would like to see what is going to get passed to vsFileOpen, and I think we can mimic it like so:

Create your FileStoreEditorInput (_input) and then do the following:

Code: [Select]
URI _uri = _input.getURI();
IPath _path = new Path(_uri.getPath());
System.out.println("Trying to open: " + _path.toOSString());

What do you get?

- Ryan

drea

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #2 on: February 27, 2009, 04:30:14 pm »
Thanks for the reply Ryan!

I am on Windows and am dealing with Remote files.  When I call _path.toOSString(), it returns the path on the server where the remote file resides.  The path that gets printed to the Console is like this, with the actual names changed: \Server\Partition\Folder\File.  There is a space (' ') in the server component and a dash ('-') in the partition component of the path.  All components can be mixed case.

The files that I am trying to open in the SlickEdit Editor do not have extensions - meaning rather than trying to open "SEFile.txt", it is just "SEFile".  I thought this may have something to do with the Exception, but I am able to create a local file on my PC without an extension and it opens just fine in the SlickEdit Editor.

drea

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #3 on: February 27, 2009, 05:13:01 pm »
Ok...so a local file works fine, that means it's definitely vsFileOpen having issues with the remote file.  FileStoreEditorInput is used when the file being opened is external to the Eclipse workspace...so I can test it by doing that.

I tried with a file with spaces in the path and that worked fine, so I don't think that's the problem.  I also opened a remote file successfully.

Just to be sure, I have to ask...when you said the path that gets printed to the Console is "\Server\Partition\Folder\File" you really meant "\\Server\Partition\Folder\File", right?  With 2 backslashes at the beginning of the path, and not 1?

drea

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #4 on: February 27, 2009, 07:59:12 pm »
No, there is only 1 backslash.  My remote "files" are really objects in a database.  The paths of these objects are created by me - I have a custom FileSystem that knows where to look in the database for an object based on its path having the "\Server\Partition\Folder\File" structure.

I am able to open my FileStoreEditorInput objects within Eclipse's default Text Editor, but not the SlickEdit Editor.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #5 on: February 27, 2009, 09:22:44 pm »
The plot thickens.  After discussing this with another developer here, if you can't go to a command prompt and type "dir \Server\Partition\Folder\File", vsFileOpen is never going to be able to open that "file".  Does the dir command work for you?

drea

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Exception trying to open editor with FileStoreEditorInput
« Reply #6 on: March 02, 2009, 01:08:49 pm »
That explains what I am seeing then - no, the dir command does not work.  Thank you for your help!