Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » open external editor on a file NOT in the workspace ...
open external editor on a file NOT in the workspace ... [message #329048] Wed, 11 June 2008 10:09 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all,
I need to open an external editor on a file not present in the workspace .

My action already works fine if I specify the default external editor . but
it doesn't if I try to open a specific program . what am I doing wrong?

What shall I do to solve the problem?
Thanks for ur help
Kar


-------------------------------------

If the editor descriptor is
EditorDescriptor(id=org.eclipse.ui.systemExternalEditor, label=&System
Editor) WORKS FINE ...

EditorDescriptor(id=C:\Program Files\Scintilla Text Editor\SciTE.exe,
label=SciTE) DOESN'T ...
(I got the name from the eclipse dialog that lists all the external
programs.)

IFileStore fileStore = Utils.getFileStore(file);
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
page.openEditor(new FileStoreEditorInput (fileStore),
editorDescriptor.getId());

-------------------------------

public static IFileStore getFileStore(java.io.File file)
{
IFileStore fileStore = EFS.getLocalFileSystem().getStore(
new Path(file.getParentFile().getAbsolutePath()));
return fileStore.getChild(file.getName());
}



org.eclipse.ui.PartInitException: Unable to open editor, unknown editor ID:
C:\Program Files\Scintilla Text Editor\SciTE.exe
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:629)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2737)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2557)
at
com.xxx.inspector.ui.views.actions.OpenFileOperation.openEdi tor(OpenFileOperation.java:86)
Re: open external editor on a file NOT in the workspace ... [message #329062 is a reply to message #329048] Wed, 11 June 2008 15:24 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
KarSc wrote:
> Hi all,
> I need to open an external editor on a file not present in the
> workspace .
>
> My action already works fine if I specify the default external editor
> . but it doesn't if I try to open a specific program . what am I doing
> wrong?
Only textual editors support this.

Dani
>
> What shall I do to solve the problem?
> Thanks for ur help
> Kar
>
>
> -------------------------------------
>
> If the editor descriptor is
> EditorDescriptor(id=org.eclipse.ui.systemExternalEditor, label=&System
> Editor) WORKS FINE ...
>
> EditorDescriptor(id=C:\Program Files\Scintilla Text Editor\SciTE.exe,
> label=SciTE) DOESN'T ...
> (I got the name from the eclipse dialog that lists all the external
> programs.)
>
> IFileStore fileStore = Utils.getFileStore(file);
> IWorkbenchPage page =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
> page.openEditor(new FileStoreEditorInput (fileStore),
> editorDescriptor.getId());
>
> -------------------------------
>
> public static IFileStore getFileStore(java.io.File file)
> {
> IFileStore fileStore = EFS.getLocalFileSystem().getStore(
> new Path(file.getParentFile().getAbsolutePath()));
> return fileStore.getChild(file.getName());
> }
>
>
>
> org.eclipse.ui.PartInitException: Unable to open editor, unknown
> editor ID: C:\Program Files\Scintilla Text Editor\SciTE.exe
> at
> org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:629)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2737)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
>
> at
> org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
> at
> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2557)
> at
> com.xxx.inspector.ui.views.actions.OpenFileOperation.openEdi tor(OpenFileOperation.java:86)
>
>
>
Previous Topic:Listeners
Next Topic:workspace use-case that Eclipse fails to handle: build newly-opened project
Goto Forum:
  


Current Time: Thu Aug 15 02:34:43 GMT 2024

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

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

Back to the top