/* *****************************************************************************
* JFire - it's hot - Free ERP System - http://jfire.org *
* Copyright (C) 2004-2005 NightLabs - http://NightLabs.org *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin St, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
* Or get it online : *
* http://www.gnu.org/copyleft/lesser.html *
* *
* *
******************************************************************************/
package org.nightlabs.jfire.reporting.ui.viewer.editor;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
import org.nightlabs.jfire.base.login.ui.part.ICloseOnLogoutEditorPart;
/**
* Abstract implementation of an Editor that can be used as
* {@link ReportViewerEditor} it provides several helper
* methods that can be used by concrete implementations in order to
* show reports.
*
* @author Alexander Bieber <alex[AT]nightlabs[DOT]de>
*
*/
public abstract class AbstractReportViewerEditor
extends EditorPart
implements ReportViewerEditor, ICloseOnLogoutEditorPart
{
private ReportViewerEditorInput viewerInput;
/**
*
*/
public AbstractReportViewerEditor() {
super();
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public void doSave(IProgressMonitor monitor) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#doSaveAs()
*/
@Override
public void doSaveAs() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
*/
@Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
setSite(site);
setInput(input);
if (input instanceof ReportViewerEditorInput)
viewerInput = (ReportViewerEditorInput)input;
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#isDirty()
*/
@Override
public boolean isDirty() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
*/
@Override
public boolean isSaveAsAllowed() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
@Override
public void setFocus() {
}
/**
* Returns the {@link ReportViewerEditorInput} associated with this editor.
* @return The {@link ReportViewerEditorInput} associated with this editor.
*/
public ReportViewerEditorInput getViewerInput() {
return viewerInput;
}
}