1 11 package org.eclipse.debug.internal.ui.views.launch; 12 13 14 import org.eclipse.core.resources.IMarker; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.jface.resource.JFaceColors; 17 import org.eclipse.swt.SWT; 18 import org.eclipse.swt.widgets.Composite; 19 import org.eclipse.swt.widgets.Text; 20 import org.eclipse.ui.IEditorInput; 21 import org.eclipse.ui.IEditorSite; 22 import org.eclipse.ui.IReusableEditor; 23 import org.eclipse.ui.part.EditorPart; 24 25 30 public class SourceNotFoundEditor extends EditorPart implements IReusableEditor { 31 32 35 private Text fText; 36 37 40 public void doSave(IProgressMonitor monitor) { 41 } 42 43 46 public void doSaveAs() { 47 } 48 49 52 public void gotoMarker(IMarker marker) { 53 } 54 55 58 public void init(IEditorSite site, IEditorInput input) { 59 setSite(site); 60 setInput(input); 61 } 62 63 66 public boolean isDirty() { 67 return false; 68 } 69 70 73 public boolean isSaveAsAllowed() { 74 return false; 75 } 76 77 80 public void createPartControl(Composite parent) { 81 fText = new Text(parent,SWT.MULTI|SWT.READ_ONLY|SWT.WRAP); 82 fText.setForeground(JFaceColors.getErrorText(fText.getDisplay())); 83 fText.setBackground(fText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); 84 if (getEditorInput() != null) { 85 setInput(getEditorInput()); 86 } 87 } 88 89 92 public void setFocus() { 93 if (fText != null) { 94 fText.setFocus(); 95 } 96 } 97 98 101 public void setInput(IEditorInput input) { 102 super.setInput(input); 103 setPartName(input.getName()); 104 if (fText != null) { 105 fText.setText(input.getToolTipText()); 106 } 107 } 108 109 } 110 | Popular Tags |