本文整理汇总了Java中nl.strohalm.cyclos.utils.Month类的典型用法代码示例。如果您正苦于以下问题:Java Month类的具体用法?Java Month怎么用?Java Month使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Month类属于nl.strohalm.cyclos.utils包,在下文中一共展示了Month类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: bindCommonFields
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
/**
* binds the common fields to the form, such as periods and filters. Method to be called from the initDataBinder method
*
* @param binder
* @param settings
*/
protected static void bindCommonFields(final BeanBinder<? extends StatisticalQuery> binder, final LocalSettings settings) {
binder.registerBinder("periodMain", DataBinderHelper.namedPeriodBinder(settings, "periodMain"));
binder.registerBinder("periodComparedTo", DataBinderHelper.namedPeriodBinder(settings, "periodComparedTo"));
binder.registerBinder("throughTimeRange", PropertyBinder.instance(ThroughTimeRange.class, "throughTimeRange"));
binder.registerBinder("initialMonth", PropertyBinder.instance(Month.class, "initialMonth"));
binder.registerBinder("finalMonth", PropertyBinder.instance(Month.class, "finalMonth"));
binder.registerBinder("initialQuarter", PropertyBinder.instance(Quarter.class, "initialQuarter"));
binder.registerBinder("finalQuarter", PropertyBinder.instance(Quarter.class, "finalQuarter"));
binder.registerBinder("initialYear", PropertyBinder.instance(Integer.class, "initialYear"));
binder.registerBinder("initialMonthYear", PropertyBinder.instance(Integer.class, "initialMonthYear"));
binder.registerBinder("initialQuarterYear", PropertyBinder.instance(Integer.class, "initialQuarterYear"));
binder.registerBinder("finalYear", PropertyBinder.instance(Integer.class, "finalYear"));
binder.registerBinder("finalMonthYear", PropertyBinder.instance(Integer.class, "finalMonthYear"));
binder.registerBinder("finalQuarterYear", PropertyBinder.instance(Integer.class, "finalQuarterYear"));
binder.registerBinder("paymentFilter", PropertyBinder.instance(PaymentFilter.class, "paymentFilter", ReferenceConverter.instance(PaymentFilter.class)));
binder.registerBinder("paymentFilters", SimpleCollectionBinder.instance(PaymentFilter.class, "paymentFilters", ReferenceConverter.instance(PaymentFilter.class)));
binder.registerBinder("groupFilters", SimpleCollectionBinder.instance(GroupFilter.class, "groupFilters"));
binder.registerBinder("groups", SimpleCollectionBinder.instance(Group.class, "groups"));
binder.registerBinder("systemAccountFilter", PropertyBinder.instance(SystemAccountType.class, "systemAccountFilter"));
binder.registerBinder("whatToShow", PropertyBinder.instance(StatisticsWhatToShow.class, "whatToShow"));
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:28,代码来源:StatisticsAction.java
示例2: getFinalMonth
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public Month getFinalMonth() {
return finalMonth;
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java
示例3: getInitialMonth
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public Month getInitialMonth() {
return initialMonth;
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java
示例4: setFinalMonth
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public void setFinalMonth(final Month finalMonth) {
this.finalMonth = finalMonth;
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java
示例5: setInitialMonth
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
public void setInitialMonth(final Month initialMonth) {
this.initialMonth = initialMonth;
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:StatisticalQuery.java
示例6: prepareForm
import nl.strohalm.cyclos.utils.Month; //导入依赖的package包/类
/**
* This prepares the form. Some common fields are taken care of (Periods); all filters must be assigned by the descendant class prepareForm
* method, which should call return super.prepareForm(context);
*/
@Override
protected QueryParameters prepareForm(final ActionContext context) {
final StatisticsForm form = context.getForm();
final StatisticalQuery query = getDataBinder().readFromString(form.getQuery());
bindPeriods(query, form);
// Send enums to JSP
final HttpServletRequest request = context.getRequest();
RequestHelper.storeEnum(request, StatisticsWhatToShow.class, "whatToShow");
RequestHelper.storeEnum(request, ThroughTimeRange.class, "throughTimeRange");
RequestHelper.storeEnum(request, Month.class, "months");
RequestHelper.storeEnum(request, Quarter.class, "quarters");
// Set default through time range
if (form.getQuery("throughTimeRange") == null) {
form.setQuery("throughTimeRange", ThroughTimeRange.MONTH);
}
// Set default initial and final months and years
if (form.getQuery("initialMonth") == null) {
final Map<String, Object> completedMonthAndYear = DateHelper.getLastCompletedMonthAndYear();
final int lastCompletedMonth = (Integer) completedMonthAndYear.get("month");
final int lastCompletedMonthYear = (Integer) completedMonthAndYear.get("year");
form.setQuery("initialMonth", lastCompletedMonth);
form.setQuery("initialMonthYear", lastCompletedMonthYear - 1);
form.setQuery("finalMonth", lastCompletedMonth);
form.setQuery("finalMonthYear", lastCompletedMonthYear);
}
// Set default initial and final quarters and years
if (form.getQuery("initialQuarter") == null) {
final Map<String, Object> completedQuarterAndYear = DateHelper.getLastCompletedQuarterAndYear();
final Quarter lastCompletedQuarter = (Quarter) completedQuarterAndYear.get("quarter");
final int lastCompletedQuarterYear = (Integer) completedQuarterAndYear.get("year");
form.setQuery("initialQuarter", lastCompletedQuarter);
form.setQuery("initialQuarterYear", lastCompletedQuarterYear - 1);
form.setQuery("finalQuarter", lastCompletedQuarter);
form.setQuery("finalQuarterYear", lastCompletedQuarterYear);
}
// Set default initial and final years
if (form.getQuery("initialYear") == null) {
final Calendar date = elementService.getFirstMemberActivationDate();
int firstYear = 0;
if (date != null) {
firstYear = date.get(Calendar.YEAR);
} else {
firstYear = Calendar.getInstance().get(Calendar.YEAR);
}
final int currentYear = Calendar.getInstance().get(Calendar.YEAR);
int lastYear = currentYear - 1;
if (firstYear > lastYear) {
// The systems started to run this year
firstYear = currentYear;
lastYear = currentYear;
}
form.setQuery("initialYear", firstYear);
form.setQuery("finalYear", lastYear);
}
return query;
}
开发者ID:mateli,项目名称:OpenCyclos,代码行数:67,代码来源:StatisticsAction.java
注:本文中的nl.strohalm.cyclos.utils.Month类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论