/** * Gets the id of the javascript widget. Note that this is the non-namespaced id, so depending * on what you want to do with it, you may need to prepend 'YAHOO.wicket.' to it. Or you can * call {@link #getJavaScriptWidgetId()}. * * @return The javascript id * @see #getJavaScriptWidgetId() */ public final String getJavaScriptId() { return getMarkupId() + "Js"; }
/** * The name spaced id of the widget. * * @return The widget id * @see #getJavaScriptId() */ public final String getJavaScriptWidgetId() { return "YAHOO.wicket." + getJavaScriptId(); }
@Override public void convertInput() { Date modelObject = (Date)getDefaultModelObject(); getDateTextField().setConvertedInput(modelObject != null ? modelObject : newDateInstance()); super.convertInput(); }
/** * @return either 12 or 24, depending on the hour format of the current {@link Locale} */ private int getMaximumHours() { return getMaximumHours(use12HourFormat()); }
/** * Check that this behavior can get a date format out of the component it is coupled to. It * checks whether {@link #getDatePattern()} produces a non-null value. If that method returns * null, and exception will be thrown * * @param component * the component this behavior is being coupled to * @throws UnableToDetermineFormatException * if this date picker is unable to determine a format. */ private void checkComponentProvidesDateFormat(final Component component) { if (getDatePattern() == null) { throw new UnableToDetermineFormatException(); } }
/** * Factory method for create a new {@link DateTimeField}. * * @param id * the id * @param model * the model * @return the {@link DateTimeField}. */ public static DateTimeField newDateTimeField(final String id, final IModel<Date> model) { final DateTimeField dateTextField = new DateTimeField(id, model); dateTextField.setOutputMarkupId(true); return dateTextField; }
/** * Gets the id of the icon that triggers the popup. * * @return The id of the icon */ protected final String getIconId() { return getEscapedComponentMarkupId() + "Icon"; }
/** * Makes a copy of the provided array and for each element copy the substring 0..len to the new * array * * @param array * array to copy from * @param len * size of substring for each element to copy * @return copy of the array filled with substrings. */ protected final String[] substring(final String[] array, final int len) { return substring(array, 0, len); }
/** * {@inheritDoc} */ @Override public void bind(final Component component) { this.component = component; checkComponentProvidesDateFormat(component); component.setOutputMarkupId(true); }
@Override public void convertInput() { Date modelObject = (Date)getDefaultModelObject(); getDateTextField().setConvertedInput(modelObject != null ? modelObject : newDateInstance()); super.convertInput(); }
/** * @return either 12 or 24, depending on the hour format of the current {@link Locale} */ private int getMaximumHours() { return getMaximumHours(use12HourFormat()); }
/** * Check that this behavior can get a date format out of the component it is coupled to. It * checks whether {@link #getDatePattern()} produces a non-null value. If that method returns * null, and exception will be thrown * * @param component * the component this behavior is being coupled to * @throws UnableToDetermineFormatException * if this date picker is unable to determine a format. */ private void checkComponentProvidesDateFormat(final Component component) { if (getDatePattern() == null) { throw new UnableToDetermineFormatException(); } }
/** * Factory method for create a new {@link DateTimeField}. * * @param id * the id * @param model * the model * @return the {@link DateTimeField}. */ public static DateTimeField newDateTimeField(final String id, final IModel<Date> model) { final DateTimeField dateTextField = new DateTimeField(id, model); dateTextField.setOutputMarkupId(true); return dateTextField; }
/** * Gets the id of the javascript widget. Note that this is the non-namespaced id, so depending * on what you want to do with it, you may need to prepend 'YAHOO.wicket.' to it. Or you can * call {@link #getJavaScriptWidgetId()}. * * @return The javascript id * @see #getJavaScriptWidgetId() */ public final String getJavaScriptId() { return getMarkupId() + "Js"; }
/** * The name spaced id of the widget. * * @return The widget id * @see #getJavaScriptId() */ public final String getJavaScriptWidgetId() { return "YAHOO.wicket." + getJavaScriptId(); }
/** * Gets the id of the icon that triggers the popup. * * @return The id of the icon */ protected final String getIconId() { return getEscapedComponentMarkupId() + "Icon"; }
/** * Makes a copy of the provided array and for each element copy the substring 0..len to the new * array * * @param array * array to copy from * @param len * size of substring for each element to copy * @return copy of the array filled with substrings. */ protected final String[] substring(final String[] array, final int len) { return substring(array, 0, len); }
/** * {@inheritDoc} */ @Override public void bind(final Component component) { this.component = component; checkComponentProvidesDateFormat(component); component.setOutputMarkupId(true); }