/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'radio'. * * @param element the element to be used */ protected SimpleRadioButton(Element element) { super(element, null); assert InputElement.as(element).getType().equalsIgnoreCase("radio"); } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'password'. * * @param element the element to be used */ protected PasswordTextBox(Element element) { super(element, null); assert InputElement.as(element).getType().equalsIgnoreCase("password"); } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'text'. * * @param element the element to be used */ protected TextBox(Element element) { super(element); assert InputElement.as(element).getType().equalsIgnoreCase("text"); }
/** * Check whether or not an element is a checkbox or radio button. * * @param elem the element to check * @return true if a checkbox, false if not */ private static boolean isCheckbox(Element elem) { if (elem == null || !"input".equalsIgnoreCase(elem.getTagName())) { return false; } String inputType = InputElement.as(elem).getType().toLowerCase(Locale.ROOT); return "checkbox".equals(inputType) || "radio".equals(inputType); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is either * 'checkbox'. * * @param element the element to be used */ protected SimpleCheckBox(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("checkbox"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'hidden'. * * @param element the element to be used */ protected Hidden(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("hidden"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'file'. * * @param element the element to be used */ protected FileUpload(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("file"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'text'. * * @param element the element to be used */ protected ValueBox(Element element, Renderer<T> renderer, Parser<T> parser) { super(element, renderer, parser); // BiDi input is not expected - disable direction estimation. setDirectionEstimator(false); if (LocaleInfo.getCurrentLocale().isRTL()) { setDirection(Direction.LTR); } assert InputElement.as(element).getType().equalsIgnoreCase("text"); }
public SelectAction translateSelectionEvent(CellPreviewEvent<T> event) { // Handle the event. NativeEvent nativeEvent = event.getNativeEvent(); if (BrowserEvents.CLICK.equals(nativeEvent.getType())) { // Ignore if the event didn't occur in the correct column. if (column > -1 && column != event.getColumn()) { return SelectAction.IGNORE; } // Determine if we clicked on a checkbox. Element target = nativeEvent.getEventTarget().cast(); if ("input".equals(target.getTagName().toLowerCase(Locale.ROOT))) { final InputElement input = target.cast(); if ("checkbox".equals(input.getType().toLowerCase(Locale.ROOT))) { // Synchronize the checkbox with the current selection state. input.setChecked(event.getDisplay().getSelectionModel().isSelected( event.getValue())); return SelectAction.TOGGLE; } } return SelectAction.IGNORE; } // For keyboard events, do the default action. return SelectAction.DEFAULT; } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'password'. * * @param element * the element to be used */ protected PasswordTextBox(Element element) { super(element, null); assert InputElement.as(element).getType().equalsIgnoreCase("password"); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <input type="submit"> element. * * @param element * the element to be used */ protected SubmitButton(Element element) { super(element); assert "submit".equalsIgnoreCase(element.<InputElement> cast().getType()); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'text'. * * @param element * the element to be used */ protected TextBox(Element element) { super(element); assert InputElement.as(element).getType().equalsIgnoreCase("text"); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'text'. * * @param element the element to be used */ protected TextBox(Element element) { super(element); assert InputElement.as(element).getType().equalsIgnoreCase("text"); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'radio'. * * @param element the element to be used */ protected SimpleRadioButton(Element element) { super(element, null); assert InputElement.as(element).getType().equalsIgnoreCase("radio"); } }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'text'. * * @param element * the element to be used */ protected CharacterBox(Element element) { super(element); assert InputElement.as(element).getType().equalsIgnoreCase("text"); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'file'. * * @param element the element to be used */ protected FileUpload(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("file"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is either * 'checkbox'. * * @param element the element to be used */ protected SimpleCheckBox(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("checkbox"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is either * 'checkbox'. * * @param element the element to be used */ protected SimpleCheckBox(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("checkbox"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'hidden'. * * @param element the element to be used */ protected Hidden(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("hidden"); setElement(element); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be an <input> element whose type is * 'hidden'. * * @param element the element to be used */ protected Hidden(Element element) { assert InputElement.as(element).getType().equalsIgnoreCase("hidden"); setElement(element); }