本文整理了Java中org.eclipse.swt.widgets.DateTime.sendSelectionEvent()
方法的一些代码示例,展示了DateTime.sendSelectionEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.sendSelectionEvent()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.DateTime
类名称:DateTime
方法名:sendSelectionEvent
暂无
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ gtk_day_selected (long /*int*/ widget) {
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ gtk_day_selected_double_click (long /*int*/ widget) {
sendSelectionEvent (SWT.DefaultSelection);
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ gtk_day_selected (int /*long*/ widget) {
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ gtk_day_selected_double_click (int /*long*/ widget) {
sendSelectionEvent (SWT.DefaultSelection);
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ gtk_day_selected (int /*long*/ widget) {
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ gtk_day_selected_double_click (int /*long*/ widget) {
sendSelectionEvent (SWT.DefaultSelection);
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
long /*int*/ gtk_month_changed (long /*int*/ widget) {
/*
* Feature in GTK. "month-changed" signal is emitted when the
* calendar is displayed though the day/month is not changed.
* The popup has to remain when the month/year is changed
* through the arrow keys, and the popup has to be called-off
* only when the day is selected. The fix is to detect the
* difference between the user changing the month/year, or
* choosing the day.
*/
if (calendarDisplayed) calendarDisplayed = false;
else monthChanged = true;
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
int /*long*/ gtk_month_changed (int /*long*/ widget) {
/*
* Feature in GTK. "month-changed" signal is emitted when the
* calendar is displayed though the day/month is not changed.
* The popup has to remain when the month/year is changed
* through the arrow keys, and the popup has to be called-off
* only when the day is selected. The fix is to detect the
* difference between the user changing the month/year, or
* choosing the day.
*/
if (calendarDisplayed) calendarDisplayed = false;
else monthChanged = true;
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
int /*long*/ gtk_month_changed (int /*long*/ widget) {
/*
* Feature in GTK. "month-changed" signal is emitted when the
* calendar is displayed though the day/month is not changed.
* The popup has to remain when the month/year is changed
* through the arrow keys, and the popup has to be called-off
* only when the day is selected. The fix is to detect the
* difference between the user changing the month/year, or
* choosing the day.
*/
if (calendarDisplayed) calendarDisplayed = false;
else monthChanged = true;
sendSelectionEvent ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void setFieldOfInternalDataStructure (int fieldName, int value) {
if (calendar.get (fieldName) == value) return;
if (fieldName == Calendar.AM_PM) {
calendar.roll (Calendar.HOUR_OF_DAY, 12); // TODO: needs more work for setFormat and locale
}
calendar.set (fieldName, value);
//When dealing with months with 31 days and have days set to 31, then if you change the month
//to one that has 30 (or less) days, then in calendar only the day is changed but the month stays.
//e.g 10.31.2014 -> decrement month, becomes:
// 10.01.2014.
//To get around this behaviour, we set the field again.
if (calendar.get (fieldName) != value) {
calendar.set (fieldName, value);
}
sendSelectionEvent (SWT.Selection);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void setFieldOfInternalDataStructure (int fieldName, int value) {
if (calendar.get (fieldName) == value) return;
if (fieldName == Calendar.AM_PM) {
calendar.roll (Calendar.HOUR_OF_DAY, 12); // TODO: needs more work for setFormat and locale
}
calendar.set (fieldName, value);
//When dealing with months with 31 days and have days set to 31, then if you change the month
//to one that has 30 (or less) days, then in calendar only the day is changed but the month stays.
//e.g 10.31.2014 -> decrement month, becomes:
// 10.01.2014.
//To get around this behaviour, we set the field again.
if (calendar.get (fieldName) != value) {
calendar.set (fieldName, value);
}
sendSelectionEvent (SWT.Selection);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void sendSelection () {
NSEvent event = NSApplication.sharedApplication().currentEvent();
if (event != null && (style & SWT.CALENDAR) != 0) {
if (event.clickCount() == 2) {
sendSelectionEvent (SWT.DefaultSelection);
} else if (event.type() == OS.NSLeftMouseUp) {
sendSelectionEvent (SWT.Selection);
}
} else { // SWT.DATE or SWT.TIME
sendSelectionEvent (SWT.Selection);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void setFieldOfInternalDataStructure (int fieldName, int value) {
if (calendar.get (fieldName) == value) return;
if (fieldName == Calendar.AM_PM) {
calendar.roll (Calendar.HOUR_OF_DAY, 12); // TODO: needs more work for setFormat and locale
}
calendar.set (fieldName, value);
//When dealing with months with 31 days and have days set to 31, then if you change the month
//to one that has 30 (or less) days, then in calendar only the day is changed but the month stays.
//e.g 10.31.2014 -> decrement month, becomes:
// 10.01.2014.
//To get around this behaviour, we set the field again.
if (calendar.get (fieldName) != value) {
calendar.set (fieldName, value);
}
sendSelectionEvent (SWT.Selection);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
LRESULT WM_CHAR (int /*long*/ wParam, int /*long*/ lParam) {
LRESULT result = super.WM_CHAR (wParam, lParam);
if (result != null) return result;
/*
* Feature in Windows. For some reason, when the
* user presses tab, return or escape, Windows beeps.
* The fix is to look for these keys and not call
* the window proc.
*/
switch ((int)/*64*/wParam) {
case SWT.CR:
sendSelectionEvent (SWT.DefaultSelection);
// FALL THROUGH
case SWT.TAB:
case SWT.ESC: return LRESULT.ZERO;
}
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
LRESULT WM_LBUTTONUP (int /*long*/ wParam, int /*long*/ lParam) {
LRESULT result = super.WM_LBUTTONUP (wParam, lParam);
if (isDisposed ()) return LRESULT.ZERO;
if (doubleClick) sendSelectionEvent (SWT.DefaultSelection);
doubleClick = false;
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void sendSelectionEvent () {
int [] y = new int [1];
int [] m = new int [1];
int [] d = new int [1];
OS.gtk_calendar_get_date (calendarHandle, y, m, d);
//TODO: hours, minutes, seconds?
if (d[0] != day ||
m[0] != month ||
y[0] != year) {
year = y[0];
month = m[0];
day = d[0];
/* Highlight the current (today) date */
if (year == Calendar.getInstance ().get (Calendar.YEAR) && month == Calendar.getInstance ().get (Calendar.MONTH)) {
OS.gtk_calendar_mark_day (calendarHandle, Calendar.getInstance ().get (Calendar.DAY_OF_MONTH));
} else {
OS.gtk_calendar_clear_marks (calendarHandle);
}
sendSelectionEvent (SWT.Selection);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void sendSelectionEvent () {
int [] y = new int [1];
int [] m = new int [1];
int [] d = new int [1];
OS.gtk_calendar_get_date (calendarHandle, y, m, d);
//TODO: hours, minutes, seconds?
if (d[0] != day ||
m[0] != month ||
y[0] != year) {
year = y[0];
month = m[0];
day = d[0];
/* Highlight the current (today) date */
if (year == Calendar.getInstance ().get (Calendar.YEAR) && month == Calendar.getInstance ().get (Calendar.MONTH)) {
OS.gtk_calendar_mark_day (calendarHandle, Calendar.getInstance ().get (Calendar.DAY_OF_MONTH));
} else {
OS.gtk_calendar_clear_marks (calendarHandle);
}
sendSelectionEvent (SWT.Selection);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void sendSelectionEvent () {
int [] y = new int [1];
int [] m = new int [1];
int [] d = new int [1];
OS.gtk_calendar_get_date (calendarHandle, y, m, d);
//TODO: hours, minutes, seconds?
if (d[0] != day ||
m[0] != month ||
y[0] != year) {
year = y[0];
month = m[0];
day = d[0];
/* Highlight the current (today) date */
if (year == Calendar.getInstance ().get (Calendar.YEAR) && month == Calendar.getInstance ().get (Calendar.MONTH)) {
OS.gtk_calendar_mark_day (calendarHandle, Calendar.getInstance ().get (Calendar.DAY_OF_MONTH));
} else {
OS.gtk_calendar_clear_marks (calendarHandle);
}
sendSelectionEvent (SWT.Selection);
}
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
boolean sendKeyEvent (NSEvent nsEvent, int type) {
boolean result = super.sendKeyEvent (nsEvent, type);
if (!result) return result;
if (type != SWT.KeyDown) return result;
if ((style & SWT.CALENDAR) == 0) {
short keyCode = nsEvent.keyCode ();
switch (keyCode) {
case 76: /* KP Enter */
case 36: /* Return */
if ((style & SWT.DROP_DOWN) != 0) {
hideCalendar ();
}
sendSelectionEvent (SWT.DefaultSelection);
}
}
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
SYSTEMTIME systime = new SYSTEMTIME ();
OS.SendMessage (handle, OS.MCM_GETCURSEL, 0, systime);
sendSelectionEvent (SWT.Selection);
break;
OS.SendMessage (handle, OS.DTM_GETSYSTEMTIME, 0, systime);
if (lastSystemTime == null || systime.wDay != lastSystemTime.wDay || systime.wMonth != lastSystemTime.wMonth || systime.wYear != lastSystemTime.wYear) {
sendSelectionEvent (SWT.Selection);
if ((style & SWT.TIME) == 0) lastSystemTime = systime;
内容来源于网络,如有侵权,请联系作者删除!