[jbosside-dev] Fwd: [Bug 166274] Opening external file in xml editor fails
by Max Rydahl Andersen
Hi Rob,
how come you are using JavaFileEditorInput for an xml file ?
just curious.
/max
------- Forwarded message -------
From: bugzilla-daemon(a)eclipse.org
To: max.andersen(a)jboss.com
Cc:
Subject: [Bug 166274] Opening external file in xml editor fails
Date: Thu, 30 Nov 2006 18:20:23 +0100
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166274
Product/Component: Web Tools / wst.xml
------- Comment #4 from rob.stryker(a)jboss.com 2006-11-30 12:22 -------
I've switched my code to use that which the file -> open uses. Namely:
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
File file = new File("C:\\some\\file.xml");
IFileStore fileStore= EFS.getLocalFileSystem().fromLocalFile(file);
if( fileStore != null ) {
IEditorInput input = new JavaFileEditorInput(fileStore);
IEditorDescriptor desc = PlatformUI.getWorkbench().
getEditorRegistry().getDefaultEditor(file.getName());
page.openEditor(input, desc.getId());
}
This seems to work fine. Thanks for the help though =]
--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
max(a)hibernate.org
http://hibernate.org
JBoss a division of Red Hat
max.andersen(a)jboss.com
17 years, 12 months