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


Java CDateTime.setLayoutData方法代码示例

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


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

示例8: 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


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