• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ControlDecorationSupport类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ControlDecorationSupport类属于org.eclipse.jface.databinding.fieldassist包,在下文中一共展示了ControlDecorationSupport类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addDataBinder

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
private void addDataBinder(Widget toObserve, IValidator validator, Class<?> observableClass,
        String propertyName, Object observedProperty, boolean textDecorationEnabled) {
    IObservableValue textObservable = WidgetProperties.text(SWT.Modify).observe(toObserve);
    UpdateValueStrategy strategy = new UpdateValueStrategy();
    strategy.setBeforeSetValidator(validator);

    ValidationStatusProvider binding = this.ctx.bindValue(textObservable,
        PojoProperties.value(observableClass, propertyName).observe(observedProperty), strategy,
        null);
    if (textDecorationEnabled) {
        ControlDecorationSupport.create(binding, SWT.LEFT);
    }
    final IObservableValue errorObservable = WidgetProperties.text()
            .observe(this.addDialog.getErrorLabel());

    ctx.bindValue(errorObservable, new AggregateValidationStatus(ctx.getBindings(),
            AggregateValidationStatus.MAX_SEVERITY),
        null, null);

}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:21,代码来源:SecuritySetupController.java


示例2: controlDecorator

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
public static void controlDecorator(Binding binding, final Button okButton) {
	ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT, null, new ControlDecorationUpdater() {
		@Override
		protected void update(ControlDecoration decoration, IStatus status) {
			super.update(decoration, status);
			if (okButton != null)
				okButton.setEnabled(status.isOK());
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:ValidatorUtil.java


示例3: initializeBindings

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
private DataBindingContext initializeBindings()
{
	EMFUpdateValueStrategy us = new EMFUpdateValueStrategy();
	context = StaticAccessController.getContext();
	sync = context.get(UISynchronize.class);
	editingDomainController = context.get(EditingDomainController.class);
	permisionsController = context.get(PermissionsAndExpressionsEvaluationController.class);
	us.setBeforeSetValidator(new IValidator()
	{

		@Override
		public IStatus validate(Object value)
		{
			if (value instanceof String)
			{
				if (value.toString().trim().length() > 0)
				{
					return ValidationStatus.ok();
				}
			}
			return ValidationStatus.error("Content must be at least one character");
		}
	});

	DataBindingContext bindingContext = new DataBindingContext();

	IObservableValue model = EMFProperties.value(
			BtsmodelPackage.Literals.BTS_PROJECT_DB_COLLECTION__COLLECTION_NAME).observe(collection);
	Binding binding = bindingContext.bindValue(WidgetProperties.text(SWT.Modify).observeDelayed(400, text), model,
			us, null);
	bindingContext.addValidationStatusProvider(binding);
	ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);

	IObservableValue model2 = EMFProperties.value(BtsmodelPackage.Literals.BTS_PROJECT_DB_COLLECTION__SYNCHRONIZED)
			.observe(collection);
	Binding binding2 = bindingContext.bindValue(
			WidgetProperties.selection().observeDelayed(0, btnSyncronizeCollection), model2, null, null);
	bindingContext.addValidationStatusProvider(binding2);
	ControlDecorationSupport.create(binding2, SWT.TOP | SWT.LEFT);

	IObservableValue model3 = EMFProperties.value(BtsmodelPackage.Literals.BTS_PROJECT_DB_COLLECTION__INDEXED)
			.observe(collection);
	Binding binding3 = bindingContext.bindValue(
			WidgetProperties.selection().observeDelayed(0, btnIndexCollectionFor), model3, null, null);
	bindingContext.addValidationStatusProvider(binding3);
	ControlDecorationSupport.create(binding2, SWT.TOP | SWT.LEFT);

	btnSyncronizeCollection.setEnabled(permisionsController.authenticatedUserMaySyncDBColl(text.getText()));

	return bindingContext;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:52,代码来源:EditDBCollectionDialog.java


示例4: rebind

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
@Override
protected void rebind() {
	Binding binding = bindingContext.bindValue(SWTObservables.observeText(trefuri, SWT.Modify), PojoObservables.observeValue(new FileProxy((AFileResource) res), "fileName"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new NotEmptyFileValidator()), null);
	ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT, null, new ControlDecorationUpdater());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:7,代码来源:AFileResourcePageContent.java


示例5: createControl

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
	Composite cmp = new Composite(parent, SWT.NONE);
	cmp.setLayout(new GridLayout(2, false));
	setControl(cmp);

	Label lbl = new Label(cmp, SWT.NONE);
	lbl.setText(Messages.ExportMetadataPage_3);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	lbl.setLayoutData(gd);

	tfile = new Text(cmp, SWT.BORDER | SWT.READ_ONLY);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	tfile.setLayoutData(gd);

	Button bfile = new Button(cmp, SWT.PUSH);
	bfile.setText(Messages.common_browse);
	bfile.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			FileDialog fd = new FileDialog(Display.getDefault().getActiveShell());
			fd.setFileName("export.zip"); //$NON-NLS-1$
			fd.setFilterPath(root.getLocation().toOSString());
			fd.setFilterExtensions(new String[] { "*.zip", "*.*" }); //$NON-NLS-1$ //$NON-NLS-2$  
			String selection = fd.open();
			tfile.setText(Misc.nvl(selection));
		}
	});

	bIncRepPerm = new Button(cmp, SWT.CHECK);
	bIncRepPerm.setText(Messages.ExportMetadataPage_5);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	bIncRepPerm.setLayoutData(gd);
	bIncRepPerm.setSelection(true);

	bIncRepJobs = new Button(cmp, SWT.CHECK);
	bIncRepJobs.setText(Messages.ExportMetadataPage_6);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	bIncRepJobs.setLayoutData(gd);
	bIncRepJobs.setSelection(true);

	bIncAccEvt = new Button(cmp, SWT.CHECK);
	bIncAccEvt.setText(Messages.ExportMetadataPage_7);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	bIncAccEvt.setLayoutData(gd);
	bIncAccEvt.setSelection(true);

	bIncAudEvt = new Button(cmp, SWT.CHECK);
	bIncAudEvt.setText(Messages.ExportMetadataPage_8);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	bIncAudEvt.setLayoutData(gd);
	bIncAudEvt.setSelection(true);

	bIncMonEvt = new Button(cmp, SWT.CHECK);
	bIncMonEvt.setText(Messages.ExportMetadataPage_9);
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalSpan = 2;
	bIncMonEvt.setLayoutData(gd);
	bIncMonEvt.setSelection(true);

	Binding binding = bindingContext.bindValue(SWTObservables.observeText(tfile, SWT.Modify), PojoObservables.observeValue(value, "file"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new EmptyStringValidator()), null);
	ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT, null, new ControlDecorationUpdater());
	bindingContext.bindValue(SWTObservables.observeSelection(bIncRepPerm), PojoObservables.observeValue(value, "incRepositoryPermission")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeSelection(bIncRepJobs), PojoObservables.observeValue(value, "incReportJobs")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeSelection(bIncAccEvt), PojoObservables.observeValue(value, "includeAccessEvents")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeSelection(bIncAudEvt), PojoObservables.observeValue(value, "includeAuditEvents")); //$NON-NLS-1$
	bindingContext.bindValue(SWTObservables.observeSelection(bIncMonEvt), PojoObservables.observeValue(value, "includeMonitoringEvents")); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:76,代码来源:ExportMetadataPage.java


示例6: doBindFileNameWidget

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
protected void doBindFileNameWidget(DataAdapter dataAdapter) {
	Binding binding = bindingContext.bindValue(SWTObservables.observeText(textFileName, SWT.Modify), PojoObservables.observeValue(dataAdapter, "fileName"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new NotEmptyFileValidator(getJrContext())), null);
	ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT, null, new ControlDecorationUpdater());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:6,代码来源:AFileDataAdapterComposite.java


示例7: refresh

import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport; //导入依赖的package包/类
@Override
public void refresh() {
	
	super.refresh();
	
	List<ValueProvider> nestedIntValProviders 
		= alternative.getVariationValueProviders(ExperimentsPackage.Literals.NESTED_INTERVALS_LONG_VALUE_PROVIDER);
	
	if(nestedIntValProviders.isEmpty()){
		textMaxValue.setEnabled(false);
		textMinValue.setEnabled(false);
		return;
	}
	
	NestedIntervalsLongValueProvider valueProvider = (NestedIntervalsLongValueProvider)nestedIntValProviders.get(0);
	
	//data binding
	if(bindingContext != null){
		bindingContext.dispose();
		bindingContext = null;
	}
	bindingContext = new DataBindingContext();
	
	UpdateValueStrategy t2mStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
	t2mStrategy.setConverter(StringToNumberConverter.toLong(true));
	
	UpdateValueStrategy m2tStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
	m2tStrategy.setConverter(NumberToStringConverter.fromLong(true));
	
	IObservableValue minValObs = EMFEditProperties.value(alternative.getEditingDomain(),
			ExperimentsPackage.Literals.NESTED_INTERVALS_LONG_VALUE_PROVIDER__MIN_VALUE).observe(valueProvider);
	IObservableValue maxValObs = EMFEditProperties.value(alternative.getEditingDomain(),
			ExperimentsPackage.Literals.NESTED_INTERVALS_LONG_VALUE_PROVIDER__MAX_VALUE).observe(valueProvider);
	
	Binding minValBind = bindingContext.bindValue(WidgetProperties.text(SWT.Modify).observe(textMinValue),
	        minValObs, t2mStrategy, m2tStrategy);
	
	Binding maxValBind = bindingContext.bindValue(WidgetProperties.text(SWT.Modify).observe(textMaxValue),
	        maxValObs, t2mStrategy, m2tStrategy);
	
	ControlDecorationSupport.create(minValBind, SWT.TOP | SWT.LEFT);
	ControlDecorationSupport.create(maxValBind, SWT.TOP | SWT.LEFT);
	
	bindingContext.updateTargets();
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:46,代码来源:ConfigCapacityComposite.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobOperator类代码示例发布时间:2022-05-22
下一篇:
Java Operation类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap