- Added and updated JavaDocs.
- Formatting fixes.
- Suppressed deprecation warnings.
*/
public class VPasswordField extends VTextField {
+ /** Default classname for this widget. */
public static final String CLASSNAME = "v-passwordfield";
+ /**
+ * Constructs a widget for a PasswordField.
+ */
public VPasswordField() {
super(DOM.createInputPassword());
setStyleName(CLASSNAME);
import com.vaadin.client.WidgetUtil;
import com.vaadin.shared.ui.slider.SliderOrientation;
+/**
+ * Widget class for the Slider component.
+ *
+ * @author Vaadin Ltd
+ *
+ */
public class VSlider extends SimpleFocusablePanel
implements Field, HasValue<Double>, SubPartAware {
+ /** Default classname for this widget. */
public static final String CLASSNAME = "v-slider";
/**
* @author Vaadin Ltd.
*
*/
+@SuppressWarnings("deprecation")
public class VTextArea extends VTextField implements DragImageModifier {
+ /** Default classname for this widget. */
public static final String CLASSNAME = "v-textarea";
private EnterDownHandler enterDownHandler = new EnterDownHandler();
}
}
+ /**
+ * Constructs a widget for a TextArea.
+ */
public VTextArea() {
super(DOM.createTextArea());
setStyleName(CLASSNAME);
getElement().getStyle().setOverflowX(Overflow.HIDDEN);
}
+ /**
+ * Gets the base TextAreaElement of this widget.
+ *
+ * @return the base element
+ */
public TextAreaElement getTextAreaElement() {
return super.getElement().cast();
}
+ /**
+ * Sets the number of text rows that should be displayed.
+ *
+ * @param rows
+ * the number of text rows
+ */
public void setRows(int rows) {
getTextAreaElement().setRows(rows);
}
+ /**
+ * Sets whether the words should wrap or not.
+ *
+ * @param wordWrap
+ * {@code true} if the words should wrap, {@code false} otherwise
+ */
public void setWordWrap(boolean wordWrap) {
if (wordWrap == this.wordWrap) {
return;
public class VTextField extends TextBoxBase
implements Field, FocusHandler, BlurHandler, AbstractTextFieldWidget {
+ /** Default classname for this widget. */
public static final String CLASSNAME = "v-textfield";
+ /**
+ * Classname suffix for this widget when focused.
+ *
+ * @see #addStyleDependentName(String)
+ */
public static final String CLASSNAME_FOCUS = "focus";
+ /**
+ * Constructs a widget for a TextField.
+ */
public VTextField() {
this(DOM.createInputText());
}
+ /**
+ * Constructs a text entry widget that wraps the given input element.
+ *
+ * @param node
+ * the input element to wrap
+ */
protected VTextField(Element node) {
super(node);
setStyleName(CLASSNAME);
addBlurHandler(this);
}
+ /**
+ * Sets the {@code maxLength} Integer property for this widget's base
+ * element. If the given value is negative, the property is removed.
+ *
+ * @param maxLength
+ * the new maximum length
+ */
public void setMaxLength(int maxLength) {
if (maxLength >= 0) {
getElement().setPropertyInt("maxLength", maxLength);
}
}
+ /**
+ * Sets the {@code placeholder} String property for this widget's base
+ * element. If the given value is {@code null}, the property is removed.
+ *
+ * @param placeholder
+ * the new placeholder text
+ */
public void setPlaceholder(String placeholder) {
if (placeholder != null) {
getElement().setAttribute("placeholder", placeholder);
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
listBox.setItemSelected(i, isSelected);
if (isSelected) {
// Ensure that last selected item is visible
- scrollToView(listBox,i);
+ scrollToView(listBox, i);
}
}
// remove extra
if (scheduledScrollToItem == -1) {
scheduledScrollToItem = i;
Scheduler.get().scheduleDeferred(() -> {
- Element el = (Element) listBox.getElement().getChild(scheduledScrollToItem);
- el.scrollIntoView();
- scheduledScrollToItem = -1;
+ @SuppressWarnings("deprecation")
+ com.google.gwt.user.client.Element el = (com.google.gwt.user.client.Element) listBox
+ .getElement().getChild(scheduledScrollToItem);
+ el.scrollIntoView();
+ scheduledScrollToItem = -1;
});
} else {
scheduledScrollToItem = i;
}
+ @SuppressWarnings("deprecation")
@Override
public com.google.gwt.user.client.Element getSubPartElement(
String subPart) {
return null;
}
+ @SuppressWarnings("deprecation")
@Override
public String getSubPartName(
com.google.gwt.user.client.Element subElement) {
import com.vaadin.client.ui.ui.UIConnector;
import com.vaadin.shared.ApplicationConstants;
+/**
+ * Widget class for the UI.
+ *
+ * @author Vaadin Ltd
+ *
+ */
public class VUI extends SimplePanel implements ResizeHandler,
Window.ClosingHandler, ShortcutActionHandlerOwner, Focusable,
com.google.gwt.user.client.ui.Focusable, HasResizeHandlers,
private Element storedFocus;
+ /**
+ * Constructs a widget for an UI.
+ */
public VUI() {
super();
// Allow focusing the view by using the focus() method, the view
Profiler.leave("VUI.sendClientResized");
}
+ /**
+ *
+ * Opens the given URL in the current browser window. If this UI needs to be
+ * closed as a result it should be handled separately.
+ *
+ * @param url
+ * the URL to navigate to
+ */
public static native void goTo(String url)
/*-{
$wnd.location = url;
*/
public class VVerticalLayout extends VAbstractOrderedLayout {
+ /** Default classname for this widget. */
public static final String CLASSNAME = "v-verticallayout";
/**
import com.google.gwt.dom.client.VideoElement;
import com.vaadin.client.Util;
+/**
+ * Widget class for the Video component.
+ *
+ * @author Vaadin Ltd
+ *
+ */
public class VVideo extends VMediaBase {
+ /** Default classname for this widget. */
public static String CLASSNAME = "v-video";
private VideoElement video;
+ /**
+ * Constructs a widget for the Video component.
+ */
public VVideo() {
video = Document.get().createVideoElement();
setMediaElement(video);
* video metadata has been loaded.
*
* @param el
+ * the root element of this widget
*/
private native void updateDimensionsWhenMetadataLoaded(Element el)
/*-{
el.addEventListener('loadedmetadata', $entry(function(e) {
self.@com.vaadin.client.ui.VVideo::updateElementDynamicSize(II)(el.videoWidth, el.videoHeight);
}), false);
-
+
}-*/;
/**
* Updates the dimensions of the widget.
*
- * @param w
- * @param h
+ * @param width
+ * width to set (in pixels)
+ * @param height
+ * height to set (in pixels)
*/
- private void updateElementDynamicSize(int w, int h) {
- video.getStyle().setWidth(w, Unit.PX);
- video.getStyle().setHeight(h, Unit.PX);
+ @SuppressWarnings("deprecation")
+ private void updateElementDynamicSize(int width, int height) {
+ video.getStyle().setWidth(width, Unit.PX);
+ video.getStyle().setHeight(height, Unit.PX);
Util.notifyParentOfSizeChange(this, true);
}
+ /**
+ * Sets the poster URL.
+ *
+ * @param poster
+ * the poster image URL
+ */
public void setPoster(String poster) {
video.setPoster(poster);
}