*/
public boolean setInput(IEditorInput input) {
if (part != null) {
if (part instanceof IReusableEditor) {
IReusableEditor editor = (IReusableEditor) part;
expectingInputChange = true;
editor.setInput(input);
// If the editor never fired a PROP_INPUT event, log the fact that we've discovered
// a buggy editor and fire the event for free. Firing the event for free isn't required
// and cannot be relied on (it only works if the input change was triggered by this
// method, and there are definitely other cases where events will still be lost),
// but older versions of the workbench did this so we fire it here in the spirit
// of playing nice.
if (expectingInputChange) {
// Log the fact that this editor is broken
reportMalfunction("Editor is not firing a PROP_INPUT event in response to IReusableEditor.setInput(...)"); //$NON-NLS-1$
// Fire the property for free (can't be relied on since there are other ways the input
// can change, but we do it here to be consistent with older versions of the workbench)
firePropertyChange(IWorkbenchPartConstants.PROP_INPUT);
}
return editor.getEditorInput() == input;
} else {
// Can't change the input if the editor already exists and isn't an IReusableEditor
return false;
}