org.eclipse.datatools.sqltools.sqleditor
Class SQLEditorStorageEditorInput

java.lang.Object
  extended byorg.eclipse.datatools.sqltools.sqleditor.SQLEditorStorageEditorInput
All Implemented Interfaces:
ISQLEditorInput
Direct Known Subclasses:
ProcEditorInput

public class SQLEditorStorageEditorInput
extends java.lang.Object
implements ISQLEditorInput

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(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
 ImageDescriptor getImageDescriptor()
          Gets the image descriptor for this input.
 java.lang.String getName()
          Gets the name of this editor input for display purposes.
 IPersistableElement getPersistable()
          Gets an object that can be used to save the state of this editor input.
 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(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(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(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.

See Also:
org.eclipse.ui.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.

See Also:
org.eclipse.core.runtime.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 ImageDescriptor getImageDescriptor()
Gets the image descriptor for this input.

See Also:
org.eclipse.ui.IEditorInput#getImageDescriptor()

getName

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

See Also:
org.eclipse.ui.IEditorInput#getName()

getPersistable

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

See Also:
org.eclipse.ui.IEditorInput#getPersistable()

getStorage

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

See Also:
org.eclipse.ui.IStorageEditorInput#getStorage()

getToolTipText

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

See Also:
org.eclipse.ui.IEditorInput#getToolTipText()

getFactoryId

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

See Also:
org.eclipse.ui.IPersistableElement#getFactoryId()

saveState

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

Parameters:
memento - the storage area for object's state
See Also:
org.eclipse.ui.IPersistableElement#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(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


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.