Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sjardine authored Aug 26, 2019
2 parents c007e5e + 8e42aaf commit fa8d24b
Show file tree
Hide file tree
Showing 56 changed files with 104 additions and 17 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Note: This project is inactive.

=======

GWTBootstrap3-Extras is a collection of wrappers based on the [GwtBootstrap3](https://github.com/gwtbootstrap3/gwtbootstrap3) for 3rd party extensions of [Twitter Bootstrap](http://getbootstrap.com/), which helps you develop responsive, mobile first HTML, CSS, and JS projects on the web using Java and Google Web Toolkit (GWT).

###Add GWTBootstrap3-Extras to your project
### Add GWTBootstrap3-Extras to your project
You can easily add GWTBootstrap3-Extras to your project by including the library as a Maven dependency.

```xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasMinView;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasPosition;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasShowTodayButton;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasShowClearButton;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasStartDate;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasStartView;
import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasViewSelect;
Expand Down Expand Up @@ -99,7 +100,7 @@
*/
public class DatePickerBase extends Widget implements HasEnabled, HasId, HasResponsiveness, HasVisibility, HasPlaceholder,
HasAutoClose, HasDaysOfWeekDisabled, HasEndDate, HasForceParse, HasFormat, HasHighlightToday, HasKeyboardNavigation,
HasMinView, HasShowTodayButton, HasStartDate, HasStartView, HasViewSelect, HasWeekStart, HasDateTimePickerHandlers,
HasMinView, HasShowTodayButton, HasShowClearButton, HasStartDate, HasStartView, HasViewSelect, HasWeekStart, HasDateTimePickerHandlers,
HasLanguage, HasName, HasValue<Date>, HasPosition, LeafValueEditor<Date>, HasEditorErrors<Date>, HasErrorHandler,
HasValidators<Date>, HasBlankValidator<Date> {

Expand Down Expand Up @@ -154,6 +155,7 @@ public void onBlur(BlurEvent event) {
private DatePickerMinView minView = DatePickerMinView.DAY;

private boolean showTodayButton = false;
private boolean showClearButton = false;
private boolean highlightToday = false;
private boolean keyboardNavigation = true;
private boolean forceParse = true;
Expand Down Expand Up @@ -446,6 +448,12 @@ public void setShowTodayButton(final boolean showTodayButton) {
this.showTodayButton = showTodayButton;
}

/** {@inheritDoc} */
@Override
public void setShowClearButton(boolean showClearbutton) {
this.showClearButton = showClearbutton;
}

/** {@inheritDoc} */
@Override
public void setStartDate(final Date startDate) {
Expand Down Expand Up @@ -649,7 +657,7 @@ protected void configure(final Widget w, final Widget container) {
this.remove(w.getElement());

configure(w.getElement(), container.getElement(), format, weekStart.getValue(), toDaysOfWeekDisabledString(daysOfWeekDisabled), autoClose,
startView.getValue(), minView.getValue(), showTodayButton, highlightToday, keyboardNavigation, forceParse, viewSelect.getValue(),
startView.getValue(), minView.getValue(), showTodayButton, showClearButton, highlightToday, keyboardNavigation, forceParse, viewSelect.getValue(),
language.getCode(), position.getPosition());
}

Expand Down Expand Up @@ -696,7 +704,7 @@ private native void setDaysOfWeekDisabled(Element e, String daysOfWeekDisabled)
}-*/;

protected native void configure(Element e, Element p, String format, int weekStart, String daysOfWeekDisabled, boolean autoClose, int startView,
int minViewMode, boolean todayBtn, boolean highlightToday, boolean keyboardNavigation, boolean forceParse, int viewSelect, String language,
int minViewMode, boolean todayBtn, boolean clearBtn, boolean highlightToday, boolean keyboardNavigation, boolean forceParse, int viewSelect, String language,
String orientation) /*-{
if (todayBtn) {
Expand All @@ -713,6 +721,7 @@ protected native void configure(Element e, Element p, String format, int weekSta
startView: startView,
minViewMode: minViewMode,
todayBtn: todayBtn,
clearBtn: clearBtn,
todayHighlight: highlightToday,
keyboardNavigation: keyboardNavigation,
forceParse: forceParse,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.gwtbootstrap3.extras.datepicker.client.ui.base.constants;

/*
* #%L
* GwtBootstrap3
* %%
* Copyright (C) 2013 - 2014 GwtBootstrap3
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

/**
* Boolean, Default: false
* <p/>
* If true, displays a clear button at the bottom of the datepicker to clear the selected date.
* If true, the "Clear" button will clear the currently selected date from the datepicker;
*
* @author Rishiraj Anand
*/
public interface HasShowClearButton {
void setShowClearButton(boolean showClearButton);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface DateTimePickerClientBundle extends ClientBundle {

static final DateTimePickerClientBundle INSTANCE = GWT.create(DateTimePickerClientBundle.class);

static final String VERSION = "2.3.11";
static final String VERSION = "2.4.4";
static final String I18N_DIR = "resource/js/locales-" + VERSION + "/";

@Source("resource/js/bootstrap-datetimepicker-" + VERSION + ".min.cache.js")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasPosition;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasShowMeridian;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasShowTodayButton;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasShowClearButton;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasStartDate;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasStartView;
import org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants.HasViewSelect;
Expand Down Expand Up @@ -103,7 +104,7 @@
*/
public class DateTimePickerBase extends Widget implements HasEnabled, HasReadOnly, HasId, HasResponsiveness, HasVisibility,
HasPlaceholder, HasAutoClose, HasDaysOfWeekDisabled, HasEndDate, HasForceParse, HasFormat, HasHighlightToday,
HasKeyboardNavigation, HasMaxView, HasMinuteStep, HasMinView, HasShowMeridian, HasShowTodayButton, HasStartDate,
HasKeyboardNavigation, HasMaxView, HasMinuteStep, HasMinView, HasShowMeridian, HasShowTodayButton, HasShowClearButton, HasStartDate,
HasStartView, HasViewSelect, HasWeekStart, HasDateTimePickerHandlers, HasLanguage, HasName, HasValue<Date>, HasPosition,
LeafValueEditor<Date>, HasEditorErrors<Date>, HasErrorHandler, HasValidators<Date>, HasBlankValidator<Date> {

Expand Down Expand Up @@ -149,7 +150,7 @@ public void onBlur(BlurEvent event) {
private LeafValueEditor<Date> editor;
private final ErrorHandlerMixin<Date> errorHandlerMixin = new ErrorHandlerMixin<Date>(this);
private final DatePickerValidatorMixin validatorMixin = new DatePickerValidatorMixin(this,
errorHandlerMixin.getErrorHandler());
errorHandlerMixin.getErrorHandler());

/**
* DEFAULT values
Expand All @@ -163,6 +164,7 @@ public void onBlur(BlurEvent event) {
private DateTimePickerView minView = DateTimePickerView.HOUR;
private DateTimePickerView maxView = DateTimePickerView.DECADE;
private boolean showTodayButton = false;
private boolean showClearButton = false;
private boolean highlightToday = false;
private boolean keyboardNavigation = true;
private boolean forceParse = true;
Expand Down Expand Up @@ -468,6 +470,13 @@ public void setShowTodayButton(final boolean showTodayButton) {
this.showTodayButton = showTodayButton;
}

/** {@inheritDoc} */
@Override
public void setShowClearButton(final boolean showClearButton) {
this.showClearButton = showClearButton;
}


/** {@inheritDoc} */
@Override
public void setStartDate(final Date startDate) {
Expand Down Expand Up @@ -602,7 +611,7 @@ private void setDateTimeFormat(final String format) {

/**
* Sets the format view type.
*
*
* @param formatViewType
* @see DateTimePickerFormatViewType
*/
Expand Down Expand Up @@ -676,8 +685,8 @@ protected void configure() {
this.remove(getElement());

configure(getElement(), format, formatViewType.getValue(), weekStart.getValue(), toDaysOfWeekDisabledString(daysOfWeekDisabled),
autoClose, startView.getValue(), minView.getValue(), maxView.getValue(), showTodayButton, highlightToday,
keyboardNavigation, forceParse, minuteStep, viewSelect.getValue(), showMeridian, language.getCode(), position.getPosition());
autoClose, startView.getValue(), minView.getValue(), maxView.getValue(), showTodayButton, showClearButton, highlightToday,
keyboardNavigation, forceParse, minuteStep, viewSelect.getValue(), showMeridian, language.getCode(), position.getPosition());
}

protected void execute(final String cmd) {
Expand Down Expand Up @@ -717,9 +726,9 @@ private native void setDaysOfWeekDisabled(Element e, String daysOfWeekDisabled)
}-*/;

protected native void configure(Element e, String format, String formatViewType, int weekStart,
String daysOfWeekDisabled, boolean autoClose, int startView, int minView, int maxView, boolean todayBtn,
boolean highlightToday, boolean keyboardNavigation, boolean forceParse, int minuteStep, int viewSelect,
boolean showMeridian, String language, String position) /*-{
String daysOfWeekDisabled, boolean autoClose, int startView, int minView, int maxView, boolean todayBtn, boolean clearBtn,
boolean highlightToday, boolean keyboardNavigation, boolean forceParse, int minuteStep, int viewSelect,
boolean showMeridian, String language, String position) /*-{
var that = this;
$wnd.jQuery(e).datetimepicker({
format: format,
Expand All @@ -732,6 +741,7 @@ protected native void configure(Element e, String format, String formatViewType,
minView: minView,
maxView: maxView,
todayBtn: todayBtn,
clearBtn: clearBtn,
todayHighlight: highlightToday,
keyboardNavigation: keyboardNavigation,
forceParse: forceParse,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.gwtbootstrap3.extras.datetimepicker.client.ui.base.constants;

/*
* #%L
* GwtBootstrap3
* %%
* Copyright (C) 2013 - 2014 GwtBootstrap3
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

/**
* Boolean, Default: false
* <p/>
* If true, displays a clear button at the bottom of the datetimepicker to clear the current date.
* If true, the "Clear" button will clear the currently selected date from the datetimepicker;
*
* @author Rishiraj Anand
*/
public interface HasShowClearButton {
void setShowClearButton(boolean showClearButton);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
-->
<module>
<public path="resource">
<include name="css/bootstrap-datetimepicker-2.3.11.min.cache.css"/>
<include name="css/bootstrap-datetimepicker-2.4.4.min.cache.css"/>
</public>

<stylesheet src="css/bootstrap-datetimepicker-2.3.11.min.cache.css"/>
<stylesheet src="css/bootstrap-datetimepicker-2.4.4.min.cache.css"/>
</module>

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
suffix: [],
meridiem: ["am","pm"],
meridiem: [],
today: "Hoje"
};
}(jQuery));

0 comments on commit fa8d24b

Please sign in to comment.