本文整理匯總了Java中org.eclipse.swt.widgets.DateTime.setMonth方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTime.setMonth方法的具體用法?Java DateTime.setMonth怎麽用?Java DateTime.setMonth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.DateTime
的用法示例。
在下文中一共展示了DateTime.setMonth方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateUI_PropertyDetail_Date
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private void updateUI_PropertyDetail_Date(final TourFilterProperty filterProperty, final int fieldNo) {
DateTime uiDateTime;
LocalDateTime dateTime;
if (fieldNo == 1) {
uiDateTime = filterProperty.uiDateTime1;
dateTime = filterProperty.dateTime1;
} else {
uiDateTime = filterProperty.uiDateTime2;
dateTime = filterProperty.dateTime2;
}
uiDateTime.setYear(dateTime.getYear());
uiDateTime.setMonth(dateTime.getMonthValue() - 1);
uiDateTime.setDay(dateTime.getDayOfMonth());
}
示例2: setDate
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
public static void setDate(DateTime dt, Date d) {
if (d == null) {
d = new Date();
}
Calendar cal = MissionConstants.getInstance().getMissionCalendar();
cal.setTime(d);
dt.setYear(cal.get(Calendar.YEAR));
dt.setMonth(cal.get(Calendar.MONTH));
dt.setDay(cal.get(Calendar.DAY_OF_MONTH));
// dt.setHours(cal.get(Calendar.HOUR_OF_DAY));
// dt.setMinutes(cal.get(Calendar.MINUTE));
// dt.setSeconds(cal.get(Calendar.SECOND));
}
示例3: initValue
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private void initValue(Object bean, String property, DateTime dateTime) {
try {
Object val = Bean.getValue(bean, property);
if (val == null)
return;
GregorianCalendar calendar = null;
if (val instanceof Date) {
calendar = new GregorianCalendar();
calendar.setTime((Date) val);
} else if (val instanceof GregorianCalendar)
calendar = (GregorianCalendar) val;
if (calendar != null) {
dateTime.setDay(calendar.get(Calendar.DAY_OF_MONTH));
dateTime.setMonth(calendar.get(Calendar.MONTH));
dateTime.setYear(calendar.get(Calendar.YEAR));
}
} catch (Exception e) {
error("Cannot set text value", e);
}
}
示例4: createDateWidget
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
private DateTime createDateWidget(final Composite parent) {
final DateTime dateWidget = new DateTime(parent, SWT.DATE | SWT.DROP_DOWN);
dateWidget.setDay(Dates.Defaults.DAY);
dateWidget.setMonth(Dates.Defaults.MONTH);
dateWidget.setYear(Dates.Defaults.YEAR);
return dateWidget;
}
示例5: setDate
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
public static void setDate(DateTime dt, Date date) {
if (date == null) {
initialDate = new Date();
}
initialDate = date;
Calendar calendar = MissionConstants.getInstance().getMissionCalendar();
calendar.setTime(initialDate);
dt.setYear(calendar.get(Calendar.YEAR));
dt.setMonth(calendar.get(Calendar.MONTH));
dt.setDay(calendar.get(Calendar.DAY_OF_MONTH));
}
示例6: setDate
import org.eclipse.swt.widgets.DateTime; //導入方法依賴的package包/類
/**
* Update the date value of the DateTime.
*
* @param time
* @param dateTime
*/
private void setDate(TimeTool time, DateTime dateTime){
dateTime.setDay(time.get(TimeTool.DAY_OF_MONTH));
dateTime.setMonth(time.get(TimeTool.MONTH));
dateTime.setYear(time.get(TimeTool.YEAR));
}