1 11 package org.eclipse.debug.internal.ui.views.launch; 12 13 14 import com.ibm.icu.text.MessageFormat; 15 16 import org.eclipse.core.runtime.PlatformObject; 17 import org.eclipse.debug.core.DebugException; 18 import org.eclipse.debug.core.model.IStackFrame; 19 import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages; 20 import org.eclipse.debug.ui.DebugUITools; 21 import org.eclipse.debug.ui.IDebugModelPresentation; 22 import org.eclipse.jface.resource.ImageDescriptor; 23 import org.eclipse.ui.IEditorInput; 24 import org.eclipse.ui.IPersistableElement; 25 26 31 public class SourceNotFoundEditorInput extends PlatformObject implements IEditorInput { 32 33 36 private IStackFrame fFrame; 37 38 41 private String fFrameText; 42 43 49 public SourceNotFoundEditorInput(IStackFrame frame) { 50 fFrame = frame; 51 IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(frame.getModelIdentifier()); 52 fFrameText = pres.getText(frame); 53 pres.dispose(); 54 } 55 56 59 public boolean exists() { 60 return false; 61 } 62 63 66 public ImageDescriptor getImageDescriptor() { 67 return DebugUITools.getDefaultImageDescriptor(fFrame); 68 } 69 70 73 public String getName() { 74 try { 75 return fFrame.getName(); 76 } catch (DebugException e) { 77 return DebugUIViewsMessages.SourceNotFoundEditorInput_Source_Not_Found_1; 78 } 79 } 80 81 84 public IPersistableElement getPersistable() { 85 return null; 86 } 87 88 91 public String getToolTipText() { 92 return MessageFormat.format(DebugUIViewsMessages.SourceNotFoundEditorInput_Source_not_found_for__0__2,new String [] {fFrameText}); 93 } 94 95 } 96 | Popular Tags |