private void updateDialog(WorkbenchDialog oldDialog, WorkbenchDialog newDialog) {
    if (!Objects.isNull(newDialog)) {
      // undo old dialog
      if (!Objects.isNull(oldDialog)) {
        dialogPane.getStyleClass().removeAll(oldDialog.getStyleClass());
      }

      // if the new dialog is an error dialog which uses the standard MultilineLabel control
      // wrap it in a DialogErrorContent control
      if (newDialog.getType() == WorkbenchDialog.Type.ERROR
          && newDialog.getContent() instanceof MultilineLabel) {
        newDialog.setContent(
            new DialogErrorContent(newDialog.getContent(), newDialog.getDetails())
        );
      }

      // update to new dialog
      dialogContentPane.getChildren().setAll(newDialog.getContent());
      dialogPane.getStyleClass().setAll("dialog-pane");
      dialogPane.getStyleClass().addAll(newDialog.getStyleClass());
    }
  }
Creates a new {@link DialogSkin} object for a corresponding {@link DialogControl}.

@param dialogControl the {@link DialogControl} for which this Skin is created
workbenchfx-core/src/main/java/com/dlsc/workbenchfx/view/controls/dialog/DialogSkin.java