Package elemental.html

Examples of elemental.html.InputElement


    addClassesToElement(elem, classNames);
    return elem;
  }

  public static InputElement createInputElement(String... classNames) {
    InputElement elem = getDocument().createInputElement();
    addClassesToElement(elem, classNames);
    return elem;
  }
View Full Code Here


    addClassesToElement(elem, classNames);
    return elem;
  }

  public static InputElement createInputTextElement(String... classNames) {
    InputElement elem = getDocument().createInputElement();
    addClassesToElement(elem, classNames);
    elem.setType("text");
    return elem;
  }
View Full Code Here

    String oldLabel = element.getTextContent();
    callback.onBeforeMutation(node);

    // Make a temporary text input box to grab user input, and place it inside
    // the label element.
    InputElement input = Elements.createInputElement();
    if (css != null) {
      input.setClassName(css.nodeNameInput());
    }
    input.setType("text");
    input.setValue(oldLabel);

    // Wipe the content from the element.
    element.setTextContent("");

    // Attach the temporary input box.
    element.appendChild(input);
    input.focus();
    input.select();

    // If we hit enter, commit the action.
    input.addEventListener(Event.KEYUP, keyListener, false);

    // If we lose focus, commit the action.
    input.addEventListener(Event.BLUR, blurListener, false);

    state = new State<D>(node, callback, input, oldLabel);
  }
View Full Code Here

    binder.createAndBindUi(this);
   
    input.setId(DOM.createUniqueId());
    data.setId(DOM.createUniqueId());
   
    InputElement in = (InputElement)input;
    //associate our data list in the browser's typeahead
    (in).setAttribute("list", data.getId());
    //associate label to our input; this should be done in generator
    ((LabelElement)inputLabel).setHtmlFor(input.getId());

    setModuleTextbox(model.getModuleName());
    list = (elemental.html.DataListElement)data;
    //TODO restore module from cookie
    EventListener ev = new EventListener() {
      String was = "";
      @Override
      public void handleEvent(Event evt) {
        String is = input.getValue().trim();
        if (is.equals(was))return;
        was = is;
        GwtRecompile module = modules.get(is);
        if (module != null) {
          showModule(module);
        }
      }
    };
    in.setOninput(ev);
    res.gwtModuleCss().ensureInjected();
  }
View Full Code Here

    String oldLabel = element.getTextContent();
    callback.onBeforeMutation(node);

    // Make a temporary text input box to grab user input, and place it inside
    // the label element.
    InputElement input = Elements.createInputElement();
    if (css != null) {
      input.setClassName(css.nodeNameInput());
    }
    input.setType("text");
    input.setValue(oldLabel);

    // Wipe the content from the element.
    element.setTextContent("");

    // Attach the temporary input box.
    element.appendChild(input);
    input.focus();
    input.select();

    // If we hit enter, commit the action.
    input.addEventListener(Event.KEYUP, keyListener, false);

    // If we lose focus, commit the action.
    input.addEventListener(Event.BLUR, blurListener, false);

    state = new State<D>(node, callback, input, oldLabel);
  }
View Full Code Here

    addClassesToElement(elem, classNames);
    return elem;
  }

  public static InputElement createInputElement(String... classNames) {
    InputElement elem = getDocument().createInputElement();
    addClassesToElement(elem, classNames);
    return elem;
  }
View Full Code Here

    addClassesToElement(elem, classNames);
    return elem;
  }

  public static InputElement createInputTextElement(String... classNames) {
    InputElement elem = getDocument().createInputElement();
    addClassesToElement(elem, classNames);
    elem.setType("text");
    return elem;
  }
View Full Code Here

TOP

Related Classes of elemental.html.InputElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.