5#include <QListWidgetItem>
17#include "ui_SchemaClassEditor.h"
28 SchemaClass ( ClassInfo ),
29 MethodModel ( nullptr ),
30 AttributeModel ( nullptr ),
31 RelationshipModel ( nullptr ),
32 SuperClassModel ( nullptr ),
33 SubClassModel ( nullptr ),
34 ContextMenuAttribute ( nullptr ),
35 ContextMenuRelationship ( nullptr ),
36 ContextMenuMethod ( nullptr ),
37 ContextMenuClass ( nullptr )
39 QWidget::setAttribute(Qt::WA_DeleteOnClose);
44 QString (
"Class Editor : %1" ).arg ( QString::fromStdString (
57 if (event->key() == Qt::Key_Escape) {
60 QWidget::keyPressEvent(event);
64 connect ( ui->buttonBox, SIGNAL ( accepted() ),
this, SLOT ( ParseToSave() ) );
65 connect ( ui->buttonBox, SIGNAL ( rejected() ),
this, SLOT ( close_slot() ) );
66 connect ( ui->moveButton, SIGNAL(clicked()),
this, SLOT (move_class()));
67 connect ( ui->AddButtonAttribute, SIGNAL ( clicked() ),
this, SLOT ( AddNewAttribute() ) );
68 connect ( ui->AddButtonSuperClass, SIGNAL ( clicked() ),
this, SLOT ( AddNewSuperClass() ) );
69 connect ( ui->AddButtonRelationship, SIGNAL ( clicked() ),
this,
70 SLOT ( AddNewRelationship() ) );
71 connect ( ui->AddButtonMethod, SIGNAL ( clicked() ),
this, SLOT ( AddNewMethod() ) );
72 connect ( ui->RelationshipView, SIGNAL ( activated ( QModelIndex ) ),
this,
73 SLOT ( OpenRelationshipEditor ( QModelIndex ) ) );
74 connect ( ui->MethodsView, SIGNAL ( activated ( QModelIndex ) ),
this,
75 SLOT ( OpenMethodEditor ( QModelIndex ) ) );
76 connect ( ui->AttributeView, SIGNAL ( activated ( QModelIndex ) ),
this,
77 SLOT ( OpenAttributeEditor ( QModelIndex ) ) );
78 connect ( ui->SuperClassView, SIGNAL ( activated ( QModelIndex ) ),
this,
79 SLOT ( OpenSuperClass ( QModelIndex ) ) );
80 connect ( ui->SubClassView, SIGNAL ( activated ( QModelIndex ) ),
this,
81 SLOT ( OpenSubClass ( QModelIndex ) ) );
82 connect ( ui->AttributeView, SIGNAL ( customContextMenuRequested ( QPoint ) ),
this,
83 SLOT ( CustomMenuAttributeView ( QPoint ) ) );
84 connect ( ui->RelationshipView, SIGNAL ( customContextMenuRequested ( QPoint ) ),
this,
85 SLOT ( CustomMenuRelationshipView ( QPoint ) ) );
86 connect ( ui->MethodsView, SIGNAL ( customContextMenuRequested ( QPoint ) ),
this,
87 SLOT ( CustomMenuMethodView ( QPoint ) ) );
88 connect ( ui->SuperClassView, SIGNAL ( customContextMenuRequested ( QPoint ) ),
this,
89 SLOT ( CustomMenuClassView ( QPoint ) ) );
95 SLOT ( ClassRemoved ( QString ) ) );
97 SLOT ( ClassUpdated ( QString ) ) );
102 if(className == objectName()) {
109 if(className == objectName()) {
117 BuildSubClassModelSlot();
118 BuildSuperClassModelSlot();
119 BuildMethodModelSlot();
120 BuildAttributeModelSlot();
121 BuildRelationshipModelSlot();
126 ui->AttributeView->setContextMenuPolicy ( Qt::ContextMenuPolicy::CustomContextMenu );
127 ui->RelationshipView->setContextMenuPolicy ( Qt::ContextMenuPolicy::CustomContextMenu );
128 ui->MethodsView->setContextMenuPolicy ( Qt::ContextMenuPolicy::CustomContextMenu );
129 ui->SuperClassView->setContextMenuPolicy ( Qt::ContextMenuPolicy::CustomContextMenu );
130 ui->SubClassView->setContextMenuPolicy ( Qt::ContextMenuPolicy::CustomContextMenu );
133 ui->ClassNameLineEdit->setText ( QString::fromStdString ( SchemaClass->get_name() ) );
136 ui->SchemaFileLineEdit->setText ( QString::fromStdString ( SchemaClass->get_file()->get_short_file_name() ) );
140 SchemaClass->get_file()->get_full_file_name())) {
141 ui->AddButtonAttribute->setEnabled (
true);
142 ui->AddButtonSuperClass->setEnabled (
true);
143 ui->AddButtonRelationship->setEnabled (
true);
144 ui->AddButtonMethod->setEnabled (
true);
145 ui->moveButton->setEnabled (
true);
148 ui->SchemaFileLineEdit->setStyleSheet(
"color:rgb(128,0,0);");
150 ui->DescriptionTextEdit->setReadOnly(
true);
152 ui->AddButtonAttribute->setEnabled (
false);
153 ui->AddButtonSuperClass->setEnabled (
false);
154 ui->AddButtonRelationship->setEnabled (
false);
155 ui->AddButtonMethod->setEnabled (
false);
156 ui->moveButton->setEnabled (
false);
157 ui->AbstractComboBox->setEnabled(
false);
161 ui->DescriptionTextEdit->setPlainText ( QString::fromStdString ( SchemaClass->get_description() ) );
162 ui->DescriptionTextEdit->setTabChangesFocus (
true);
164 if ( SchemaClass->get_is_abstract() )
166 ui->AbstractComboBox->setCurrentIndex ( 0 );
170 ui->AbstractComboBox->setCurrentIndex ( 1 );
175 move_class(SchemaClass,
this);
182 std::vector<OksFile*> files;
184 QStringList writable_files;
185 std::map<QString, OksFile*> file_map;
186 int current_row = -1;
187 for (
auto file: files) {
188 auto fn = file->get_full_file_name();
190 if (fn == current_file) {
191 current_row = writable_files.size();
193 writable_files.append(QString::fromStdString(fn));
194 file_map[QString::fromStdString(fn)] = file;
197 if (writable_files.empty()) {
198 QMessageBox::warning ( 0,
"Schema editor",
199 QString (
"No writable schema files to move class to." ) );
203 QWidget* widget =
new QWidget();
204 QString text =
"Select file to hold class " +
205 QString::fromStdString(schema_class->
get_name());
206 QLabel* label =
new QLabel(text);
207 QListWidget* qlw =
new QListWidget();
208 qlw->addItems(writable_files);
209 if (current_row != -1) {
210 qlw->setCurrentRow(current_row);
213 connect (qlw, &QListWidget::itemActivated,
215 QListWidgetItem* it = qlw->currentItem();
216 auto fn = it->text();
217 if (fn.toStdString() != current_file) {
218 schema_class->
set_file(file_map.at(fn));
225 auto bb =
new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
226 connect (bb, &QDialogButtonBox::accepted, pwidget, [=] () {
227 auto it = qlw->currentItem();
229 auto fn = it->text();
230 if (fn.toStdString() != current_file) {
231 schema_class->
set_file(file_map.at(fn));
237 QMessageBox::warning ( 0,
"Schema editor",
238 QString (
"No schema file selected to move class to." ) );
242 connect ( bb, &QDialogButtonBox::rejected, pwidget, [=] () {
delete widget;} );
244 QVBoxLayout* layout =
new QVBoxLayout();
245 layout->addWidget(label);
246 layout->addWidget(qlw);
247 layout->addWidget(bb);
248 widget->setWindowTitle(
"Select new file for class");
249 widget->setLayout(layout);
250 widget->setParent(pwidget, Qt::Dialog);
256 QString name = QString::fromStdString(SchemaClass->get_name() +
"::") +
258 for (QWidget* widget : QApplication::allWidgets())
262 if ( (widget->objectName()).compare (name) == 0 )
265 widget->setVisible (
true );
266 widget->activateWindow();
277 QString name = QString::fromStdString(SchemaClass->get_name() +
"::") +
280 for ( QWidget* widget : QApplication::allWidgets() )
284 if ( ( widget->objectName() ).compare ( name ) == 0 )
287 widget->setVisible (
true );
288 widget->activateWindow();
299 bool WidgetFound =
false;
301 for ( QWidget * Editor : QApplication::allWidgets() )
305 if ( Widget !=
nullptr )
307 if ( ( Widget->objectName() ).compare ( Name ) == 0 )
310 Widget->setVisible (
true );
311 Widget->activateWindow();
322 const std::string& attributeName = CurrentRow.at ( 0 ).toStdString();
323 OksAttribute * SchemaAttribute = SchemaClass->find_direct_attribute( attributeName );
324 if(SchemaAttribute !=
nullptr) {
326 SchemaClass, SchemaAttribute, SchemaAttribute->
get_name(), SchemaAttribute->
get_type(),
331 QMessageBox::warning ( 0,
"Schema editor",
332 QString::fromStdString(
"Cannot remove attribute \"" + attributeName +
333 "\" because it is not a direct attribute of \"" + SchemaClass->get_name() +
"\"") );
339 const std::string& relationshipName = CurrentRow.at ( 0 ).toStdString();
340 OksRelationship * SchemaRelationship = SchemaClass->find_direct_relationship( relationshipName );
341 if(SchemaRelationship !=
nullptr) {
343 SchemaClass, SchemaRelationship, SchemaRelationship->
get_name(),
350 QMessageBox::warning ( 0,
"Schema editor",
351 QString::fromStdString(
"Cannot remove relationship \"" + relationshipName +
352 "\" because it is not a direct relationship of \"" + SchemaClass->get_name() +
"\"") );
358 const std::string& methodName = CurrentRow.at ( 0 ).toStdString();
359 OksMethod * SchemaMethod = SchemaClass->find_direct_method ( methodName );
360 if(SchemaMethod !=
nullptr) {
365 QMessageBox::warning ( 0,
"Schema editor",
366 QString::fromStdString(
"Cannot remove method \"" + methodName +
367 "\" because it is not a direct method of \"" + SchemaClass->get_name() +
"\"") );
373 const std::string& superClassName = CurrentRow.at ( 0 ).toStdString();
374 if(SchemaClass->has_direct_super_class(superClassName))
380 QMessageBox::warning ( 0,
"Schema editor",
381 QString::fromStdString(
"Cannot remove super-class \"" + superClassName +
382 "\" because it is not a direct super-class of \"" + SchemaClass->get_name() +
"\"") );
389 std::string NewDescription = ui->DescriptionTextEdit->toPlainText().toStdString();
391 bool Abstract =
false;
393 if ( ui->AbstractComboBox->currentIndex() == 0 )
402 if ( Abstract != SchemaClass->get_is_abstract() )
407 if ( NewDescription != SchemaClass->get_description() )
417 bool widgetFound=
false;
418 QString class_name = QString::fromStdString(SchemaClass->get_name());
420 QString wname =
"add_sc_"+class_name;
421 for ( QWidget* widget : QApplication::allWidgets() ) {
422 if (widget->objectName().compare(wname) == 0 ) {
424 widget->setVisible (
true );
425 widget->activateWindow();
432 QWidget* widget =
new QWidget();
433 widget->setObjectName(wname);
434 QLabel* label =
new QLabel(
"Select a super-class to add to " + class_name);
435 label->setWordWrap(
true);
440 auto search =
new QLineEdit(widget);
441 search->setPlaceholderText(
"Search classes");
442 search->setClearButtonEnabled(
true);
444 QListWidget* qlwidget =
new QListWidget();
445 QStringList allClasses;
447 qlwidget->addItems(allClasses);
449 connect ( qlwidget, &QListWidget::itemActivated,
451 const std::string& className = qlwidget->currentItem()->text().toStdString();
457 connect (search, &QLineEdit::textChanged,
this, [search, qlwidget] () {
458 auto items = qlwidget->findItems(search->text(), Qt::MatchRegularExpression);
459 if (!items.empty()) {
460 qlwidget->setCurrentItem(items[0]);
464 auto close_button =
new QPushButton(
"Close");
465 connect (close_button, SIGNAL (clicked()), widget, SLOT(close()));
466 QVBoxLayout* lout =
new QVBoxLayout();
467 lout->addWidget(label);
468 lout->addWidget(qlwidget);
469 lout->addWidget(search);
470 lout->addWidget(close_button);
473 widget->setWindowTitle(
"Select super-class(es) for " + class_name);
474 widget->setLayout(lout);
475 widget->setParent(
this, Qt::Dialog);
482 if (ShouldOpenAttributeEditor(
"")) {
484 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildAttributeModelSlot() ) );
491 if (ShouldOpenRelationshipEditor(
"")) {
493 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildRelationshipModelSlot() ) );
501 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildMethodModelSlot() ) );
507 QStringList Row = AttributeModel->getRowFromIndex ( Index );
508 bool ShouldOpen = ShouldOpenAttributeEditor ( Row.at ( 0 ) );
510 if ( !Row.isEmpty() && ShouldOpen )
513 SchemaClass, SchemaClass->find_attribute ( Row.at ( 0 ).toStdString() ) );
514 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildAttributeModelSlot() ) );
521 QStringList Row = RelationshipModel->getRowFromIndex ( Index );
522 bool ShouldOpen = ShouldOpenRelationshipEditor ( Row.at ( 0 ) );
524 if ( !Row.isEmpty() && ShouldOpen )
527 SchemaClass, SchemaClass->find_relationship ( Row.at ( 0 ).toStdString() ) );
528 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildRelationshipModelSlot() ) );
535 QStringList Row = MethodModel->getRowFromIndex ( Index );
536 auto method = Row.at(0).toStdString();
537 if (SchemaClass->find_direct_method(method) ==
nullptr) {
538 std::string message{
"Method '" + method +
"' is not a direct method of " +
539 SchemaClass->get_name() +
540". Please open the method editor from the base class or add a local implementation to overrride it."};
541 QMessageBox::warning (0,
543 QString::fromStdString(message));
547 bool ShouldOpen = ShouldOpenMethodEditor ( Row.at ( 0 ) );
549 if ( !Row.isEmpty() && ShouldOpen )
552 SchemaClass, SchemaClass->find_method ( method ) );
553 connect ( Editor, SIGNAL ( RebuildModel() ),
this, SLOT ( BuildMethodModelSlot() ) );
560 QStringList Row = SuperClassModel->getRowFromIndex ( Index );
562 if ( !Row.isEmpty() )
564 QString ClassName = Row.at ( 0 );
565 OpenNewClassEditor(ClassName);
571 QStringList Row = SubClassModel->getRowFromIndex ( Index );
573 if ( !Row.isEmpty() )
575 QString ClassName = Row.at ( 0 );
576 OpenNewClassEditor(ClassName);
582 bool WidgetFound =
false;
585 for ( QWidget * Editor : QApplication::allWidgets() )
589 if ( Widget !=
nullptr )
591 if ( ( Widget->objectName() ).compare ( ClassName ) == 0 )
594 Widget->setVisible (
true );
595 Widget->activateWindow();
610 QStringList AttributeHeaders
613 if ( AttributeModel !=
nullptr ) {
614 delete AttributeModel;
619 ui->ShowDerivedAttributes->isChecked());
621 ui->AttributeView->setModel ( AttributeModel );
622 ui->AttributeView->horizontalHeader()->setSectionResizeMode ( QHeaderView::Stretch );
623 ui->AttributeView->setSelectionBehavior ( QAbstractItemView::SelectRows );
628 QStringList RelationshipHeaders
629 {
"Name",
"Type",
"Low cc",
"High cc" };
632 SchemaClass, RelationshipHeaders, ui->ShowDerivedRelationships->isChecked() );
635 delete RelationshipModel;
636 RelationshipModel =
new CustomRelationshipModel ( SchemaClass, RelationshipHeaders, ui->ShowDerivedRelationships->isChecked() );
639 ui->RelationshipView->setModel ( RelationshipModel );
640 ui->RelationshipView->horizontalHeader()->setSectionResizeMode ( QHeaderView::Stretch );
641 ui->RelationshipView->setSelectionBehavior ( QAbstractItemView::SelectRows );
646 QStringList MethodHeaders
649 if ( MethodModel ==
nullptr )
651 MethodModel =
new CustomMethodModel ( SchemaClass, MethodHeaders, ui->ShowDerivedMethods->isChecked() );
656 MethodModel =
new CustomMethodModel ( SchemaClass, MethodHeaders, ui->ShowDerivedMethods->isChecked() );
659 ui->MethodsView->setModel ( MethodModel );
660 ui->MethodsView->horizontalHeader()->setSectionResizeMode ( QHeaderView::Stretch );
661 ui->MethodsView->setSelectionBehavior ( QAbstractItemView::SelectRows );
666 QStringList SuperClassHeaders
669 if ( SuperClassModel ==
nullptr )
671 SuperClassModel =
new CustomSuperClassModel ( SchemaClass, SuperClassHeaders, ui->ShowAllSuperClasses->isChecked() );
675 delete SuperClassModel;
676 SuperClassModel =
new CustomSuperClassModel ( SchemaClass, SuperClassHeaders, ui->ShowAllSuperClasses->isChecked() );
679 ui->SuperClassView->setModel ( SuperClassModel );
680 ui->SuperClassView->horizontalHeader()->setSectionResizeMode ( QHeaderView::Stretch );
681 ui->SuperClassView->setSelectionBehavior ( QAbstractItemView::SelectRows );
686 QStringList SubClassHeaders
689 if ( SubClassModel ==
nullptr )
695 delete SubClassModel;
699 ui->SubClassView->setModel ( SubClassModel );
700 ui->SubClassView->horizontalHeader()->setSectionResizeMode ( QHeaderView::Stretch );
701 ui->SubClassView->setSelectionBehavior ( QAbstractItemView::SelectRows );
706 if ( ContextMenuClass ==
nullptr )
708 ContextMenuClass =
new QMenu (
this );
710 QAction * Add =
new QAction ( tr (
"&Add" ),
this );
711 Add->setShortcut ( tr (
"Ctrl+A" ) );
712 Add->setShortcutContext ( Qt::WidgetShortcut );
713 connect ( Add, SIGNAL ( triggered() ),
this, SLOT ( AddNewSuperClass() ) );
715 QAction * Remove =
new QAction ( tr (
"&Remove" ),
this );
716 Remove->setShortcut ( tr (
"Ctrl+R" ) );
717 Remove->setShortcutContext ( Qt::WidgetShortcut );
718 connect ( Remove, SIGNAL ( triggered() ),
this, SLOT ( RemoveSuperClass() ) );
720 ContextMenuClass->addAction ( Add );
721 ContextMenuClass->addAction ( Remove );
724 QModelIndex Index = ui->SuperClassView->currentIndex();
726 if ( Index.isValid() )
728 CurrentRow = SuperClassModel->getRowFromIndex ( Index );
729 ContextMenuClass->exec ( ui->SuperClassView->mapToGlobal ( pos ) );
735 if ( ContextMenuAttribute ==
nullptr )
737 ContextMenuAttribute =
new QMenu (
this );
739 QAction * Add =
new QAction ( tr (
"&Add" ),
this );
740 Add->setShortcut ( tr (
"Ctrl+A" ) );
741 Add->setShortcutContext ( Qt::WidgetShortcut );
742 connect ( Add, SIGNAL ( triggered() ),
this, SLOT ( AddNewAttribute() ) );
744 QAction * Remove =
new QAction ( tr (
"&Remove" ),
this );
745 Remove->setShortcut ( tr (
"Ctrl+R" ) );
746 Remove->setShortcutContext ( Qt::WidgetShortcut );
747 connect ( Remove, SIGNAL ( triggered() ),
this, SLOT ( RemoveAttribute() ) );
749 ContextMenuAttribute->addAction ( Add );
750 ContextMenuAttribute->addAction ( Remove );
753 QModelIndex Index = ui->AttributeView->currentIndex();
755 if ( Index.isValid() )
757 CurrentRow = AttributeModel->getRowFromIndex ( Index );
758 ContextMenuAttribute->exec ( ui->AttributeView->mapToGlobal ( pos ) );
764 if ( ContextMenuRelationship ==
nullptr )
766 ContextMenuRelationship =
new QMenu (
this );
768 QAction * Add =
new QAction ( tr (
"&Add" ),
this );
769 Add->setShortcut ( tr (
"Ctrl+A" ) );
770 Add->setShortcutContext ( Qt::WidgetShortcut );
771 connect ( Add, SIGNAL ( triggered() ),
this, SLOT ( AddNewRelationship() ) );
773 QAction * Remove =
new QAction ( tr (
"&Remove" ),
this );
774 Remove->setShortcut ( tr (
"Ctrl+R" ) );
775 Remove->setShortcutContext ( Qt::WidgetShortcut );
778 ContextMenuRelationship->addAction ( Add );
779 ContextMenuRelationship->addAction ( Remove );
782 QModelIndex Index = ui->RelationshipView->currentIndex();
784 if ( Index.isValid() )
786 CurrentRow = RelationshipModel->getRowFromIndex ( Index );
787 ContextMenuRelationship->exec ( ui->RelationshipView->mapToGlobal ( pos ) );
793 if ( ContextMenuMethod ==
nullptr )
795 ContextMenuMethod =
new QMenu (
this );
797 QAction * Add =
new QAction ( tr (
"&Add" ),
this );
798 Add->setShortcut ( tr (
"Ctrl+A" ) );
799 Add->setShortcutContext ( Qt::WidgetShortcut );
800 connect ( Add, SIGNAL ( triggered() ),
this, SLOT ( AddNewMethod() ) );
802 QAction * Remove =
new QAction ( tr (
"&Remove" ),
this );
803 Remove->setShortcut ( tr (
"Ctrl+R" ) );
804 Remove->setShortcutContext ( Qt::WidgetShortcut );
805 connect ( Remove, SIGNAL ( triggered() ),
this, SLOT ( RemoveMethod() ) );
807 ContextMenuMethod->addAction ( Add );
808 ContextMenuMethod->addAction ( Remove );
811 QModelIndex Index = ui->MethodsView->currentIndex();
813 if ( Index.isValid() )
815 CurrentRow = MethodModel->getRowFromIndex ( Index );
816 ContextMenuMethod->exec ( ui->MethodsView->mapToGlobal ( pos ) );
822 auto createNewClass = [] (
const std::string& className) ->
bool {
825 QMessageBox::warning (
829 "There is no active schema set!\n\nPlease set a schema file as active and continue!" ) );
842 QMessageBox::warning ( 0,
"Schema editor",
843 QString (
"Can not create class because class already exist !" ) );
850 QString text = QInputDialog::getText(
nullptr,
"Schema editor: create new class",
851 "New class name:", QLineEdit::Normal,
854 if(ok && !text.isEmpty()) {
855 if(createNewClass(text.toStdString())) {
864 bool widgetFound=
false;
867 for ( QWidget* widget : QApplication::allWidgets() ) {
869 if (editor !=
nullptr) {
870 if ((editor->objectName()).compare(class_name) == 0 ) {
872 widget->setVisible (
true );
873 widget->activateWindow();
880 if ( !widgetFound ) {
void PushRemoveSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
void GetClassListString(QStringList &ClassListString) const
static KernelWrapper & GetInstance()
void PushSetAbstractClassCommand(dunedaq::oks::OksClass *Class, bool Value)
dunedaq::oks::OksClass * FindClass(std::string ClassName) const
void PushAddSuperClassCommand(dunedaq::oks::OksClass *Class, std::string SuperClass)
void ClassUpdated(QString ClassName)
void PushRemoveAttributeCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksAttribute *Attribute, std::string name, std::string type, bool is_mv, std::string range, std::string init_values, std::string description, bool is_null, dunedaq::oks::OksAttribute::Format format=dunedaq::oks::OksAttribute::Format::Dec)
void PushSetDescriptionClassCommand(dunedaq::oks::OksClass *Class, std::string Description)
void PushRemoveRelationship(dunedaq::oks::OksClass *Class, dunedaq::oks::OksRelationship *Relationship, std::string Name, std::string Description, std::string Type, bool Composite, bool Exclusive, bool Dependent, dunedaq::oks::OksRelationship::CardinalityConstraint LowCc, dunedaq::oks::OksRelationship::CardinalityConstraint HighCc)
void PushRemoveMethodCommand(dunedaq::oks::OksClass *Class, dunedaq::oks::OksMethod *Method, std::string name, std::string description)
void PushCreateClassCommand(std::string ClassName, std::string ClassDescription, bool Abstract)
void GetSchemaFiles(std::vector< std::string > &SchemaFiles)
void CustomMenuMethodView(QPoint pos)
void keyPressEvent(QKeyEvent *event)
void OpenRelationshipEditor(QModelIndex Index)
void ClassUpdated(QString className)
bool ShouldOpenAttributeEditor(QString Name)
Helper functions.
void RemoveRelationship()
bool ShouldOpenRelationshipEditor(QString Name)
bool ShouldOpenMethodEditor(QString Name)
void BuildSubClassModelSlot()
void BuildAttributeModelSlot()
void RemoveAttribute()
Remove Functions.
void BuildSuperClassModelSlot()
void BuildMethodModelSlot()
void CustomMenuRelationshipView(QPoint pos)
void ClassRemoved(QString className)
void OpenSuperClass(QModelIndex Index)
SchemaClassEditor(dunedaq::oks::OksClass *ClassInfo, QWidget *parent=nullptr)
static void launch(QString class_name)
dunedaq::oks::OksClass * SchemaClass
void CustomMenuClassView(QPoint pos)
void OpenMethodEditor(QModelIndex Index)
static QString createNewClass()
void OpenSubClass(QModelIndex Index)
void AddNewRelationship()
std::unique_ptr< dbse::Ui::SchemaClassEditor > ui
void OpenAttributeEditor(QModelIndex Index)
void OpenNewClassEditor(const QString &ClassName)
void CustomMenuAttributeView(QPoint pos)
Context Menu Functions.
void BuildRelationshipModelSlot()
bool get_is_multi_values() const noexcept
const std::string & get_type() const noexcept
Get attribute string type.
const std::string & get_range() const noexcept
Get attribute range.
const std::string & get_name() const noexcept
out stream operator
const std::string & get_init_value() const noexcept
const std::string & get_description() const noexcept
bool get_is_no_null() const noexcept
Format get_format() const noexcept
Get attribute format.
void set_file(OksFile *f, bool update_owner=true)
Move class to different file.
const std::string & get_name() const noexcept
OksFile * get_file() const noexcept
const std::string & get_full_file_name() const
const std::string & get_description() const noexcept
const std::string & get_name() const noexcept
bool get_is_exclusive() const noexcept
bool get_is_composite() const noexcept
bool get_is_dependent() const noexcept
const std::string & get_name() const noexcept
CardinalityConstraint get_high_cardinality_constraint() const noexcept
Get relationship high cardinality constraint.
const std::string & get_description() const noexcept
CardinalityConstraint get_low_cardinality_constraint() const noexcept
Get relationship low cardinality constraint.
const std::string & get_type() const noexcept