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


Java CDateTime类代码示例

本文整理汇总了Java中org.eclipse.nebula.widgets.cdatetime.CDateTime的典型用法代码示例。如果您正苦于以下问题:Java CDateTime类的具体用法?Java CDateTime怎么用?Java CDateTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CDateTime类属于org.eclipse.nebula.widgets.cdatetime包,在下文中一共展示了CDateTime类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例6: createBinding

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public Binding createBinding(Composite parent, boolean createLabel, DetailProviderParameter p) {
	FormToolkit toolkit = p.getDetailFormToolkit();
	EObject target = p.getTarget();
	IItemPropertyDescriptor pd = p.getPropertyDescriptor();
	EStructuralFeature feature = (EStructuralFeature) pd.getFeature(target);
	if (feature == null) {
		return null;
	}
	boolean isEditable = pd.canSetProperty(target);
	if (createLabel) {
		EMFDetailUtils.createLabel(parent, toolkit, target, pd);
	}
	CDateTime cdt = new CDateTime(parent, CDT.BORDER | CDT.TAB_FIELDS | CDT.SPINNER);
	cdt.setPattern(formatPattern);
	cdt.setTimeZone("GMT");
	cdt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	cdt.setEnabled(isEditable);
	EMFDetailUtils.bindControlViability(p, new Control[] {cdt});
	DurationUpdateValueStrategy targetToModel = new DurationUpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
	DurationUpdateValueStrategy modelToTarget = new DurationUpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
	return EMFDetailUtils.bindEMFUndoable(p, new CDateTimeObservableValue(cdt), targetToModel, modelToTarget);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:DurationBindingFactory.java

示例7: bindDate

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public static <E> Binding bindDate(final CDateTime dateTime, final E entity, final Class<E> entityClass,
		final String propertyName, final DataBindingContext bindingContext) {
	final CDateTimeObservableValue targetObservable = new CDateTimeObservableValue(dateTime);
	final IObservableValue modelObservable = BeanProperties.value(entityClass, propertyName).observe(entity);
	final Binding binding = bindingContext.bindValue(targetObservable, modelObservable);
	return binding;
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:8,代码来源:BindingHelper.java

示例8: 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);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:11,代码来源:CDateTimeObservableValue.java

示例9: createBinding

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public Binding createBinding(Composite parent, boolean createLabel, DetailProviderParameter p) {
	FormToolkit toolkit = p.getDetailFormToolkit();
	EObject target = p.getTarget();
	IItemPropertyDescriptor pd = p.getPropertyDescriptor();
	EStructuralFeature feature = (EStructuralFeature) pd.getFeature(target);
	if (feature == null) {
		return null;
	}
	boolean isEditable = pd.canSetProperty(target);
	if (createLabel) {
		EMFDetailUtils.createLabel(parent, toolkit, target, pd);
	}
	CDateTime cdt = new CDateTime(parent, CDT.BORDER | 
			CDT.TAB_FIELDS |
			CDT.SPINNER);
	if (useTimeFormat) {
		cdt.setPattern(TIME_FORMAT_PATTERN);
	} else {
		cdt.setPattern(DATE_FORMAT_PATTERN);
	}
	cdt.setTimeZone("GMT");
	cdt.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	cdt.setEnabled(isEditable);
	toolkit.adapt(cdt, true, true);
	EMFDetailUtils.bindControlViability(p, new Control[] {cdt});
	return EMFDetailUtils.bindEMFUndoable(p, new CDateTimeObservableValue(cdt));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:28,代码来源:CDateTimeBindingFactory.java

示例10: createDates

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
private void createDates(Composite container) {
	Label lblValidFrom = new Label(container, SWT.NONE);
	lblValidFrom.setText(Messages.Cst_Text_anzeigen_ab);
	cdtValidFrom =
		new CDateTime(container, CDT.BORDER | CDT.DROP_DOWN | CDT.DATE_MEDIUM | CDT.TEXT_TRAIL);
	cdtValidFrom.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:9,代码来源:ProfileDetailDialog.java

示例11: createDialogArea

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
@Override
   protected Control createDialogArea(Composite parent) {

Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);

createFirstName(container);
createLastName(container);

Label lblNewLabel_1 = new Label(container, SWT.NONE);
lblNewLabel_1.setText("Datum:");

dateTime = new CDateTime(container, CDT.BORDER | CDT.DROP_DOWN | CDT.DATE_MEDIUM | CDT.TEXT_TRAIL);

Label lblNewLabel = new Label(container, SWT.NONE);
lblNewLabel.setText("Typ: ");

combo = new ImageCombo(container, SWT.NONE);
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
combo.setBackground(UiDesk.getColorFromRGB("FFFFFF"));

StateType[] stateTypes = StateType.values();
for (StateType stateType : stateTypes) {
    combo.add(imageMap.get(stateType.ordinal()), stateType.name());
}
combo.select(0);
return area;
   }
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:33,代码来源:CstReminderDialog.java

示例12: getPeriodFromDateTime

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public CDateTime getPeriodFromDateTime() {
	return periodFromDateTime;
}
 
开发者ID:Albertus82,项目名称:EarthquakeBulletin,代码行数:4,代码来源:SearchForm.java

示例13: getPeriodToDateTime

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public CDateTime getPeriodToDateTime() {
	return periodToDateTime;
}
 
开发者ID:Albertus82,项目名称:EarthquakeBulletin,代码行数:4,代码来源:SearchForm.java

示例14: createCDateTime

import org.eclipse.nebula.widgets.cdatetime.CDateTime; //导入依赖的package包/类
public CDateTime createCDateTime(final Composite parent) {
	final CDateTime dateTime = new CDateTime(parent, CDT.DATE_MEDIUM);
	dateTime.setNullText("");
	return dateTime;
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:6,代码来源:BiboFormToolkit.java


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