/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id) { return forShortStyle(id, null); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, String dateStyle) { return forDateStyle(id, null, dateStyle); }
/** * Creates a new DateLabel using the provided converter. * * @param id * The id of the text field * @param converter * the date converter * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel withConverter(String id, DateConverter converter) { return withConverter(id, null, converter); }
/** * Creates a new DateLabel using the provided converter. * * @param id * The id of the text field * @param model * The model * @param converter * the date converter * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel withConverter(String id, IModel<Date> model, DateConverter converter) { return new DateLabel(id, model, converter); }
public static void main(String[] args) { JFrame wnd = new JFrame("DateLabel Test"); wnd.setLocation(200, 200); wnd.setSize(300, 300); wnd.setLayout(null); wnd.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); DateLabel lblDate1 = new DateLabel(24, 12, 2014, "dd.MM.yyyy"); lblDate1.setLocation(10, 10); lblDate1.setSize(100, 15); wnd.add(lblDate1); DateLabel lblDate2 = new DateLabel(24, 12, 2014, "MM/dd/yyyy"); lblDate2.setLocation(10, 30); lblDate2.setSize(100, 15); wnd.add(lblDate2); wnd.setVisible(true); lblDate2.setDay(lblDate1.getDay() + 7); } }
/** * {@inheritDoc} */ @Override public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { String s = getDefaultModelObjectAsString(); if (before != null) { s = before + s; } if (after != null) { s = s + after; } replaceComponentTagBody(markupStream, openTag, s); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param datePattern * The pattern to use. Must be not null. See {@link SimpleDateFormat} for available * patterns. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDatePattern(String id, String datePattern) { return forDatePattern(id, null, datePattern); }
@Override protected void onBeforeRender() { super.onBeforeRender(); boolean refreshGroupVisible = !(getBreadCrumbBar().getActive() instanceof PanelPluginPanel); refreshGroup.setVisible(refreshGroupVisible); if (refreshGroupVisible) { lastRefreshDateLabel.setDefaultModel(Model.of(new Date())); } }
/** * Creates a new DateLabel using the provided converter. * * @param id * The id of the text field * @param model * The model * @param converter * the date converter * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel withConverter(String id, IModel<Date> model, DateConverter converter) { return new DateLabel(id, model, converter); }
/** * {@inheritDoc} */ @Override public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { String s = getDefaultModelObjectAsString(); if (before != null) { s = before + s; } if (after != null) { s = s + after; } replaceComponentTagBody(markupStream, openTag, s); }
/** * Creates a new DateLabel using the provided converter. * * @param id * The id of the text field * @param converter * the date converter * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel withConverter(String id, DateConverter converter) { return withConverter(id, null, converter); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param datePattern * The pattern to use. Must be not null. See {@link SimpleDateFormat} for available * patterns. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDatePattern(String id, String datePattern) { return forDatePattern(id, null, datePattern); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id) { return forShortStyle(id, null); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, String dateStyle) { return forDateStyle(id, null, dateStyle); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id, IModel<Date> model) { return new DateLabel(id, model, new StyleDateConverter(true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id, IModel<Date> model) { return new DateLabel(id, model, new StyleDateConverter(true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param datePattern * The pattern to use. Must be not null. See {@link SimpleDateFormat} for available * patterns. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDatePattern(String id, IModel<Date> model, String datePattern) { return new DateLabel(id, model, new PatternDateConverter(datePattern, true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param datePattern * The pattern to use. Must be not null. See {@link SimpleDateFormat} for available * patterns. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDatePattern(String id, IModel<Date> model, String datePattern) { return new DateLabel(id, model, new PatternDateConverter(datePattern, true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateLabel(id, model, new StyleDateConverter(dateStyle, true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateLabel(id, model, new StyleDateConverter(dateStyle, true)); }