Commit 06fadf6f authored by Jeroen Hoffman's avatar Jeroen Hoffman

CMS-11068 [back port to 11.2] non-functional: (mostly) add @deprecated Javadoc

(cherry picked from commit 827f5dad)
parent d4bc885f
......@@ -27,6 +27,9 @@ import org.apache.wicket.model.IModel;
/**
* Label component to render a date (year-month-day) of the {@link Date} object in GMT timezone.
*
* @deprecated no longer used because it uses a hardcoded GMT timezone, while user session time zone is to be used.
* Use DateTimeLabel instead.
*/
@Deprecated
public class GMTDateLabel extends ZonedDateLabel {
......
......@@ -30,6 +30,8 @@ import org.apache.wicket.model.IModel;
/**
* Label component that represents only the date (year-month-day) of the
* {@link ZonedDateTime} model object in current session locale format.
*
* @deprecated no longer used because it was only used by deprecated GMTDateLabel.
*/
@Deprecated
public class ZonedDateLabel extends Label {
......
/*
* Copyright 2008-2016 Hippo B.V. (http://www.onehippo.com)
* Copyright 2008-2018 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
......@@ -49,7 +49,6 @@ import java.util.TimeZone;
*
* @see YuiDatePickerSettings for all configuration options
*/
public class YuiDateTimeField extends DateTimeField {
public static final String DATE_LABEL = "date-label";
......@@ -65,18 +64,20 @@ public class YuiDateTimeField extends DateTimeField {
this(id, model, null);
}
public YuiDateTimeField(final String id, final IModel<Date> model, YuiDatePickerSettings settings) {
public YuiDateTimeField(final String id, final IModel<Date> model, final YuiDatePickerSettings settings) {
this(id, model, settings, false);
}
public YuiDateTimeField(final String id, final IModel<Date> model, YuiDatePickerSettings settings, final boolean hideTime) {
public YuiDateTimeField(final String id, final IModel<Date> model, final YuiDatePickerSettings settings, final boolean hideTime) {
super(id, model);
this.hideTime = hideTime;
if (settings == null) {
settings = new YuiDatePickerSettings();
settings.setLanguage(getLocale().getLanguage());
if (settings != null) {
this.settings = settings;
}
else {
this.settings = new YuiDatePickerSettings();
this.settings.setLanguage(getLocale().getLanguage());
}
this.settings = settings;
setOutputMarkupId(true);
......@@ -139,13 +140,14 @@ public class YuiDateTimeField extends DateTimeField {
}
});
}
if (hideTime) {
// hiding the "hours" component hides the entire "hours" wicket:enclosure
get(HOURS).setVisibilityAllowed(false);
// hide the minutes field to prevent wicket.ajax javascript errors
get(MINUTES).setVisibilityAllowed(false);
}
this.hideTime = hideTime;
}
private int calculateDateLength() {
......
......@@ -22,6 +22,9 @@ import org.apache.wicket.model.IModel;
/**
* The component to represent only the date section of the {@link Date} object value in GMT timezone.
*
* @deprecated no longer used because it uses a hardcoded GMT timezone, while user session time zone is to be used.
* Use YuiDateTimeField instead.
*/
@Deprecated
public class YuiGMTDateField extends YuiDateTimeField {
......
......@@ -23,7 +23,6 @@ import org.apache.wicket.model.IModel;
import org.hippoecm.frontend.plugin.IPluginContext;
import org.hippoecm.frontend.plugin.config.IPluginConfig;
import org.hippoecm.frontend.plugins.standards.datetime.DateTimeLabel;
import org.hippoecm.frontend.plugins.standards.datetime.GMTDateLabel;
import org.hippoecm.frontend.plugins.yui.datetime.DateFieldWidget;
import org.hippoecm.frontend.model.properties.MapEmptyDateToNullModel;
import org.hippoecm.frontend.service.IEditor.Mode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment