## org.eclipse.datatools.sqltools.sqlbuilder.views.source
Class SQLSourceViewer

    java.lang.Object
      org.eclipse.jface.viewers.Viewer
          org.eclipse.jface.viewers.ContentViewer
              org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer

All Implemented Interfaces:
  java.util.EventListener, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.swt.events.DisposeListener, org.eclipse.swt.internal.SWTEventListener

    public class SQLSourceViewer

extends org.eclipse.jface.viewers.ContentViewer
implements org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.swt.events.DisposeListener

Field Summary
`java.util.Map` `actions`

Constructor Summary
`SQLSourceViewer(SQLDomainModel sqlDomainModel, org.eclipse.swt.widgets.Composite parent)`
`SQLSourceViewer(SQLDomainModel sqlDomainModel, org.eclipse.swt.widgets.Composite parent, boolean handleImproper)`

Method Summary
`boolean` `forceReparse()`
`org.eclipse.jface.action.IAction` `getAction(java.lang.String actionID)`
`org.eclipse.swt.widgets.Control` `getControl()`
`org.eclipse.ui.texteditor.IDocumentProvider` `getDocumentProvider()`
`SQLDomainModel` `getDomainModel()`
`java.lang.String` `getFileSQLStr()`
`java.lang.String` `getLastKnownProperSource()`
`boolean` `getParseRequired()`
`org.eclipse.jface.viewers.ISelection` `getSelection()`
`java.lang.String` `getText()`
`boolean` `getTextChanged()`
`void` `initDBContext()`
`void` `inputChanged(java.lang.Object input, java.lang.Object oldInput)`
`boolean` `isRootStatement()`
`boolean` `isTextChanged()`
`void` `menuAboutToShow(org.eclipse.jface.action.IMenuManager menu)`
`void` `noUnsupportedReparse()`
`void` `propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)`
`void` `refresh()`
`void` `refreshSource()`
`void` `refreshSource(java.lang.String inputStr)`
`boolean` `reparse()`
`void` `revertToDefaultSource()`
`void` `revertToInitialSource()`
`void` `revertToLastKnownProperSource()`
`void` `selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)`
`void` `setAction(java.lang.String actionID, org.eclipse.jface.action.IAction action)`
`void` `setContentChangeListener(IContentChangeListener qListener)`
`void` `setFileSQLStr(java.lang.String fileSQLStr)`
`void` `setParseRequired(boolean required)`
`void` `setSelection(org.eclipse.jface.viewers.ISelection selection, boolean reveal)`
`void` `setSQLBuilder(SQLBuilder sqlbuilder)`
`void` `setTextChanged(boolean changed)`
`void` `setTextDirty(boolean dirty)` Let the source view knows that the text is dirty from action such as dropping a table in the Graph view.
`void` `widgetDisposed(org.eclipse.swt.events.DisposeEvent arg0)`

Methods inherited from class org.eclipse.jface.viewers.ContentViewer
`getContentProvider, getInput, getLabelProvider, setContentProvider, setInput, setLabelProvider`

Methods inherited from class org.eclipse.jface.viewers.Viewer
`addHelpListener, addSelectionChangedListener, getData, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection`

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

Field Detail

### actions

    public java.util.Map actions

Constructor Detail

### SQLSourceViewer

    public SQLSourceViewer(SQLDomainModel sqlDomainModel,
                           org.eclipse.swt.widgets.Composite parent)

### SQLSourceViewer

    public SQLSourceViewer(SQLDomainModel sqlDomainModel,
                           org.eclipse.swt.widgets.Composite parent,
                           boolean handleImproper)

Method Detail

### setSQLBuilder

    public void setSQLBuilder(SQLBuilder sqlbuilder)

### propertyChange

    public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)

  Specified by:
    `propertyChange` in interface `org.eclipse.jface.util.IPropertyChangeListener`

### setContentChangeListener

    public void setContentChangeListener(IContentChangeListener qListener)

### initDBContext

    public void initDBContext()

### inputChanged

    public void inputChanged(java.lang.Object input,
                             java.lang.Object oldInput)

  Overrides:
    `inputChanged` in class `org.eclipse.jface.viewers.Viewer`

### getControl

    public org.eclipse.swt.widgets.Control getControl()

  Specified by:
    `getControl` in class `org.eclipse.jface.viewers.Viewer`

### refresh

    public void refresh()

  Specified by:
    `refresh` in class `org.eclipse.jface.viewers.Viewer`

### setSelection

    public void setSelection(org.eclipse.jface.viewers.ISelection selection,
                             boolean reveal)

  Specified by:
    `setSelection` in class `org.eclipse.jface.viewers.Viewer`

### getSelection

    public org.eclipse.jface.viewers.ISelection getSelection()

  Specified by:
    `getSelection` in interface `org.eclipse.jface.viewers.ISelectionProvider`
  Specified by:
    `getSelection` in class `org.eclipse.jface.viewers.Viewer`

### refreshSource

    public void refreshSource()

### refreshSource

    public void refreshSource(java.lang.String inputStr)

### revertToLastKnownProperSource

    public void revertToLastKnownProperSource()

### revertToDefaultSource

    public void revertToDefaultSource()

### revertToInitialSource

    public void revertToInitialSource()

### getText

    public java.lang.String getText()

### selectionChanged

    public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)

  Specified by:
    `selectionChanged` in interface `org.eclipse.jface.viewers.ISelectionChangedListener`

### setAction

    public void setAction(java.lang.String actionID,
                          org.eclipse.jface.action.IAction action)

### getDomainModel

    public SQLDomainModel getDomainModel()

### getAction

    public org.eclipse.jface.action.IAction getAction(java.lang.String actionID)

### isRootStatement

    public boolean isRootStatement()

### menuAboutToShow

    public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menu)

  Specified by:
    `menuAboutToShow` in interface `org.eclipse.jface.action.IMenuListener`

### reparse

    public boolean reparse()

### noUnsupportedReparse

    public void noUnsupportedReparse()

### forceReparse

    public boolean forceReparse()

### getTextChanged

    public boolean getTextChanged()

### isTextChanged

    public boolean isTextChanged()

### setTextChanged

    public void setTextChanged(boolean changed)

### setParseRequired

    public void setParseRequired(boolean required)

### getParseRequired

    public boolean getParseRequired()

### setTextDirty

    public void setTextDirty(boolean dirty)

  Let the source view knows that the text is dirty from action such as dropping a table in the Graph view. FYI: the Textlistener should have detected the change but did not. This is a work-around solution

  Parameters:
    `dirty` - whether or not the text is dirty

### widgetDisposed

    public void widgetDisposed(org.eclipse.swt.events.DisposeEvent arg0)

  Specified by:
    `widgetDisposed` in interface `org.eclipse.swt.events.DisposeListener`
  See Also:
    `DisposeListener.widgetDisposed(DisposeEvent)`

### getLastKnownProperSource

    public java.lang.String getLastKnownProperSource()

### getFileSQLStr

    public java.lang.String getFileSQLStr()

  Returns:
    Returns the fileSQLStr.

### setFileSQLStr

    public void setFileSQLStr(java.lang.String fileSQLStr)

  Parameters:
    `fileSQLStr` - The fileSQLStr to set.

### getDocumentProvider

    public org.eclipse.ui.texteditor.IDocumentProvider getDocumentProvider()