Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » One editor for many files
One editor for many files [message #602674] Tue, 20 October 2009 20:58 Go to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: October 2009
Junior Member
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 09:50 Go to previous messageGo to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
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 11:01 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: October 2009
Junior Member
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 15:47 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
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: Sun Aug 09 06:10:08 GMT 2020

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

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

Back to the top