当前位置: 首页>>代码示例>>Java>>正文


Java CDateTime.addSelectionListener方法代码示例

本文整理汇总了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());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:DateWidget.java

示例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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:ADateElement.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:DateInput.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:DateInput.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:DateInput.java


注:本文中的org.eclipse.nebula.widgets.cdatetime.CDateTime.addSelectionListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。