org.jmlspecs.eclipse.jdt.ui
Class ZipEditorInput

java.lang.Object
  extended by org.jmlspecs.eclipse.jdt.ui.ZipEditorInput
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.ui.IEditorInput, org.eclipse.ui.IStorageEditorInput

public class ZipEditorInput
extends java.lang.Object
implements org.eclipse.ui.IStorageEditorInput

This class is used to provide an IEditorInput from files that are in a jar file, so that entries in a jar file can be displayed (readonly) in an editor within Eclipse.

Author:
David R. Cok

Constructor Summary
ZipEditorInput(java.lang.String jarFileName, java.lang.String jarEntryName)
          Constructor to wrap an element of the zip file for the editor
ZipEditorInput(org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage zes)
          Constructor to wrap the zip file entry for the editor
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean exists()
           
 java.lang.Object getAdapter(java.lang.Class c)
           
 org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
           
 java.lang.String getName()
           
 org.eclipse.ui.IPersistableElement getPersistable()
           
 IStorage getStorage()
          Returns the IStorage object represented by this.
 java.lang.String getToolTipText()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipEditorInput

public ZipEditorInput(org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage zes)
Constructor to wrap the zip file entry for the editor

Parameters:
zes - The zip file entry destined for the editor

ZipEditorInput

public ZipEditorInput(java.lang.String jarFileName,
                      java.lang.String jarEntryName)
               throws java.io.IOException
Constructor to wrap an element of the zip file for the editor

Parameters:
jarFileName - The name of the zip or jar file in which the element resides
jarEntryName - The file name of the entry within the zip /jar file
Throws:
java.io.IOException
Method Detail

getAdapter

public java.lang.Object getAdapter(java.lang.Class c)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Returns:
true if the objects refer to the same entry of the same zip file
See Also:
Object.equals(java.lang.Object)

getStorage

public IStorage getStorage()
Returns the IStorage object represented by this.

Specified by:
getStorage in interface org.eclipse.ui.IStorageEditorInput
Returns:
The underlying IZipEntryStorage object

getName

public java.lang.String getName()
Specified by:
getName in interface org.eclipse.ui.IEditorInput
Returns:
a display name for the object
See Also:
IEditorInput.getName()

exists

public boolean exists()
Specified by:
exists in interface org.eclipse.ui.IEditorInput
Returns:
false since the object does not exist in the project
See Also:
IEditorInput.exists()

getImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
Specified by:
getImageDescriptor in interface org.eclipse.ui.IEditorInput
Returns:
null since this method is sort of inapplicable
See Also:
IEditorInput.getImageDescriptor()

getPersistable

public org.eclipse.ui.IPersistableElement getPersistable()
Specified by:
getPersistable in interface org.eclipse.ui.IEditorInput
Returns:
null since the object is readonly
See Also:
IEditorInput.getPersistable()

getToolTipText

public java.lang.String getToolTipText()
Specified by:
getToolTipText in interface org.eclipse.ui.IEditorInput
Returns:
some help type text consisting of the file and entry names
See Also:
IEditorInput.getToolTipText()