com.google.gwt.user.datepicker.client.DatePicker.isYearAndMonthDropdownVisible()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中com.google.gwt.user.datepicker.client.DatePicker.isYearAndMonthDropdownVisible()方法的一些代码示例,展示了DatePicker.isYearAndMonthDropdownVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DatePicker.isYearAndMonthDropdownVisible()方法的具体详情如下:
包路径:com.google.gwt.user.datepicker.client.DatePicker
类名称:DatePicker
方法名:isYearAndMonthDropdownVisible

DatePicker.isYearAndMonthDropdownVisible介绍

[英]Is the year and month selectable via a dropdown?
[中]是否可以通过下拉菜单选择年份和月份?

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

private boolean isDatePickerConfigChanged() {
 boolean isMonthCurrentlySelectable = monthSelect.getParent() != null;
 boolean isYearNavigationCurrentlyEnabled = yearBackwards.getParent() != null;
 return getDatePicker().isYearAndMonthDropdownVisible() != isMonthCurrentlySelectable ||
   getDatePicker().isYearArrowsVisible() != isYearNavigationCurrentlyEnabled;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private void setDate(Date date) {
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // setup months dropdown
  int month = date.getMonth();
  monthSelect.setSelectedIndex(month);
  // setup years dropdown
  yearSelect.clear();
  int year = date.getYear();
  int startYear = year - getNoOfYearsToDisplayBefore();
  int endYear = year + getNoOfYearsToDisplayAfter();
  Date newDate = new Date();
  for (int i = startYear; i <= endYear; i++) {
   newDate.setYear(i);
   yearSelect.addItem(getModel().getYearFormatter().format(newDate));
  }
  yearSelect.setSelectedIndex(year - startYear);
 } else {
  grid.setText(0, monthColumn, getModel().formatCurrentMonthAndYear());
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private void setupGrid() {
 grid.removeAllRows();
 grid.insertRow(0);
 // Back arrows
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearBackwards, "1");
 }
 addCell(monthBackwards, "1");
 // Month/Year column
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // Drop-down
  if (getModel().isMonthBeforeYear()) {
   addCell(monthSelect, "50%", css().month());
   addCell(yearSelect, "50%", css().year());
  } else {
   addCell(yearSelect, "50%", css().year());
   addCell(monthSelect, "50%", css().month());
  }
 } else {
  // Text-only
  monthColumn = addCell(null, "100%", css().month());
 }
 // Forward arrows
 addCell(monthForwards, "1");
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearForwards, "1");
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

private boolean isDatePickerConfigChanged() {
 boolean isMonthCurrentlySelectable = monthSelect.getParent() != null;
 boolean isYearNavigationCurrentlyEnabled = yearBackwards.getParent() != null;
 return getDatePicker().isYearAndMonthDropdownVisible() != isMonthCurrentlySelectable ||
   getDatePicker().isYearArrowsVisible() != isYearNavigationCurrentlyEnabled;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

private boolean isDatePickerConfigChanged() {
 boolean isMonthCurrentlySelectable = monthSelect.getParent() != null;
 boolean isYearNavigationCurrentlyEnabled = yearBackwards.getParent() != null;
 return getDatePicker().isYearAndMonthDropdownVisible() != isMonthCurrentlySelectable ||
   getDatePicker().isYearArrowsVisible() != isYearNavigationCurrentlyEnabled;
}

代码示例来源:origin: net.wetheinter/gwt-user

private void setDate(Date date) {
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // setup months dropdown
  int month = date.getMonth();
  monthSelect.setSelectedIndex(month);
  // setup years dropdown
  yearSelect.clear();
  int year = date.getYear();
  int startYear = year - getNoOfYearsToDisplayBefore();
  int endYear = year + getNoOfYearsToDisplayAfter();
  Date newDate = new Date();
  for (int i = startYear; i <= endYear; i++) {
   newDate.setYear(i);
   yearSelect.addItem(getModel().getYearFormatter().format(newDate));
  }
  yearSelect.setSelectedIndex(year - startYear);
 } else {
  grid.setText(0, monthColumn, getModel().formatCurrentMonthAndYear());
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

private void setDate(Date date) {
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // setup months dropdown
  int month = date.getMonth();
  monthSelect.setSelectedIndex(month);
  // setup years dropdown
  yearSelect.clear();
  int year = date.getYear();
  int startYear = year - getNoOfYearsToDisplayBefore();
  int endYear = year + getNoOfYearsToDisplayAfter();
  Date newDate = new Date();
  for (int i = startYear; i <= endYear; i++) {
   newDate.setYear(i);
   yearSelect.addItem(getModel().getYearFormatter().format(newDate));
  }
  yearSelect.setSelectedIndex(year - startYear);
 } else {
  grid.setText(0, monthColumn, getModel().formatCurrentMonthAndYear());
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

private void setupGrid() {
 grid.removeAllRows();
 grid.insertRow(0);
 // Back arrows
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearBackwards, "1");
 }
 addCell(monthBackwards, "1");
 // Month/Year column
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // Drop-down
  if (getModel().isMonthBeforeYear()) {
   addCell(monthSelect, "50%", css().month());
   addCell(yearSelect, "50%", css().year());
  } else {
   addCell(yearSelect, "50%", css().year());
   addCell(monthSelect, "50%", css().month());
  }
 } else {
  // Text-only
  monthColumn = addCell(null, "100%", css().month());
 }
 // Forward arrows
 addCell(monthForwards, "1");
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearForwards, "1");
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

private void setupGrid() {
 grid.removeAllRows();
 grid.insertRow(0);
 // Back arrows
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearBackwards, "1");
 }
 addCell(monthBackwards, "1");
 // Month/Year column
 if (getDatePicker().isYearAndMonthDropdownVisible()) {
  // Drop-down
  if (getModel().isMonthBeforeYear()) {
   addCell(monthSelect, "50%", css().month());
   addCell(yearSelect, "50%", css().year());
  } else {
   addCell(yearSelect, "50%", css().year());
   addCell(monthSelect, "50%", css().month());
  }
 } else {
  // Text-only
  monthColumn = addCell(null, "100%", css().month());
 }
 // Forward arrows
 addCell(monthForwards, "1");
 if (getDatePicker().isYearArrowsVisible()) {
  addCell(yearForwards, "1");
 }
}

相关文章