org.eclipse.datatools.sqltools.sqleditor
Class SQLEditorStorageEditorInput

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqleditor.SQLEditorStorageEditorInput
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, ISQLEditorInput, org.eclipse.ui.IEditorInput, org.eclipse.ui.IPersistable, org.eclipse.ui.IPersistableElement, org.eclipse.ui.IStorageEditorInput
Direct Known Subclasses:
ProcEditorInput, SQLBuilderStorageEditorInput

public class SQLEditorStorageEditorInput
extends java.lang.Object
implements org.eclipse.ui.IStorageEditorInput, ISQLEditorInput, org.eclipse.ui.IPersistableElement

This class implements the ISQLEditorInput interface on a IStorageEditorInput base. It is provided as a convenience to callers of the SQL Editor who want to open the editor on an input that isn't a file.


Constructor Summary
SQLEditorStorageEditorInput(org.eclipse.core.resources.IStorage storage)
          Constructs an instance of this class with the given IStorage object as the editor input source.
SQLEditorStorageEditorInput(java.lang.String name, java.lang.String storageSource)
          Constructs an instance of this class with the given string as the editor input source.
 
Method Summary
 boolean exists()
          Gets whether the editor input exists.
 java.lang.Object getAdapter(java.lang.Class adapter)
          Gets an object which is an instance of the given class associated with this object.
 ISQLEditorConnectionInfo getConnectionInfo()
          Gets the ISQLEditorConnectionInfo object for this editor input.
 java.lang.String getFactoryId()
          Returns the id of the element factory which should be used to re-create this object.
 java.lang.String getId()
          Returns the unique identifier that distinguishes this editor input
 org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
          Gets the image descriptor for this input.
 java.lang.String getName()
          Gets the name of this editor input for display purposes.
 org.eclipse.ui.IPersistableElement getPersistable()
          Gets an object that can be used to save the state of this editor input.
 org.eclipse.core.resources.IStorage getStorage()
          Gets the underlying IStorage object.
 java.lang.String getToolTipText()
          Gets the tool tip text for this editor input.
 boolean isConnectionRequired()
          Returns whether database connection is required for this editor input to exist.
 void saveState(org.eclipse.ui.IMemento memento)
          Saves the state of the object in the given memento.
 void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
          Sets the ISQLEditorConnectionInfo object for this editor input to the given object.
 void setName(java.lang.String name)
          Sets the name of this editor input to the given name.
 void setStorage(org.eclipse.core.resources.IStorage storage)
          Sets the underlying IStorage object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLEditorStorageEditorInput

public SQLEditorStorageEditorInput(java.lang.String name,
                                   java.lang.String storageSource)
Constructs an instance of this class with the given string as the editor input source.

Parameters:
storageSource - the editor input source string

SQLEditorStorageEditorInput

public SQLEditorStorageEditorInput(org.eclipse.core.resources.IStorage storage)
Constructs an instance of this class with the given IStorage object as the editor input source.

Parameters:
storage - the storage object for this editor input
Method Detail

exists

public boolean exists()
Gets whether the editor input exists.

Specified by:
exists in interface org.eclipse.ui.IEditorInput
See Also:
IEditorInput.exists()

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Gets an object which is an instance of the given class associated with this object. Returns null if no such object can be found. This default implementation returns null.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
See Also:
IAdaptable.getAdapter(java.lang.Class)

getConnectionInfo

public ISQLEditorConnectionInfo getConnectionInfo()
Gets the ISQLEditorConnectionInfo object for this editor input.

Specified by:
getConnectionInfo in interface ISQLEditorInput
Returns:
the current ISQLEditorConnectionInfo object

getImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
Gets the image descriptor for this input.

Specified by:
getImageDescriptor in interface org.eclipse.ui.IEditorInput
See Also:
IEditorInput.getImageDescriptor()

getName

public java.lang.String getName()
Gets the name of this editor input for display purposes.

Specified by:
getName in interface org.eclipse.ui.IEditorInput
See Also:
IEditorInput.getName()

getPersistable

public org.eclipse.ui.IPersistableElement getPersistable()
Gets an object that can be used to save the state of this editor input.

Specified by:
getPersistable in interface org.eclipse.ui.IEditorInput
See Also:
IEditorInput.getPersistable()

getStorage

public org.eclipse.core.resources.IStorage getStorage()
Gets the underlying IStorage object. The default storage object is implemented as a InputStream.)

Specified by:
getStorage in interface org.eclipse.ui.IStorageEditorInput
See Also:
IStorageEditorInput.getStorage()

getToolTipText

public java.lang.String getToolTipText()
Gets the tool tip text for this editor input.

Specified by:
getToolTipText in interface org.eclipse.ui.IEditorInput
See Also:
IEditorInput.getToolTipText()

getFactoryId

public java.lang.String getFactoryId()
Returns the id of the element factory which should be used to re-create this object.

Specified by:
getFactoryId in interface org.eclipse.ui.IPersistableElement
See Also:
IPersistableElement.getFactoryId()

saveState

public void saveState(org.eclipse.ui.IMemento memento)
Saves the state of the object in the given memento.

Specified by:
saveState in interface org.eclipse.ui.IPersistable
Parameters:
memento - the storage area for object's state
See Also:
IPersistable.saveState(org.eclipse.ui.IMemento)

setConnectionInfo

public void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
Sets the ISQLEditorConnectionInfo object for this editor input to the given object.

Specified by:
setConnectionInfo in interface ISQLEditorInput
Parameters:
connInfo - the ISQLEditorConnectionInfo object to set

setName

public void setName(java.lang.String name)
Sets the name of this editor input to the given name.

Parameters:
name - the name to set

setStorage

public void setStorage(org.eclipse.core.resources.IStorage storage)
Sets the underlying IStorage object.

Parameters:
storage - the storage object to use

isConnectionRequired

public boolean isConnectionRequired()
Description copied from interface: ISQLEditorInput
Returns whether database connection is required for this editor input to exist.

Specified by:
isConnectionRequired in interface ISQLEditorInput
Returns:

getId

public java.lang.String getId()
Description copied from interface: ISQLEditorInput
Returns the unique identifier that distinguishes this editor input

Specified by:
getId in interface ISQLEditorInput
Returns:
A string id