org.eclipse.datatools.sqltools.sqlbuilder.util
Class SQLBuilderEditorInputUtil

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqlbuilder.util.SQLBuilderEditorInputUtil

public class SQLBuilderEditorInputUtil
extends java.lang.Object

This class provides static methods for SQLBuilder EditorInputs.

Author:
Jeremy Lindop

Constructor Summary
SQLBuilderEditorInputUtil()
           
 
Method Summary
static SQLBuilderEditorInput createSQLBuilderEditorInput(org.eclipse.core.resources.IFile file)
          Creates a SQLBuilderEditorInput from a file.
static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(org.eclipse.core.resources.IFile file)
          Creates a SQLBuilderStorageEditorInput from a file.
static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(org.eclipse.ui.IMemento memento)
          Create a new SQLBuilderStorageEditorInput from the specified memento.
static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(java.lang.String s)
          Creates a SQLBuilderStorageEditorInput from a string.
static org.eclipse.ui.IMemento readMementoFromString(java.lang.String s)
          Utility function to create a new IMemento from a a string.
static org.eclipse.ui.XMLMemento saveSQLBuilderStorageEditorInput(SQLBuilderStorageEditorInput storageEditorInput)
          Save a SQLBuilderStorageEditorInput to an XMLMemento
static java.lang.String writeXMLMementoToString(org.eclipse.ui.XMLMemento memento)
          Utility function to write an XMLMemento to a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLBuilderEditorInputUtil

public SQLBuilderEditorInputUtil()
Method Detail

createSQLBuilderStorageEditorInput

public static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(java.lang.String s)
Creates a SQLBuilderStorageEditorInput from a string. The string should be a serialized XMLMemento created from a SQLBuilderStorageEditorInput.

Parameters:
s -
Returns:
SQLBuilderFileEditorInput the SQLBuilderFileEditorInput created from the input string.

createSQLBuilderStorageEditorInput

public static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(org.eclipse.ui.IMemento memento)
Create a new SQLBuilderStorageEditorInput from the specified memento.

Parameters:
memento -
Returns:
the SQLBuilderFileEditorInput created from the memento

createSQLBuilderStorageEditorInput

public static SQLBuilderStorageEditorInput createSQLBuilderStorageEditorInput(org.eclipse.core.resources.IFile file)
Creates a SQLBuilderStorageEditorInput from a file. It consumes .sql files created in the DTP SQLEditor and possibly edited subsequently in the SQLBuilder.

Parameters:
file -
Returns:
SQLBuilderStorageEditorInput the SQLBuilderStorageEditorInput created from the input file.

createSQLBuilderEditorInput

public static SQLBuilderEditorInput createSQLBuilderEditorInput(org.eclipse.core.resources.IFile file)
Creates a SQLBuilderEditorInput from a file. It consumes .sql files created in the DTP SQLEditor and possibly edited subsequently in the SQLBuilder.

Parameters:
file -
Returns:
SQLBuilderEditorInput the SQLBuilderEditorInput created from the input file.

saveSQLBuilderStorageEditorInput

public static org.eclipse.ui.XMLMemento saveSQLBuilderStorageEditorInput(SQLBuilderStorageEditorInput storageEditorInput)
Save a SQLBuilderStorageEditorInput to an XMLMemento

Parameters:
storageEditorInput -
Returns:
XMLMemento the XMLMemento to which the input is saved.

writeXMLMementoToString

public static java.lang.String writeXMLMementoToString(org.eclipse.ui.XMLMemento memento)
Utility function to write an XMLMemento to a string

Returns:
String

readMementoFromString

public static org.eclipse.ui.IMemento readMementoFromString(java.lang.String s)
Utility function to create a new IMemento from a a string.

Parameters:
s - a serialized XMLMemento
Returns:
the de-serialized IMemento