1 11 package org.eclipse.jdt.internal.debug.ui; 12 13 14 import org.eclipse.core.resources.IStorage; 15 import org.eclipse.core.runtime.PlatformObject; 16 import org.eclipse.jdt.ui.ISharedImages; 17 import org.eclipse.jdt.ui.JavaUI; 18 import org.eclipse.jface.resource.ImageDescriptor; 19 import org.eclipse.ui.IPersistableElement; 20 import org.eclipse.ui.IStorageEditorInput; 21 22 public abstract class StorageEditorInput extends PlatformObject implements IStorageEditorInput { 23 24 27 private IStorage fStorage; 28 29 32 public StorageEditorInput(IStorage storage) { 33 fStorage = storage; 34 } 35 36 39 public IStorage getStorage() { 40 return fStorage; 41 } 42 43 46 public ImageDescriptor getImageDescriptor() { 47 return JavaUI.getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_CUNIT); 48 } 49 50 53 public String getName() { 54 return getStorage().getName(); 55 } 56 57 60 public IPersistableElement getPersistable() { 61 return null; 62 } 63 64 67 public String getToolTipText() { 68 return getStorage().getFullPath().toOSString(); 69 } 70 71 74 public boolean equals(Object object) { 75 return object instanceof StorageEditorInput && 76 getStorage().equals(((StorageEditorInput)object).getStorage()); 77 } 78 79 82 public int hashCode() { 83 return getStorage().hashCode(); 84 } 85 86 } 87 | Popular Tags |