Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Find Editors Juno(Find editors in Juno)
Find Editors Juno [message #1057948] Fri, 10 May 2013 02:20 Go to next message
hekar khani is currently offline hekar khaniFriend
Messages: 2
Registered: May 2013
Junior Member
I'm porting a plugin to Eclipse 4.2 (Juno) from Indigo, but I'm having trouble finding an alternative to org.eclipse.ui.ide.ResourceUtil. It was removed from org.eclipse.ui.ide.

The respective method I need is static IEditorPart findEditor(IWorkbenchPage page, IFile file).

Is there any alternative to findEditor for Juno?


I wanted to rewrite the findEditor function, but I noticed that FindEditorInput is not available either.

def findEditor(page: IWorkbenchPage, file: IFile): IEditorPart = {
// handle the common case where the editor input is a FileEditorInput
val editor = page.findEditor(new FileEditorInput(file));
if (editor != null) {
return editor;
}

// check for editors that have their own kind of input that adapts to IFile,
// being careful not to force loading of the editor
val refs = page.getEditorReferences()
for (ref <- refs) {
val part = ref.getEditor(false)
if (part != null) {
val editorFile = getFile(part.getEditorInput())
if (editorFile != null && file.equals(editorFile)) {
return part
}
}
}

return null
}

Am I just doing something wrong, can I just import Eclipse 3.7 plugins instead?
Re: Find Editors Juno [message #1057997 is a reply to message #1057948] Fri, 10 May 2013 12:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Hekar,

That class is there there for me. Nothing was removed from the IDE
bundle...


On 10/05/2013 2:15 PM, hekar khani wrote:
> I'm porting a plugin to Eclipse 4.2 (Juno) from Indigo, but I'm having
> trouble finding an alternative to org.eclipse.ui.ide.ResourceUtil. It
> was removed from org.eclipse.ui.ide.
>
> The respective method I need is static IEditorPart
> findEditor(IWorkbenchPage page, IFile file).
>
> Is there any alternative to findEditor for Juno?
>
>
> I wanted to rewrite the findEditor function, but I noticed that
> FindEditorInput is not available either.
>
> def findEditor(page: IWorkbenchPage, file: IFile): IEditorPart = {
> // handle the common case where the editor input is a FileEditorInput
> val editor = page.findEditor(new FileEditorInput(file));
> if (editor != null) {
> return editor;
> }
>
> // check for editors that have their own kind of input that adapts
> to IFile,
> // being careful not to force loading of the editor
> val refs = page.getEditorReferences()
> for (ref <- refs) {
> val part = ref.getEditor(false)
> if (part != null) {
> val editorFile = getFile(part.getEditorInput())
> if (editorFile != null && file.equals(editorFile)) {
> return part
> }
> }
> }
>
> return null
> }
>
> Am I just doing something wrong, can I just import Eclipse 3.7 plugins
> instead?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Find Editors Juno [message #1058096 is a reply to message #1057948] Sat, 11 May 2013 03:20 Go to previous message
hekar khani is currently offline hekar khaniFriend
Messages: 2
Registered: May 2013
Junior Member
Oh, I see it's a part of the 3.8 jars rather than the 4.2 jars.

Simply view the dependencies tab in plugin.xml and set the version numbers of org.eclipse.ui.ide to 3.8.x.

Thanks!
Previous Topic:Customized perspective
Next Topic:need help new to programming!
Goto Forum:
  


Current Time: Sat Apr 20 00:22:26 GMT 2024

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

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

Back to the top