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.

Author:
  Fabian Prasser

### 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

All Methods Instance Methods Concrete Methods
`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.
`ARXClassificationConfiguration<?>` `showClassificationConfigurationDialog(ARXClassificationConfiguration<?> config)` Shows a preference dialog for editing parameter values of classification configurations.
`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.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.
`ModelAnonymizationConfiguration` `showLocalAnonymizationDialog(Model model)` Shows a dialog for anonymization parameters
`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

`equals, 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:

#### showClassificationConfigurationDialog

    public ARXClassificationConfiguration<?> showClassificationConfigurationDialog(ARXClassificationConfiguration<?> config)

Shows a preference dialog for editing parameter values of classification configurations.

Parameters:
  `config` -
  `model` -

#### 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.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:

#### showLocalAnonymizationDialog

    public ModelAnonymizationConfiguration showLocalAnonymizationDialog(Model model)

Shows a dialog for anonymization parameters

Parameters:
  `model` -
Returns:
  Returns the parameters selected by the user. Returns a pair. First: max. time per iteration. Second: min. records per iteration.

#### 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`