本文整理汇总了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 ();
}
示例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$
}
示例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$
}
示例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);
}
示例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);
}
示例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));
}
}
示例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);
}
示例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;
}
示例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 ) );
}
示例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;
}
示例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 );
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}