org.eclipse.datatools.sqltools.sqleditor
Class SQLEditor

java.lang.Object
  extended byTextEditor
      extended byorg.eclipse.datatools.sqltools.sqleditor.SQLEditor

public class SQLEditor
extends TextEditor

This class is responsible for configuring the SQL editor.

See Also:
Serialized Form

Field Summary
static java.lang.String HELP_CONTEXT_ID
           
static java.lang.String PLUGIN_NAME
           
 
Constructor Summary
SQLEditor()
          Constructs an instance of this class.
 
Method Summary
 void createPartControl(Composite parent)
          Creates the SWT controls for the editor.
 void dispose()
          Dispose of resources held by this editor.
 void doRevertToSaved()
          Abandons all modifications applied to this text editor's input element's textual presentation since the last save operation.
 void doSave(IProgressMonitor monitor)
          Saves the content of this editor.
 void doSaveAs()
          Saves the contents of this editor to another object.
 void doSetInput(IEditorInput input)
          Sets the input of the outline page after this class has set input.
 java.lang.Object getAdapter(java.lang.Class classForWhichAdapterNeeded)
          Gets an adapter for the given class.
 ISQLEditorConnectionInfo getConnectionInfo()
          Gets the connection info object of the editor input of this editor.
 Database getDatabase()
          Gets the Database object associated with this input.
 ISQLDBProposalsService getDBProposalsService()
          Gets the DBProposalsService object that provides content assist services for this editor.
 java.lang.String getDefaultSchemaName()
          Gets the default schema name to use with the connection or database associated with this input.
 SQLEditorDocumentSetupParticipant getDocumentSetupParticipant()
          Gets the document setup participant object associated with this editor.
 ParsingResult getParsingResult()
           
 java.util.ResourceBundle getResourceBundle()
          Gets the resource bundle associated with this editor.
 java.lang.String getSelectedText()
          Returns the selected text.
 SQLColorProvider getSQLColorProvider()
          Gets the color provider for colorizing SQL source code.
 ISourceViewer getSV()
          Makes the source viewer public.
 java.lang.String getText()
          Returns the complete text in this editor.
 void outlinePageClosed()
          Informs the editor that its outliner has been closed.
 void propertyChange(PropertyChangeEvent event)
          Handles notifications to the object that a property has changed.
 void refreshConnectionStatus()
          Refreshes the status area indicating the connection state.
 ISQLEditorConnectionInfo requestConnectionFromUser()
          Prompts the user to select an existing connection or create a new one.
 void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
          Sets the connection info object of the editor input of this editor.
 void setDocumentSetupParticipant(SQLEditorDocumentSetupParticipant docSetupParticipant)
          Sets the document setup participant object associated with this editor to the given object.
 void setFocus()
          Asks this part to take focus within the workbench.
 void setParsingResult(ParsingResult result)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_NAME

public static final java.lang.String PLUGIN_NAME
See Also:
Constant Field Values

HELP_CONTEXT_ID

public static final java.lang.String HELP_CONTEXT_ID
See Also:
Constant Field Values
Constructor Detail

SQLEditor

public SQLEditor()
Constructs an instance of this class. This is the default constructor.

Method Detail

createPartControl

public void createPartControl(Composite parent)
Creates the SWT controls for the editor.

See Also:
org.eclipse.ui.texteditor.AbstractTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)

dispose

public void dispose()
Dispose of resources held by this editor.

See Also:
IWorkbenchPart#dispose()

doRevertToSaved

public void doRevertToSaved()
Abandons all modifications applied to this text editor's input element's textual presentation since the last save operation.

See Also:
ITextEditor#doRevertToSaved()

doSave

public void doSave(IProgressMonitor monitor)
Saves the content of this editor.

See Also:
org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)

doSaveAs

public void doSaveAs()
Saves the contents of this editor to another object.

See Also:
org.eclipse.ui.ISaveablePart#doSaveAs()

doSetInput

public void doSetInput(IEditorInput input)
                throws CoreException
Sets the input of the outline page after this class has set input.

Parameters:
input - the new input for the editor
Throws:
CoreException
See Also:
org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)

getAdapter

public java.lang.Object getAdapter(java.lang.Class classForWhichAdapterNeeded)
Gets an adapter for the given class. Returns the SQL content outline page if the get request is for an outline page. Otherwise returns a projection adapter if one hasn't already been created.

See Also:
org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class), org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer, java.lang.Class)

getConnectionInfo

public ISQLEditorConnectionInfo getConnectionInfo()
Gets the connection info object of the editor input of this editor.

Returns:
the current connection info object if the editor has one, otherwise null

setConnectionInfo

public void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
Sets the connection info object of the editor input of this editor. Also updates connection related features such as actions, status line, syntax highlighting, and syntax validation, etc.

Parameters:
connInfo - the new connection info object

getDatabase

public Database getDatabase()
Gets the Database object associated with this input.

Returns:
the Database object associated with this input

getDBProposalsService

public ISQLDBProposalsService getDBProposalsService()
Gets the DBProposalsService object that provides content assist services for this editor.

Returns:
the current DBProposalsService object

getDefaultSchemaName

public java.lang.String getDefaultSchemaName()
Gets the default schema name to use with the connection or database associated with this input.

Returns:
the default schema name to use with this input, or null if none

getDocumentSetupParticipant

public SQLEditorDocumentSetupParticipant getDocumentSetupParticipant()
Gets the document setup participant object associated with this editor. The setup participant sets the partitioning type for the document.

Returns:
the current document setup participant

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Gets the resource bundle associated with this editor.

Returns:
the resource bundle associated with this editor.

getSQLColorProvider

public SQLColorProvider getSQLColorProvider()
Gets the color provider for colorizing SQL source code.

Returns:
the SQL color provider

propertyChange

public void propertyChange(PropertyChangeEvent event)
Handles notifications to the object that a property has changed.

Parameters:
event - the property change event object describing which property changed and how

setDocumentSetupParticipant

public void setDocumentSetupParticipant(SQLEditorDocumentSetupParticipant docSetupParticipant)
Sets the document setup participant object associated with this editor to the given object. The setup participant sets the partitioning type for the document.

Returns:
the current document setup participant

setFocus

public void setFocus()
Asks this part to take focus within the workbench.

See Also:
org.eclipse.ui.IWorkbenchPart#setFocus()

requestConnectionFromUser

public ISQLEditorConnectionInfo requestConnectionFromUser()
Prompts the user to select an existing connection or create a new one. Returns a ISQLEditorConnectionInfo object for the chosen connection.

Returns:
the ISQLEditorConnectionInfo object for the selected connection or null if none selected

getSV

public ISourceViewer getSV()
Makes the source viewer public.

Returns:
The source viewer used to create this editor

outlinePageClosed

public void outlinePageClosed()
Informs the editor that its outliner has been closed.


getParsingResult

public ParsingResult getParsingResult()
Returns:
the recent parsing result since the last modification

setParsingResult

public void setParsingResult(ParsingResult result)

refreshConnectionStatus

public void refreshConnectionStatus()
Refreshes the status area indicating the connection state.


getText

public java.lang.String getText()
Returns the complete text in this editor.

Returns:
the complete text.

getSelectedText

public java.lang.String getSelectedText()
Returns the selected text.



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