1 11 package org.eclipse.ui.internal; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.swt.widgets.Composite; 16 import org.eclipse.ui.IEditorInput; 17 import org.eclipse.ui.IEditorSite; 18 import org.eclipse.ui.internal.part.StatusPart; 19 import org.eclipse.ui.part.EditorPart; 20 21 26 public class ErrorEditorPart extends EditorPart { 27 28 private IStatus error; 29 30 33 public ErrorEditorPart() { 34 } 35 36 39 public ErrorEditorPart(IStatus error) { 40 this.error = error; 41 } 42 43 48 public void doSave(IProgressMonitor monitor) { 49 } 50 51 56 public void doSaveAs() { 57 } 58 59 64 public void createPartControl(Composite parent) { 65 if (error != null) { 66 new StatusPart(parent, error); 67 } 68 } 69 70 76 public void init(IEditorSite site, IEditorInput input) { 77 setSite(site); 78 setInput(input); 79 setPartName(input.getName()); 80 } 81 82 87 public boolean isDirty() { 88 return false; 89 } 90 91 96 public boolean isSaveAsAllowed() { 97 return false; 98 } 99 100 105 public void setFocus() { 106 107 } 108 109 114 public void setPartName(String newName) { 115 super.setPartName(newName); 116 } 117 } 118 | Popular Tags |