本文整理汇总了Java中org.eclipse.nebula.widgets.cdatetime.CDateTime.getSelection方法的典型用法代码示例。如果您正苦于以下问题:Java CDateTime.getSelection方法的具体用法?Java CDateTime.getSelection怎么用?Java CDateTime.getSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.nebula.widgets.cdatetime.CDateTime
的用法示例。
在下文中一共展示了CDateTime.getSelection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTimestamp
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
protected void createTimestamp(Composite parent, final IParameter param, final Map<String, Object> params) {
date = new CDateTime(parent, CDT.BORDER | CDT.DATE_SHORT | CDT.TIME_MEDIUM | CDT.DROP_DOWN);
GridData gd = new GridData();
gd.horizontalIndent = 8;
gd.widthHint = 25 * getCharWidth(date);
date.setLayoutData(gd);
setMandatory(param, date);
SelectionAdapter listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Date sdate = date.getSelection();
Timestamp d = sdate != null ? new java.sql.Timestamp(sdate.getTime()) : null;
updateModel(isNumeric ? d.getTime() : d);
}
};
date.addSelectionListener(listener);
updateInput();
listener.widgetSelected(null);
}
示例2: createTime
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
protected void createTime(Composite parent, final IParameter param, final Map<String, Object> params) {
date = new CDateTime(parent, CDT.BORDER | CDT.TIME_MEDIUM | CDT.DROP_DOWN);
GridData gd = new GridData();
gd.horizontalIndent = 8;
gd.widthHint = 25 * getCharWidth(date);
date.setLayoutData(gd);
setMandatory(param, date);
SelectionAdapter listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Date sdate = date.getSelection();
Time d = sdate != null ? new java.sql.Time(sdate.getTime()) : null;
updateModel(isNumeric ? d.getTime() : d);
}
};
date.addSelectionListener(listener);
updateInput();
listener.widgetSelected(null);
}
示例3: createDate
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
protected void createDate(Composite parent, final IParameter param, final Map<String, Object> params) {
date = new CDateTime(parent, CDT.BORDER | CDT.DATE_SHORT | CDT.DROP_DOWN);
GridData gd = new GridData();
gd.horizontalIndent = 8;
gd.widthHint = 25 * getCharWidth(date);
date.setLayoutData(gd);
setMandatory(param, date);
updateInput();
SelectionAdapter listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Date sdate = date.getSelection();
Date d = sdate != null ? new java.sql.Date(sdate.getTime()) : null;
updateModel(isNumeric && d != null ? d.getTime() : d);
}
};
date.addSelectionListener(listener);
listener.widgetSelected(null);
}
示例4: CDateTimeObservableValue
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
/**
* Observe the selection property of the provided CDateTime control.
* @param dateTime the control to observe
*/
public CDateTimeObservableValue(CDateTime dateTime) {
this.dateTime = dateTime;
currentSelection = dateTime.getSelection();
this.dateTime.addSelectionListener(selectionListener);
this.dateTime.addFocusListener(focusListener);
}