Bug 43523 - [MPE] getAdapter(IEditorStatusLine.class) not working for MultipageEditor
Summary: [MPE] getAdapter(IEditorStatusLine.class) not working for MultipageEditor
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2003-09-23 13:32 EDT by Dani Megert CLA
Modified: 2006-05-31 22:02 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2003-09-23 13:32:03 EDT
I20030923

As an example: use FindReplace dialog on Source page of PDE's plug-in editor and
observe: status is written in dialog but not in the workbench window's status line.
Comment 1 Paul Webster CLA 2006-04-05 14:23:30 EDT
This is fixable with by allowing MultiPageEditorPart to delegate to an inner editor's getAdapter() call if it cannot provide an adapter itself.

mvm, I'm overriding a public method on a public abstract class, but it's already API on the super class.  Am I prevented from doing this?

PW
Comment 2 Michael Van Meekeren CLA 2006-04-05 16:21:15 EDT
I think this is ok, Boris?
Comment 3 Dani Megert CLA 2006-04-06 03:04:55 EDT
Just make sure not to introduce a similar problem as reported in bug 120336.
Comment 4 Paul Webster CLA 2006-04-06 07:08:28 EDT
If the MPEP is adaptable, it wins (just like now).  It's only if the MPEP can't adapt to the object that we delegate to the inner editor.

public Object getAdapter(Class adapter) {
	Object result = super.getAdapter(adapter);
	if (result == null && getActiveEditor() != null) {
		result = getActiveEditor().getAdapter(adapter);
	}
	return result;
}

Later,
PW
Comment 5 Boris Bokowski CLA 2006-04-06 11:43:30 EDT
Re-implementing an API method in a subclass is no problem if the contract for callers does not change (to be precise: preconditions can only be loosened, postconditions tightened), and if you follow the superclass' rules to call the super implementation when such rules exist.
Comment 6 Paul Webster CLA 2006-04-07 08:54:13 EDT
Released into HEAD >20060407

PW
Comment 7 Eric Moffatt CLA 2006-05-09 10:20:10 EDT
Verified (visually) in RC3.