Search in sources :

Example 6 with HTMLLIElement

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);
}
Also used : HTMLLIElement(elemental2.dom.HTMLLIElement)

Example 7 with HTMLLIElement

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;
}
Also used : HTMLLIElement(elemental2.dom.HTMLLIElement)

Example 8 with HTMLLIElement

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;
}
Also used : ArrayList(java.util.ArrayList) HTMLLIElement(elemental2.dom.HTMLLIElement)

Aggregations

HTMLLIElement (elemental2.dom.HTMLLIElement)8 HTMLElement (elemental2.dom.HTMLElement)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 DataType (org.kie.workbench.common.dmn.client.editors.types.common.DataType)1