diff --git a/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java b/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java
new file mode 100644
index 000000000..1b3ac5535
--- /dev/null
+++ b/ccm-core/src/main/java/org/libreccm/ui/ConfirmDialog.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2017 LibreCCM Foundation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+package org.libreccm.ui;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import org.libreccm.core.UnexpectedErrorException;
+
+import java.util.concurrent.Callable;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class ConfirmDialog extends Window {
+
+ private static final long serialVersionUID = -3953818045293474190L;
+
+ private final Callable confirmedAction;
+ private final Callable cancelAction;
+
+ private Label messageLabel;
+ private Button confirmButton;
+ private Button cancelButton;
+
+ public ConfirmDialog(final Callable confirmedAction) {
+ this.confirmedAction = confirmedAction;
+ this.cancelAction = () -> {
+ close();
+ return null;
+ };
+ addWidgets();
+ }
+
+ public ConfirmDialog(final Callable confirmedAction,
+ final Callable cancelAction) {
+ this.confirmedAction = confirmedAction;
+ this.cancelAction = cancelAction;
+ addWidgets();
+ }
+
+ private void addWidgets() {
+
+ messageLabel = new Label("");
+
+ confirmButton = new Button("OK");
+ confirmButton.addClickListener(event -> {
+ try {
+ confirmedAction.call();
+ } catch (Exception ex) {
+ throw new UnexpectedErrorException(ex);
+ }
+ });
+
+ cancelButton = new Button("Cancel");
+ cancelButton.addClickListener(event -> {
+ try {
+ cancelAction.call();
+ } catch (Exception ex) {
+ throw new UnexpectedErrorException(ex);
+ }
+ });
+
+ final HorizontalLayout buttonsLayout = new HorizontalLayout(
+ confirmButton, cancelButton);
+ final VerticalLayout layout = new VerticalLayout(messageLabel,
+ buttonsLayout);
+ setContent(layout);
+ }
+
+ public String getMessage() {
+ return messageLabel.getValue();
+ }
+
+ public void setMessage(final String message) {
+ messageLabel.setValue(message);
+ }
+
+ public Button getConfirmButton() {
+ return confirmButton;
+ }
+
+ public Button getCancelButton() {
+ return cancelButton;
+ }
+
+}