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


Java DataBindingContext.bindValue方法代码示例

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


在下文中一共展示了DataBindingContext.bindValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createVendorIdControls

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void createVendorIdControls(DataBindingContext dbc, Composite parent) {
	final Composite composite = new Composite(parent, SWT.NULL);
	composite.setLayout(GridLayoutFactory.swtDefaults().numColumns(2).create());
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	final Label vendorIdLabel = new Label(composite, SWT.NONE);
	vendorIdLabel.setText("Vendor id:");

	Text vendorIdText = new Text(composite, SWT.BORDER);
	vendorIdText.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	projectInfo.addPropertyChangeListener(event -> {
		if (event.getPropertyName().equals(N4MFProjectInfo.VENDOR_ID_PROP_NAME)) {
			setPageComplete(validatePage());
		}
	});

	dbc.bindValue(WidgetProperties.text(Modify).observe(vendorIdText),
			BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.VENDOR_ID_PROP_NAME).observe(projectInfo));

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:N4MFWizardNewProjectCreationPage.java

示例2: createComposite

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@PostConstruct
public void createComposite(Composite parent) {
	GridLayoutFactory.fillDefaults().applyTo(parent);
	Checkbox checkbox = new Checkbox(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(checkbox);
	checkbox.setSelection(true);
	checkbox.setText("Custom checkbox with databinding");
	
	Label label = new Label(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(label);
	
	DataBindingContext dbc = new DataBindingContext();
	
	IObservableValue checkboxProperty = CustomWidgetProperties.selection().observe(checkbox);
	ISWTObservableValue labelProperty = WidgetProperties.text().observe(label);
	
	dbc.bindValue(labelProperty, checkboxProperty);
	
	Button checkButton = new Button(parent, SWT.CHECK);
	checkButton.setSelection(true);
	checkButton.setText("Usual SWT check button");
}
 
开发者ID:vogellacompany,项目名称:swt-custom-widgets,代码行数:23,代码来源:DatabindingCustomWidgetPart.java

示例3: createWidget

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的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);

	txt = new Text(this, SWT.BORDER);
	txt.setText(getValue().toSQLString());
	txt.setToolTipText(getValue().toSQLString());
	GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
	gd.widthHint = 100;
	txt.setLayoutData(gd);

	DataBindingContext bindingContext = new DataBindingContext();

	bindingContext.bindValue(SWTObservables.observeText(txt, SWT.Modify), PojoObservables.observeValue(getValue(), "value"));

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:NumberWidget.java

示例4: initializeRoleDescBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
private DataBindingContext initializeRoleDescBindings(BTSDBCollectionRoleDesc dBRoleDesc)
{
	getEditingDomain(dBRoleDesc);
	if (dbRoleDesc_bindingContext != null)
	{
		dbRoleDesc_bindingContext.dispose();
	}
	DataBindingContext bindingContext = new DataBindingContext();

	// db collection name - cannot be changed
	IObservableValue model_na = EMFProperties.value(BtsmodelPackage.Literals.BTSDB_COLLECTION_ROLE_DESC__ROLE_NAME)
			.observe(dBRoleDesc);
	bindingContext.bindValue(
			WidgetProperties.text(SWT.Modify).observeDelayed(
					BTSUIConstants.DELAY, roles_rolesDesc_name_text),
			model_na, null, null);
	return bindingContext;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:19,代码来源:UserManagementPart.java

示例5: createWidget

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的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);

	txt = new Text(this, SWT.BORDER);
	txt.setText(getValue().toSQLString());
	txt.setToolTipText(getValue().toSQLString());
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.minimumWidth = 250;
	txt.setLayoutData(gd);

	DataBindingContext bindingContext = new DataBindingContext();
	bindingContext.bindValue(SWTObservables.observeText(txt, SWT.Modify), PojoObservables.observeValue(getValue(), "value")); //$NON-NLS-1$
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:UnknownOperandWidget.java

示例6: createDialogArea

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite cmp = (Composite) super.createDialogArea(parent);
	cmp.setLayout(new GridLayout(5, false));

	DataBindingContext bindingContext = new DataBindingContext();

	new Label(cmp, SWT.NONE).setText(Messages.CreateParameterCommand_parameter_name);

	Combo operator = new Combo(cmp, SWT.READ_ONLY);
	JRDesignDataset ds = value.getRoot().getValue();
	List<JRParameter> prms = ds.getParametersList();
	String[] items = new String[prms.size()];
	for (int i = 0; i < items.length; i++)
		items[i] = prms.get(i).getName();
	operator.setItems(items);
	operator.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));

	bindingContext.bindValue(SWTObservables.observeSelection(operator), PojoObservables.observeValue(this, "prm")); //$NON-NLS-1$
	return cmp;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:EditPNotExpressionDialog.java

示例7: initDefaultCreateGreeterBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void initDefaultCreateGreeterBindings(DataBindingContext dbc, Button createGreeterFileButton) {
	// Bind the "create greeter file"-checkbox
	dbc.bindValue(WidgetProperties.selection().observe(createGreeterFileButton),
			BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.CREATE_GREETER_FILE_PROP_NAME)
					.observe(projectInfo));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:8,代码来源:N4MFWizardNewProjectCreationPage.java

示例8: initTestProjectBinding

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void initTestProjectBinding(DataBindingContext dbc, Button addNormalSourceFolderButton,
		Button createTestGreeterFileButton) {
	// Bind the "normal source folder"-checkbox
	dbc.bindValue(WidgetProperties.selection().observe(addNormalSourceFolderButton),
			PojoProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.ADDITIONAL_NORMAL_SOURCE_FOLDER_PROP_NAME)
					.observe(projectInfo));

	// Bind the "Create greeter file"-checkbox
	dbc.bindValue(WidgetProperties.selection().observe(createTestGreeterFileButton),
			BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.CREATE_GREETER_FILE_PROP_NAME)
					.observe(projectInfo));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:14,代码来源:N4MFWizardNewProjectCreationPage.java

示例9: createInput

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
    this.input = new Text ( composite, SWT.BORDER );
    this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
    dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:ConfirmationWidgetFactory.java

示例10: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTxtUserNameObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtUserName);
	IObservableValue userNameCredentialsObserveValue = PojoProperties.value("username").observe(credentials);
	bindingContext.bindValue(observeTextTxtUserNameObserveWidget, userNameCredentialsObserveValue, null, null);
	//
	IObservableValue observeTextTxtPasswordObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtPassword);
	IObservableValue passwordCredentialsObserveValue = PojoProperties.value("password").observe(credentials);
	bindingContext.bindValue(observeTextTxtPasswordObserveWidget, passwordCredentialsObserveValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:14,代码来源:LoginDialog.java

示例11: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	bindingContext = new DataBindingContext();
	//
	IObservableValue observeTagsObserveWidget = WidgetProperties.text(SWT.Modify).observe(text);
	IObservableValue solutionTagsObserveValue = EMFObservables.observeValue(solution, Literals.NODE__IUS);
	UpdateValueStrategy solutionTagsToModelStrategy = new UpdateValueStrategy();
	solutionTagsToModelStrategy.setConverter(new StringToFeatureConverter());
	UpdateValueStrategy solutionModelToTagsStrategy = new UpdateValueStrategy();
	solutionModelToTagsStrategy.setConverter(new FeatureToStringConverter());
	bindingContext.bindValue(observeTagsObserveWidget, solutionTagsObserveValue, solutionTagsToModelStrategy, solutionModelToTagsStrategy);
	//
	return bindingContext;
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:14,代码来源:FeatureSection.java

示例12: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTxtLogoFilePathObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtLogoFilePath);
	IObservableValue solutionImageObserveValue = EMFObservables.observeValue(solution, Literals.NODE__IMAGE);
	bindingContext.bindValue(observeTextTxtLogoFilePathObserveWidget, solutionImageObserveValue, null, null);
	//
	IObservableValue observeTextTxtScreenshotFilePathObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtScreenshotFilePath);
	IObservableValue solutionScreenshotObserveValue = EMFObservables.observeValue(solution,Literals.NODE__SCREENSHOT);
	bindingContext.bindValue(observeTextTxtScreenshotFilePathObserveWidget, solutionScreenshotObserveValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:14,代码来源:ImagesSection.java

示例13: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTextObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtShortDescription);
	IObservableValue solutionShortdescriptionObserveValue = EMFObservables.observeValue(solution, Literals.NODE__SHORTDESCRIPTION);
	bindingContext.bindValue(observeTextTextObserveWidget, solutionShortdescriptionObserveValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:10,代码来源:ShortDescriptionSection.java

示例14: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTxtLogoFilePathObserveWidget = WidgetProperties.text(SWT.Modify).observe(markupViewer.getTextWidget());
	IObservableValue solutionImageObserveValue = EMFObservables.observeValue(solution, Literals.NODE__RAW_BODY);
	bindingContext.bindValue(observeTextTxtLogoFilePathObserveWidget, solutionImageObserveValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:Itema-as,项目名称:dawn-marketplace-server,代码行数:10,代码来源:DescriptionSection.java

示例15: initDataBindings

import org.eclipse.core.databinding.DataBindingContext; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue observeTextTxtDomainModelFilterObserveWidget = WidgetProperties.text(SWT.Modify).observeDelayed(100, txtDomainModelFilter);
	bindingContext.bindValue(observeTextTxtDomainModelFilterObserveWidget, filterValue, null, null);
	//
	IObservableValue observeSingleSelectionCheckboxTreeViewer = ViewerProperties.singleSelection().observe(checkboxTreeViewer);
	bindingContext.bindValue(observeSingleSelectionCheckboxTreeViewer, selectionWritableValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:Nasdanika,项目名称:codegen-ecore,代码行数:12,代码来源:EcoreCodegenForm.java


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