1 11 package org.eclipse.debug.internal.ui.sourcelookup; 12 13 import java.text.MessageFormat ; 14 15 import org.eclipse.core.runtime.PlatformObject; 16 import org.eclipse.debug.ui.DebugUITools; 17 import org.eclipse.debug.ui.IDebugModelPresentation; 18 import org.eclipse.jface.resource.ImageDescriptor; 19 import org.eclipse.ui.IEditorInput; 20 import org.eclipse.ui.IPersistableElement; 21 22 30 public class CommonSourceNotFoundEditorInput extends PlatformObject implements IEditorInput { 31 32 35 protected String fLabel; 36 39 protected Object fObject; 40 41 47 public CommonSourceNotFoundEditorInput(Object object) { 48 fObject = object; 49 if (object != null) { 50 IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(); 51 fLabel = pres.getText(object); 52 pres.dispose(); 53 } 54 if (fLabel == null) { 55 fLabel = ""; } 57 } 58 59 62 public boolean exists() { 63 return false; 64 } 65 66 69 public ImageDescriptor getImageDescriptor() { 70 return DebugUITools.getDefaultImageDescriptor(fObject); 71 } 72 73 76 public String getName() { 77 return fLabel; 78 } 79 80 83 public IPersistableElement getPersistable() { 84 return null; 85 } 86 87 90 public String getToolTipText() { 91 return MessageFormat.format(SourceLookupUIMessages.addSourceLocation_editorMessage, new String [] { fLabel }); } 93 94 98 public Object getObject(){ 99 return fObject; 100 } 101 102 } 103 | Popular Tags |