/** * Creates an Anchor widget that wraps an existing <a> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Anchor wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Anchor anchor = new Anchor(element); // Mark it attached and remember it for cleanup. anchor.onAttach(); RootPanel.detachOnWindowClose(anchor); return anchor; }
/** * Creates a Frame widget that wraps an existing <frame> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Frame wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Frame frame = new Frame(element); // Mark it attached and remember it for cleanup. frame.onAttach(); RootPanel.detachOnWindowClose(frame); return frame; }
/** * Creates a Button widget that wraps an existing <button> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Button wrap(com.google.gwt.dom.client.Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Button button = new Button(element); // Mark it attached and remember it for cleanup. button.onAttach(); RootPanel.detachOnWindowClose(button); return button; }
/** * Creates a PasswordTextBox widget that wraps an existing <input * type='password'> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static PasswordTextBox wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); PasswordTextBox textBox = new PasswordTextBox(element); // Mark it attached and remember it for cleanup. textBox.onAttach(); RootPanel.detachOnWindowClose(textBox); return textBox; }
/** * Creates a SimpleRadioButton widget that wraps an existing <input * type='radio'> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static SimpleRadioButton wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); SimpleRadioButton radioButton = new SimpleRadioButton(element); // Mark it attached and remember it for cleanup. radioButton.onAttach(); RootPanel.detachOnWindowClose(radioButton); return radioButton; }
/** * Creates a TextArea widget that wraps an existing <textarea> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static TextArea wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); TextArea textArea = new TextArea(element); // Mark it attached and remember it for cleanup. textArea.onAttach(); RootPanel.detachOnWindowClose(textArea); return textArea; }
/** * Creates an HTML widget that wraps an existing <div> or <span> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static HTML wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); HTML html = new HTML(element); // Mark it attached and remember it for cleanup. html.onAttach(); RootPanel.detachOnWindowClose(html); return html; }
/** * Creates a FileUpload widget that wraps an existing <input * type='file'> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static FileUpload wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); FileUpload fileUpload = new FileUpload(element); // Mark it attached and remember it for cleanup. fileUpload.onAttach(); RootPanel.detachOnWindowClose(fileUpload); return fileUpload; }
/** * Creates an InlineHTML widget that wraps an existing <div> or * <span> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static InlineHTML wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); InlineHTML html = new InlineHTML(element); // Mark it attached and remember it for cleanup. html.onAttach(); RootPanel.detachOnWindowClose(html); return html; }
/** * Creates a Hidden widget that wraps an existing <input type='hidden'> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Hidden wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Hidden hidden = new Hidden(element); // Mark it attached and remember it for cleanup. hidden.onAttach(); RootPanel.detachOnWindowClose(hidden); return hidden; }
/** * Creates a ListBox widget that wraps an existing <select> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped * @return list box */ public static ListBox wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); ListBox listBox = new ListBox(element); // Mark it attached and remember it for cleanup. listBox.onAttach(); RootPanel.detachOnWindowClose(listBox); return listBox; }
/** * Creates a ValueBox widget that wraps an existing <input type='text'> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static <T> ValueBox<T> wrap(Element element, Renderer<T> renderer, Parser<T> parser) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); ValueBox<T> valueBox = new ValueBox<T>(element, renderer, parser); // Mark it attached and remember it for cleanup. valueBox.onAttach(); RootPanel.detachOnWindowClose(valueBox); return valueBox; }
/** * Creates a TextBox widget that wraps an existing <input type='text'> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static TextBox wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); TextBox textBox = new TextBox(element); // Mark it attached and remember it for cleanup. textBox.onAttach(); RootPanel.detachOnWindowClose(textBox); return textBox; }
/** * Creates a Label widget that wraps an existing <div> or <span> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Label wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Label label = new Label(element); // Mark it attached and remember it for cleanup. label.onAttach(); RootPanel.detachOnWindowClose(label); return label; }
/** * Creates a SubmitButton widget that wraps an existing <button> * element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Button wrap(com.google.gwt.dom.client.Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); SubmitButton button = new SubmitButton(element); assert "submit".equalsIgnoreCase(button.getButtonElement().getType()); // Mark it attached and remember it for cleanup. button.onAttach(); RootPanel.detachOnWindowClose(button); return button; }
/** * Creates a Image widget that wraps an existing <img> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Image wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Image image = new Image(element); // Mark it attached and remember it for cleanup. image.onAttach(); RootPanel.detachOnWindowClose(image); return image; }
/** * Creates a ResetButton widget that wraps an existing <button> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Button wrap(com.google.gwt.dom.client.Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); ResetButton button = new ResetButton(element); // Mark it attached and remember it for cleanup. button.onAttach(); RootPanel.detachOnWindowClose(button); return button; }
/** * Creates an HTML panel that wraps an existing element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static HTMLPanel wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); HTMLPanel html = new HTMLPanel(element); // Mark it attached and remember it for cleanup. html.onAttach(); RootPanel.detachOnWindowClose(html); return html; }
/** * Creates a InlineLabel widget that wraps an existing <div> or * <span> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static InlineLabel wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); InlineLabel label = new InlineLabel(element); // Mark it attached and remember it for cleanup. label.onAttach(); RootPanel.detachOnWindowClose(label); return label; }
/** * Creates a SimpleCheckBox widget that wraps an existing <input * type='checkbox'> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static SimpleCheckBox wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); SimpleCheckBox checkBox = new SimpleCheckBox(element); // Mark it attached and remember it for cleanup. checkBox.onAttach(); RootPanel.detachOnWindowClose(checkBox); return checkBox; }