本文整理汇总了Java中org.eclipse.nebula.widgets.cdatetime.CDateTime.addSelectionListener方法的典型用法代码示例。如果您正苦于以下问题:Java CDateTime.addSelectionListener方法的具体用法?Java CDateTime.addSelectionListener怎么用?Java CDateTime.addSelectionListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.nebula.widgets.cdatetime.CDateTime
的用法示例。
在下文中一共展示了CDateTime.addSelectionListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWidget
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
@Override
protected void createWidget(Composite parent) {
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 2;
layout.marginWidth = 0;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
setLayout(layout);
date = new CDateTime(this, getDateStyle());
date.setToolTipText(getValue().toSQLString());
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
gd.widthHint = 150;
date.setLayoutData(gd);
date.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Date sdate = date.getSelection();
((ScalarOperand<Date>) getValue()).setValue(sdate);
}
});
date.setSelection((Date) getValue().getValue());
}
示例2: createControl
import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入方法依赖的package包/类
@Override
public Control createControl(Composite parent) {
date = new CDateTime(parent, CDT.BORDER | getStyle() | CDT.DROP_DOWN);
GridData gd = new GridData();
gd.horizontalIndent = 8;
gd.widthHint = 25 * ADataInput.getCharWidth(date);
date.setLayoutData(gd);
date.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setValue(getDate());
}
});
if (getValue() != null && getValue() instanceof Date)
date.setSelection((Date) getValue());
return date;
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}