    public void Delete() {
        if (mEngine.id == null) {
            DataProvider.deleteSearchEngine(getActivity(), getData());
            return;
        }
        DialogInterface.OnClickListener click = new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (i == DialogInterface.BUTTON_POSITIVE) {
                    DataProvider.deleteSearchEngine(getActivity(), getData());
                    if (mDetailController != null) {
                        final DetailController detailController = mDetailController.get();
                        if (detailController != null) {
                            detailController.OnDetailFinish(MODE_DELETE, mEngine);
                        }
                    }
                }
            }
        };
        new AlertDialog.Builder(getActivity())
            .setTitle(R.string.dialog_confirmation)
            .setMessage(R.string.confirmation_delete)
            .setCancelable(true)
            .setNegativeButton(R.string.no, click)
            .setPositiveButton(R.string.yes, click)
            .show();
    }

    public void Delete() {
        if (mEngine.id == null) {
            if (mDetailController != null) {
                final DetailController detailController = mDetailController.get();
                if (detailController != null) {
                    detailController.OnDetailFinish(MODE_DELETE, mEngine);
                }
            }
            return;
        }
        DialogInterface.OnClickListener click = new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (i == DialogInterface.BUTTON_POSITIVE) {
                    DataProvider.deleteSearchEngine(getActivity(), getData());
                    if (mDetailController != null) {
                        final DetailController detailController = mDetailController.get();
                        if (detailController != null) {
                            detailController.OnDetailFinish(MODE_DELETE, mEngine);
                        }
                    }
                }
            }
        };
        new AlertDialog.Builder(getActivity())
            .setTitle(R.string.dialog_confirmation)
            .setMessage(R.string.confirmation_delete)
            .setCancelable(true)
            .setNegativeButton(R.string.no, click)
            .setPositiveButton(R.string.yes, click)
            .show();
    }
