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


Java BeansObservables.observeValue方法代码示例

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


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

示例1: update

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
protected void update ( final ISelection selection )
{
    if ( this.lockedKeyObs != null )
    {
        this.lockedKeyObs.dispose ();
    }

    this.selectedKey = SelectionHelper.first ( selection, Key.class );
    this.lockable = SelectionHelper.first ( selection, Locked.class );

    if ( this.lockable != null )
    {
        this.lockedKeyObs = BeansObservables.observeValue ( this.lockable, Locked.PROP_LOCKED );
        this.lockedKeyObs.addValueChangeListener ( new ButtonUpdater () );
    }

    updateButtons ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:KeySelectorDialog.java

示例2: bindUniverseDefinition

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的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));
	}
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:21,代码来源:EditVersionPage.java

示例3: DataItemSeriesViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
public DataItemSeriesViewer ( final DataBindingContext dbc, final DataItemSeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator )
{
    super ( dbc, element, viewer, resourceManager, xLocator, yLocator );

    this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT );
    this.linePropertiesObservable = EMFObservables.observeValue ( element, ChartPackage.Literals.DATA_ITEM_SERIES__LINE_PROPERTIES );

    addBindings ( LinePropertiesBinder.bind ( dbc, this.inputObservable, this.linePropertiesObservable ) );

    setInputObserable ( this.inputObservable );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:DataItemSeriesViewer.java

示例4: ScriptSeriesViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
public ScriptSeriesViewer ( final DataBindingContext dbc, final ScriptSeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator )
{
    super ( dbc, element, viewer, resourceManager, xLocator, yLocator );

    this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT );
    this.linePropertiesObservable = EMFObservables.observeValue ( element, ChartPackage.Literals.SCRIPT_SERIES__LINE_PROPERTIES );

    addBinding ( dbc.bindValue ( PojoObservables.observeDetailValue ( this.inputObservable, "script", null ), EMFObservables.observeValue ( element, ChartPackage.Literals.SCRIPT_SERIES__SCRIPT ) ) ); //$NON-NLS-1$
    addBindings ( LinePropertiesBinder.bind ( dbc, this.inputObservable, this.linePropertiesObservable ) );

    setInputObserable ( this.inputObservable );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:ScriptSeriesViewer.java

示例5: initDataBindings

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
protected DataBindingContext initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();
	//
	IObservableValue lblOFFLINENACHSIGNATURENObserveTextObserveWidget = SWTObservables.observeText(lblOFFLINENACHSIGNATUREN);
	IObservableValue kseStatusNumberOfflineNachsignaturenObserveValue = BeansObservables.observeValue(kseStatus, "numberOfflineNachsignaturen");
	bindingContext.bindValue(lblOFFLINENACHSIGNATURENObserveTextObserveWidget, kseStatusNumberOfflineNachsignaturenObserveValue, null, null);
	//
	IObservableValue lblGESPEICHERTEKONSULTATIONENObserveTextObserveWidget = SWTObservables.observeText(lblGESPEICHERTEKONSULTATIONEN);
	IObservableValue kseStatusNumberOfflineKonsultationenObserveValue = BeansObservables.observeValue(kseStatus, "numberOfflineKonsultationen");
	bindingContext.bindValue(lblGESPEICHERTEKONSULTATIONENObserveTextObserveWidget, kseStatusNumberOfflineKonsultationenObserveValue, null, null);
	//
	return bindingContext;
}
 
开发者ID:MEDEVIT,项目名称:ecard,代码行数:14,代码来源:KonsultationenView.java

示例6: createMavenToOsgiVersionMappingStrategy

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的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();
		}
	});
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:31,代码来源:VersionTigerPreferencesPage.java

示例7: createOsgiReleaseQualifier

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
private void createOsgiReleaseQualifier(UpdateValueStrategy strategy, Group osgiQualifierGroup) {
	Label customOsgiReleaseQualifierLabel = new Label(osgiQualifierGroup, SWT.CHECK);
	customOsgiReleaseQualifierLabel.setText(Messages.preferencesOsgiReleaseQualifierLabel);
	GridDataFactory.fillDefaults().indent(0, 20).applyTo(customOsgiReleaseQualifierLabel);
	
	Text customOsgiReleaseQualifier = new Text(osgiQualifierGroup, SWT.BORDER | SWT.FILL);
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(customOsgiReleaseQualifier);
	
	IObservableValue releaseText = WidgetProperties.text(SWT.Modify).observe(customOsgiReleaseQualifier);
	IObservableValue releaseModel = BeansObservables.observeValue(model, PreferencesPageModel.PN_OSGI_RELEASE_QUALIFIER);
	dataBindingContext.bindValue(releaseText, releaseModel, strategy, null);
	
	customQualifiersControls.add(customOsgiReleaseQualifierLabel);
	customQualifiersControls.add(customOsgiReleaseQualifier);
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:16,代码来源:VersionTigerPreferencesPage.java

示例8: createOsgiSnapshotQualifier

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
private void createOsgiSnapshotQualifier(UpdateValueStrategy strategy, Group osgiQualifierGroup) {
	Label customOsgiSnapshotQualifierLabel = new Label(osgiQualifierGroup, SWT.CHECK);
	customOsgiSnapshotQualifierLabel.setText(Messages.preferencesOsgiSnapshotQualifierLabel);
	
	Text customOsgiSnapshotQualifier = new Text(osgiQualifierGroup, SWT.BORDER);
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(customOsgiSnapshotQualifier);
	
	IObservableValue snapshotText = WidgetProperties.text(SWT.Modify).observe(customOsgiSnapshotQualifier);
	IObservableValue snapshotModel = BeansObservables.observeValue(model, PreferencesPageModel.PN_OSGI_SNAPSHOT_QUALIFIER);
	dataBindingContext.bindValue(snapshotText, snapshotModel, strategy, null);
	
	customQualifiersControls.add(customOsgiSnapshotQualifierLabel);
	customQualifiersControls.add(customOsgiSnapshotQualifier);
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:15,代码来源:VersionTigerPreferencesPage.java

示例9: createVersionRangeChangeStrategy

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的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();
		}
	});
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:36,代码来源:VersionTigerPreferencesPage.java

示例10: initDataBindings

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
private DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();

    IObservableValue nameTextObserveWidget = SWTObservables
            .observeText(commandText, SWT.Modify);
    IObservableValue personNameObserveValue = BeansObservables.observeValue(
            commandEntryPresenter, "command");

    bindingContext.bindValue(nameTextObserveWidget, personNameObserveValue,
            new UpdateValueStrategy().setAfterConvertValidator(validator), null);
    return bindingContext;
}
 
开发者ID:yuflyud,项目名称:eclipse-commando-plugin,代码行数:13,代码来源:CommandDialog.java

示例11: bindText

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
/**
 * Returns an observable observing the text attribute of the provided <code>control</code>. The supported types
 * are:
 * <ul>
 * <li>org.eclipse.swt.widgets.Text</li>
 * <li>org.eclipse.swt.custom.StyledText (as of 1.3)</li>
 * </ul>
 * 
 * @param control
 * @param event event type to register for change events {@literal SWT.FocusOut  SWT.Modify or SWT.NONE}
 * @param bean
 * @param propertyName
 * @param validator
 * @param converter
 * @return binding
 * @throws IllegalArgumentException if <code>control</code> type is unsupported
 */
public DecoratedBinding bindText(Control control, int event, Object bean, String propertyName,
		IValidator validator, IConverter targetToModelConverter, IConverter modelToTargetConverter) {

	// IObservableValue widgetValue =
	// WidgetProperties.text(SWT.Modify).observe(serverUriText);
	// IObservableValue modelValuea = BeanProperties.value(Connection.class,
	// "serverURI").observe(connection);

	// observe
	IObservableValue widgetValue = SWTObservables.observeText(control, event);
	IObservableValue modelValue = BeansObservables.observeValue(bean, propertyName);

	UpdateValueStrategy targetToModel = new UpdateValueStrategy();
	UpdateValueStrategy modelToTarget = new UpdateValueStrategy();

	// targetToModel
	// validator
	if (validator != null) {
		targetToModel.setBeforeSetValidator(validator);
	}
	// converter
	if (targetToModelConverter != null) {
		targetToModel.setConverter(targetToModelConverter);
	}

	// modelToTarget
	if (modelToTargetConverter != null) {
		modelToTarget.setConverter(modelToTargetConverter);
	}

	Binding bindValue = context.bindValue(widgetValue, modelValue, targetToModel, modelToTarget);

	// decoration
	ControlDecorationSupport decorationSupport = ControlDecorationSupport.create(bindValue, SWT.TOP | SWT.LEFT);

	return new DecoratedBinding(bindValue, decorationSupport);
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:55,代码来源:DataBindings.java

示例12: ArchiveChannelViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
public ArchiveChannelViewer ( final DataBindingContext dbc, final ArchiveChannel element, final ChartViewer viewer, final ResourceManager resourceManager, final ArchiveSeriesViewer archiveSeriesViewer )
{
    super ();

    this.viewer = viewer;

    this.resourceManager = resourceManager;

    addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "channelName" ), EMFObservables.observeValue ( element, ChartPackage.Literals.ARCHIVE_CHANNEL__NAME ) ) ); //$NON-NLS-1$
    addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "querySeriesData" ), BeansObservables.observeValue ( archiveSeriesViewer, ArchiveSeriesViewer.PROP_QUERY_SERIES_DATA ) ) ); //$NON-NLS-1$

    addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "XAxisViewer" ), BeansObservables.observeValue ( archiveSeriesViewer, AbstractInputViewer.PROP_X_AXIS ) ) ); //$NON-NLS-1$
    addBinding ( dbc.bindValue ( PojoObservables.observeValue ( this, "YAxisViewer" ), BeansObservables.observeValue ( archiveSeriesViewer, AbstractInputViewer.PROP_Y_AXIS ) ) ); //$NON-NLS-1$

    this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT );
    this.linePropertiesObservable = EMFObservables.observeValue ( element, ChartPackage.Literals.ARCHIVE_CHANNEL__LINE_PROPERTIES );

    addBinding ( dbc.bindValue ( PojoObservables.observeDetailValue ( this.inputObservable, "label", null ), EMFObservables.observeValue ( element, ChartPackage.Literals.ARCHIVE_CHANNEL__LABEL ) ) ); //$NON-NLS-1$

    addBindings ( LinePropertiesBinder.bind ( dbc, this.inputObservable, this.linePropertiesObservable ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:ArchiveChannelViewer.java

示例13: bindSelection

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
/**
 * @param control
 * @param bean
 * @param propertyName
 */
public Binding bindSelection(Control control, Object bean, String propertyName) {
	IObservableValue widgetValue = SWTObservables.observeSelection(control);
	IObservableValue modelValue = BeansObservables.observeValue(bean, propertyName);
	return context.bindValue(widgetValue, modelValue, null, null);
}
 
开发者ID:gulliverrr,项目名称:hestia-engine-dev,代码行数:11,代码来源:DataBindings.java

示例14: CompositeArchiveQualityViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入方法依赖的package包/类
public CompositeArchiveQualityViewer ( final DataBindingContext dbc, final CompositeArchiveQualitySeries element, final ChartViewer viewer, final ResourceManager resourceManager, final AxisLocator<XAxis, XAxisViewer> xLocator, final AxisLocator<YAxis, YAxisViewer> yLocator )
{
    super ( dbc, element, viewer, resourceManager, xLocator, yLocator );

    this.inputObservable = BeansObservables.observeValue ( this, PROP_INPUT );

    addBinding ( dbc.bindValue ( PojoObservables.observeDetailValue ( this.inputObservable, PROP_THRESHOLD, null ), EMFObservables.observeValue ( element, ChartPackage.Literals.COMPOSITE_ARCHIVE_QUALITY_SERIES__THRESHOLD ) ) );

    setInputObserable ( this.inputObservable );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:CompositeArchiveQualityViewer.java


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