EditorContributor: only Constructor is called [message #463086] |
Tue, 06 February 2007 12:20 |
Eclipse User |
|
|
|
Originally posted by: febro.gmx.net
Hi,
I have a rcp-application with a MultipageEditor. For this editor, created a contributor (extends BasicTextEditorActionContributor). When I open the editor, the constructor is called. But no other method like "init(IActionBars bars, IWorkbenchPage page)", "init(IActionBars bars)" or "doSetActiveEditor(IEditorPart part)"
any hints?
if you need some more code, please tell - I don't know what parts you may need ;)
bye
Felix
|
|
|
Re: EditorContributor: only Constructor is called [message #463140 is a reply to message #463086] |
Tue, 06 February 2007 22:56 |
Snjezana Peco Messages: 789 Registered: July 2009 |
Senior Member |
|
|
The "init(IActionBars bars)" or "doSetActiveEditor(IEditorPart part)"
methods won't be called except if you call them.
The action contribution works in the following way:
-when the editor is opened the first time, the object is created and
the init(IActionBars bars, IWorkbenchPage page)method is called.
- when the editor is activated, the setActiveEditor(IEditorPart editor)
method is called.
If init(IActionBars bars, IWorkbenchPage page) method hasn't been called
(your case), you probably have an error either in the editor extension
definition in the plugin.xml file or in the signature of the method.
Try to check if the method has been called in a superclass
(BasicTextEditorActionContributor).
Anyway, I recommend you to start with
MultiPageEditorActionBarContributor. You can use
XMLMultiPageEditorActionBarContributor and XMLMultiPageEditorPart from
the wtp project as an example.
Snjeza
FelixB wrote:
> Hi,
>
> I have a rcp-application with a MultipageEditor. For this editor, created a contributor (extends BasicTextEditorActionContributor). When I open the editor, the constructor is called. But no other method like "init(IActionBars bars, IWorkbenchPage page)", "init(IActionBars bars)" or "doSetActiveEditor(IEditorPart part)"
>
> any hints?
>
> if you need some more code, please tell - I don't know what parts you may need ;)
>
> bye
> Felix
|
|
|
Powered by
FUDForum. Page generated in 0.03782 seconds