Example usage for com.google.gwt.dom.client InputElement select

List of usage examples for com.google.gwt.dom.client InputElement select

Introduction

In this page you can find the example usage for com.google.gwt.dom.client InputElement select.

Prototype

public final void select() 

Source Link

Usage

From source file:cc.alcina.framework.gwt.client.cell.EditTextCell.java

License:Apache License

/**
 * Convert the cell to edit mode.//from w  w w  .jav  a2  s  .  co  m
 *
 * @param context
 *            the {@link Context} of the cell
 * @param parent
 *            the parent element
 * @param value
 *            the current value
 */
protected void edit(Context context, Element parent, String value) {
    setValue(context, parent, value);
    InputElement input = getInputElement(parent);
    input.focus();
    input.select();
}

From source file:com.google.code.tree.client.CustomEditTextCell.java

License:Apache License

/**
 * Convert the cell to edit mode./* w w  w . j  ava  2 s.  c  o m*/
 * 
 * @param context
 *            the {@link Context} of the cell
 * @param parent
 *            the parent element
 * @param value
 *            the current value
 */
protected void edit(Context context, Element parent, UpdatableTreeNode value) {
    setValue(context, parent, value);
    InputElement input = getInputElement(parent);
    input.focus();
    input.select();
}

From source file:com.google.collide.client.ui.popup.CenterPanel.java

License:Open Source License

/**
 * Displays the {@link CenterPanel} popup. The popup will animate into view.
 *
 * @param selectAndFocusElement an {@link InputElement} to select and focus on when the panel is
 *        shown. If null, no element will be given focus
 *///from w  w  w.  j a v  a2s. c o m
public void show(@Nullable final InputElement selectAndFocusElement) {
    if (isShowing) {
        return;
    }
    isShowing = true;

    // Attach the popup to the body.
    final JsElement popup = getView().popup.cast();
    if (popup.getParentElement() == null) {
        // Hide the popup so it can enter its initial state without flickering.
        popup.getStyle().setVisibility("hidden");
        Elements.getBody().appendChild(popup);
    }

    // Start the animation after the element is attached.
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override
        public void execute() {
            // The popup may have been hidden before this timer executes.
            if (isShowing) {
                popup.getStyle().removeProperty("visibility");
                getView().setShowing(true);
                if (selectAndFocusElement != null) {
                    selectAndFocusElement.select();
                    selectAndFocusElement.focus();
                }
            }
        }
    });
}

From source file:com.ocado.rangeui.client.gui.component.grid.column.EditNumberCell.java

/**
 * Convert the cell to edit mode./*from   w  w  w .  jav  a  2 s.  co m*/
 *
 * @param context the {@link Context} of the cell
 * @param parent the parent element
 * @param value the current value
 */
protected void edit(Context context, Element parent, Number value) {
    setValue(context, parent, value);
    InputElement input = getInputElement(parent);
    input.focus();
    input.select();
}

From source file:io.pelle.mango.client.gwt.modules.dictionary.controls.EditTextCellWithValidation.java

License:Open Source License

private void focus(Element parent) {
    InputElement input = getInputElement(parent);

    input.focus();
    input.select();
}

From source file:io.pelle.mango.client.gwt.modules.dictionary.controls.table.SuggestCellControl.java

License:Open Source License

private void setFocus(final Element parent) {
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override//from   ww w.  j a v a 2s  . co m
        public void execute() {
            InputElement input = getInputElement(parent);
            input.focus();
            input.select();
        }
    });
}

From source file:stroom.dashboard.client.table.FieldEditTextCell.java

License:Apache License

/**
 * Convert the cell to edit mode.//from ww  w  .  j  a  v a  2s .com
 *
 * @param context
 *            the {@link Context} of the cell
 * @param parent
 *            the parent element
 * @param value
 *            the current value
 */
protected void edit(final Context context, final Element parent, final String value) {
    setValue(context, parent, value);
    final InputElement input = getInputElement(parent);
    input.focus();
    input.select();
}