From d92e2302ba5e46df1d65ac880eee3ce217ef0520 Mon Sep 17 00:00:00 2001 From: Thomas Gutmann Date: Fri, 7 Jul 2023 20:52:00 +0200 Subject: [PATCH 1/2] WebViewer, enhance parameter display options with date picker (#1356) --- .../designer/util/FormatDateTimePattern.java | 50 +++++-- .../ui/preview/parameter/FormatUtil.java | 2 +- .../internal/ui/dialogs/FormatAdapter.java | 3 +- .../ui/dialogs/FormatChangeEvent.java | 6 + .../ui/dialogs/FormatDateTimeAdapter.java | 60 ++++++--- .../ui/dialogs/FormatDateTimeLayoutPeer.java | 85 +++++++----- .../ui/dialogs/FormatDateTimePage.java | 9 +- .../dialogs/FormatDateTimePreferencePage.java | 4 +- .../ui/dialogs/CascadingParametersDialog.java | 6 +- .../ui/dialogs/InputParameterDialog.java | 4 +- .../designer/ui/dialogs/ParameterDialog.java | 4 +- .../designer/ui/parameters/ParameterUtil.java | 2 +- .../birt/core/format/DateFormatter.java | 124 +++++++++++------- .../api/script/element/ElementTest.java | 4 +- .../api/ParameterValidationUtilTest.java | 32 ++--- .../report/model/api/StyleHandleTest.java | 4 +- .../report/model/parser/StyleParseTest.java | 2 +- .../api/elements/DesignChoiceConstants.java | 56 +++++--- .../structures/DateTimeFormatValue.java | 1 - .../api/util/ParameterValidationUtil.java | 2 +- .../birt/report/model/elements/rom.def | 8 +- .../report/model/i18n/Messages.properties | 6 + .../model/APISamples/ProjectAnalysis.java | 6 +- .../tests/model/APISamples/Sample2.java | 6 +- .../tests/model/api/DynamicParameterTest.java | 4 +- .../service/BirtViewerReportService.java | 5 +- .../service/api/ParameterDefinition.java | 10 +- .../eclipse/birt/report/utility/DataUtil.java | 2 +- .../birt/index.jsp | 2 +- .../ajax/ui/dialog/BirtParameterDialog.js | 5 +- .../birt/pages/layout/FramesetFragment.jsp | 3 +- .../parameter/TextBoxParameterFragment.jsp | 40 +++++- .../birt/webcontent/birt/styles/style.css | 8 +- .../ui/editors/model/CrosstabAdaptUtil.java | 4 +- .../internal/ui/util/CrosstabUIHelper.java | 2 +- 35 files changed, 376 insertions(+), 195 deletions(-) diff --git a/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/FormatDateTimePattern.java b/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/FormatDateTimePattern.java index c8f667afca8..9bd391939c4 100644 --- a/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/FormatDateTimePattern.java +++ b/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/util/FormatDateTimePattern.java @@ -98,7 +98,7 @@ public static String getCustormFormatPattern(String custormCategory, ULocale loc } /** - * Retrieves format pattern from arrays given format type categorys. + * Retrieves format pattern from arrays given format type categories. * * @param category Given format type category. * @return The corresponding format pattern string. @@ -106,27 +106,53 @@ public static String getCustormFormatPattern(String custormCategory, ULocale loc public static String getPatternForCategory(String category) { String pattern; - if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE.equals(category) + if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE.equals(category) || DesignChoiceConstants.DATE_FORMAT_TYPE_GENERAL_DATE.equals(category)) { pattern = "General Date"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE.equals(category) - || DesignChoiceConstants.DATE_FORMAT_TYPE_LONG_DATE.equals(category)) { + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE.equals(category) + || DesignChoiceConstants.DATE_FORMAT_TYPE_LONG_DATE.equals(category) + ) { pattern = "Long Date"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE.equals(category) - || DesignChoiceConstants.DATE_FORMAT_TYPE_MUDIUM_DATE.equals(category)) { + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE.equals(category) + || DesignChoiceConstants.DATE_FORMAT_TYPE_MEDIUM_DATE.equals(category) + ) { pattern = "Medium Date"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE.equals(category) + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE.equals(category) || DesignChoiceConstants.DATE_FORMAT_TYPE_SHORT_DATE.equals(category)) { pattern = "Short Date"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME.equals(category) + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME.equals(category) || DesignChoiceConstants.TIME_FORMAT_TYPE_LONG_TIME.equals(category)) { pattern = "Long Time"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME.equals(category) - || DesignChoiceConstants.TIME_FORMAT_TYPE_MEDIUM_TIME.equals(category)) { + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME.equals(category) + || DesignChoiceConstants.TIME_FORMAT_TYPE_MEDIUM_TIME.equals(category) + ) { pattern = "Medium Time"; //$NON-NLS-1$ - } else if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME.equals(category) - || DesignChoiceConstants.TIME_FORMAT_TYPE_SHORT_TIME.equals(category)) { + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME.equals(category) + || DesignChoiceConstants.TIME_FORMAT_TYPE_SHORT_TIME.equals(category) + ) { pattern = "Short Time"; //$NON-NLS-1$ + + } else if (DesignChoiceConstants.TIME_FORMAT_TYPE_TIME_PICKER_SHORT_TIME.equals(category)) { + pattern = "HH:mm"; //$NON-NLS-1$ + + } else if (DesignChoiceConstants.TIME_FORMAT_TYPE_TIME_PICKER_MEDIUM_TIME.equals(category)) { + pattern = "HH:mm:ss"; //$NON-NLS-1$ + + } else if (DesignChoiceConstants.DATE_FORMAT_TYPE_DATE_PICKER.equals(category) + || DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_PICKER.equals(category)) { + pattern = "yyyy-MM-dd"; //$NON-NLS-1$ + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_SHORT_TIME.equals(category)) { + pattern = "yyyy-MM-dd HH:mm"; //$NON-NLS-1$ + + } else if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_MEDIUM_TIME.equals(category)) { + pattern = "yyyy-MM-dd HH:mm:ss"; //$NON-NLS-1$ + } else { // default, unformatted. pattern = ""; //$NON-NLS-1$ diff --git a/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/parameter/FormatUtil.java b/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/parameter/FormatUtil.java index 19c77c3eda5..4d86d088569 100644 --- a/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/parameter/FormatUtil.java +++ b/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/parameter/FormatUtil.java @@ -42,7 +42,7 @@ public class FormatUtil { private static boolean isCustom(String formatCategory) { if (DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM.equals(formatCategory) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM.equals(formatCategory) - || DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals(formatCategory)) { + || DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM.equals(formatCategory)) { return true; } return false; diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatAdapter.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatAdapter.java index ff5aabecbe9..8fb90bae3b0 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatAdapter.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatAdapter.java @@ -49,9 +49,8 @@ public abstract class FormatAdapter { public static String getLocaleDisplayName(ULocale locale) { if (locale == null) { return NONE; - } else { - return locale.getDisplayName(); } + return locale.getDisplayName(); } public static String[] getLocaleDisplayNames() { diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatChangeEvent.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatChangeEvent.java index f7a084bd197..8df83434c06 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatChangeEvent.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatChangeEvent.java @@ -51,6 +51,7 @@ public class FormatChangeEvent extends EventObject { * null) * @param newCategory the new category of the format * @param newPattern the new pattern of the format + * @param newLocale */ public FormatChangeEvent(Object source, String name, String newCategory, String newPattern, String newLocale) { super(source); @@ -61,6 +62,11 @@ public FormatChangeEvent(Object source, String name, String newCategory, String this.locale = newLocale; } + /** + * Get the locale + * + * @return Return the locale + */ public String getLocale() { return locale; } diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeAdapter.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeAdapter.java index dbe50ef7287..c8b562c5e99 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeAdapter.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeAdapter.java @@ -23,6 +23,7 @@ import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; import org.eclipse.birt.report.model.api.elements.structures.DateFormatValue; import org.eclipse.birt.report.model.api.elements.structures.DateTimeFormatValue; +import org.eclipse.birt.report.model.api.elements.structures.FormatValue; import org.eclipse.birt.report.model.api.elements.structures.TimeFormatValue; import com.ibm.icu.util.ULocale; @@ -32,15 +33,15 @@ */ public final class FormatDateTimeAdapter extends FormatAdapter { - private static final String[] DATETIME_FORMAT_TYPES = { DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME }; + private static final String[] DATETIME_FORMAT_TYPES = { DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, + DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, + DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE, + DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE, DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME, + DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME, + DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME }; private static final String[] DATE_FORMAT_TYPES = { DesignChoiceConstants.DATE_FORMAT_TYPE_GENERAL_DATE, - DesignChoiceConstants.DATE_FORMAT_TYPE_LONG_DATE, DesignChoiceConstants.DATE_FORMAT_TYPE_MUDIUM_DATE, + DesignChoiceConstants.DATE_FORMAT_TYPE_LONG_DATE, DesignChoiceConstants.DATE_FORMAT_TYPE_MEDIUM_DATE, DesignChoiceConstants.DATE_FORMAT_TYPE_SHORT_DATE }; private static final String[] TIME_FORMAT_TYPES = { DesignChoiceConstants.TIME_FORMAT_TYPE_LONG_TIME, @@ -56,6 +57,11 @@ public final class FormatDateTimeAdapter extends FormatAdapter { private String[] formatTypes = null; + /** + * Constructor + * + * @param type date time type + */ public FormatDateTimeAdapter(int type) { this.type = type; init(); @@ -64,10 +70,9 @@ public FormatDateTimeAdapter(int type) { private void init() { switch (type) { case FormatBuilder.DATETIME: - UNFORMATTED_DISPLAYNAME = DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED; - CUSTOM = DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM; + UNFORMATTED_DISPLAYNAME = DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED; + CUSTOM = DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM; UNFORMATTED_NAME = DateFormatter.DATETIME_UNFORMATTED; - break; case FormatBuilder.DATE: UNFORMATTED_DISPLAYNAME = DesignChoiceConstants.DATE_FORMAT_TYPE_UNFORMATTED; @@ -82,6 +87,11 @@ private void init() { } } + /** + * Method to return the date time format types + * + * @return Return the date time format types + */ public String[] getSimpleDateTimeFormatTypes() { if (type == FormatBuilder.DATETIME) { return DATETIME_FORMAT_TYPES; @@ -96,19 +106,21 @@ public String[] getSimpleDateTimeFormatTypes() { /** * Returns the choiceArray of this choice element from model. + * + * @return Return the choiceArray of this choice element from model. */ public String[][] getFormatTypeChoiceSet() { String structName, property; if (type == FormatBuilder.DATETIME) { structName = DateTimeFormatValue.FORMAT_VALUE_STRUCT; - property = DateTimeFormatValue.CATEGORY_MEMBER; + property = FormatValue.CATEGORY_MEMBER; } else if (type == FormatBuilder.DATE) { structName = DateFormatValue.FORMAT_VALUE_STRUCT; - property = DateFormatValue.CATEGORY_MEMBER; + property = FormatValue.CATEGORY_MEMBER; } else { structName = TimeFormatValue.FORMAT_VALUE_STRUCT; - property = TimeFormatValue.CATEGORY_MEMBER; + property = FormatValue.CATEGORY_MEMBER; } return getChoiceArray(structName, property); @@ -121,15 +133,15 @@ public String[][] initChoiceArray() { case FormatBuilder.DATETIME: default: categoryChoiceArray = getChoiceArray(DateTimeFormatValue.FORMAT_VALUE_STRUCT, - DateTimeFormatValue.CATEGORY_MEMBER); + FormatValue.CATEGORY_MEMBER); break; case FormatBuilder.DATE: categoryChoiceArray = getChoiceArray(DateFormatValue.FORMAT_VALUE_STRUCT, - DateFormatValue.CATEGORY_MEMBER); + FormatValue.CATEGORY_MEMBER); break; case FormatBuilder.TIME: categoryChoiceArray = getChoiceArray(TimeFormatValue.FORMAT_VALUE_STRUCT, - TimeFormatValue.CATEGORY_MEMBER); + FormatValue.CATEGORY_MEMBER); break; } } @@ -151,7 +163,7 @@ public String getCategory4DisplayName(String displayName) { @Override public String getDisplayName4Category(String category) { return ChoiceSetFactory.getStructDisplayName(DateTimeFormatValue.FORMAT_VALUE_STRUCT, - DateTimeFormatValue.CATEGORY_MEMBER, category); + FormatValue.CATEGORY_MEMBER, category); } @Override @@ -162,7 +174,8 @@ public String[] getFormatTypes(ULocale locale) { for (int i = 0; i < categoryChoiceArray.length; i++) { String fmtStr = ""; //$NON-NLS-1$ String category = categoryChoiceArray[i][1]; - if (category.equals(CUSTOM) || category.equals(UNFORMATTED_DISPLAYNAME)) { + if (category.equals(CUSTOM) || category.equals(UNFORMATTED_DISPLAYNAME) + || category.startsWith("Date Picker") || category.startsWith("Time Picker")) { fmtStr = categoryChoiceArray[i][0]; } else { // uses UI specified display names. @@ -194,18 +207,27 @@ public int getIndexOfCategory(String category) { @Override public String getPattern4DisplayName(String displayName, ULocale locale) { String category = ChoiceSetFactory.getStructPropValue(DateTimeFormatValue.FORMAT_VALUE_STRUCT, - DateTimeFormatValue.CATEGORY_MEMBER, displayName); + FormatValue.CATEGORY_MEMBER, displayName); return FormatDateTimePattern.getPatternForCategory(category); } + /** + * @return + */ public String getUnformattedCategoryDisplayName() { return UNFORMATTED_DISPLAYNAME; } + /** + * @return + */ public String getCustomCategoryName() { return CUSTOM; } + /** + * @return + */ public String getUnformattedCategoryName() { return UNFORMATTED_NAME; } diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeLayoutPeer.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeLayoutPeer.java index 69a32429b70..41efb5c15a0 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeLayoutPeer.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimeLayoutPeer.java @@ -25,16 +25,15 @@ import org.eclipse.birt.report.designer.internal.ui.swt.custom.FormWidgetFactory; import org.eclipse.birt.report.designer.nls.Messages; import org.eclipse.birt.report.designer.util.FormatDateTimePattern; -import org.eclipse.birt.report.model.api.StyleHandle; import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants; import org.eclipse.birt.report.model.api.util.StringUtil; +import org.eclipse.birt.report.model.elements.interfaces.IStyleModel; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.TableColumn; @@ -68,6 +67,14 @@ public class FormatDateTimeLayoutPeer extends FormatLayoutPeer { private String defaultPreviewText = new DateFormatter(ENTER_DATE_TIME_GUIDE_FORMAT, ULocale.getDefault()) .format(defaultDate); + /** + * Constructor + * + * @param dateTimeType + * @param pageAlignment + * @param isFormStyle + * @param showLocale + */ public FormatDateTimeLayoutPeer(int dateTimeType, int pageAlignment, boolean isFormStyle, boolean showLocale) { super(pageAlignment, isFormStyle, showLocale); @@ -76,30 +83,42 @@ public FormatDateTimeLayoutPeer(int dateTimeType, int pageAlignment, boolean isF @Override protected void fireFormatChanged(String newCategory, String newPattern, String newLocale) { - fireFormatChanged(StyleHandle.DATE_TIME_FORMAT_PROP, newCategory, newPattern, newLocale); + fireFormatChanged(IStyleModel.DATE_TIME_FORMAT_PROP, newCategory, newPattern, newLocale); } @Override protected void createCategoryPages(Composite parent) { categoryPageMaps = new HashMap<>(); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_PICKER, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_SHORT_TIME, + getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_MEDIUM_TIME, + getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME, getGeneralPage(parent)); + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE, getGeneralPage(parent)); - categoryPageMaps.put(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM, + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME, getGeneralPage(parent)); + + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME, getGeneralPage(parent)); + + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME, getGeneralPage(parent)); + + categoryPageMaps.put(DesignChoiceConstants.TIME_FORMAT_TYPE_TIME_PICKER_MEDIUM_TIME, getGeneralPage(parent)); + + categoryPageMaps.put(DesignChoiceConstants.TIME_FORMAT_TYPE_TIME_PICKER_SHORT_TIME, getGeneralPage(parent)); + + categoryPageMaps.put(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM, getCustomPage(parent, true, LABEL_CUSTOM_PREVIEW_DATETIME)); } @@ -319,60 +338,60 @@ private String[][] getTableItems(ULocale locale) { List itemList = new ArrayList<>(); String[][] items = { new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME), locale) .getFormatCode() }, new String[] { - formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME), + formatAdapter.getDisplayName4Category(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME), locale) .format(defaultDate), new DateFormatter(FormatDateTimePattern - .getPatternForCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME), locale) + .getPatternForCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME), locale) .getFormatCode() } }; itemList.addAll(Arrays.asList(items)); String[] customPatterns = FormatDateTimePattern.getCustormPatternCategorys(); diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java index 11b921d73e9..8713dca2c56 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePage.java @@ -25,12 +25,12 @@ public class FormatDateTimePage extends FormatPage { /** * Constructs a page for formatting date time, default aligns the page - * virtically. + * vertically. * * @param parent The container + * @param type * @param style The style of the page */ - public FormatDateTimePage(Composite parent, int type, int style) { this(parent, type, style, PAGE_ALIGN_VIRTICAL, true); } @@ -39,11 +39,12 @@ public FormatDateTimePage(Composite parent, int type, int style) { * Constructs a page for formatting date time. * * @param parent The container + * @param type * @param style The style of the page - * @param pageAlignment Aligns the page virtically(PAGE_ALIGN_VIRTICAL) or + * @param pageAlignment Aligns the page vertically(PAGE_ALIGN_VIRTICAL) or * horizontally(PAGE_ALIGN_HORIZONTAL). + * @param showLocale */ - public FormatDateTimePage(Composite parent, int type, int style, int pageAlignment, boolean showLocale) { super(parent, style); diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePreferencePage.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePreferencePage.java index 17577be484c..19c818e5132 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePreferencePage.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/FormatDateTimePreferencePage.java @@ -71,6 +71,8 @@ private void setPreferenceName(String name) { /** * Gets the preference name. + * + * @return Return the preference name */ public String getPreferenceName() { return name; @@ -125,7 +127,7 @@ public boolean performOk() { /** * Stores the result pattern string into Preference Store. * - * @return + * @return Return the result pattern string into Preference Store. */ protected boolean doStore() { if (formatPage == null || !formatPage.isFormatModified() || !formatPage.isDirty()) { diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/CascadingParametersDialog.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/CascadingParametersDialog.java index 432a9fcd1db..6530a1423bf 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/CascadingParametersDialog.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/CascadingParametersDialog.java @@ -2000,7 +2000,7 @@ private void initFormatField(String selectedDataType) { if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(selectedDataType)) { formatCategroy = choiceSet.findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(selectedDataType)) { - formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED).getName(); + formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_DATE.equals(selectedDataType)) { formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATE_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_TIME.equals(selectedDataType)) { @@ -2156,7 +2156,7 @@ private void updateFormatField() { private boolean isCustom() { if (DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM.equals(formatCategroy) - || DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals(formatCategroy) + || DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.DATE_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.TIME_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY.equals(formatCategroy)) { @@ -2172,7 +2172,7 @@ private void doPreview(String pattern, ULocale locale) { if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) { formatStr = new StringFormatter(pattern, locale).format(DEFAULT_PREVIEW_STRING); } else if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) { - pattern = pattern.equals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED) + pattern = pattern.equals(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATETIME_UNFORMATTED : pattern; formatStr = new DateFormatter(pattern, locale).format(new Date()); diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/InputParameterDialog.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/InputParameterDialog.java index 97ece9c0146..32b99c076cc 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/InputParameterDialog.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/InputParameterDialog.java @@ -495,7 +495,7 @@ protected String formatString(String str, ScalarParameter para) { if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) { formatStr = new StringFormatter(formatPattern, formatLocale).format(str); } else if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) { - formatPattern = formatPattern.equals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED) + formatPattern = formatPattern.equals(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATETIME_UNFORMATTED : formatPattern; formatStr = new DateFormatter(formatPattern, formatLocale).format((Date) para.converToDataType(str)); @@ -558,7 +558,7 @@ private ULocale cvonvertFormatLocale(ScalarParameterHandle paraHandle) { private boolean isCustom(String formatCategroy) { if (DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM.equals(formatCategroy) - || DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals(formatCategroy) + || DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.DATE_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.TIME_FORMAT_TYPE_CUSTOM.equals(formatCategroy) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY.equals(formatCategroy)) { diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ParameterDialog.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ParameterDialog.java index d02970c18e2..d78dceb2762 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ParameterDialog.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/dialogs/ParameterDialog.java @@ -1288,7 +1288,7 @@ private void initFormatField() { if (DesignChoiceConstants.PARAM_TYPE_STRING.equals(type)) { formatCategroy = choiceSet.findChoice(DesignChoiceConstants.STRING_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equals(type)) { - formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED).getName(); + formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_DATE.equals(type)) { formatCategroy = choiceSet.findChoice(DesignChoiceConstants.DATE_FORMAT_TYPE_UNFORMATTED).getName(); } else if (DesignChoiceConstants.PARAM_TYPE_TIME.equals(type)) { @@ -3416,7 +3416,7 @@ private void updateFormatField() { if (type.equals(DesignChoiceConstants.PARAM_TYPE_DATETIME)) { previewString = new DateFormatter(ParameterUtil.isCustomCategory(formatCategroy) ? formatPattern - : (formatCategroy.equals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED) + : (formatCategroy.equals(DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED) ? DateFormatter.DATETIME_UNFORMATTED : formatCategroy), locale).format(new Date()); diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/parameters/ParameterUtil.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/parameters/ParameterUtil.java index 8dfed9489e7..cdc0dc7425a 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/parameters/ParameterUtil.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/parameters/ParameterUtil.java @@ -53,7 +53,7 @@ private ParameterUtil() { public static boolean isCustomCategory(String formatCategory) { if (DesignChoiceConstants.STRING_FORMAT_TYPE_CUSTOM.equals(formatCategory) || DesignChoiceConstants.NUMBER_FORMAT_TYPE_CUSTOM.equals(formatCategory) - || DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM.equals(formatCategory) + || DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM.equals(formatCategory) || DesignChoiceConstants.DATE_FORMAT_TYPE_CUSTOM.equals(formatCategory) || DesignChoiceConstants.TIME_FORMAT_TYPE_CUSTOM.equals(formatCategory)) { return true; diff --git a/core/org.eclipse.birt.core/src/org/eclipse/birt/core/format/DateFormatter.java b/core/org.eclipse.birt.core/src/org/eclipse/birt/core/format/DateFormatter.java index 621b3d4e5d2..bedfb09b59c 100644 --- a/core/org.eclipse.birt.core/src/org/eclipse/birt/core/format/DateFormatter.java +++ b/core/org.eclipse.birt.core/src/org/eclipse/birt/core/format/DateFormatter.java @@ -16,10 +16,10 @@ import java.text.ParseException; import java.util.Date; -import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; +import com.ibm.icu.text.DateFormat; import com.ibm.icu.text.SimpleDateFormat; import com.ibm.icu.util.TimeZone; import com.ibm.icu.util.ULocale; @@ -36,8 +36,11 @@ public class DateFormatter implements IFormatter { private static final String UNFORMATTED = "Unformatted"; + /** property: date time unformatted */ public static final String DATETIME_UNFORMATTED = "DateTime" + UNFORMATTED; + /** property: date unformatted */ public static final String DATE_UNFORMATTED = "Date" + UNFORMATTED; + /** property: time unformatted */ public static final String TIME_UNFORMATTED = "Time" + UNFORMATTED; /** @@ -67,18 +70,23 @@ public class DateFormatter implements IFormatter { static protected Logger logger = Logger.getLogger(DateFormatter.class.getName()); /** - * constuctor method with no paremeter + * Constructor method with no parameter */ public DateFormatter() { this(null, null, null); } + /** + * Constructor + * + * @param timeZone + */ public DateFormatter(TimeZone timeZone) { this(null, null, timeZone); } /** - * constuctor method with String parameter + * Constructor method with String parameter * * @param pattern */ @@ -87,7 +95,7 @@ public DateFormatter(String pattern) { } /** - * constuctor method with Locale parameters + * Constructor method with Locale parameters * * @param localeLoc */ @@ -95,21 +103,18 @@ public DateFormatter(ULocale localeLoc) { this(null, localeLoc, null); } - public DateFormatter(ULocale localeLoc, TimeZone timeZone) { - this(null, localeLoc, timeZone); - } - /** - * @deprecated since 2.1 - * @return + * Constructor + * + * @param localeLoc + * @param timeZone */ - @Deprecated - public DateFormatter(Locale localeLoc) { - this(null, ULocale.forLocale(localeLoc), null); + public DateFormatter(ULocale localeLoc, TimeZone timeZone) { + this(null, localeLoc, timeZone); } /** - * constuctor method with two parameters, one is String type while the other is + * Constructor method with two parameters, one is String type while the other is * Locale type * * @param pattern @@ -119,6 +124,13 @@ public DateFormatter(String pattern, ULocale localeLoc) { this(pattern, localeLoc, null); } + /** + * Constructor + * + * @param pattern pattern of date + * @param localeLoc local of date + * @param timeZone time zone of date + */ public DateFormatter(String pattern, ULocale localeLoc, TimeZone timeZone) { if (localeLoc != null) { locale = localeLoc; @@ -129,24 +141,20 @@ public DateFormatter(String pattern, ULocale localeLoc, TimeZone timeZone) { applyPattern(pattern); } - /** - * @deprecated since 2.1 - * @return - */ - @Deprecated - public DateFormatter(String pattern, Locale localeLoc) { - this(pattern, ULocale.forLocale(localeLoc)); - } - /** * get the string pattern * - * @return + * @return Return the string pattern */ public String getPattern() { return this.formatPattern; } + /** + * Method to set the date/time format string + * + * @param formatString + */ public void applyPattern(String formatString) { createPattern(formatString); @@ -167,7 +175,7 @@ public void applyPattern(String formatString) { * * @param dateformat * @param locale - * @return + * @return Return formatted date */ @SuppressWarnings("nls") private SimpleDateFormat toPredefinedPattern(SimpleDateFormat dateformat, ULocale locale) { @@ -185,6 +193,7 @@ private SimpleDateFormat toPredefinedPattern(SimpleDateFormat dateformat, ULocal */ @SuppressWarnings("nls") private void createPattern(String formatString) { + try { this.formatPattern = formatString; this.dateTimeFormat = null; @@ -336,37 +345,51 @@ private void createPattern(String formatString) { if (formatString.equals("Long Date")) { dateTimeFormat = com.ibm.icu.text.DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.LONG, locale); return; - } if (formatString.equals("Medium Date")) { dateTimeFormat = com.ibm.icu.text.DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.MEDIUM, locale); return; - } if (formatString.equals("Short Date")) { dateTimeFormat = com.ibm.icu.text.DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.SHORT, locale); return; - } if (formatString.equals("Long Time")) { dateTimeFormat = com.ibm.icu.text.DateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.LONG, locale); return; - } if (formatString.equals("Medium Time")) { dateTimeFormat = com.ibm.icu.text.DateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.MEDIUM, locale); return; - } if (formatString.equals("Short Time")) { dateTimeFormat = new SimpleDateFormat("kk:mm", locale); return; - } - dateTimeFormat = new SimpleDateFormat(formatString, locale); + if (formatString.equals("Date Picker")) { + dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd", locale); + return; + } + if (formatString.equals("Date Picker, Short Time")) { + dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm", locale); + return; + } + if (formatString.equals("Date Picker, Medium Time")) { + dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", locale); + return; + } + if (formatString.equals("Time Picker, Short Time")) { + dateTimeFormat = new SimpleDateFormat("HH:mm", locale); + return; + } + if (formatString.equals("Time Picker, Medium Time")) { + dateTimeFormat = new SimpleDateFormat("HH:mm:ss", locale); + return; + } + dateTimeFormat = new SimpleDateFormat(formatString, locale); } catch (Exception e) { logger.log(Level.WARNING, e.getMessage(), e); } @@ -429,9 +452,12 @@ private com.ibm.icu.text.DateFormat hackMilliSecond(com.ibm.icu.text.DateFormat return factoryFormat; } - /* + /** * transfer the format string pattern from msdn to the string pattern which java * can recognize + * + * @param date Date to recognize the format of Java + * @return Returns the analyst format of date */ public String format(Date date) { try { @@ -452,7 +478,9 @@ public String format(Date date) { } /** - * Returns format code according to format type and current locale + * Method to return format code according to format type and current locale + * + * @return Returns format code according to format type and current locale */ public String getFormatCode() { if (UNFORMATTED.equals(formatPattern) || DATETIME_UNFORMATTED.equals(formatPattern) @@ -463,13 +491,14 @@ public String getFormatCode() { SimpleDateFormat format = getFormatter(); if (format == null) { return ((SimpleDateFormat) dateFormat).toPattern(); - } else { - return format.toPattern(); } + return format.toPattern(); } /** - * Returns format code according to format type and current locale + * Method to return the format code according to format type and current locale + * + * @return Returns format code according to format type and current locale */ public String getLocalizedFormatCode() { if (UNFORMATTED.equals(formatPattern) || DATETIME_UNFORMATTED.equals(formatPattern) @@ -480,38 +509,39 @@ public String getLocalizedFormatCode() { SimpleDateFormat format = getFormatter(); if (format == null) { return ((SimpleDateFormat) dateFormat).toPattern(); - } else { - return format.toLocalizedPattern(); } + return format.toLocalizedPattern(); } /** - * Returns format code according to format type and current locale + * Method to return the format code according to format type and current locale + * + * @return Returns format code according to format type and current locale */ public SimpleDateFormat getFormatter() { SimpleDateFormat dateFormat = null; if (formatPattern.equals("General Date")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(com.ibm.icu.text.DateFormat.LONG, + dateFormat = (SimpleDateFormat) DateFormat.getDateTimeInstance(com.ibm.icu.text.DateFormat.LONG, com.ibm.icu.text.DateFormat.LONG, locale); } if (formatPattern.equals("Long Date")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.LONG, locale); + dateFormat = (SimpleDateFormat) DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.LONG, locale); } if (formatPattern.equals("Medium Date")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.MEDIUM, + dateFormat = (SimpleDateFormat) DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.MEDIUM, locale); - } if (formatPattern.equals("Short Date")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getDateInstance(com.ibm.icu.text.DateFormat.SHORT, locale); + dateFormat = (SimpleDateFormat) DateFormat.getDateInstance(com.ibm.icu.text.DateFormat.SHORT, locale); + } if (formatPattern.equals("Long Time")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.LONG, locale); + dateFormat = (SimpleDateFormat) DateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.LONG, locale); } if (formatPattern.equals("Medium Time")) { - dateFormat = (SimpleDateFormat) SimpleDateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.MEDIUM, + dateFormat = (SimpleDateFormat) DateFormat.getTimeInstance(com.ibm.icu.text.DateFormat.MEDIUM, locale); } if (formatPattern.equals("Short Time")) { diff --git a/engine/org.eclipse.birt.report.engine.tests/test/org/eclipse/birt/report/engine/api/script/element/ElementTest.java b/engine/org.eclipse.birt.report.engine.tests/test/org/eclipse/birt/report/engine/api/script/element/ElementTest.java index 14acc4bfa1d..7ae9cbdbbaa 100644 --- a/engine/org.eclipse.birt.report.engine.tests/test/org/eclipse/birt/report/engine/api/script/element/ElementTest.java +++ b/engine/org.eclipse.birt.report.engine.tests/test/org/eclipse/birt/report/engine/api/script/element/ElementTest.java @@ -872,8 +872,8 @@ public void testStyle() throws ScriptException { style.setDateTimeFormat(YY_MM_DD); assertEquals(YY_MM_DD, style.getDateTimeFormat()); - style.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE); - assertEquals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE, style.getDateTimeFormatCategory()); + style.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE); + assertEquals(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE, style.getDateTimeFormatCategory()); style.setDisplay(DesignChoiceConstants.DISPLAY_INLINE); assertEquals(DesignChoiceConstants.DISPLAY_INLINE, style.getDisplay()); diff --git a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/ParameterValidationUtilTest.java b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/ParameterValidationUtilTest.java index ec43cd77c95..d0eae9b98ff 100644 --- a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/ParameterValidationUtilTest.java +++ b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/ParameterValidationUtilTest.java @@ -177,13 +177,13 @@ public void testTime() throws Exception { String value1 = "12:30:31"; //$NON-NLS-1$ java.sql.Time date = (java.sql.Time) ParameterValidationUtil.validate(DesignChoiceConstants.PARAM_TYPE_TIME, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, value1); + DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, value1); assertEquals("12:30:31", date.toString());//$NON-NLS-1$ String value2 = "122a:30:31";//$NON-NLS-1$ try { ParameterValidationUtil.validate(DesignChoiceConstants.PARAM_TYPE_TIME, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, value2); + DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, value2); fail(); } catch (ValidationValueException e) { assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE, e.getErrorCode()); @@ -201,13 +201,13 @@ public void testDate() throws Exception { String value1 = "1998-09-13"; //$NON-NLS-1$ java.sql.Date date = (java.sql.Date) ParameterValidationUtil.validate(DesignChoiceConstants.PARAM_TYPE_DATE, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, value1); + DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, value1); assertEquals("1998-09-13", date.toString());//$NON-NLS-1$ String value2 = "1992a-123-12";//$NON-NLS-1$ try { ParameterValidationUtil.validate(DesignChoiceConstants.PARAM_TYPE_DATE, - DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, value2); + DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, value2); fail(); } catch (ValidationValueException e) { assertEquals(PropertyValueException.DESIGN_EXCEPTION_INVALID_VALUE, e.getErrorCode()); @@ -228,20 +228,20 @@ public void testDateTime() throws Exception { // date time String value1 = "1998-09-13 20:01:44"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_GENERAL_DATE, value1); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_GENERAL_DATE, value1); String value2 = "1998-09-13 00:00:00"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, value2); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, value2); String value3 = "1998-09-13 00:00:00"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE, value3); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE, value3); String value4 = "1998-09-13 00:00:00"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE, value4); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE, value4); String value5 = "1970-01-01 19:01:44"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_TIME, value5); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_TIME, value5); String value6 = "1970-01-01 20:01:44"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME, value6); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME, value6); String value7 = "1970-01-01 20:01:00"; //$NON-NLS-1$ - testDateTimeByFormat(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_TIME, value7); + testDateTimeByFormat(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_TIME, value7); } /** @@ -349,7 +349,7 @@ public void testGetDisplayValue() { Date dateValue = dateCal.getTime(); assertEquals("13 septembre 1998", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ - DesignChoiceConstants.PARAM_TYPE_DATETIME, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, + DesignChoiceConstants.PARAM_TYPE_DATETIME, DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, dateValue, ULocale.FRANCE)); // no format, then we display in (medium, short) pattern assertEquals("Sep 13, 1998 8:01 PM", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ @@ -359,11 +359,11 @@ public void testGetDisplayValue() { dateValue = new java.sql.Date(100, 0, 1); assertEquals("1 janvier 2000", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ - DesignChoiceConstants.PARAM_TYPE_DATE, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, dateValue, + DesignChoiceConstants.PARAM_TYPE_DATE, DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, dateValue, ULocale.FRANCE)); assertEquals("January 1, 2000", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ - DesignChoiceConstants.PARAM_TYPE_DATE, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, dateValue, + DesignChoiceConstants.PARAM_TYPE_DATE, DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, dateValue, ULocale.ENGLISH)); // no format @@ -374,11 +374,11 @@ public void testGetDisplayValue() { java.sql.Time timeValue = new java.sql.Time(14, 20, 30); assertEquals("2:20:30 PM", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ - DesignChoiceConstants.PARAM_TYPE_TIME, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME, + DesignChoiceConstants.PARAM_TYPE_TIME, DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME, timeValue, ULocale.ENGLISH).replace("\u202f", " ")); assertEquals("14:20:30", ParameterValidationUtil.getDisplayValue( //$NON-NLS-1$ - DesignChoiceConstants.PARAM_TYPE_TIME, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MEDIUM_TIME, + DesignChoiceConstants.PARAM_TYPE_TIME, DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_TIME, timeValue, ULocale.FRANCE)); // no format diff --git a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/StyleHandleTest.java b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/StyleHandleTest.java index ce27af79bdb..9ca58604a8d 100644 --- a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/StyleHandleTest.java +++ b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/StyleHandleTest.java @@ -243,7 +243,7 @@ public void testStyleProperties() throws SemanticException { styleHandle.setStringFormat("***"); //$NON-NLS-1$ assertEquals("***", styleHandle.getStringFormat()); //$NON-NLS-1$ - styleHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE); + styleHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_SHORT_DATE); styleHandle.setDateTimeFormat("MM/DD/YYYY"); //$NON-NLS-1$ assertEquals("MM/DD/YYYY", styleHandle.getDateTimeFormat()); //$NON-NLS-1$ @@ -395,7 +395,7 @@ public void testHighlightProperties() throws SemanticException { highlightHandle.setNumberFormatCategory(DesignChoiceConstants.NUMBER_FORMAT_TYPE_CURRENCY); highlightHandle.setNumberFormat("$000,000"); //$NON-NLS-1$ - highlightHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE); + highlightHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE); highlightHandle.setDateTimeFormat("mm dd, yyyy"); //$NON-NLS-1$ highlightHandle.setStringFormatCategory(DesignChoiceConstants.STRING_FORMAT_TYPE_UPPERCASE); diff --git a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/parser/StyleParseTest.java b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/parser/StyleParseTest.java index c48e7372db3..31dab95e93a 100644 --- a/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/parser/StyleParseTest.java +++ b/model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/parser/StyleParseTest.java @@ -725,7 +725,7 @@ public void testWriteHighlightRules() throws Exception { highlightHandle.setNumberFormat("$000,000");//$NON-NLS-1$ - highlightHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_MUDIUM_DATE); + highlightHandle.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_MEDIUM_DATE); highlightHandle.setDateTimeFormat("mm dd, yyyy"); //$NON-NLS-1$ try { diff --git a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java index 39aaaf5f9f7..ebd34cf53d7 100644 --- a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java +++ b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/DesignChoiceConstants.java @@ -1311,32 +1311,41 @@ public interface DesignChoiceConstants { /** design constant: choice datetime format type */ String CHOICE_DATETIME_FORMAT_TYPE = "dateTimeFormat"; //$NON-NLS-1$ - /** design constant: datetiem format type unformatted */ - String DATETIEM_FORMAT_TYPE_UNFORMATTED = "Unformatted"; //$NON-NLS-1$ + /** design constant: datetime format type unformatted */ + String DATETIME_FORMAT_TYPE_UNFORMATTED = "Unformatted"; //$NON-NLS-1$ - /** design constant: datetiem format type general date */ - String DATETIEM_FORMAT_TYPE_GENERAL_DATE = "General Date"; //$NON-NLS-1$ + /** design constant: datetime format type medium date */ + String DATETIME_FORMAT_TYPE_DATE_PICKER = "Date Picker"; //$NON-NLS-1$ - /** design constant: datetiem format type long date */ - String DATETIEM_FORMAT_TYPE_LONG_DATE = "Long Date"; //$NON-NLS-1$ + /** design constant: datetime format type medium date with short time */ + String DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_SHORT_TIME = "Date Picker, Short Time"; //$NON-NLS-1$ - /** design constant: datetiem format type mudium date */ - String DATETIEM_FORMAT_TYPE_MUDIUM_DATE = "Medium Date"; //$NON-NLS-1$ + /** design constant: datetime format type general date with medium time */ + String DATETIME_FORMAT_TYPE_DATE_TIME_PICKER_MEDIUM_TIME = "Date Picker, Medium Time"; //$NON-NLS-1$ - /** design constant: datetiem format type short date */ - String DATETIEM_FORMAT_TYPE_SHORT_DATE = "Short Date"; //$NON-NLS-1$ + /** design constant: datetime format type general date */ + String DATETIME_FORMAT_TYPE_GENERAL_DATE = "General Date"; //$NON-NLS-1$ - /** design constant: datetiem format type long time */ - String DATETIEM_FORMAT_TYPE_LONG_TIME = "Long Time"; //$NON-NLS-1$ + /** design constant: datetime format type long date */ + String DATETIME_FORMAT_TYPE_LONG_DATE = "Long Date"; //$NON-NLS-1$ - /** design constant: datetiem format type medium time */ - String DATETIEM_FORMAT_TYPE_MEDIUM_TIME = "Medium Time"; //$NON-NLS-1$ + /** design constant: datetime format type mudium date */ + String DATETIME_FORMAT_TYPE_MEDIUM_DATE = "Medium Date"; //$NON-NLS-1$ - /** design constant: datetiem format type short time */ - String DATETIEM_FORMAT_TYPE_SHORT_TIME = "Short Time"; //$NON-NLS-1$ + /** design constant: datetime format type short date */ + String DATETIME_FORMAT_TYPE_SHORT_DATE = "Short Date"; //$NON-NLS-1$ - /** design constant: datetiem format type custom */ - String DATETIEM_FORMAT_TYPE_CUSTOM = VALUE_FORMAT_TYPE_CUSTOM; + /** design constant: datetime format type long time */ + String DATETIME_FORMAT_TYPE_LONG_TIME = "Long Time"; //$NON-NLS-1$ + + /** design constant: datetime format type medium time */ + String DATETIME_FORMAT_TYPE_MEDIUM_TIME = "Medium Time"; //$NON-NLS-1$ + + /** design constant: datetime format type short time */ + String DATETIME_FORMAT_TYPE_SHORT_TIME = "Short Time"; //$NON-NLS-1$ + + /** design constant: datetime format type custom */ + String DATETIME_FORMAT_TYPE_CUSTOM = VALUE_FORMAT_TYPE_CUSTOM; /** @@ -1348,6 +1357,9 @@ public interface DesignChoiceConstants { /** design constant: date format type unformatted */ String DATE_FORMAT_TYPE_UNFORMATTED = "Unformatted"; //$NON-NLS-1$ + /** design constant: date format type general date */ + String DATE_FORMAT_TYPE_DATE_PICKER = "Date Picker"; //$NON-NLS-1$ + /** design constant: date format type general date */ String DATE_FORMAT_TYPE_GENERAL_DATE = "General Date"; //$NON-NLS-1$ @@ -1355,7 +1367,7 @@ public interface DesignChoiceConstants { String DATE_FORMAT_TYPE_LONG_DATE = "Long Date"; //$NON-NLS-1$ /** design constant: date format type mudium date */ - String DATE_FORMAT_TYPE_MUDIUM_DATE = "Medium Date"; //$NON-NLS-1$ + String DATE_FORMAT_TYPE_MEDIUM_DATE = "Medium Date"; //$NON-NLS-1$ /** design constant: date format type short date */ String DATE_FORMAT_TYPE_SHORT_DATE = "Short Date"; //$NON-NLS-1$ @@ -1370,6 +1382,12 @@ public interface DesignChoiceConstants { /** design constant: choice time format type */ String CHOICE_TIME_FORMAT_TYPE = "timeFormat"; //$NON-NLS-1$ + /** design constant: date format type general date */ + String TIME_FORMAT_TYPE_TIME_PICKER_SHORT_TIME = "Time Picker, Short Time"; //$NON-NLS-1$ + + /** design constant: date format type general date */ + String TIME_FORMAT_TYPE_TIME_PICKER_MEDIUM_TIME = "Time Picker, Medium Time"; //$NON-NLS-1$ + /** design constant: time format type long time */ String TIME_FORMAT_TYPE_LONG_TIME = "Long Time"; //$NON-NLS-1$ diff --git a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/structures/DateTimeFormatValue.java b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/structures/DateTimeFormatValue.java index 914c4b75d5d..2fd07c8fe1f 100644 --- a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/structures/DateTimeFormatValue.java +++ b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/elements/structures/DateTimeFormatValue.java @@ -28,7 +28,6 @@ public class DateTimeFormatValue extends FormatValue { /** * Name of this structure. Matches the definition in the meta-data dictionary. */ - public static final String FORMAT_VALUE_STRUCT = "DateTimeFormatValue"; //$NON-NLS-1$ @Override diff --git a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ParameterValidationUtil.java b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ParameterValidationUtil.java index b6258694105..50848f946c3 100644 --- a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ParameterValidationUtil.java +++ b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ParameterValidationUtil.java @@ -745,7 +745,7 @@ static public Object validate(String dataType, String format, String value, ULoc */ private static String transformDateFormat(String dataType, String format, Object value) { - if (DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED.equalsIgnoreCase(format)) { + if (DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED.equalsIgnoreCase(format)) { if (!StringUtil.isBlank(dataType)) { if (DesignChoiceConstants.PARAM_TYPE_DATE.equalsIgnoreCase(dataType)) { return DateFormatter.DATE_UNFORMATTED; diff --git a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/rom.def b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/rom.def index 969ab73a6e7..4445e5ed3eb 100644 --- a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/rom.def +++ b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/elements/rom.def @@ -428,6 +428,9 @@ + + + @@ -439,14 +442,17 @@ + - + + + diff --git a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/i18n/Messages.properties b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/i18n/Messages.properties index 104f33cd0b4..a668534beec 100644 --- a/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/i18n/Messages.properties +++ b/model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/i18n/Messages.properties @@ -478,6 +478,9 @@ Choices.columnAlign.right=right #59. dateTimeFormat Choices.dateTimeFormat.unformatted=Unformatted +Choices.dateTimeFormat.datePicker.mediumDate=Date Picker, Medium Date +Choices.dateTimeFormat.datePicker.shortTime=Date Picker, Short Time +Choices.dateTimeFormat.datePicker.mediumTime=Date Picker, Medium Time Choices.dateTimeFormat.generalDate=General Date Choices.dateTimeFormat.longDate=Long Date Choices.dateTimeFormat.mediumDate=Medium Date @@ -489,6 +492,7 @@ Choices.dateTimeFormat.custom=Custom #59. dateFormat Choices.dateFormat.unformatted=Unformatted +Choices.dateFormat.datePicker.mediumDate=Date Picker, Medium Date Choices.dateFormat.generalDate=General Date Choices.dateFormat.longDate=Long Date Choices.dateFormat.mediumDate=Medium Date @@ -497,6 +501,8 @@ Choices.dateFormat.custom=Custom #59. timeFormat Choices.timeFormat.unformatted=Unformatted +Choices.timeFormat.timePicker.shortTime=Time Picker, Short Time +Choices.timeFormat.timePicker.mediumTime=Time Picker, Medium Time Choices.timeFormat.longTime=Long Time Choices.timeFormat.mediumTime=Medium Time Choices.timeFormat.shortTime=Short Time diff --git a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/ProjectAnalysis.java b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/ProjectAnalysis.java index 9abf17de26d..dddb497001f 100644 --- a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/ProjectAnalysis.java +++ b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/ProjectAnalysis.java @@ -208,7 +208,7 @@ void buildStyles() throws SemanticException { StyleHandle style4 = elementFactory.newStyle("Date"); style4.setDateTimeFormat("MM-dd-yyyy"); - style4.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + style4.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); designHandle.getStyles().add(style1); designHandle.getStyles().add(style2); @@ -644,7 +644,7 @@ void buildBodyGrid() throws SemanticException { row4Cell4Data.setStyleName("Date"); row4Cell4Data.setProperty(StyleHandle.FONT_FAMILY_PROP, "Georgia"); row4Cell4Data.setProperty(StyleHandle.FONT_SIZE_PROP, DesignChoiceConstants.FONT_SIZE_SMALLER); - row4Cell4Data.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + row4Cell4Data.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); row4Cell4Data.getPrivateStyle().setDateTimeFormat("$###,###.00"); row4Cell4Data.setValueExpr("row[\"Value\"]"); @@ -708,7 +708,7 @@ void buildBodyGrid() throws SemanticException { row5Cell4Data.setStyleName("Date"); row5Cell4Data.setProperty(StyleHandle.FONT_FAMILY_PROP, "Georgia"); row5Cell4Data.setProperty(StyleHandle.FONT_SIZE_PROP, DesignChoiceConstants.FONT_SIZE_SMALLER); - row5Cell4Data.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + row5Cell4Data.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); row5Cell4Data.getPrivateStyle().setDateTimeFormat("$###,###.00"); row5Cell4Data.setValueExpr("row[\"Billing\"]"); diff --git a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/Sample2.java b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/Sample2.java index 47a82825aaf..0d2b5ac3331 100644 --- a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/Sample2.java +++ b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/APISamples/Sample2.java @@ -816,17 +816,17 @@ void buildTheme() throws SemanticException { // style "year" SharedStyleHandle year = libraryFactory.newStyle("year"); year.setDateTimeFormat("yyyy"); - year.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + year.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); // style "Month" SharedStyleHandle month = libraryFactory.newStyle("month"); month.setDateTimeFormat("MM"); - month.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + month.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); // style "day" SharedStyleHandle day = libraryFactory.newStyle("day"); day.setDateTimeFormat("dd"); - day.setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + day.setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); // style "TransactionType" SharedStyleHandle transaction = libraryFactory.newStyle("TransactionType"); diff --git a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/api/DynamicParameterTest.java b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/api/DynamicParameterTest.java index 19333db46da..a82ff4bd3ed 100644 --- a/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/api/DynamicParameterTest.java +++ b/testsuites/org.eclipse.birt.report.tests.model/src/org/eclipse/birt/report/tests/model/api/DynamicParameterTest.java @@ -104,8 +104,8 @@ public void testPropertiesOfDynamicParameter() throws Exception { handle.setDefaultValue("10/15/2005"); assertEquals("10/15/2005", handle.getDefaultValue()); - handle.setCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE); - assertEquals(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_LONG_DATE, handle.getCategory()); + handle.setCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE); + assertEquals(DesignChoiceConstants.DATETIME_FORMAT_TYPE_LONG_DATE, handle.getCategory()); handle.setListlimit(20); assertEquals(20, handle.getListlimit()); diff --git a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java index f24fe0fed95..6cf1dc90358 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java +++ b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java @@ -1082,6 +1082,8 @@ private static ParameterDefinition convertScalarParameter(IScalarParameterDefn e long id = scalarParamHandle != null ? scalarParamHandle.getID() : 0L; String pattern = scalarParamHandle == null ? "" //$NON-NLS-1$ : scalarParamHandle.getPattern(); + String category = scalarParamHandle == null ? "" //$NON-NLS-1$ + : scalarParamHandle.getCategory(); String displayFormat = engineParam.getDisplayFormat(); String displayName = engineParam.getDisplayName(); String helpText = engineParam.getHelpText(); @@ -1102,7 +1104,8 @@ private static ParameterDefinition convertScalarParameter(IScalarParameterDefn e isMultiValue = DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE .equalsIgnoreCase(scalarParamHandle.getParamType()); } - ParameterDefinition param = new ParameterDefinition(id, name, pattern, displayFormat, displayName, helpText, + ParameterDefinition param = new ParameterDefinition(id, name, category, pattern, displayFormat, displayName, + helpText, promptText, dataType, valueExpr, controlType, hidden, allowNull, allowBlank, isRequired, mustMatch, concealValue, distinct, isMultiValue, group, null); return param; diff --git a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/api/ParameterDefinition.java b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/api/ParameterDefinition.java index ee0a35ecd5f..059d170308b 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/api/ParameterDefinition.java +++ b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/api/ParameterDefinition.java @@ -50,6 +50,8 @@ public class ParameterDefinition { private String name; + private String category; + private String pattern; private String displayFormat; @@ -86,12 +88,14 @@ public class ParameterDefinition { private Collection selectionList; - public ParameterDefinition(long id, String name, String pattern, String displayFormat, String displayName, + public ParameterDefinition(long id, String name, String category, String pattern, String displayFormat, + String displayName, String helpText, String promptText, int dataType, String valueExpr, int controlType, boolean hidden, boolean allowNull, boolean allowBlank, boolean isRequired, boolean mustMatch, boolean concealValue, boolean distinct, boolean isMultiValue, ParameterGroupDefinition group, Collection selectionList) { this.id = id; this.name = name; + this.category = category; this.pattern = pattern; this.displayFormat = displayFormat; this.displayName = displayName; @@ -123,6 +127,10 @@ public String getName() { return name; } + public String getCategory() { + return category; + } + public String getPattern() { return pattern; } diff --git a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/DataUtil.java b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/DataUtil.java index e17efd04839..62e8b180529 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/DataUtil.java +++ b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/DataUtil.java @@ -286,7 +286,7 @@ public static Object validateWithLocale(String dataType, String format, String v } else if (DesignChoiceConstants.PARAM_TYPE_TIME.equalsIgnoreCase(dataType)) { format = ParameterValidationUtil.DISPLAY_TIME_FORMAT; } else if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) { - format = DesignChoiceConstants.DATETIEM_FORMAT_TYPE_UNFORMATTED; + format = DesignChoiceConstants.DATETIME_FORMAT_TYPE_UNFORMATTED; } } diff --git a/viewer/org.eclipse.birt.report.viewer/birt/index.jsp b/viewer/org.eclipse.birt.report.viewer/birt/index.jsp index 63aa5aee974..526df03b33b 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/index.jsp +++ b/viewer/org.eclipse.birt.report.viewer/birt/index.jsp @@ -1,4 +1,4 @@ - + Eclipse BIRT Home diff --git a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js index f83c6c75729..ff348966025 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js +++ b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/ajax/ui/dialog/BirtParameterDialog.js @@ -1276,6 +1276,7 @@ BirtParameterDialog.prototype = Object.extend( new AbstractParameterDialog( ), var temp = Event.element( event ); var oInput = temp.parentNode.getElementsByTagName( "input" ); var oSelect = temp.parentNode.getElementsByTagName( "select" ); + var aInputTextTypes = ["text", "password", "date", "datetime", "datetime-local", "time"]; // check if current parameter is cascading parameter var oCascadeFlag = false; @@ -1294,7 +1295,7 @@ BirtParameterDialog.prototype = Object.extend( new AbstractParameterDialog( ), var element = oInput[i - 1]; if( !oInput[i].checked ) { - if(element && ( element.type == "text" || element.type == "password" ) ) + if(element && aInputTextTypes.includes(element.type)) { element.disabled = false; element.focus( ); @@ -1316,7 +1317,7 @@ BirtParameterDialog.prototype = Object.extend( new AbstractParameterDialog( ), } } } else { - if( element && ( element.type == "text" || element.type == "password" ) ) + if( element && aInputTextTypes.includes(element.type)) { element.disabled = true; // if cascading parameter, clear value diff --git a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/FramesetFragment.jsp b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/FramesetFragment.jsp index 273602aad3f..1fbe78f1fb4 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/FramesetFragment.jsp +++ b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/layout/FramesetFragment.jsp @@ -37,13 +37,14 @@ <%----------------------------------------------------------------------------- Viewer root fragment -----------------------------------------------------------------------------%> - + <%= ParameterAccessor.htmlEncode( attributeBean.getReportTitle( ) ) %> + <% if( attributeBean.isRtl() ) diff --git a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp index 9b592e3de4d..50192864198 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp +++ b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp @@ -12,7 +12,8 @@ <%@ page session="false" buffer="none" %> <%@ page import="org.eclipse.birt.report.utility.ParameterAccessor, org.eclipse.birt.report.context.BaseAttributeBean, - org.eclipse.birt.report.context.ScalarParameterBean" + org.eclipse.birt.report.context.ScalarParameterBean, + org.eclipse.birt.report.service.api.ParameterDefinition" %> <%----------------------------------------------------------------------------- @@ -49,8 +50,41 @@ "> - " + + TYPE="date" + <% + } else if ( parameterBean.getParameter().getDataType() == ParameterDefinition.TYPE_DATE_TIME + && parameterBean.getParameter().getCategory().startsWith("Date Picker") ) { + %> + TYPE="datetime-local" + <% if (parameterBean.getParameter().getCategory().contains("Medium Time")) { %> + step="1" + <%} %> + <% + } else if ( parameterBean.getParameter().getDataType() == ParameterDefinition.TYPE_TIME + && parameterBean.getParameter().getCategory().startsWith("Time Picker") ) { + %> + TYPE="time" + <% if (parameterBean.getParameter().getCategory().contains("Medium Time")) { %> + step="1" + <%} %> + <% + } else if ( parameterBean.isValueConcealed() ) { + %> + TYPE="password" + <% + } else { + %> + TYPE="text" + <% + } + %> NAME="<%= encodedParameterName %>" ID="<%= encodedParameterName %>" TITLE="<%= parameterBean.getToolTip( ) %>" diff --git a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/styles/style.css b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/styles/style.css index 7c6734fb2e8..7604f5e9a09 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/styles/style.css +++ b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/styles/style.css @@ -36,7 +36,7 @@ .BirtViewer_parameter_dialog_Input { font-family: Arial; - font-size: 8pt; + font-size: 8.5pt; width: 68%; padding: 4px 4px; margin: 4px 0; @@ -48,7 +48,7 @@ .birtviewer_parameter_dialog_Select { font-family: Arial; - font-size: 8pt; + font-size: 8.5pt; width: 68%; padding: 4px 4px; margin: 4px 0; @@ -60,7 +60,7 @@ .birtviewer_parameter_dialog_Label { font-family: Arial; - font-size: 8pt; + font-size: 8.5pt; } @@ -309,7 +309,7 @@ input[type="text"]:focus { width: 100%; height: 100%; font-family: Arial; - font-size: 8pt; + font-size: 8.5pt; } .birtviewer_dialog_button diff --git a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/CrosstabAdaptUtil.java b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/CrosstabAdaptUtil.java index 9f3bf4c68ed..e8355950142 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/CrosstabAdaptUtil.java +++ b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/editors/model/CrosstabAdaptUtil.java @@ -182,7 +182,7 @@ public static DataItemHandle createColumnBindingAndDataItem(ReportItemHandle own levelHandle.getName(), LevelAttribute.DATE_TIME_ATTRIBUTE_NAME)); dataHandle.getPrivateStyle() - .setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + .setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); dataHandle.getPrivateStyle().setDateTimeFormat(levelHandle.getDateTimeFormat()); } } @@ -228,7 +228,7 @@ public static DataItemHandle createColumnBindingAndDataItem(ReportItemHandle own if (LevelAttribute.DATE_TIME_ATTRIBUTE_NAME.equals(levelAttrHandle.getName())) { bindingHandle.setDataType(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME); - dataHandle.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + dataHandle.getPrivateStyle().setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); dataHandle.getPrivateStyle().setDateTimeFormat(levelHandle.getDateTimeFormat()); } else { bindingHandle.setDataType(levelAttrHandle.getDataType()); diff --git a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/util/CrosstabUIHelper.java b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/util/CrosstabUIHelper.java index ff36a625904..aba87beb04a 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/util/CrosstabUIHelper.java +++ b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/internal/ui/util/CrosstabUIHelper.java @@ -206,7 +206,7 @@ public static DataItemHandle createColumnBindingAndDataItemForSubTotal(ReportIte levelHandle.getName(), LevelAttribute.DATE_TIME_ATTRIBUTE_NAME)); dataHandle.getPrivateStyle() - .setDateTimeFormatCategory(DesignChoiceConstants.DATETIEM_FORMAT_TYPE_CUSTOM); + .setDateTimeFormatCategory(DesignChoiceConstants.DATETIME_FORMAT_TYPE_CUSTOM); dataHandle.getPrivateStyle().setDateTimeFormat(levelHandle.getDateTimeFormat()); } } From 7ff9a13f9d873cce93db4658853df9bf1ad6e8da Mon Sep 17 00:00:00 2001 From: Thomas Gutmann Date: Fri, 7 Jul 2023 21:01:30 +0200 Subject: [PATCH 2/2] Added spaces before step="1" concat --- .../birt/pages/parameter/TextBoxParameterFragment.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp index 50192864198..fc32256e3d5 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp +++ b/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp @@ -57,12 +57,12 @@ <% if (parameterBean.getParameter().getCategory().equals("Date Picker") ) { %> - TYPE="date" + TYPE="date" <% } else if ( parameterBean.getParameter().getDataType() == ParameterDefinition.TYPE_DATE_TIME && parameterBean.getParameter().getCategory().startsWith("Date Picker") ) { %> - TYPE="datetime-local" + TYPE="datetime-local" <% if (parameterBean.getParameter().getCategory().contains("Medium Time")) { %> step="1" <%} %>