|
Re: why is MultiPageEditorPart.getActiveEditor() not public ? [message #461175 is a reply to message #460646] |
Fri, 05 January 2007 23:53 |
|
Diego Tognola wrote:
>
> Here's my question: why was MultiPageEditorPart.getActiveEditor()
> declared protected ? Am I doing something I am not supposed to do here ?
you are doing something you're not supposed to ... from the javadoc:
* Returns the active nested editor if there is one.
* <p>
* Subclasses should not override this method
* </p>
That's not to say you can't create public IEditorPart getCurrentEditor()
and return getActiveEditor().
As to why ... that's partly lost in the mists of time, but basically as
public API it states you can't override or extend (the framework expects
certain return values and a certain behaviour).
One plugin ignored the warning, overrode the method, and changed the
behaviour that if there was no active editor (just a Composite page) it
return the MPEP ... then suddenly they got an infinite loop.
It's not that you can't ignore those kinds of warnings ... but perhaps
you shouldn't.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 1.43135 seconds