## org.eclipse.datatools.sqltools.result.ui.view
Class ResultsViewControl

    java.lang.Object
      org.eclipse.datatools.sqltools.result.ui.view.ResultsViewControl

All Implemented Interfaces:
  java.util.EventListener, IProfileListener, IProfileListener1, IResultManagerListener, org.eclipse.help.IContextProvider, org.eclipse.jface.util.IPropertyChangeListener

    public class ResultsViewControl

extends java.lang.Object
implements org.eclipse.jface.util.IPropertyChangeListener, IProfileListener1, org.eclipse.help.IContextProvider, IResultManagerListener

This is the control for the view showing the result.

Author:
  Jeremy Lindop

Field Summary

Fields inherited from interface org.eclipse.help.IContextProvider
`NONE, SELECTION`

Constructor Summary
`ResultsViewControl()`
`ResultsViewControl(ResultsView resultsView)`

Method Summary
`void` `addResultHistoryFilter(org.eclipse.jface.viewers.ViewerFilter filter)`
`void` `allResultInstancesRemoved()` When all instances are removed, we perform the following steps: Clears the status for the SQL Results View Re-search the index according to current query expression Refreshes the history results table
`void` `clearHistory()`
`void` `createActions()`
`void` `createPartControl(org.eclipse.swt.widgets.Composite parent)`
`void` `dispose()`
`org.eclipse.help.IContext` `getContext(java.lang.Object target)`
`int` `getContextChangeMask()`
`org.eclipse.swt.widgets.Composite` `getControl()`
`IResultInstance` `getCurrentInstance()`
`org.eclipse.jface.action.Action` `getHLayoutAction()`
`org.eclipse.jface.action.IAction` `getOpenFilterDialogAction()`
`org.eclipse.jface.action.IAction` `getPreferenceAction()`
`org.eclipse.jface.action.IAction[]` `getRegisteredActions()`
`RemoveAllVisibleFinishedResultAction` `getRemoveAllVisibleFinishedResultAction()`
`org.eclipse.jface.action.IAction` `getRemoveResultAction()`
`ResultHistorySection` `getResultHistorySection()`
`ResultSection` `getResultSection()`
`java.lang.String` `getSearchExpression(java.lang.Object target)`
`org.eclipse.jface.action.IAction` `getSingleTabDisplayAction()`
`org.eclipse.jface.action.IAction` `getTerminateAction()`
`org.eclipse.jface.action.IAction` `getTextModeDisplayAction()`
`boolean` `getUsePreferences()` Gets the ResultsViewControl's setting about whether to use preference settings or defaults.
`ResultsView` `getView()`
`org.eclipse.jface.action.Action` `getVLayoutAction()`
`void` `init()`
`void` `init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento)`
`void` `parametersShow(IResultInstance instance, java.util.List params)` When CURRENT result instance need to show parameters, we perform the following steps: Invokes the `onParametersShown` method to show the parameters
`void` `profileAdded(IConnectionProfile profile)` Refresh the result history when profile is created
`void` `profileChanged(IConnectionProfile profile)` Refresh the result history when profile is changed
`void` `profileChanged(IConnectionProfile profile, java.lang.String oldName, java.lang.String oldDesc, java.lang.Boolean oldAutoConnect)` Refresh the result history when profile is changed
`void` `profileDeleted(IConnectionProfile profile)` Refresh the result history when profile is deleted
`void` `propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)`
`void` `reDisplay(IResultInstance instance)` Re-displays the selected instance since the options is modified
`void` `refreshResults()`
`void` `resultInstanceAppended(IResultInstance instance, ResultItem result, int index)` When an item is appended to the CURRENT result instance, we perform the following steps: Invokes the `onNewItemAppended` method to show the new item
`void` `resultInstanceCreated(IResultInstance result)` When a new result instance is created, we perform the following steps: Clears the status for the SQL Results View Refreshes the history results table to display the newly-created result Selects this newly-created result (make it the current result, this will invoke the `showDetail` method to show this result)
`void` `resultInstanceRemoved(IResultInstance result)` When an instance is removed, we perform the following steps: Clears the status for the SQL Results View Re-search the index according to current query expression Refreshes the history results table
`void` `resultInstanceReset(IResultInstance instance)` When an instance is reseted, we perform the following steps: Re-search the index according to current query expression Refreshes the history results table to display new status If it is the CURRENT instance, invokes `onInstanceReseted` method
`void` `resultInstancesRemoved(IResultInstance[] results)` When an array of instances are removed, we perform the following steps: Clears the status for the SQL Results View Re-search the index according to current query expression Refreshes the history results table
`void` `resultInstanceStatusUpdated(IResultInstance instance)` When a result instance's status is changed, we perform the following steps: If the status is changed to FINISH status, we update the actions accordingly Refreshes the history results table to display new status for this result If it is the CURRENT instance, invokes `onInstanceFinished`
`void` `saveState(org.eclipse.ui.IMemento memento)`
`void` `setCurrentInstance(IResultInstance instance)`
`void` `setFocus()`
`void` `setResultSection(ResultSection section)`
`void` `setUsePreferences(boolean usePreferences)` Tells the ResultsViewControl whether to use preference settings or preference defaults.

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

Constructor Detail

### ResultsViewControl

    public ResultsViewControl()

### ResultsViewControl

    public ResultsViewControl(ResultsView resultsView)

Method Detail

### getContext

    public org.eclipse.help.IContext getContext(java.lang.Object target)

  Specified by:
    `getContext` in interface `org.eclipse.help.IContextProvider`

### getContextChangeMask

    public int getContextChangeMask()

  Specified by:
    `getContextChangeMask` in interface `org.eclipse.help.IContextProvider`

### getSearchExpression

    public java.lang.String getSearchExpression(java.lang.Object target)

  Specified by:
    `getSearchExpression` in interface `org.eclipse.help.IContextProvider`

### init

    public void init()
              throws org.eclipse.ui.PartInitException

  Throws:
    `org.eclipse.ui.PartInitException`

### init

    public void init(org.eclipse.ui.IViewSite site,
                     org.eclipse.ui.IMemento memento)
              throws org.eclipse.ui.PartInitException

  Throws:
    `org.eclipse.ui.PartInitException`

### saveState

    public void saveState(org.eclipse.ui.IMemento memento)

### getControl

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

### createPartControl

    public void createPartControl(org.eclipse.swt.widgets.Composite parent)

### createActions

    public void createActions()

### setFocus

    public void setFocus()

### dispose

    public void dispose()

### propertyChange

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

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

### reDisplay

    public void reDisplay(IResultInstance instance)

  Re-displays the selected instance since the options is modified

  Parameters:
    `instance` - the result instance

### getResultSection

    public ResultSection getResultSection()

### setResultSection

    public void setResultSection(ResultSection section)

### getResultHistorySection

    public ResultHistorySection getResultHistorySection()

### getCurrentInstance

    public IResultInstance getCurrentInstance()

### getRegisteredActions

    public org.eclipse.jface.action.IAction[] getRegisteredActions()

### refreshResults

    public void refreshResults()

### setCurrentInstance

    public void setCurrentInstance(IResultInstance instance)

### profileChanged

    public void profileChanged(IConnectionProfile profile,
                               java.lang.String oldName,
                               java.lang.String oldDesc,
                               java.lang.Boolean oldAutoConnect)

  Refresh the result history when profile is changed

  Specified by:
    `profileChanged` in interface `IProfileListener1`

### profileAdded

    public void profileAdded(IConnectionProfile profile)

  Refresh the result history when profile is created

  Specified by:
    `profileAdded` in interface `IProfileListener`

### profileDeleted

    public void profileDeleted(IConnectionProfile profile)

  Refresh the result history when profile is deleted

  Specified by:
    `profileDeleted` in interface `IProfileListener`

### profileChanged

    public void profileChanged(IConnectionProfile profile)

  Refresh the result history when profile is changed

  Specified by:
    `profileChanged` in interface `IProfileListener`

### getRemoveAllVisibleFinishedResultAction

    public RemoveAllVisibleFinishedResultAction getRemoveAllVisibleFinishedResultAction()

### clearHistory

    public void clearHistory()

### getView

    public ResultsView getView()

### addResultHistoryFilter

    public void addResultHistoryFilter(org.eclipse.jface.viewers.ViewerFilter filter)

### getUsePreferences

    public boolean getUsePreferences()

  Gets the ResultsViewControl's setting about whether to use preference settings or defaults.

### setUsePreferences

    public void setUsePreferences(boolean usePreferences)

  Tells the ResultsViewControl whether to use preference settings or preference defaults.

  Parameters:
    `usePreferences` -

### getTerminateAction

    public org.eclipse.jface.action.IAction getTerminateAction()

### getRemoveResultAction

    public org.eclipse.jface.action.IAction getRemoveResultAction()

### getSingleTabDisplayAction

    public org.eclipse.jface.action.IAction getSingleTabDisplayAction()

### getTextModeDisplayAction

    public org.eclipse.jface.action.IAction getTextModeDisplayAction()

### getVLayoutAction

    public org.eclipse.jface.action.Action getVLayoutAction()

### getHLayoutAction

    public org.eclipse.jface.action.Action getHLayoutAction()

### getOpenFilterDialogAction

    public org.eclipse.jface.action.IAction getOpenFilterDialogAction()

### getPreferenceAction

    public org.eclipse.jface.action.IAction getPreferenceAction()

### resultInstanceCreated

    public void resultInstanceCreated(IResultInstance result)

  When a new result instance is created, we perform the following steps:
  - Clears the status for the SQL Results View
  - Refreshes the history results table to display the newly-created result
  - Selects this newly-created result (make it the current result, this will invoke the `showDetail` method to show this result)

  Specified by:
    `resultInstanceCreated` in interface `IResultManagerListener`
  Parameters:
    `result` - the result instance

### resultInstanceRemoved

    public void resultInstanceRemoved(IResultInstance result)

  When an instance is removed, we perform the following steps:
  - Clears the status for the SQL Results View
  - Re-search the index according to current query expression
  - Refreshes the history results table

  Specified by:
    `resultInstanceRemoved` in interface `IResultManagerListener`
  Parameters:
    `result` - the result instance

### resultInstancesRemoved

    public void resultInstancesRemoved(IResultInstance[] results)

  When an array of instances are removed, we perform the following steps:
  - Clears the status for the SQL Results View
  - Re-search the index according to current query expression
  - Refreshes the history results table

  Specified by:
    `resultInstancesRemoved` in interface `IResultManagerListener`
  Parameters:
    `results` - the result instances

### allResultInstancesRemoved

    public void allResultInstancesRemoved()

  When all instances are removed, we perform the following steps:
  - Clears the status for the SQL Results View
  - Re-search the index according to current query expression
  - Refreshes the history results table

  Specified by:
    `allResultInstancesRemoved` in interface `IResultManagerListener`

### resultInstanceAppended

    public void resultInstanceAppended(IResultInstance instance,
                                       ResultItem result,
                                       int index)

  When an item is appended to the CURRENT result instance, we perform the following steps:
  - Invokes the `onNewItemAppended` method to show the new item

  Specified by:
    `resultInstanceAppended` in interface `IResultManagerListener`
  Parameters:
    `instance` - the result instance
    `result` - the result item
    `index` - the index of the result item

### resultInstanceStatusUpdated

    public void resultInstanceStatusUpdated(IResultInstance instance)

  When a result instance's status is changed, we perform the following steps:
  - If the status is changed to FINISH status, we update the actions accordingly
  - Refreshes the history results table to display new status for this result
  - If it is the CURRENT instance, invokes `onInstanceFinished`

  Specified by:
    `resultInstanceStatusUpdated` in interface `IResultManagerListener`
  Parameters:
    `instance` - the result instance

### resultInstanceReset

    public void resultInstanceReset(IResultInstance instance)

  When an instance is reseted, we perform the following steps:
  - Re-search the index according to current query expression
  - Refreshes the history results table to display new status
  - If it is the CURRENT instance, invokes `onInstanceReseted` method

  Specified by:
    `resultInstanceReset` in interface `IResultManagerListener`
  Parameters:
    `instance` - the result instance

### parametersShow

    public void parametersShow(IResultInstance instance,
                               java.util.List params)

  When CURRENT result instance need to show parameters, we perform the following steps:
  - Invokes the `onParametersShown` method to show the parameters

  Specified by:
    `parametersShow` in interface `IResultManagerListener`
  Parameters:
    `instance` - the result instance
    `params` - the `Parameter` instances list
  See Also:
    `Parameter`