Search in sources :

Example 1 with HTMLSelectElement

use of org.w3c.dom.html.HTMLSelectElement in project intellij-plugins by StepicOrg.

the class StepDescriptionUtils method getBlanks.

private static List<String> getBlanks(@NotNull Elements elements) {
    List<String> blanks = new ArrayList<>();
    for (Node node : elements) {
        if (node instanceof HTMLInputElement) {
            HTMLInputElement element = (HTMLInputElement) node;
            String type = element.getType();
            if ("text".equals(type)) {
                blanks.add(element.getValue());
            }
            element.setDisabled(true);
        } else if (node instanceof HTMLSelectElement) {
            HTMLSelectElement element = (HTMLSelectElement) node;
            blanks.add(element.getValue());
            element.setDisabled(true);
        }
    }
    return blanks;
}
Also used : StepNode(org.stepik.core.courseFormat.StepNode) Node(org.w3c.dom.Node) HTMLInputElement(org.w3c.dom.html.HTMLInputElement) ArrayList(java.util.ArrayList) HTMLSelectElement(org.w3c.dom.html.HTMLSelectElement)

Aggregations

ArrayList (java.util.ArrayList)1 StepNode (org.stepik.core.courseFormat.StepNode)1 Node (org.w3c.dom.Node)1 HTMLInputElement (org.w3c.dom.html.HTMLInputElement)1 HTMLSelectElement (org.w3c.dom.html.HTMLSelectElement)1