Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » One editor for many files
One editor for many files [message #602674] Tue, 20 October 2009 16:58 Go to next message
Eclipse UserFriend
Hello, all!

I am developing an editor for some type of files (for example .xxx) and my editor allows user to edit all files of some package in one editor tab.

When user opens the second .xxx file in the same package Eclipse creates a new editor for it. But I need not to open new tab, but set focus on existing one.

How may I do it?
Re: One editor for many files [message #602702 is a reply to message #602674] Wed, 21 October 2009 05:50 Go to previous messageGo to next message
Eclipse UserFriend
If u wish to use the already opened editor...try IWorkbenchPage openEditor() method
Re: One editor for many files [message #602724 is a reply to message #602702] Wed, 21 October 2009 07:01 Go to previous messageGo to next message
Eclipse UserFriend
Rahul Yadav wrote on Wed, 21 October 2009 05:50
> If u wish to use the already opened editor...try IWorkbenchPage openEditor() method


I tried to do it in init() method but it does not works.

Also I tried to do like this:

Activator.getDefault().getWorkbench().getActiveWorkbenchWind ow().getActivePage().closeEditor(this, false)

in methods init() or createPartControl(): tab closes, but I Eclipse catches an exception and sets focus on the rightest tab in the list.

java.lang.RuntimeException: WARNING: Blocked recursive attempt to close part com.doksoft.propeditor.PropEditorForEclipse while still in the middle of activating it
at org.eclipse.ui.internal.WorkbenchPage.closeEditors(Workbench Page.java:1282)
at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchP age.java:1411)
...

Can you write full openEditor() call and tell me in what method am I to insert it, please?
Re: One editor for many files [message #602863 is a reply to message #602674] Fri, 23 October 2009 11:47 Go to previous message
Eclipse UserFriend
chesscoder@mail.ru wrote:
> I am developing an editor for some type of files (for example .xxx) and
> my editor allows user to edit all files of some package in one editor tab.
>
> When user opens the second .xxx file in the same package Eclipse creates
> a new editor for it. But I need not to open new tab, but set focus on
> existing one.

My guess is that you'll have to specify a matchingStrategy to your
editor extension.

http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/reference/extension-points/org_eclipse_ui_editors.htm l

Brian.
Previous Topic:One editor for many files
Next Topic:Undefined context exception when activating a plug-in
Goto Forum:
  


Current Time: Thu Jul 03 03:26:46 EDT 2025

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

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

Back to the top