-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojecteditorfactory.cpp
More file actions
45 lines (37 loc) · 1.24 KB
/
Copy pathprojecteditorfactory.cpp
File metadata and controls
45 lines (37 loc) · 1.24 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "projecteditorfactory.h"
#include "phpqt5constants.h"
#include "projecteditorwidget.h"
#include "projecteditor.h"
#include <coreplugin/id.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorsettings.h>
namespace PHPQt5 {
namespace Internal {
class ProjectTextEditorActionHandler : public TextEditor::TextEditorActionHandler
{
public:
explicit ProjectTextEditorActionHandler(QObject *parent)
: TextEditorActionHandler(parent, Constants::PROJECT_EDITOR_CONTEXT)
{}
private:
TextEditor::TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const
{
ProjectEditor *projectEditor = static_cast<ProjectEditor *>(editor);
return projectEditor->textEditor();
}
};
ProjectEditorFactory::ProjectEditorFactory(QObject *parent)
: Core::IEditorFactory(parent)
{
setId(Constants::PROJECT_EDITOR_ID);
setDisplayName(tr("PHPQt5 Project editor"));
addMimeType(Constants::C_PHPQT5_PROJECT_MIMETYPE);
new ProjectTextEditorActionHandler(this);
}
Core::IEditor *ProjectEditorFactory::createEditor()
{
ProjectEditorWidget *projectEditorWidget = new ProjectEditorWidget();
return projectEditorWidget->editor();
}
} // namespace Internal
} // namespace PHPQt5