protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException { super.renderProperties(renderer); if (_name != null) render(renderer, "name", _name); render(renderer, "defaultTzone", _defaultTzone.getID()); render(renderer, "weekOfYear", _weekOfYear); render(renderer, "value", _value); render(renderer, "showTodayLink", _showTodayLink); render(renderer, "todayLinkLabel", _todayLinkLabel); if (_constraint != null) { render(renderer, "constraint", new JavaScriptValue(_constraint.getClientConstraint())); } } }
/** * Sets whether enable to show the link that jump to today in day view * @param showTodayLink show or hidden * @since 8.0.0 */ public void setShowTodayLink(boolean showTodayLink) { if (_showTodayLink != showTodayLink) { _showTodayLink = showTodayLink; smartUpdate("showTodayLink", _showTodayLink); } }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Calendar self = (Calendar) comp; final String uuid = self.getUuid(); wh.write("<table id=\"").write(uuid).write("\""); wh.write(" z.type=\"zul.db.Cal\""); wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()); wh.write("></table>"); } }
/** * Sets a list of constraints separated by comma. * Example: "between 20071012 and 20071223", "before 20080103". * @param constr a list of constraints separated by comma. */ public void setConstraint(String constr) { if (constr != null) { setConstraint(new SimpleDateConstraint(constr)); } }
/** Processes an AU request. * * <p>Default: in addition to what are handled by {@link XulElement#service}, * it also handles onChange, onChanging and onError. * @since 5.0.0 */ public void service(org.zkoss.zk.au.AuRequest request, boolean everError) { final String cmd = request.getCommand(); if (cmd.equals(Events.ON_CHANGE)) { final Map<String, Object> data = request.getData(); final Object value = data.get("value"); if (Objects.equals(_value, value)) return; //nothing happen _value = (Date) value; final InputEvent evt = new InputEvent(cmd, this, getDateFormat().format(value), value, AuRequests.getBoolean(data, "bySelectBack"), AuRequests.getInt(data, "start", 0)); Events.postEvent(evt); } else { super.service(request, everError); } }
/** * Sets whether enable to show the week number within the current year or * not. * [ZK EE] * @since 6.5.0 */ public void setWeekOfYear(boolean weekOfYear) { if (_weekOfYear != weekOfYear) { _weekOfYear = weekOfYear; smartUpdate("weekOfYear", _weekOfYear); } }
/** * Sets the label of the link that jump to today in day view * @param todayLinkLabel today link label * @since 8.0.4 */ public void setTodayLinkLabel(String todayLinkLabel) { if (!Objects.equals(_todayLinkLabel, todayLinkLabel)) { _todayLinkLabel = todayLinkLabel; smartUpdate("todayLinkLabel", todayLinkLabel); } }
/** Assigns a value to this component. * @param value the date to assign. If null, today is assumed. */ public void setValue(Date value) { if (value == null) value = Dates.today(); if (!value.equals(_value)) { _value = value; smartUpdate("value", _value); } }
/** Sets the name of this component. * <p>The name is used only to work with "legacy" Web application that * handles user's request by servlets. * It works only with HTTP/HTML-based browsers. It doesn't work * with other kind of clients. * <p>Don't use this method if your application is purely based * on ZK's event-driven model. * * @param name the name of this component. * @since 3.0.0 */ public void setName(String name) { if (name != null && name.length() == 0) name = null; if (!Objects.equals(_name, name)) { _name = name; smartUpdate("name", _name); } }
public void setConstraint(Constraint constr) { if (!Objects.equals(_constraint, constr)) { _constraint = (SimpleDateConstraint) constr; smartUpdate("constraint", new JavaScriptValue(_constraint.getClientConstraint())); } }