com.microfocus.awm.model

## Interface IUIUtility

-     public interface IUIUtility

  Contains helper methods for making UI calls from a non-UI plug-in. The registered instance of can be acquired using `TaurusUIUtilityProcessor.getMyUIUtility()`.

  Not intended to be implemented by clients.

  Author:
    Joachim Kaltenbach

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CONFIRM_DIALOG` Constant for opening a confirm dialog
    `static int` | `ERROR_DIALOG` Constant for opening a error dialog
    `static int` | `INFO_DIALOG` Constant for opening a info dialog
    `static int` | `QUESTION_DIALOG` Constant for opening a question dialog
    `static int` | `WARNING_DIALOG` Constant for opening a warning dialog

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeEditorParts()` Close all open editor parts registered by Taurus.
    `void` | `expandInTreeView(java.lang.Object pObject, int pLevel)` Expands the object in the main AWM tree view.
    `java.lang.String` | `getActiveEditorContents()` Gets the contents of the active text editor.
    `java.lang.String` | `getViewTitle(java.lang.String pViewID, java.lang.String pSecondaryID)` Gets the title of the view.
    `void` | `loadOpenFiles()` Load the open files saved in the file ft_openfiles.xml.
    `org.eclipse.core.resources.IFile` | `openFile(FileDescriptor pFD, IExecutionContext pContext, boolean pReadOnly)` Opens the given Content in editor.
    `void` | `refreshElementListEntryInViews(IElementListEntry pEntry)` Refreshes visual representations of the element list entry in AWM views.
    `void` | `refreshElementViews()` Refreshes all AWM views which contain AWM elements.
    `void` | `refreshInTreeView(java.lang.Object pObject)` Refreshes the object in the tree view.
    `void` | `restoreDefaultAWMViews(boolean pRestoreSecondaryTableViews)` Restores (shows) all default AWM views and optionally all secondary table views.
    `boolean` | `sendMessageDialog(int pDialogTyp, java.lang.String pTitle, java.lang.String pMsg)` Open a message dialog.
    `void` | `showTaurusErrorView()` Opens or reveals the TAURUS Error View (in a UI Thread).
    `void` | `showView(java.lang.String pViewID)` Opens or reveals the view with the given ID (in a UI Thread).

- - ### Field Detail

    - #### INFO_DIALOG

          static final int INFO_DIALOG

      Constant for opening a info dialog
      See Also:
        Constant Field Values

    - #### WARNING_DIALOG

          static final int WARNING_DIALOG

      Constant for opening a warning dialog
      See Also:
        Constant Field Values

    - #### ERROR_DIALOG

          static final int ERROR_DIALOG

      Constant for opening a error dialog
      See Also:
        Constant Field Values

    - #### CONFIRM_DIALOG

          static final int CONFIRM_DIALOG

      Constant for opening a confirm dialog
      See Also:
        Constant Field Values

    - #### QUESTION_DIALOG

          static final int QUESTION_DIALOG

      Constant for opening a question dialog
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### closeEditorParts

          void closeEditorParts()
                         throws TaurusCoreException

      Close all open editor parts registered by Taurus.
      Throws:
        `TaurusCoreException` - if closing of the editor parts fails.

    - #### loadOpenFiles

          void loadOpenFiles()
                      throws TaurusCoreException

      Load the open files saved in the file ft_openfiles.xml.
      Throws:
        `TaurusCoreException` - if opening the saved files fails.

    - #### sendMessageDialog

          boolean sendMessageDialog(int pDialogTyp,
                                    java.lang.String pTitle,
                                    java.lang.String pMsg)

      Open a message dialog.
      Parameters:
        `pDialogTyp` - type of the dialog (info, warning, confirmation, error, question)
        `pTitle` - dialog title
        `pMsg` - dialog message
      Returns:
        whether the user confirmed the dialog.

    - #### showTaurusErrorView

          void showTaurusErrorView()

      Opens or reveals the TAURUS Error View (in a UI Thread).

    - #### showView

          void showView(java.lang.String pViewID)

      Opens or reveals the view with the given ID (in a UI Thread).
      Parameters:
        `pViewID` - the ID of the view to be shown.

    - #### getActiveEditorContents

          java.lang.String getActiveEditorContents()
                                            throws TaurusCoreException

      Gets the contents of the active text editor.
      Returns:
        the editor contents as a string.
      Throws:
        `TaurusCoreException` - if the active editor is not a text editor.

    - #### getViewTitle

          java.lang.String getViewTitle(java.lang.String pViewID,
                                        java.lang.String pSecondaryID)

      Gets the title of the view. Returns `null` if the view reference with the given ID was not found (which also occurs if the view is not opened).
      Parameters:
        `pViewID` - the view ID.
        `pSecondaryID` - (optional) the secondary view ID (can be `null`).
      Returns:
        the view title or `null`.

    - #### restoreDefaultAWMViews

          void restoreDefaultAWMViews(boolean pRestoreSecondaryTableViews)

      Restores (shows) all default AWM views and optionally all secondary table views.
      Parameters:
        `pRestoreSecondaryTableViews` - whether to restore secondary table views.
      See Also:
        `ActionDescriptor.getTableViewID()`, `ActionDescriptor.getTableViewLabel()`

    - #### expandInTreeView

          void expandInTreeView(java.lang.Object pObject,
                                int pLevel)

      Expands the object in the main AWM tree view. Does nothing if the view cannot be found.
      Parameters:
        `pObject` - the object that should be expanded.
        `pLevel` - the expand level

    - #### refreshInTreeView

          void refreshInTreeView(java.lang.Object pObject)

      Refreshes the object in the tree view. Does not execute the GetChildren action if children of the given object are cached.
      Does nothing if the object does not exist in the tree or the tree view is not open.
      Parameters:
        `pObject` - the object to refresh

    - #### openFile

          org.eclipse.core.resources.IFile openFile(FileDescriptor pFD,
                                                    IExecutionContext pContext,
                                                    boolean pReadOnly)
                                             throws TaurusCoreException

      Opens the given Content in editor.
      Parameters:
        `pFD` - the file descriptor for the file to open
        `pContext` - The execution context
        `pReadOnly` - if `true` the file is opened in read only modus
      Returns:
        the opened file
      Throws:
        `TaurusCoreException` - if an Exception of any kind occurs

    - #### refreshElementListEntryInViews

          void refreshElementListEntryInViews(IElementListEntry pEntry)
                                       throws TaurusCoreException

      Refreshes visual representations of the element list entry in AWM views. Does trigger the "get children" action of the corresponding element, if its children have been cached already.
      Parameters:
        `pEntry` - the entry to be refreshed
      Throws:
        `TaurusCoreException` - if refreshing the entries children was executed but failed

    - #### refreshElementViews

          void refreshElementViews()
                            throws TaurusCoreException

      Refreshes all AWM views which contain AWM elements. This method should only be used if new element list entries are expected to show up in views, since it's much more efficient to use `refreshElementListEntryInViews(IElementListEntry)` for existing elements.
      Throws:
        `TaurusCoreException` - if an exception occurs during the attempt to refresh views

Copyright © 2015 Micro Focus GmbH. All rights reserved.