| /******************************************************************************* |
| * Copyright (c) 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Common Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/cpl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ui.internal; |
| |
| import org.eclipse.core.runtime.IProgressMonitor; |
| import org.eclipse.core.runtime.IStatus; |
| import org.eclipse.swt.widgets.Composite; |
| import org.eclipse.ui.IEditorInput; |
| import org.eclipse.ui.IEditorSite; |
| import org.eclipse.ui.PartInitException; |
| import org.eclipse.ui.internal.part.StatusPart; |
| import org.eclipse.ui.part.EditorPart; |
| |
| public class ErrorEditorPart extends EditorPart { |
| |
| private IStatus msg; |
| |
| public ErrorEditorPart(IStatus errorMessage) { |
| msg = errorMessage; |
| } |
| |
| public void doSave(IProgressMonitor monitor) { |
| } |
| |
| public void doSaveAs() { |
| } |
| |
| public void createPartControl(Composite parent) { |
| new StatusPart(parent, msg); |
| } |
| |
| public void init(IEditorSite site, IEditorInput input) |
| throws PartInitException { |
| setSite(site); |
| setInput(input); |
| setPartName(input.getName()); |
| } |
| |
| public boolean isDirty() { |
| return false; |
| } |
| |
| public boolean isSaveAsAllowed() { |
| return false; |
| } |
| |
| public void setFocus() { |
| |
| } |
| |
| } |