summaryrefslogtreecommitdiff
path: root/src/plugins/android/androidmanifesteditorfactory.cpp
blob: 15114918b54aa218a019a11718af45d5e2d16718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "androidconstants.h"
#include "androidmanifesteditor.h"
#include "androidmanifesteditorfactory.h"
#include "androidmanifesteditorwidget.h"
#include "androidtr.h"

#include <texteditor/texteditorsettings.h>

using namespace Android;
using namespace Android::Internal;

AndroidManifestEditorFactory::AndroidManifestEditorFactory()
    : m_actionHandler(Constants::ANDROID_MANIFEST_EDITOR_ID,
                      Constants::ANDROID_MANIFEST_EDITOR_CONTEXT,
                      TextEditor::TextEditorActionHandler::None,
                      [](Core::IEditor *editor) { return static_cast<AndroidManifestEditor *>(editor)->textEditor(); })
{
    setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
    setDisplayName(Tr::tr("Android Manifest editor"));
    addMimeType(Constants::ANDROID_MANIFEST_MIME_TYPE);
    setEditorCreator([] {
        auto androidManifestEditorWidget = new AndroidManifestEditorWidget;
        return androidManifestEditorWidget->editor();
    });
}