Search in sources :

Example 1 with HTMLTextAreaElement

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

the class Elements method getInputValue.

@NotNull
String getInputValue(@NotNull String name) {
    Node item = elements.namedItem(name);
    String value = null;
    if (item instanceof HTMLInputElement) {
        value = ((HTMLInputElement) item).getValue();
    } else if (item instanceof HTMLTextAreaElement) {
        value = ((HTMLTextAreaElement) item).getValue();
    }
    return value != null ? value : "";
}
Also used : Node(org.w3c.dom.Node) HTMLInputElement(org.w3c.dom.html.HTMLInputElement) HTMLTextAreaElement(org.w3c.dom.html.HTMLTextAreaElement) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with HTMLTextAreaElement

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

the class StepDescriptionUtils method disableAllInputs.

private static void disableAllInputs(@NotNull Elements elements) {
    for (Node node : elements) {
        if (node instanceof HTMLInputElement) {
            HTMLInputElement element = (HTMLInputElement) node;
            element.setDisabled(true);
        } else if (node instanceof HTMLTextAreaElement) {
            HTMLTextAreaElement element = (HTMLTextAreaElement) node;
            element.setDisabled(true);
        }
    }
}
Also used : StepNode(org.stepik.core.courseFormat.StepNode) Node(org.w3c.dom.Node) HTMLInputElement(org.w3c.dom.html.HTMLInputElement) HTMLTextAreaElement(org.w3c.dom.html.HTMLTextAreaElement)

Aggregations

Node (org.w3c.dom.Node)2 HTMLInputElement (org.w3c.dom.html.HTMLInputElement)2 HTMLTextAreaElement (org.w3c.dom.html.HTMLTextAreaElement)2 NotNull (org.jetbrains.annotations.NotNull)1 StepNode (org.stepik.core.courseFormat.StepNode)1