## org.eclipse.datatools.sqltools.sqleditor
Class SQLEditorStorage

    java.lang.Object
      org.eclipse.datatools.sqltools.sqleditor.SQLEditorStorage

public class SQLEditorStorage
extends java.lang.Object

This class implements the IStorage interface to facilitate launching the SQL Editor from an editor input that isn't based on a file.

Constructor Summary
`SQLEditorStorage(java.lang.String source)` Creates an instance of this class with the given string as the storage source content.
`SQLEditorStorage(java.lang.String name, java.lang.String source)` Creates an instance of this class with the given name and the given string as the storage content.

Method Summary
`java.lang.Object` `getAdapter(java.lang.Class key)` Returns an object which is an instance of the given class associated with this object.
`java.io.InputStream` `getContents()` Returns an open input stream on the contents of this storage.
`java.lang.String` `getContentsString()` Returns the content of this object as a string.
`IPath` `getFullPath()` Returns the full path of this storage.
`java.lang.String` `getName()` Returns the name of this storage.
`boolean` `isReadOnly()` Returns whether this storage is read-only.
`void` `setContents(java.io.InputStream contents)` Sets the input stream that acts as the contents of this storage to the given input stream.
`void` `setName(java.lang.String name)` Sets the name of this storage object to the given name.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SQLEditorStorage

    public SQLEditorStorage(java.lang.String source)

  Creates an instance of this class with the given string as the storage source content. The new storage object has a default name.

Parameters:
  `source` - the source content for this object

### SQLEditorStorage

    public SQLEditorStorage(java.lang.String name,
                            java.lang.String source)

  Creates an instance of this class with the given name and the given string as the storage content.

Parameters:
  `name` - the name for this storage object
  `source` - the content source for this object

Method Detail

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class key)

  Returns an object which is an instance of the given class associated with this object. This implementation returns `null`

  See Also:
    `org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)`

### getContents

    public java.io.InputStream getContents()

  Returns an open input stream on the contents of this storage. The caller is responsible for closing the stream when finished.

  See Also:
    `org.eclipse.core.resources.IStorage#getContents()`

### getContentsString

    public java.lang.String getContentsString()

  Returns the content of this object as a string.

  Returns:
    the content as a string

### getFullPath

    public IPath getFullPath()

  Returns the full path of this storage. This default implementation returns null.

  Returns:
    `null</null>`
  See Also:
    `org.eclipse.core.resources.IStorage#getFullPath()`

### getName

    public java.lang.String getName()

  Returns the name of this storage. The name of a storage is synonymous with the last segment of its full path though if the storage does not have a path, it may still have a name.

  Returns:
    the name of this storage object
  See Also:
    `org.eclipse.core.resources.IStorage#getName()`

### isReadOnly

    public boolean isReadOnly()

  Returns whether this storage is read-only.

  Returns:
    false, since this storage is not read only
  See Also:
    `org.eclipse.core.resources.IStorage#isReadOnly()`

### setContents

    public void setContents(java.io.InputStream contents)

  Sets the input stream that acts as the contents of this storage to the given input stream.

  Parameters:
    `contents` - the contents stream to use

### setName

    public void setName(java.lang.String name)

  Sets the name of this storage object to the given name.

  Parameters:
    `name` - the name of this storage object

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