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


Java BeansObservables类代码示例

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


BeansObservables类属于org.eclipse.core.databinding.beans包,在下文中一共展示了BeansObservables类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: XAxisViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
public XAxisViewer ( final DataBindingContext dbc, final ChartRenderer manager, final XAxis axis, final boolean top )
{
    super ( dbc, manager, axis );

    this.axis = axis;

    this.control = new org.eclipse.scada.chart.XAxis ();

    this.renderer = new XAxisDynamicRenderer ( manager );
    this.renderer.setAxis ( this.control );
    this.renderer.setAlign ( top ? SWT.TOP : SWT.BOTTOM );
    manager.addRenderer ( this.renderer, -2 );

    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "label" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__LABEL ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "min" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.XAXIS__MINIMUM ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "max" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.XAXIS__MAXIMUM ) ) ); //$NON-NLS-1$

    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "showLabels" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__LABEL_VISIBLE ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "format" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__FORMAT ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "textPadding" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__TEXT_PADDING ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "color" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__COLOR ) ) ); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:XAxisViewer.java

示例3: YAxisViewer

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
public YAxisViewer ( final DataBindingContext dbc, final ChartRenderer manager, final YAxis axis, final boolean left )
{
    super ( dbc, manager, axis );

    this.axis = axis;

    this.control = new org.eclipse.scada.chart.YAxis ();

    this.renderer = new YAxisDynamicRenderer ( manager );
    this.renderer.setAxis ( this.control );
    this.renderer.setAlign ( left ? SWT.LEFT : SWT.RIGHT );
    manager.addRenderer ( this.renderer, -1 );

    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "label" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__LABEL ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "min" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.YAXIS__MINIMUM ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( BeansObservables.observeValue ( this.control, "max" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.YAXIS__MAXIMUM ) ) ); //$NON-NLS-1$

    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "showLabels" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__LABEL_VISIBLE ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "format" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__FORMAT ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "textPadding" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__TEXT_PADDING ) ) ); //$NON-NLS-1$
    addBinding ( this.dbc.bindValue ( PojoObservables.observeValue ( this.renderer, "color" ), EMFObservables.observeValue ( this.axis, ChartPackage.Literals.AXIS__COLOR ) ) ); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:YAxisViewer.java

示例4: initBinding

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
@Override
protected void initBinding() throws ConnectException {
	BindingHelper.bindStringToTextField(txtBarcode, getInputObservable(), Copy.FIELD_BARCODE, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtCondition, getInputObservable(), Copy.FIELD_CONDITION, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtEdition, getInputObservable(), Copy.FIELD_EDITION, bindingContext,
			false);

	// one-way binding to update the input in sub-form
	bindingContext.bindValue(BeansObservables.observeValue(mediumInformationForm, INPUT),
			BeansObservables.observeDetailValue(inputObservable, Copy.FIELD_MEDIUM, Medium.class),
			new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), null);
	bindingContext.bindValue(BeansObservables.observeValue(movementForm, INPUT), inputObservable,
			new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), null);
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:17,代码来源:InventoryView.java

示例5: initBinding

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
@Override
protected void initBinding() throws ConnectException {
	BindingHelper.bindStringToTextField(txtBarcode, copyToModifyObservable, Copy.FIELD_BARCODE, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtEdition, copyToModifyObservable, Copy.FIELD_EDITION, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtCondition, copyToModifyObservable, Copy.FIELD_CONDITION, bindingContext,
			false);

	// one-way binding to update the pseudo-input in sub-forms
	bindingContext.bindValue(BeansObservables.observeValue(movementForm, INPUT), copyToModifyObservable,
			new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), null);
	bindingContext.bindValue(BeansObservables.observeValue(informationForm, INPUT),
			BeansObservables.observeDetailValue(copyToModifyObservable, Copy.FIELD_MEDIUM, Medium.class),
			new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), null);
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:17,代码来源:LendCopyView.java

示例6: 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

示例7: bindAlgoParamValues

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
private void bindAlgoParamValues() {
	DataBindingContext ctx = new DataBindingContext();
	IObservableSet modelSet = BeansObservables.observeSet(
			Realm.getDefault(), selectedAlgorithm, "algorithms");
	// ViewerSupport.bind(checkboxTableViewer, modelSet,
	// BeanProperties.value(Algorithm.class, "name"));

	IObservableSet widgetSet = ViewersObservables.observeCheckedElements(
			algorithmTableViewer, Algorithm.class);
	// modelSet = BeansObservables.obser(Realm.getDefault(),
	// selectedAlgorithm, "algorithms");

	ctx.bindSet(widgetSet, modelSet);

	// .observe(key);
	// ctx.bindSet(widgetSet, modelSet);
	// IObservableValue modelValue = BeanProperties.value(
	// AlgorithmParameter.class, btnBindding.get(key)).observe(
	// algoPara);

}
 
开发者ID:CrowdsourcingGeek,项目名称:CrowdBenchmark,代码行数:22,代码来源:SimulateConfigPart.java

示例8: initDataBindings

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
protected DataBindingContext initDataBindings(){
	DataBindingContext bindingContext = new DataBindingContext();
	
	tableViewerContacts.setContentProvider(contentProvider);
	IObservableMap[] observeMaps =
		BeansObservables.observeMaps(contentProvider.getKnownElements(), IContact.class,
			new String[] {
				"description1", "description2", "mandator", "patient", "user"
			});
	ILabelDecorator decorator =
		PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
	tableViewerContacts.setLabelProvider(new TableDecoratingLabelProvider(
		new ContactSelectorObservableMapLabelProvider(observeMaps), decorator));
	tableViewerContacts.setInput(contactList);
	return bindingContext;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ContactSelectorView.java

示例9: Entry

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
public Entry ( final int index, final SeriesInformation information )
{
    this.index = index;
    this.information = information;

    // must use BeansObversvables to actually receive changes
    addListener ( BeansObservables.observeValue ( information, SeriesInformation.PROP_LABEL ) );
    addListener ( BeansObservables.observeValue ( information, SeriesInformation.PROP_SELECTED_QUALITY ) );
    addListener ( BeansObservables.observeValue ( information, SeriesInformation.PROP_SELECTED_VALUE ) );
    addListener ( BeansObservables.observeValue ( information, SeriesInformation.PROP_SELECTED_TIMESTAMP ) );

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

示例10: createMenu

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
private Composite createMenu ( final Composite parent )
{
    final Composite menu = new Composite ( parent, SWT.NONE );

    menu.setLayout ( new FillLayout () );

    this.viewer = new TreeViewer ( menu, SWT.FULL_SELECTION );

    this.treeContentProvider = new ObservableListTreeContentProvider ( new FactoryImpl (), null );
    this.viewer.setContentProvider ( this.treeContentProvider );

    this.viewer.setLabelProvider ( new TreeNodeLabelProvider ( this.viewer,
            BeansObservables.observeMap ( this.treeContentProvider.getRealizedElements (), TreeNode.PROP_NAME ),
            BeansObservables.observeMap ( this.treeContentProvider.getRealizedElements (), TreeNode.PROP_PROVIDER_SET )
            ) );

    this.viewer.setInput ( this.manager.getRootNode () );

    this.viewer.addSelectionChangedListener ( new ISelectionChangedListener () {

        @Override
        public void selectionChanged ( final SelectionChangedEvent event )
        {
            handleSelectionChanged ( event );
        }
    } );

    this.viewer.setAutoExpandLevel ( 2 );

    return menu;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:32,代码来源:MainEntryPoint.java

示例11: 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

示例12: 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

示例13: initBinding

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
@Override
protected void initBinding() {
	BindingHelper.bindStringToTextField(txtName, curator, Curator.class, Curator.FIELD_NAME, bindingContext, true);
	BindingHelper.bindStringToTextField(txtPassword, curator, Curator.class, Curator.FIELD_PASSWORD, bindingContext,
			true);
	BindingHelper.bindStringToTextField(txtPassword2, BeansObservables.observeValue(this, FIELD_PASSWORD2),
			bindingContext, true);

}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:10,代码来源:ManageCuratorDialog.java

示例14: initBinding

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
@Override
protected void initBinding() {
	// one-way binding to update the input in sub-form
	bindingContext.bindValue(BeansObservables.observeValue(borrowerForm, INPUT),
			BeansObservables.observeValue(this, INPUT), new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
			null);
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:8,代码来源:BorrowerView.java

示例15: initBinding

import org.eclipse.core.databinding.beans.BeansObservables; //导入依赖的package包/类
@Override
protected void initBinding() throws ConnectException {
	BindingHelper.bindStringToTextField(txtBarcode, getInputObservable(), Copy.FIELD_BARCODE, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtEdition, getInputObservable(), Copy.FIELD_EDITION, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtCondition, getInputObservable(), Copy.FIELD_CONDITION, bindingContext,
			false);
	final IObservableValue mediumObservable = BeansObservables.observeDetailValue(getInputObservable(),
			Copy.FIELD_MEDIUM, Medium.class);
	BindingHelper.bindStringToTextField(txtTitle, mediumObservable, Medium.FIELD_TITLE, bindingContext, false);
	BindingHelper.bindStringToTextField(txtAuthor, mediumObservable, Medium.FIELD_AUTHOR, bindingContext, false);
	BindingHelper.bindStringToTextField(txtLanguage, mediumObservable, Medium.FIELD_LANGUAGE, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtPublisher, mediumObservable, Medium.FIELD_PUBLISHER, bindingContext,
			false);
	BindingHelper.bindStringToTextField(txtIsbn, mediumObservable, Medium.FIELD_ISBN, bindingContext, false);

	BindingHelper.bindObjectToCCombo(comboMediumType, mediumObservable, Medium.class, Medium.FIELD_TYPE,
			MediumType.class, ServiceLocator.getInstance().getTypService().list(), new MediumTypeLabelProvider(),
			bindingContext, false);

	// dummy binding to validate that barcode isn't taken
	final UpdateValueStrategy modelToTarget = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
	modelToTarget.setAfterGetValidator(new BarcodeTakenValidator());
	bindingContext.bindValue(new WritableValue(null, String.class), barcodeObservable,
			new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), modelToTarget);
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:29,代码来源:RegisterCopyView.java


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