org.eclipse.datatools.sqltools.result.internal.ui.view
Class ResultSection

java.lang.Object
  extended by org.eclipse.datatools.sqltools.result.internal.ui.view.ResultSection
Direct Known Subclasses:
MultipleTabsModeSection, SingleWindowModeSection

public abstract class ResultSection
extends java.lang.Object

ResultSection is an UI class, which is responsible for displaying the right part of the SQL Results View. Four kinds of display modes are supported:

So four classes are defined for each mode --- MultipleTabsGridSection, MultipleTabsTextSection, SingleWindowGridSection, and SingleWindowTextSection.

Author:
Dafan Yang

Nested Class Summary
 class ResultSection.OutputThread
           
 
Constructor Summary
ResultSection(IResultInstance instance, ResultsViewControl resultsViewControl)
           
 
Method Summary
abstract  org.eclipse.swt.widgets.Composite getControl()
          Returns the outer control of this UI section
 int getRowCount()
          Returns the row count of the current displaying result set.
abstract  void onInstanceFinished()
          Does some jobs when resultInstanceFinish event occurs for the current result instance, for example, when using single window display mode, we need to display the parameters at the end
abstract  void onInstanceReseted()
          Refreshes UI when resultInstanceReset event occurs for the current result instance
 void onNewItemAppended(ResultItem item, int index)
          Shows the newly-appended result item (when resultInstanceAppended event occurs) for the current result instance
abstract  void onParametersShown(java.util.List params)
          Shows the parameters for the current result instance, do nothing in single window display mode, because we need to display the parameters at the end in this mode
 void showDetail(IResultInstance instance)
          Shows the selected instance (when user clicks the history results item).
 void showResultSet(IResultSetObject result)
          Sets focus to the given result set
 void showTab(int tabType)
          Sets focus to the given tab
 void showTab(int tabType, int tabNumber)
          Sets focus to the given message/result tab with the given number
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSection

public ResultSection(IResultInstance instance,
                     ResultsViewControl resultsViewControl)
Method Detail

getControl

public abstract org.eclipse.swt.widgets.Composite getControl()
Returns the outer control of this UI section

Returns:
the outer composite

showDetail

public void showDetail(IResultInstance instance)
Shows the selected instance (when user clicks the history results item).

Parameters:
instance - the selected result instance

onNewItemAppended

public void onNewItemAppended(ResultItem item,
                              int index)
Shows the newly-appended result item (when resultInstanceAppended event occurs) for the current result instance

Parameters:
item - the newly-appended result item
index - the index of this item

onParametersShown

public abstract void onParametersShown(java.util.List params)
Shows the parameters for the current result instance, do nothing in single window display mode, because we need to display the parameters at the end in this mode

Parameters:
params - the parameters

onInstanceFinished

public abstract void onInstanceFinished()
Does some jobs when resultInstanceFinish event occurs for the current result instance, for example, when using single window display mode, we need to display the parameters at the end


onInstanceReseted

public abstract void onInstanceReseted()
Refreshes UI when resultInstanceReset event occurs for the current result instance


showTab

public void showTab(int tabType)
Sets focus to the given tab

Parameters:
tabType - the type of the tab to be set focus
See Also:
ResultsViewUIAccessor.STATUS_TAB, ResultsViewUIAccessor.PARAM_TAB, ResultsViewUIAccessor.MESSAGE_TAB, ResultsViewUIAccessor.RESULT_TAB

showResultSet

public void showResultSet(IResultSetObject result)
Sets focus to the given result set

Parameters:
result - the result set

showTab

public void showTab(int tabType,
                    int tabNumber)
Sets focus to the given message/result tab with the given number

Parameters:
tabType - the type of the tab to be set focus
tabNumber - the number of the tab for the given type
See Also:
ResultsViewUIAccessor.MESSAGE_TAB, ResultsViewUIAccessor.RESULT_TAB

getRowCount

public int getRowCount()
Returns the row count of the current displaying result set.

Returns:
the row count of the current displaying result set, returns -1 if the current tab is not a result set tab or current display mode is single tab display mode