use of elemental2.dom.HTMLLIElement in project drools-wb by kiegroup.
the class CoverageScenarioListPresenter method addScesimDataGroup.
@Override
public void addScesimDataGroup(ScenarioWithIndex scenarioWithIndex, Map<String, Integer> resultCounter, Type type) {
CoverageScenarioListView coverageScenarioListView = viewsProvider.getCoverageScenarioListView();
coverageScenarioListView.setPresenter(this);
coverageScenarioListView.setVisible(false);
HTMLLIElement scenarioElement = coverageScenarioListView.getScenarioElement();
String customText = Type.DMN.equals(type) ? ScenarioSimulationEditorConstants.INSTANCE.decisionsEvaluated() : ScenarioSimulationEditorConstants.INSTANCE.rulesFired();
String itemLabel = customText + " " + scenarioWithIndex.getIndex() + ": " + scenarioWithIndex.getScesimData().getDescription();
coverageScenarioListView.setItemLabel(itemLabel);
scenarioElement.appendChild(createInternalList(resultCounter, coverageScenarioListView.getScenarioContentList()));
this.scenarioList.appendChild(scenarioElement);
}
use of elemental2.dom.HTMLLIElement in project drools-wb by kiegroup.
the class CoverageScenarioListPresenter method createElementLi.
protected HTMLLIElement createElementLi() {
HTMLLIElement li = (HTMLLIElement) DomGlobal.document.createElement("li");
li.classList.add("list-group-item");
return li;
}
use of elemental2.dom.HTMLLIElement in project drools-wb by kiegroup.
the class CoverageScenarioListPresenter method createInternalList.
protected HTMLUListElement createInternalList(Map<String, Integer> elements, HTMLUListElement listGroup) {
List<String> keys = new ArrayList<>(elements.keySet());
keys.sort(Comparator.naturalOrder());
for (String key : keys) {
Integer counter = elements.get(key);
HTMLLIElement listElement = createElementLi();
listElement.textContent = createContent(key, counter);
listGroup.appendChild(listElement);
}
return listGroup;
}
Aggregations