@Override
  public void actionPerformed(ActionEvent event) {
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(_configuration);
    ajb.setDatastore(_datastore);
    ajb.addSourceColumns(getColumns());

    final QuickAnalysisStrategy quickAnalysisStrategy = _userPreferences.getQuickAnalysisStrategy();

    quickAnalysisStrategy.configureAnalysisJobBuilder(ajb);

    try {
      if (!ajb.isConfigured(true)) {
        throw new IllegalStateException("Unknown job configuration issue!");
      }

      Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb));

      RunAnalysisActionListener actionListener =
          injector.getInstance(RunAnalysisActionListener.class);
      actionListener.actionPerformed(event);
    } catch (Exception e) {
      WidgetUtils.showErrorMessage(
          "Error", "Could not perform quick analysis on table " + _table.getName(), e);
    }
  }
  private void updateComponents() {
    _listPanel.removeAll();

    final String[] names = _catalog.getStringPatternNames();
    Arrays.sort(names);

    final Icon icon = imageManager.getImageIcon("images/model/stringpattern.png");

    for (final String name : names) {
      final StringPattern stringPattern = _catalog.getStringPattern(name);

      final DCLabel stringPatternLabel =
          DCLabel.dark(
              "<html><b>" + name + "</b><br/>" + getDescription(stringPattern) + "</html>");
      stringPatternLabel.setIcon(icon);
      stringPatternLabel.setMaximumWidth(ReferenceDataDialog.REFERENCE_DATA_ITEM_MAX_WIDTH);

      final JButton editButton = WidgetFactory.createSmallButton("images/actions/edit.png");
      editButton.setToolTipText("Edit string pattern");

      if (stringPattern instanceof RegexStringPattern) {
        editButton.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                RegexStringPatternDialog dialog =
                    new RegexStringPatternDialog(
                        (RegexStringPattern) stringPattern, _catalog, _windowContext);
                dialog.setVisible(true);
              }
            });
      } else if (stringPattern instanceof SimpleStringPattern) {
        editButton.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                SimpleStringPatternDialog dialog =
                    new SimpleStringPatternDialog(
                        (SimpleStringPattern) stringPattern, _catalog, _windowContext);
                dialog.setVisible(true);
              }
            });
      } else {
        editButton.setEnabled(false);
      }

      final JButton removeButton = WidgetFactory.createSmallButton(IconUtils.ACTION_REMOVE);
      removeButton.setToolTipText("Remove string pattern");
      removeButton.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              int result =
                  JOptionPane.showConfirmDialog(
                      StringPatternListPanel.this,
                      "Are you sure you wish to remove the string pattern '" + name + "'?",
                      "Confirm remove",
                      JOptionPane.YES_NO_OPTION);
              if (result == JOptionPane.YES_OPTION) {
                _catalog.removeStringPattern(stringPattern);
              }
            }
          });

      if (!_catalog.isStringPatternMutable(name)) {
        editButton.setEnabled(false);
        removeButton.setEnabled(false);
      }

      final DCPanel stringPatternPanel = new DCPanel();
      stringPatternPanel.setBorder(WidgetUtils.BORDER_LIST_ITEM);
      WidgetUtils.addToGridBag(stringPatternLabel, stringPatternPanel, 0, 0, 1.0, 0.0);
      WidgetUtils.addToGridBag(editButton, stringPatternPanel, 1, 0, GridBagConstraints.EAST);
      WidgetUtils.addToGridBag(removeButton, stringPatternPanel, 2, 0, GridBagConstraints.EAST);
      _listPanel.add(stringPatternPanel);
    }

    if (names.length == 0) {
      _listPanel.add(DCLabel.dark("(none)"));
    }

    updateUI();
  }
  private JComponent getLicensingPanel() {
    final String dcLicense = getLicense("lgpl");

    final DCLabel licenseHeader = DCLabel.dark("");
    licenseHeader.setFont(WidgetUtils.FONT_HEADER1);

    final DCLabel licenseLabel = DCLabel.darkMultiLine("");
    licenseLabel.setBackground(WidgetUtils.BG_COLOR_BRIGHTEST);
    licenseLabel.setFont(WidgetUtils.FONT_MONOSPACE);
    licenseLabel.setOpaque(true);

    final JButton dcLicenseButton = WidgetFactory.createSmallButton("images/menu/license.png");
    dcLicenseButton.setToolTipText("DataCleaner's license: GNU LGPL");
    dcLicenseButton.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            licenseHeader.setText("Displaying license of DataCleaner");
            licenseLabel.setText(dcLicense);
          }
        });

    final JComboBox librariesComboBox = new JComboBox();
    final JButton visitProjectButton = WidgetFactory.createSmallButton(IconUtils.WEBSITE);

    librariesComboBox.setRenderer(
        new DCListCellRenderer() {

          private static final long serialVersionUID = 1L;

          @Override
          public Component getListCellRendererComponent(
              JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            if (value instanceof LicensedProject) {
              LicensedProject project = (LicensedProject) value;
              String name = project.name;
              return super.getListCellRendererComponent(
                  list, name, index, isSelected, cellHasFocus);
            } else if (value instanceof String) {
              return super.getListCellRendererComponent(
                  list, value, index, isSelected, cellHasFocus);
            }
            throw new UnsupportedOperationException();
          }
        });
    librariesComboBox.addItemListener(
        new ItemListener() {
          @Override
          public void itemStateChanged(ItemEvent e) {
            Object item = e.getItem();
            if (item instanceof LicensedProject) {
              visitProjectButton.setEnabled(true);
              LicensedProject project = (LicensedProject) item;
              licenseLabel.setText(project.license);
              licenseHeader.setText("Displaying license of " + project.name + "");
            } else {
              visitProjectButton.setEnabled(false);
              licenseHeader.setText("Displaying license of DataCleaner");
              licenseLabel.setText(dcLicense);
            }
          }
        });

    visitProjectButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            Object item = librariesComboBox.getSelectedItem();
            LicensedProject project = (LicensedProject) item;
            String websiteUrl = project.websiteUrl;
            if (!StringUtils.isNullOrEmpty(websiteUrl)) {
              new OpenBrowserAction(websiteUrl).actionPerformed(e);
            }
          }
        });

    librariesComboBox.addItem("- select project -");
    final List<LicensedProject> licensedProjects = getLicensedProjects();
    for (LicensedProject licensedProject : licensedProjects) {
      librariesComboBox.addItem(licensedProject);
    }

    final JToolBar toolBar = WidgetFactory.createToolBar();
    toolBar.add(DCLabel.dark("DataCleaners license: "));
    toolBar.add(dcLicenseButton);
    toolBar.add(WidgetFactory.createToolBarSeparator());
    toolBar.add(DCLabel.dark("Included libraries: "));
    toolBar.add(librariesComboBox);
    toolBar.add(visitProjectButton);

    final JScrollPane licenseLabelScroll = WidgetUtils.scrolleable(licenseLabel);
    licenseLabelScroll.setBorder(
        new CompoundBorder(new EmptyBorder(10, 0, 10, 0), WidgetUtils.BORDER_THIN));

    final DCPanel headerPanel = new DCPanel();
    headerPanel.setLayout(new VerticalLayout());
    headerPanel.add(toolBar);
    headerPanel.add(Box.createVerticalStrut(20));
    headerPanel.add(licenseHeader);

    final DCPanel panel = new DCPanel(WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_BRIGHTEST);
    panel.setBorder(new EmptyBorder(4, 4, 4, 4));
    panel.setLayout(new BorderLayout());
    panel.add(headerPanel, BorderLayout.NORTH);
    panel.add(licenseLabelScroll, BorderLayout.CENTER);

    return panel;
  }
  public DatastorePanel(
      Datastore datastore,
      MutableDatastoreCatalog datastoreCatalog,
      DatastoreListPanel datastoreListPanel,
      WindowContext windowContext,
      InjectorBuilder injectorBuilder) {
    super(WidgetUtils.BG_COLOR_BRIGHT, WidgetUtils.BG_COLOR_LESS_BRIGHT);
    _datastore = datastore;
    _datastoreCatalog = datastoreCatalog;
    _datastoreListPanel = datastoreListPanel;
    _windowContext = windowContext;
    _injectorBuilder = injectorBuilder;

    setOpaque(false);

    final Icon icon = IconUtils.getDatastoreIcon(datastore);
    final String description = getDescription(datastore);

    _checkBox = new JCheckBox();
    _checkBox.setOpaque(false);
    _checkBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            _datastoreListPanel.setSelectedDatastorePanel(DatastorePanel.this);
          }
        });
    _checkBox.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            setOpaque(isSelected());
            updateUI();
          }
        });

    final String datastoreName = datastore.getName();
    final DCLabel datastoreNameLabel =
        DCLabel.dark("<html><b>" + datastoreName + "</b><br/>" + description + "</html>");
    datastoreNameLabel.setIconTextGap(10);
    datastoreNameLabel.setIcon(icon);
    datastoreNameLabel.setMaximumWidth(LABEL_MAX_WIDTH);
    MouseAdapter invokeCheckBoxMouseListener =
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            _checkBox.doClick();
            _datastoreListPanel.requestSearchFieldFocus();
            if (e.getClickCount() > 1) {
              // begin job on double click
              _datastoreListPanel.clickAnalyzeButton();
            }
          }
        };

    addMouseListener(invokeCheckBoxMouseListener);
    datastoreNameLabel.addMouseListener(invokeCheckBoxMouseListener);

    final JButton editButton = createEditButton(datastore);
    final JButton removeButton = createRemoveButton(datastore);

    setBorder(WidgetUtils.BORDER_LIST_ITEM);

    WidgetUtils.addToGridBag(
        DCPanel.flow(_checkBox, datastoreNameLabel), this, 0, 0, GridBagConstraints.WEST, 1.0, 1.0);
    WidgetUtils.addToGridBag(editButton, this, 1, 0, GridBagConstraints.EAST);
    WidgetUtils.addToGridBag(removeButton, this, 2, 0, GridBagConstraints.EAST);
  }