1 11 package org.eclipse.pde.internal.ui.view; 12 13 14 import org.eclipse.core.resources.IStorage; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.ui.*; 17 18 19 22 public class JarEntryEditorInput implements IStorageEditorInput { 23 24 private IStorage fJarEntryFile; 25 26 public JarEntryEditorInput(IStorage jarEntryFile) { 27 fJarEntryFile= jarEntryFile; 28 } 29 30 32 public boolean equals(Object obj) { 33 if (this == obj) 34 return true; 35 if (!(obj instanceof JarEntryEditorInput)) 36 return false; 37 JarEntryEditorInput other= (JarEntryEditorInput) obj; 38 return fJarEntryFile.equals(other.fJarEntryFile); 39 } 40 41 44 public IPersistableElement getPersistable() { 45 return null; 46 } 47 48 51 public String getName() { 52 return fJarEntryFile.getName(); 53 } 54 55 58 public String getFullPath() { 59 return fJarEntryFile.getFullPath().toString(); 60 } 61 62 65 public String getContentType() { 66 return fJarEntryFile.getFullPath().getFileExtension(); 67 } 68 69 72 public String getToolTipText() { 73 return fJarEntryFile.getFullPath().toString(); 74 } 75 76 79 public ImageDescriptor getImageDescriptor() { 80 IEditorRegistry registry= PlatformUI.getWorkbench().getEditorRegistry(); 81 return registry.getImageDescriptor(fJarEntryFile.getFullPath().getFileExtension()); 82 } 83 84 87 public boolean exists() { 88 return true; 90 } 91 92 95 public Object getAdapter(Class adapter) { 96 return null; 97 } 98 99 102 public IStorage getStorage() { 103 return fJarEntryFile; 104 } 105 } 106 107 108 | Popular Tags |