## org.eclipse.datatools.sqltools.result.ui
Class ResultsViewUIAccessor

    java.lang.Object
      org.eclipse.datatools.sqltools.result.ui.ResultsViewUIAccessor

    public class ResultsViewUIAccessor

extends java.lang.Object

This class is mainly used to control the UI related behaviour, and is mainly designed for WTP Output view's current consumers to lessen the refactoring effort.

Author:
  Dafan Yang

Field Summary
`static int` `MESSAGE_TAB`
`static int` `PARAM_TAB`
`static int` `RESULT_TAB`
`static int` `STATUS_TAB`

Method Summary
`static ResultsViewUIAccessor` `getInstance()`
`int` `getMaxLengthToShowEllipses()` Gets the maximum length to display ellipsis[...] button
`int` `getRowCount(OperationCommand cmd)` Returns the row count of current displaying result set of the given result instance, if the current tab is not ressult set or it is in single tab display mode, we will simply return -1.
`void` `showTab(OperationCommand cmd, int tabType)` Sets the focus to the given tab if the current result instance is the given instance.
`void` `showTab(OperationCommand cmd, int tabType, int tabNum)` Sets focus to the given message/result tab with the given tab number.
`void` `showTab(OperationCommand cmd, IResultSetObject result)` Sets the focus to the given result set if the current result instance is the given instance.

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

Field Detail

### STATUS_TAB

    public static final int STATUS_TAB

See Also:
  Constant Field Values

### PARAM_TAB

    public static final int PARAM_TAB

See Also:
  Constant Field Values

### MESSAGE_TAB

    public static final int MESSAGE_TAB

See Also:
  Constant Field Values

### RESULT_TAB

    public static final int RESULT_TAB

See Also:
  Constant Field Values

Method Detail

### getInstance

    public static ResultsViewUIAccessor getInstance()

### showTab

    public void showTab(OperationCommand cmd,
                        int tabType)

  Sets the focus to the given tab if the current result instance is the given instance. If there are multiple message or result tab, we always set focus to the first one. There is no guarantee that it will succeed because if the current displaying result instance is not the given one, we will do nothing.

  Parameters:
    `cmd` - the operation request, should not be null
    `tabType` - the tab type
  See Also:
    `OperationCommand#STATUS_TAB`, `OperationCommand#PARAM_TAB`, `OperationCommand#MESSAGE_TAB`, `OperationCommand#RESULT_TAB`

### showTab

    public void showTab(OperationCommand cmd,
                        int tabType,
                        int tabNum)

  Sets focus to the given message/result tab with the given tab number.

  Parameters:
    `cmd` - the operation request, should not be null
    `tabType` - the tab type, can be the one of the following:
    `tabNum` -
  See Also:
    `RESULT_TAB`, `MESSAGE_TAB`

### showTab

    public void showTab(OperationCommand cmd,
                        IResultSetObject result)

  Sets the focus to the given result set if the current result instance is the given instance. There is no guarantee that it will succeed because if the current displaying result instance is not the given one, we will do nothing.

  Parameters:
    `cmd` - the operation request, should not be null
    `result` - the result set object

### getRowCount

    public int getRowCount(OperationCommand cmd)

  Returns the row count of current displaying result set of the given result instance, if the current tab is not ressult set or it is in single tab display mode, we will simply return -1. Also, if the current displaying result instance is not the given one, will returns -1

  Parameters:
    `cmd` - the operation request, should not be null
  Returns:
    the row count of current displaying result

### getMaxLengthToShowEllipses

    public int getMaxLengthToShowEllipses()

  Gets the maximum length to display ellipsis[...] button

  Returns:
    the maximum length of parameter to display ellipsis[...] button