@PropertySetter("multiple") public void setMultiple(boolean multiple) { if (multiple != this.multiple) { if (!multiple && selected.size() > 1) { unselect(null); } sync("multiple", this.multiple = multiple); } }
/** * Registers a property setter. * * @param setter {@literal @PropertySetter} annotation * @param method The setter method. */ /*package*/ void _addSetter(PropertySetter setter, Method method) { String name = setter.value(); if (!setters.containsKey(name)) { if (isStatic(method) || method.getParameterTypes().length != 1) { throw new IllegalArgumentException("Bad signature for setter method: " + method.getName()); } setters.put(name, setter.hide() ? null : method); if (setter.defer()) { deferred.add(name); } } }
/** * Sets the data object to be associated with the component. * * @param data The data object. */ @PropertySetter("data") public void setData(Object data) { this.data = data; }
@PropertySetter("name") public void setName(String name) { if (!areEqual(name = nullify(name), this.name)) { validateName(name); nameIndex.remove(this); this.name = name; nameIndex.add(this); sync("name", name); } }
@PropertySetter("image") public void setImage(String image) { if (!areEqual(image = nullify(image), this.image)) { sync("image", this.image = image); } }
/** * Set to true if multiple file uploads are allowed. * * @param multiple True if multiple file uploads are to be allowed. */ @PropertySetter("multiple") public void setMultiple(boolean multiple) { if (multiple != this.multiple) { sync("multiple", this.multiple = multiple); } }
@PropertySetter("showRoot") public void setShowRoot(boolean showRoot) { if (showRoot != this.showRoot) { sync("showRoot", this.showRoot = showRoot); } }
@PropertySetter("dropid") public void setDropid(String dropid) { dropid = trimify(dropid); if (!areEqual(dropid, this.dropid)) { sync("dropid", this.dropid = dropid); } }
@PropertySetter("tabindex") public void setTabindex(int tabindex) { tabindex = tabindex < 0 ? 0 : tabindex; if (tabindex != this.tabindex) { sync("tabindex", this.tabindex = tabindex); } }
@PropertySetter("width") public void setWidth(String width) { width = trimify(width); if (!areEqual(width, this.width)) { this.width = width; addStyle("width", width); } }
@PropertySetter("height") public void setHeight(String height) { height = trimify(height); if (!areEqual(height, this.height)) { this.height = height; addStyle("height", height); } }
@PropertySetter("style") public void setStyles(String styles) { this.styles.parse(styles, true); _syncStyles(); }
@PropertySetter("title") public void setTitle(String title) { if (!areEqual(title = nullify(title), this.title)) { sync("title", this.title = title); } }
@PropertySetter("orientation") public void setOrientation(Orientation orientation) { orientation = orientation == null ? Orientation.HORIZONTAL : orientation; if (orientation != this.orientation) { sync("orientation", this.orientation = orientation); } } }
@PropertySetter(value = "src") private void setSrc(String src) { src = nullify(src); if (src != null) { PageParser.getInstance().parse(src).materialize(this); } } }
@PropertySetter("movable") public void setMovable(boolean movable) { if (movable != this.movable) { sync("movable", this.movable = movable); } }
@PropertySetter("position") public void setPosition(Position position) { if (position != this.position) { sync("position", this.position = position); } }
@PropertySetter("sizable") public void setSizable(boolean sizable) { if (sizable != this.sizable) { sync("sizable", this.sizable = sizable); } }
@PropertySetter("closable") public void setClosable(boolean closable) { if (closable != this.closable) { sync("closable", this.closable = closable); } }
/** * Sets the alignment of the label. * * @param alignment May be one of: start, center, end. */ @PropertySetter("alignment") public void setAlignment(LabelAlignment alignment) { alignment = alignment == null ? LabelAlignment.START : alignment; if (alignment != this.alignment) { sync("alignment", this.alignment = alignment); } }