Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFForms] How to open a non-project file in GenericEditor
[EMFForms] How to open a non-project file in GenericEditor [message #1730541] Tue, 26 April 2016 14:55 Go to next message
Christopher Dietsch is currently offline Christopher DietschFriend
Messages: 1
Registered: April 2016
Junior Member
I have a GenericEditor I need to use with files that exist outside the workspace. I am using

						final File fileToOpen = new File(file.getPathToFile());
						if (fileToOpen.exists() && fileToOpen.isFile())
						{
							final IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
							final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
							IDE.openEditorOnFileStore(page, fileStore);
						}


and have org.eclipse.emfforms.spi.editor.GenericEditor registered against the file type that this file ends in. The GenericEditor.loadResource fails with a ClassCastException of org.eclipse.ui.ide.FileStoreEditorInput cannot be cast to org.eclipse.ui.part.FileEditorInput.

Any help on how I can get off the ground here?
Re: [EMFForms] How to open a non-project file in GenericEditor [message #1730729 is a reply to message #1730541] Thu, 28 April 2016 06:11 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

let us continue this topic in the created BR
https://bugs.eclipse.org/bugs/show_bug.cgi?id=492476

Best regards

Jonas

Am 26.04.2016 um 20:10 schrieb Christopher Dietsch:
> I have a GenericEditor I need to use with files that exist outside the
> workspace. I am using
> final File fileToOpen = new
> File(file.getPathToFile());
> if (fileToOpen.exists() && fileToOpen.isFile())
> {
> final IFileStore fileStore =
> EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
> final IWorkbenchPage page =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
> IDE.openEditorOnFileStore(page, fileStore);
> }
>
> and have org.eclipse.emfforms.spi.editor.GenericEditor registered
> against the file type that this file ends in. The
> GenericEditor.loadResource fails with a ClassCastException of
> org.eclipse.ui.ide.FileStoreEditorInput cannot be cast to
> org.eclipse.ui.part.FileEditorInput.
>
> Any help on how I can get off the ground here?


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Previous Topic:[EMFStore,ECP] java.lang.RuntimeException: An invalid XML character was found in the element content
Next Topic:EMFForms 1.7 View Proxies Not Available
Goto Forum:
  


Current Time: Wed Nov 22 13:14:54 GMT 2017

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

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