• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WritableMap类的典型用法和代码示例

java 1次浏览

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

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

示例1: getDataMap

点赞 2

import org.eclipse.core.databinding.observable.map.WritableMap; //导入依赖的package包/类
public WritableMap getDataMap ()
{
    return this.dataMap;
}
 

开发者ID:eclipse,
项目名称:neoscada,
代码行数:5,
代码来源:ConfigurationEditorInput.java

示例2: createControl

点赞 2

import org.eclipse.core.databinding.observable.map.WritableMap; //导入依赖的package包/类
public void createControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayoutFactory.fillDefaults().numColumns(2).spacing(10, LayoutConstants.getSpacing().y).applyTo(composite);

	Label label = new Label(composite, SWT.NONE);
	label.setText(Messages.COMMONTXT_NAME_WITH_COLON);

	nameText = new Text(composite, SWT.BORDER);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(nameText);
	nameText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			service.setName(nameText.getText());
		}
	});

	bindingContext = new DataBindingContext();
	map = new WritableMap();

	WizardPageSupport.create(this, bindingContext);

	bindingContext.bindValue(SWTObservables.observeText(nameText, SWT.Modify),
			Observables.observeMapEntry(map, "name"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new StringValidator()), null);

	label = new Label(composite, SWT.NONE);
	label.setText(Messages.CloudFoundryServicePlanWizardPage_LABEL_TYPE);

	typeCombo = new Combo(composite, SWT.READ_ONLY | SWT.BORDER);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(typeCombo);
	typeCombo.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent event) {
			int index = typeCombo.getSelectionIndex();
			if (index != -1) {
				CFServiceOffering configuration = serviceOfferings.get(index);
				setCloudService(service, configuration);
			}
			refreshPlan();
		}
	});

	bindingContext.bindValue(SWTObservables.observeSelection(typeCombo), Observables.observeMapEntry(map, "type"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new ComboValidator(Messages.CloudFoundryServicePlanWizardPage_TEXT_SELECT_TYPE)), null);

	pageBook = new PageBook(composite, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(pageBook);

	planGroup = new Group(pageBook, SWT.BORDER);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(planGroup);
	planGroup.setLayout(new GridLayout());
	planGroup.setVisible(false);
	planGroup.setText(getPlanLabel());

	MultiValidator validator = new MultiValidator() {
		protected IStatus validate() {
			// access plan value to bind validator
			if (planObservable.getValue() == null) {
				return ValidationStatus.cancel(getValidationErrorMessage());
			}
			return ValidationStatus.ok();
		}
	};
	bindingContext.addValidationStatusProvider(validator);

	Dialog.applyDialogFont(composite);
	setControl(composite);
}
 

开发者ID:eclipse,
项目名称:cft,
代码行数:67,
代码来源:CloudFoundryServicePlanWizardPage.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)