1 11 package org.eclipse.debug.ui.sourcelookup; 12 13 import com.ibm.icu.text.MessageFormat; 14 15 import org.eclipse.core.runtime.PlatformObject; 16 import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages; 17 import org.eclipse.debug.ui.DebugUITools; 18 import org.eclipse.debug.ui.IDebugModelPresentation; 19 import org.eclipse.jface.resource.ImageDescriptor; 20 import org.eclipse.ui.IEditorInput; 21 import org.eclipse.ui.IPersistableElement; 22 23 32 public class CommonSourceNotFoundEditorInput extends PlatformObject implements IEditorInput { 33 34 37 private String fLabel; 38 41 private Object fArtifact; 42 43 48 public CommonSourceNotFoundEditorInput(Object artifact) { 49 fArtifact = artifact; 50 if (artifact != null) { 51 IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(); 52 fLabel = pres.getText(artifact); 53 pres.dispose(); 54 } 55 if (fLabel == null) { 56 fLabel = ""; } 58 } 59 60 63 public boolean exists() { 64 return false; 65 } 66 67 70 public ImageDescriptor getImageDescriptor() { 71 return DebugUITools.getDefaultImageDescriptor(fArtifact); 72 } 73 74 77 public String getName() { 78 return fLabel; 79 } 80 81 84 public IPersistableElement getPersistable() { 85 return null; 86 } 87 88 91 public String getToolTipText() { 92 return MessageFormat.format(SourceLookupUIMessages.addSourceLocation_editorMessage, new String [] { fLabel }); 93 } 94 95 100 public Object getArtifact(){ 101 return fArtifact; 102 } 103 104 } 105 | Popular Tags |