# MainWindow (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl

## Class MainWindow

- java.lang.Object
- - org.deidentifier.arx.gui.view.impl.MainWindow

- All Implemented Interfaces:
    IView

      public class MainWindow
      extends java.lang.Object
      implements IView

  This class implements the global application window.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MainWindow(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Monitor monitor)` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` Disposes the view.
    `Controller` | `getController()` Returns the controller.
    `org.eclipse.swt.widgets.Shell` | `getShell()` Returns the shell.
    `boolean` | `isDisposed()` Is this shell disposed.
    `void` | `onShow(java.lang.Runnable runnable)` Executes the given runnable on show.
    `void` | `reset()` Resets the GUI.
    `void` | `show()` Main SWT event loop.
    `void` | `showAboutDialog()` Shows an about dialog.
    `ModelCriterion` | `showAddCriterionDialog(Model model, java.util.List<ModelCriterion> criteria)` Shows a dialog for selecting privacy criteria.
    `void` | `showAuditTrail(java.util.List<ModelAuditTrailEntry> auditTrail)` Shows the audit trail
    `java.nio.charset.Charset` | `showCharsetInputDialog(org.eclipse.swt.widgets.Shell shell)` Shows an input dialog for selecting a charset.
    `void` | `showConfigureCriterionDialog(Model model, java.util.List<ModelCriterion> criteria, ModelCriterion criterion)` Shows a dialog for configuring privacy criteria.
    `void` | `showDebugDialog()` Shows a debug dialog.
    `void` | `showErrorDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String message, java.lang.String text)` Shows an error dialog.
    `void` | `showErrorDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String message, java.lang.Throwable throwable)` Shows an error dialog.
    `void` | `showErrorDialog(java.lang.String message, java.lang.String text)` Shows an error dialog.
    `void` | `showErrorDialog(java.lang.String message, java.lang.Throwable throwable)` Shows an error dialog.
    `org.apache.commons.math3.util.Pair<java.lang.String,java.lang.String>` | `showFindReplaceDialog(Model model, DataHandle handle, int column)` Shows a find & replace dialog
    `java.lang.String` | `showFormatInputDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text, java.lang.String preselected, java.util.Locale locale, DataType.DataTypeDescription<?> description, java.util.Collection<java.lang.String> values)` Shows an input dialog for selecting formats string for data types.
    `void` | `showHelpDialog(java.lang.String id)` Shows a help dialog.
    `void` | `showInfoDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text)` Shows an info dialog.
    `java.lang.String` | `showInputDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text, java.lang.String initial)` Shows an input dialog.
    `java.lang.String` | `showInputDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text, java.lang.String initial, org.eclipse.jface.dialogs.IInputValidator validator)` Shows an input dialog.
    `java.util.List<java.lang.String>` | `showMultiSelectionDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String text, java.util.List<java.lang.String> elements, java.util.List<java.lang.String> selected)` Shows a dialog that allows selecting multiple elements
    `java.lang.String` | `showOpenFileDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String filter)` Shows a file open dialog.
    `java.lang.String[]` | `showOrderValuesDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text, DataType<?> type, java.util.Locale locale, java.lang.String[] values)` Shows an input dialog for ordering data items.
    `void` | `showProgressDialog(java.lang.String text, Worker<?> worker)` Shows a progress dialog.
    `DialogQueryResult` | `showQueryDialog(java.lang.String query, Data data)` Shows a query dialog for selecting a research subset.
    `boolean` | `showQuestionDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String header, java.lang.String text)` Shows a question dialog.
    `java.lang.String` | `showSaveFileDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String filter)` Shows a file save dialog.
    `ModelExplicitCriterion` | `showSelectCriterionDialog(java.util.List<ModelExplicitCriterion> criteria)` Shows a dialog for selecting privacy criteria.
    `org.apache.commons.math3.util.Pair<org.apache.commons.math3.util.Pair<java.lang.String,java.lang.Boolean>,org.apache.commons.math3.util.Pair<java.lang.String,java.lang.Boolean>>` | `showTopBottomCodingDialog(DataType<?> type)` Shows a top/bottom coding dialog
    `void` | `update(ModelEvent event)` Updates the view.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MainWindow

          public MainWindow(org.eclipse.swt.widgets.Display display,
                    org.eclipse.swt.widgets.Monitor monitor)

      Creates a new instance.
      Parameters:
        `display` -
        `monitor` -

  - ### Method Detail

    - #### dispose

          public void dispose()

      Description copied from interface: `IView`
      Disposes the view.
      Specified by:
        `dispose` in interface `IView`

    - #### getController

          public Controller getController()

      Returns the controller.
      Returns:

    - #### getShell

          public org.eclipse.swt.widgets.Shell getShell()

      Returns the shell.
      Returns:

    - #### isDisposed

          public boolean isDisposed()

      Is this shell disposed.
      Returns:

    - #### onShow

          public void onShow(java.lang.Runnable runnable)

      Executes the given runnable on show.
      Parameters:
        `runnable` -

    - #### reset

          public void reset()

      Resets the GUI.
      Specified by:
        `reset` in interface `IView`

    - #### show

          public void show()

      Main SWT event loop.

    - #### showAboutDialog

          public void showAboutDialog()

      Shows an about dialog.

    - #### showAddCriterionDialog

          public ModelCriterion showAddCriterionDialog(Model model,
                                              java.util.List<ModelCriterion> criteria)

      Shows a dialog for selecting privacy criteria.
      Parameters:
        `criteria` -
      Returns:

    - #### showAuditTrail

          public void showAuditTrail(java.util.List<ModelAuditTrailEntry> auditTrail)

      Shows the audit trail

    - #### showCharsetInputDialog

          public java.nio.charset.Charset showCharsetInputDialog(org.eclipse.swt.widgets.Shell shell)

      Shows an input dialog for selecting a charset.
      Parameters:
        `shell` -
      Returns:

    - #### showConfigureCriterionDialog

          public void showConfigureCriterionDialog(Model model,
                                          java.util.List<ModelCriterion> criteria,
                                          ModelCriterion criterion)

      Shows a dialog for configuring privacy criteria.
      Parameters:
        `criteria` -
        `criterion` -

    - #### showDebugDialog

          public void showDebugDialog()

      Shows a debug dialog.

    - #### showErrorDialog

          public void showErrorDialog(org.eclipse.swt.widgets.Shell shell,
                             java.lang.String message,
                             java.lang.String text)

      Shows an error dialog.
      Parameters:
        `shell` -
        `message` -
        `text` -

    - #### showErrorDialog

          public void showErrorDialog(org.eclipse.swt.widgets.Shell shell,
                             java.lang.String message,
                             java.lang.Throwable throwable)

      Shows an error dialog.
      Parameters:
        `shell` -
        `message` -
        `throwable` -

    - #### showErrorDialog

          public void showErrorDialog(java.lang.String message,
                             java.lang.String text)

      Shows an error dialog.
      Parameters:
        `message` -
        `text` -

    - #### showErrorDialog

          public void showErrorDialog(java.lang.String message,
                             java.lang.Throwable throwable)

      Shows an error dialog.
      Parameters:
        `message` -
        `throwable` -

    - #### showFindReplaceDialog

          public org.apache.commons.math3.util.Pair<java.lang.String,java.lang.String> showFindReplaceDialog(Model model,
                                                                                                    DataHandle handle,
                                                                                                    int column)

      Shows a find & replace dialog
      Parameters:
        `handle` -
        `column` -
      Returns:
        A pair containing the string to be found and the string with which it is to be replaced, `null` if cancel was pressed.

    - #### showFormatInputDialog

          public java.lang.String showFormatInputDialog(org.eclipse.swt.widgets.Shell shell,
                                               java.lang.String header,
                                               java.lang.String text,
                                               java.lang.String preselected,
                                               java.util.Locale locale,
                                               DataType.DataTypeDescription<?> description,
                                               java.util.Collection<java.lang.String> values)

      Shows an input dialog for selecting formats string for data types.
      Parameters:
        `shell` -
        `header` -
        `text` -
        `preselected` - Preselected format string, can be null
        `locale` - The current locale
        `description` -
        `values` -
      Returns:

    - #### showHelpDialog

          public void showHelpDialog(java.lang.String id)

      Shows a help dialog.
      Parameters:
        `id` -

    - #### showInfoDialog

          public void showInfoDialog(org.eclipse.swt.widgets.Shell shell,
                            java.lang.String header,
                            java.lang.String text)

      Shows an info dialog.
      Parameters:
        `shell` -
        `header` -
        `text` -

    - #### showInputDialog

          public java.lang.String showInputDialog(org.eclipse.swt.widgets.Shell shell,
                                         java.lang.String header,
                                         java.lang.String text,
                                         java.lang.String initial)

      Shows an input dialog.
      Parameters:
        `shell` -
        `header` -
        `text` -
        `initial` -
      Returns:

    - #### showInputDialog

          public java.lang.String showInputDialog(org.eclipse.swt.widgets.Shell shell,
                                         java.lang.String header,
                                         java.lang.String text,
                                         java.lang.String initial,
                                         org.eclipse.jface.dialogs.IInputValidator validator)

      Shows an input dialog.
      Parameters:
        `shell` -
        `header` -
        `text` -
        `initial` -
        `validator` -
      Returns:

    - #### showMultiSelectionDialog

          public java.util.List<java.lang.String> showMultiSelectionDialog(org.eclipse.swt.widgets.Shell shell,
                                                                  java.lang.String title,
                                                                  java.lang.String text,
                                                                  java.util.List<java.lang.String> elements,
                                                                  java.util.List<java.lang.String> selected)

      Shows a dialog that allows selecting multiple elements
      Parameters:
        `shell` -
        `title` -
        `text` -
        `elements` -
        `selected` -
      Returns:

    - #### showOpenFileDialog

          public java.lang.String showOpenFileDialog(org.eclipse.swt.widgets.Shell shell,
                                            java.lang.String filter)

      Shows a file open dialog.
      Parameters:
        `shell` -
        `filter` -
      Returns:

    - #### showOrderValuesDialog

          public java.lang.String[] showOrderValuesDialog(org.eclipse.swt.widgets.Shell shell,
                                                 java.lang.String header,
                                                 java.lang.String text,
                                                 DataType<?> type,
                                                 java.util.Locale locale,
                                                 java.lang.String[] values)

      Shows an input dialog for ordering data items.
      Parameters:
        `shell` -
        `header` -
        `text` -
        `type` -
        `locale` -
        `values` -
      Returns:

    - #### showProgressDialog

          public void showProgressDialog(java.lang.String text,
                                Worker<?> worker)

      Shows a progress dialog.
      Parameters:
        `text` -
        `worker` -

    - #### showQueryDialog

          public DialogQueryResult showQueryDialog(java.lang.String query,
                                          Data data)

      Shows a query dialog for selecting a research subset.
      Parameters:
        `query` -
        `data` -
      Returns:

    - #### showQuestionDialog

          public boolean showQuestionDialog(org.eclipse.swt.widgets.Shell shell,
                                   java.lang.String header,
                                   java.lang.String text)

      Shows a question dialog.
      Parameters:
        `shell` -
        `header` -
        `text` -
      Returns:

    - #### showSaveFileDialog

          public java.lang.String showSaveFileDialog(org.eclipse.swt.widgets.Shell shell,
                                            java.lang.String filter)

      Shows a file save dialog.
      Parameters:
        `shell` -
        `filter` -
      Returns:

    - #### showSelectCriterionDialog

          public ModelExplicitCriterion showSelectCriterionDialog(java.util.List<ModelExplicitCriterion> criteria)

      Shows a dialog for selecting privacy criteria.
      Parameters:
        `criteria` -
      Returns:

    - #### showTopBottomCodingDialog

          public org.apache.commons.math3.util.Pair<org.apache.commons.math3.util.Pair<java.lang.String,java.lang.Boolean>,org.apache.commons.math3.util.Pair<java.lang.String,java.lang.Boolean>> showTopBottomCodingDialog(DataType<?> type)

      Shows a top/bottom coding dialog
      Parameters:
        `type` -
      Returns:
        A pair containing the bottom value + inclusive and the top value + inclusive. Either bottom or top may be `null` if they have not been defined. The overall pair may be `null` if cancel was pressed.

    - #### update

          public void update(ModelEvent event)

      Description copied from interface: `IView`
      Updates the view.
      Specified by:
        `update` in interface `IView`