本文整理汇总了Java中org.eclipse.jface.databinding.viewers.ViewerProperties类的典型用法代码示例。如果您正苦于以下问题:Java ViewerProperties类的具体用法?Java ViewerProperties怎么用?Java ViewerProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewerProperties类属于org.eclipse.jface.databinding.viewers包,在下文中一共展示了ViewerProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupProjectSelectorDataBinding
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void setupProjectSelectorDataBinding() {
IViewerObservableValue projectInput =
ViewerProperties.input().observe(projectSelector.getViewer());
IViewerObservableValue projectSelection =
ViewerProperties.singleSelection().observe(projectSelector.getViewer());
bindingContext.addValidationStatusProvider(
new ProjectSelectionValidator(projectInput, projectSelection, requireValues));
IViewerObservableValue projectList =
ViewerProperties.singleSelection().observe(projectSelector.getViewer());
IObservableValue projectIdModel = PojoProperties.value("projectId").observe(model);
UpdateValueStrategy gcpProjectToProjectId =
new UpdateValueStrategy().setConverter(new GcpProjectToProjectIdConverter());
UpdateValueStrategy projectIdToGcpProject =
new UpdateValueStrategy().setConverter(new ProjectIdToGcpProjectConverter());
bindingContext.bindValue(projectList, projectIdModel,
gcpProjectToProjectId, projectIdToGcpProject);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:21,代码来源:AppEngineDeployPreferencesPanel.java
示例2: initDataBindings
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.ENTITY__NAME});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList architectureCloudProvidersObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, architecture, ArchitecturePackage.Literals.ARCHITECTURE__CLOUD_ENVIRONMENTS);
tableViewer.setInput(architectureCloudProvidersObserveList);
//
IObservableValue observeSingleSelectionTableViewer = ViewerProperties.singleSelection().observe(tableViewer);
IObservableValue cloudProviderCloudProviderModelObserveValue = BeanProperties.value("cloudProvider").observe(cloudProviderModel);
bindingContext.bindValue(observeSingleSelectionTableViewer, cloudProviderCloudProviderModelObserveValue, null, null);
//
return bindingContext;
}
示例3: bindClusteredComputingEnvironment
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void bindClusteredComputingEnvironment (DataBindingContext bindingContext)
{
bindingContext.bindValue(
WidgetProperties.text(SWT.Modify).observe(txtInitialSize),
EMFProperties.value(DeploymentPackage.Literals.CLUSTERED_COMPUTING_ENVIRONMENT__SIZE).observeDetail(valueComputingEnvironment)
);
// Scheduling policy (enum!)
cvLoadBalancer.setContentProvider(ArrayContentProvider.getInstance());
cvLoadBalancer.setInput(SchedulingPolicy.VALUES);
bindingContext.bindValue(
ViewerProperties.singleSelection().observe(cvLoadBalancer),
EMFProperties.value(DeploymentPackage.Literals.CLUSTERED_COMPUTING_ENVIRONMENT__LOAD_BALANCER).observeDetail(valueComputingEnvironment)
);
}
示例4: bindUniverseDefinition
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void bindUniverseDefinition(ComboViewer universeDefinitionCombo) {
universeDefinitionCombo.setContentProvider(new ArrayContentProvider());
universeDefinitionCombo.setLabelProvider(new ProjectUniverseLabelProvider());
universeDefinitionCombo.setComparator(new ViewerComparator());
Set<ProjectUniverse> projectUniverses = getProjectUniverses();
universeDefinitionCombo.setInput(projectUniverses);
IObservableValue selectedUniverseDefinition = ViewerProperties.singleSelection().observe(universeDefinitionCombo);
IObservableValue universeDefinition = BeansObservables.observeValue(editVersionModel, EditVersionModel.PN_PROJECT_UNIVERSE);
dbc.bindValue(selectedUniverseDefinition, universeDefinition);
ProjectUniverse projectUniverse = findUniverse(projectUniverses, getUniverseId());
if (projectUniverse == null) {
projectUniverse = findUniverse(projectUniverses, UniverseDefinitions.ALL_WORKSPACE_PROJECTS_UNIVERSE_ID);
}
/* We simply use the first element in the list as the initial selection. */
if (0 < universeDefinitionCombo.getCombo().getItemCount()) {
universeDefinitionCombo.setSelection(new StructuredSelection(projectUniverse));
}
}
示例5: createButtonsForButtonBar
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
dbc.bindValue(
ViewerProperties.singleSelection().observe(taggerComboViewer),
EMFProperties.value(TermsuiteuiPackage.Literals.ETAGGER_CONFIG__TAGGER_TYPE).observe(this.taggerConfig));
dbc.bindValue(
new BrowseDirText.TextValueProperty().observe(taggerPath),
EMFProperties.value(TermsuiteuiPackage.Literals.ETAGGER_CONFIG__PATH).observe(this.taggerConfig));
dbc.updateTargets();
updateTaggerName();
}
示例6: initDataBindings
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的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;
}
示例7: bindEntryKindControl
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void bindEntryKindControl(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(
TransactionUtil.getEditingDomain(eObject),
SGraphPackage.Literals.ENTRY__KIND);
context.bindValue(
ViewerProperties.singleSelection().observe(entryKindViewer),
property.observe(eObject));
}
示例8: initDataBindings
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
IObservableValue observeSingleSelectionTableViewer = ViewerProperties.singleSelection().observe(this.cloudComposite.getTableViewer());
IObservableValue cloudProviderCloudProviderModelObserveValue = BeanProperties.value("cloudProvider").observe(instancesComposite);
bindingContext.bindValue(observeSingleSelectionTableViewer, cloudProviderCloudProviderModelObserveValue, null, null);
IObservableValue observeInstanceSelectionTableViewer = ViewerProperties.singleSelection().observe(this.instancesComposite.getTableViewer());
IObservableValue instanceObvservableValue = BeanProperties.value("computingInfrastructureService").observe(this.instanceDescriptionComposite);
bindingContext.bindValue(observeInstanceSelectionTableViewer, instanceObvservableValue, null, null);
return bindingContext;
}
示例9: bindComputingResources
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void bindComputingResources (DataBindingContext bindingContext)
{
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap observeMap = PojoObservables.observeMap(listContentProvider.getKnownElements(), ComputingResourceDescriptor.class, "name");
cvComputingResource.setLabelProvider(new ObservableMapLabelProvider(observeMap));
cvComputingResource.setContentProvider(listContentProvider);
//
IObservableList computingResourceDescriptorsCisdObserveList = PojoProperties.list("computingResourceDescriptors").observeDetail(valueComputingInfrastructureServiceDescriptor);
cvComputingResource.setInput(computingResourceDescriptorsCisdObserveList);
//
IObservableValue observeSingleSelectionCvComputingResource = ViewerProperties.singleSelection().observe(cvComputingResource);
IObservableValue computingEnvironmentinstanceDescriptorRuntimeDeploymentObserveValue = PojoProperties.value("instanceDescriptor").observe(valueComputingEnvironment);
bindingContext.bindValue(observeSingleSelectionCvComputingResource, computingEnvironmentinstanceDescriptorRuntimeDeploymentObserveValue, null, null);
cvComputingResource.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
ComputingResourceDescriptor crd = (ComputingResourceDescriptor) ((IStructuredSelection)event.getSelection()).getFirstElement();
valueComputingResourceDescriptor.setValue(crd);
updateComputingResourceFields(crd);
}
});;
}
示例10: createMavenToOsgiVersionMappingStrategy
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void createMavenToOsgiVersionMappingStrategy(final Group group) {
ComboViewer mavenToOsgiVersionMapping = new ComboViewer(group);
mavenToOsgiVersionMapping.setContentProvider(new ArrayContentProvider());
mavenToOsgiVersionMapping.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((MavenToOsgiVersionMappingStrategy) element).getKey();
}
});
mavenToOsgiVersionMapping.setComparator(new ViewerComparator());
mavenToOsgiVersionMapping.setInput(MavenToOsgiVersionMappingStrategy.values());
IObservableValue versionMappingTargetObservable = ViewerProperties.singleSelection().observe(mavenToOsgiVersionMapping);
IObservableValue versionMappingModelObservable = BeansObservables.observeValue(model, PreferencesPageModel.PN_MAVEN_TO_OSGI_VERSION_MAPPING_STRATEGY);
dataBindingContext.bindValue(versionMappingTargetObservable, versionMappingModelObservable, null, null);
Label description = new Label(group, SWT.WRAP);
GridDataFactory.fillDefaults().grab(true, true).hint(150, SWT.DEFAULT).applyTo(description);
IObservableValue descriptionTargetObservable = WidgetProperties.text().observe(description);
IObservableValue descriptionModelObservable = BeansObservables.observeValue(model, PreferencesPageModel.PN_MAVEN_TO_OSGI_VERSION_MAPPING_STRATEGY_DESCRIPTION);
dataBindingContext.bindValue(descriptionTargetObservable, descriptionModelObservable, null, null);
model.addPropertyChangeListener(PreferencesPageModel.PN_MAVEN_TO_OSGI_VERSION_MAPPING_STRATEGY_DESCRIPTION, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
group.getParent().layout();
}
});
}
示例11: createVersionRangeChangeStrategy
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
private void createVersionRangeChangeStrategy(final Composite container) {
Group group = new Group(container, SWT.BORDER);
group.setText(Messages.VersionTigerPreferencesPage_DependencyGroup);
group.setLayout(new GridLayout(1, false));
group.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
ComboViewer versionRangeChange = new ComboViewer(group);
versionRangeChange.setContentProvider(new ArrayContentProvider());
versionRangeChange.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((VersionRangeChangeStrategy) element).getKey();
}
});
versionRangeChange.setComparator(new ViewerComparator());
versionRangeChange.setInput(VersionRangeChangeStrategy.values());
IObservableValue versionRangeTargetObservable = ViewerProperties.singleSelection().observe(versionRangeChange);
IObservableValue versionRangeModelObservable = BeansObservables.observeValue(model, PreferencesPageModel.PN_VERSION_RANGE_CHANGE_STRATEGY);
dataBindingContext.bindValue(versionRangeTargetObservable, versionRangeModelObservable, null, null);
Label description = new Label(group, SWT.WRAP);
GridDataFactory.fillDefaults().grab(true, true).hint(150, SWT.DEFAULT).applyTo(description);
IObservableValue descriptionTargetObservable = WidgetProperties.text().observe(description);
IObservableValue descriptionModelObservable = BeansObservables.observeValue(model, PreferencesPageModel.PN_VERSION_RANGE_CHANGE_STRATEGY_DESCRIPTION);
dataBindingContext.bindValue(descriptionTargetObservable, descriptionModelObservable, null, null);
model.addPropertyChangeListener(PreferencesPageModel.PN_VERSION_RANGE_CHANGE_STRATEGY_DESCRIPTION, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
container.layout();
}
});
}
示例12: input
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
public ViewerUI<V> input(Object value) {
return prop(ViewerProperties.input(), value);
}
示例13: bindChoiceKind
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
protected void bindChoiceKind(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject),
SGraphPackage.Literals.CHOICE__KIND);
context.bindValue(ViewerProperties.singleSelection().observe(choiceKindViewer), property.observe(eObject));
}
示例14: initDataBindings
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap observeMap = BeansObservables.observeMap(listContentProvider.getKnownElements(), Icon.class, "src");
iconsTableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMap));
iconsTableViewer.setContentProvider(listContentProvider);
//
IObservableList iconsGetWidgetObserveList = BeanProperties.list("icons").observe(getWidget());
iconsTableViewer.setInput(iconsGetWidgetObserveList);
//
ObservableListContentProvider listContentProvider_1 = new ObservableListContentProvider();
IObservableMap observeMap_1 = BeansObservables.observeMap(listContentProvider_1.getKnownElements(), Splash.class, "src");
splashTableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMap_1));
splashTableViewer.setContentProvider(listContentProvider_1);
//
IObservableList splashesGetWidgetObserveList = BeanProperties.list("splashes").observe(getWidget());
splashTableViewer.setInput(splashesGetWidgetObserveList);
//
IObservableValue observeSingleSelectionIconsTableViewer = ViewerProperties.singleSelection().observe(iconsTableViewer);
IObservableValue iconsTableViewerWidthObserveDetailValue = BeanProperties.value(Icon.class, "width", int.class).observeDetail(observeSingleSelectionIconsTableViewer);
IObservableValue observeTextTxtWidthObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtWidth);
bindingContext.bindValue(iconsTableViewerWidthObserveDetailValue, observeTextTxtWidthObserveWidget, null, null);
//
IObservableValue observeSingleSelectionIconsTableViewer_1 = ViewerProperties.singleSelection().observe(iconsTableViewer);
IObservableValue iconsTableViewerHeightObserveDetailValue = BeanProperties.value(Icon.class, "height", int.class).observeDetail(observeSingleSelectionIconsTableViewer_1);
IObservableValue observeTextTxtHeightObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtHeight);
bindingContext.bindValue(iconsTableViewerHeightObserveDetailValue, observeTextTxtHeightObserveWidget, null, null);
//
IObservableValue observeSingleSelectionIconsTableViewer_2 = ViewerProperties.singleSelection().observe(iconsTableViewer);
IObservableValue iconsTableViewerPlatformObserveDetailValue = BeanProperties.value(Icon.class, "platform", String.class).observeDetail(observeSingleSelectionIconsTableViewer_2);
IObservableValue observeTextTxtPlatformObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtPlatform);
bindingContext.bindValue(iconsTableViewerPlatformObserveDetailValue, observeTextTxtPlatformObserveWidget, null, null);
//
IObservableValue observeSingleSelectionIconsTableViewer_3 = ViewerProperties.singleSelection().observe(iconsTableViewer);
IObservableValue iconsTableViewerDensityObserveDetailValue = BeanProperties.value(Icon.class, "density", String.class).observeDetail(observeSingleSelectionIconsTableViewer_3);
IObservableValue observeTextTxtDensityObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtDensity);
bindingContext.bindValue(iconsTableViewerDensityObserveDetailValue, observeTextTxtDensityObserveWidget, null, null);
//
IObservableValue observeSingleSelectionSplashTableViewer = ViewerProperties.singleSelection().observe(splashTableViewer);
IObservableValue splashTableViewerWidthObserveDetailValue = BeanProperties.value(Splash.class, "width", int.class).observeDetail(observeSingleSelectionSplashTableViewer);
IObservableValue observeTextTxtSplshWidthObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtSplshWidth);
bindingContext.bindValue(splashTableViewerWidthObserveDetailValue, observeTextTxtSplshWidthObserveWidget, null, null);
//
IObservableValue observeSingleSelectionSplashTableViewer_1 = ViewerProperties.singleSelection().observe(splashTableViewer);
IObservableValue splashTableViewerHeightObserveDetailValue = BeanProperties.value(Splash.class, "height", int.class).observeDetail(observeSingleSelectionSplashTableViewer_1);
IObservableValue observeTextTxtSplshHeightObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtSplshHeight);
bindingContext.bindValue(splashTableViewerHeightObserveDetailValue, observeTextTxtSplshHeightObserveWidget, null, null);
//
IObservableValue observeSingleSelectionSplashTableViewer_2 = ViewerProperties.singleSelection().observe(splashTableViewer);
IObservableValue splashTableViewerPlatformObserveDetailValue = BeanProperties.value(Splash.class, "platform", String.class).observeDetail(observeSingleSelectionSplashTableViewer_2);
IObservableValue observeTextTxtSplshPlatformObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtSplshPlatform);
bindingContext.bindValue(splashTableViewerPlatformObserveDetailValue, observeTextTxtSplshPlatformObserveWidget, null, null);
//
IObservableValue observeSingleSelectionSplashTableViewer_3 = ViewerProperties.singleSelection().observe(splashTableViewer);
IObservableValue splashTableViewerDensityObserveDetailValue = BeanProperties.value(Splash.class, "density", String.class).observeDetail(observeSingleSelectionSplashTableViewer_3);
IObservableValue observeTextTxtSplshDensityObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtSplshDensity);
bindingContext.bindValue(splashTableViewerDensityObserveDetailValue, observeTextTxtSplshDensityObserveWidget, null, null);
//
return bindingContext;
}
示例15: initBindings
import org.eclipse.jface.databinding.viewers.ViewerProperties; //导入依赖的package包/类
public void initBindings(){
if(bindingContext != null){
bindingContext.dispose();
}
bindingContext = new DataBindingContext();
//bind combo metric description
{
IObservableValue observeSingleSelectionComboViewer = ViewerProperties.singleSelection().observe(comboMeasurementSpecViewer);
IObservableValue measurementSpecObserveValue = EMFEditObservables.observeValue(editingDomain, sloWrapper.getMaster(),
ServicelevelObjectivePackage.Literals.SERVICE_LEVEL_OBJECTIVE__MEASUREMENT_SPECIFICATION);
bindingContext.bindValue(observeSingleSelectionComboViewer, measurementSpecObserveValue, null, null);
}
Binding upperThresholdBinding = null;
Binding lowerThresholdBinding = null;
//bind upper bound checkbox
{
upperThresholdBinding = bindCreateThresholdCheck(btnUpperBound, FeaturePath.fromList(
ServicelevelObjectivePackage.Literals.SERVICE_LEVEL_OBJECTIVE__UPPER_THRESHOLD),
ServicelevelObjectiveFactory.eINSTANCE.createHardThreshold());
}
//bind lower bound checkbox
{
lowerThresholdBinding = bindCreateThresholdCheck(btnLowerBound, FeaturePath.fromList(
ServicelevelObjectivePackage.Literals.SERVICE_LEVEL_OBJECTIVE__LOWER_THRESHOLD),
ServicelevelObjectiveFactory.eINSTANCE.createHardThreshold());
}
//bind upper bound
{
bindThresholdMeasure(textUpperBound, FeaturePath.fromList(
ServicelevelObjectivePackage.Literals.SERVICE_LEVEL_OBJECTIVE__UPPER_THRESHOLD,
ServicelevelObjectivePackage.Literals.THRESHOLD__THRESHOLD_LIMIT
));
}
//bind lower bound
{
bindThresholdMeasure(textLowerBound, FeaturePath.fromList(
ServicelevelObjectivePackage.Literals.SERVICE_LEVEL_OBJECTIVE__LOWER_THRESHOLD,
ServicelevelObjectivePackage.Literals.THRESHOLD__THRESHOLD_LIMIT
));
}
//bind GUI components
IObservableValue btnUpperCheckObs = (IObservableValue)upperThresholdBinding.getTarget();
IObservableValue textUpperObs = WidgetProperties.enabled().observe(textUpperBound);
bindingContext.bindValue(textUpperObs, btnUpperCheckObs);
IObservableValue btnLowerCheckObs = (IObservableValue)lowerThresholdBinding.getTarget();
IObservableValue textLowerObs = WidgetProperties.enabled().observe(textLowerBound);
bindingContext.bindValue(textLowerObs, btnLowerCheckObs);
bindingContext.updateTargets();
}