1 17 package org.eclipse.emf.common.ui; 18 19 20 import java.io.File ; 21 22 import org.eclipse.jface.resource.ImageDescriptor; 23 import org.eclipse.ui.IEditorInput; 24 import org.eclipse.ui.IPersistableElement; 25 26 import org.eclipse.emf.common.util.URI; 27 28 29 33 public class URIEditorInput implements IEditorInput 34 { 35 private URI uri; 36 37 public URIEditorInput(URI uri) 38 { 39 this.uri = uri; 40 } 41 42 45 public URI getURI() 46 { 47 return uri; 48 } 49 50 55 public boolean exists() 56 { 57 if (getURI().isFile()) 58 { 59 return new File (getURI().toFileString()).exists(); 60 } 61 else 62 { 63 return false; 64 } 65 } 66 67 71 public String getName() 72 { 73 return getURI().toString(); 74 } 75 76 79 public String getToolTipText() 80 { 81 return getName(); 82 } 83 84 87 public ImageDescriptor getImageDescriptor() 88 { 89 return null; 90 } 91 92 95 public IPersistableElement getPersistable() 96 { 97 return null; 98 } 99 100 103 public Object getAdapter(Class adapter) 104 { 105 return null; 106 } 107 } | Popular Tags |