[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: why is MultiPageEditorPart.getActiveEditor() not public ?

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