Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » One editor for many files(How do not to open editor twice?)
icon4.gif  One editor for many files [message #492584] 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 #492659 is a reply to message #492584] 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 #492676 is a reply to message #492659] 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().getActiveWorkbenchWindow().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(WorkbenchPage.java:1282)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.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 #492855 is a reply to message #492676] Thu, 22 October 2009 02:02 Go to previous messageGo to next message
Eclipse UserFriend
You will have to extend AbstractTextSearchViewPage and override
showMatch(Match match, int offset, int length, boolean activate) method.

use extension point "org.eclipse.search.searchResultViewPages" in plugin.xml.
Re: One editor for many files [message #493215 is a reply to message #492584] 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.
Re: One editor for many files [message #602770 is a reply to message #492676] Thu, 22 October 2009 02:03 Go to previous message
Eclipse UserFriend
You will have to extend AbstractTextSearchViewPage and override
showMatch(Match match, int offset, int length, boolean activate) method.

use extension point "org.eclipse.search.searchResultViewPages" in plugin.xml.
Previous Topic:Hiding incompatible features in update site?
Next Topic:One editor for many files
Goto Forum:
  


Current Time: Sat Jul 05 01:38:33 EDT 2025

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

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

Back to the top