use of org.archcnl.ui.inputview.rulesormappingeditorview.architectureruleeditor.components.verbcomponents.StatementComponent in project ArchCNL by Mari-Wie.
the class RuleCreatorView method initializeLayout.
private void initializeLayout(Optional<String> ruleString) {
subject = new SubjectComponent();
subject.addListener(RelationListUpdateRequestedEvent.class, this::fireEvent);
subject.addListener(ConceptListUpdateRequestedEvent.class, this::fireEvent);
subject.addListener(DetermineStatementComponentEvent.class, event -> verb.determineVerbComponent(event.getSource().getFirstModifierValue()));
verb = new StatementComponent();
verb.addListener(RelationListUpdateRequestedEvent.class, this::fireEvent);
verb.addListener(ConceptListUpdateRequestedEvent.class, this::fireEvent);
buttonsLayout = new HorizontalLayout();
saveButton = new Button("Save Rule", e -> saveRule());
cancelButton = new Button("Cancel", click -> fireEvent(new RulesWidgetRequestedEvent(this, true)));
expertmodeCheckbox = new Checkbox("Activate Expertmode");
expertmodeCheckbox.addClickListener(e -> activateExpertMode(expertmodeCheckbox.getValue()));
buttonsLayout.setVerticalComponentAlignment(Alignment.CENTER, expertmodeCheckbox);
buttonsLayout.setPadding(true);
buttonsLayout.add(saveButton, cancelButton, expertmodeCheckbox);
archRuleTextArea = new TextArea("Create new architecture rule");
archRuleTextArea.setWidthFull();
add(subject, verb, buttonsLayout);
ruleString.ifPresent(rule -> {
archRuleTextArea.setValue(rule);
expertmodeCheckbox.setValue(true);
activateExpertMode(true);
});
}
Aggregations