Bug 116706 Bad Class Cast in IDEReportEditor.java
So I'm trying to open a report with BIRT/Eclipse API using the BIRT 2.0 nightly build code (as of 11/16/2005). the file IDEReportEditor.java method private IFile getFile( IEditorInput input ) { return ( (ReportFileEditorInput) input ).getFile( ); } However, input can be ReportEditorInput which is also an IEditorInput (to support reports found outside projects and workspaces) which doesn't even have a getFile() method on it. This causes a deeply nested exception that causes the report desinger to not be able to show a report that might be physically located outside a workspace.
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/actions/BaseInsertMenuAction.java
import org.eclipse.birt.report.designer.internal.ui.dnd.InsertInLayoutUtil;
import org.eclipse.birt.report.designer.internal.ui.editors.parts.GraphicalEditorWithFlyoutPalette;
import org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts.LabelEditPart;
import org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler;
import org.eclipse.birt.report.designer.internal.ui.util.Policy;
import org.eclipse.birt.report.designer.internal.ui.views.IRequestConstants;
import org.eclipse.birt.report.designer.internal.ui.views.actions.InsertAction;
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.birt.report.designer.ui.editors.AbstractMultiPageEditor;
import org.eclipse.birt.report.designer.ui.views.ProviderFactory;
import org.eclipse.birt.report.designer.util.DEUtil;
import org.eclipse.birt.report.designer.util.DNDUtil;
import org.eclipse.birt.report.model.api.CommandStack;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.ReportItemHandle;
import org.eclipse.birt.report.model.api.SlotHandle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.Request;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
/**
 * Abstract class for insert report element. Provides basic support for insert
 * actions.
 */
public abstract class BaseInsertMenuAction extends SelectionAction