org.eclipse.core.databinding.observable.value.WritableValue类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中org.eclipse.core.databinding.observable.value.WritableValue类的一些代码示例,展示了WritableValue类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableValue类的具体详情如下:
包路径:org.eclipse.core.databinding.observable.value.WritableValue
类名称:WritableValue

WritableValue介绍

[英]Mutable (writable) implementation of IObservableValue that will maintain a value and fire change events when the value changes.

This class is thread safe. All state accessing methods must be invoked from the Realm#isCurrent(). Methods for adding and removing listeners may be invoked from any thread.
[中]IObservableValue的可变(可写)实现,它将维护一个值,并在值更改时触发更改事件。
这个类是线程安全的。必须从#isCurrent()领域调用所有状态访问方法。可以从任何线程调用添加和删除侦听器的方法。

代码示例

代码示例来源:origin: org.eclipse.fx/org.eclipse.core.databinding.observable

/**
   * @param elementType can be <code>null</code>
   * @return new instance with the default realm and a value of <code>null</code>
   */
  public static WritableValue withValueType(Object elementType) {
    return new WritableValue(Realm.getDefault(), null, elementType);
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.databinding

@Override
  public void run() {
    validationStatusObservable.setValue(status);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.core.databinding

private void setValidationStatus(final IStatus status) {
  validationStatusObservable.getRealm().exec(() -> validationStatusObservable.setValue(status));
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.core.di.context

final WritableValue w = new WritableValue(r);
w.setValue(sourceObject.getValue());
w.addValueChangeListener( event -> sourceObject.publish(event.diff.getNewValue()));
sourceObject.subscribeOnValueChange( value -> w.setValue(value));
sourceObject.subscribeOnDispose(value -> w.dispose());
return w;

代码示例来源:origin: org.eclipse.fx/org.eclipse.core.databinding

private void setValidationStatus(final IStatus status) {
  validationStatusObservable.getRealm().exec(new Runnable() {
    public void run() {
      validationStatusObservable.setValue(status);
    }
  });
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.databinding

private void setValidationStatus(final IStatus status) {
  validationStatusObservable.getRealm().exec(new Runnable() {
    @Override
    public void run() {
      validationStatusObservable.setValue(status);
    }
  });
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.databinding

@Override
protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor

@Override
  public void handleChange ( final ChangeEvent event )
  {
    ConfigurationEditorInput.this.dirtyValue.setValue ( true );
  }
} );

代码示例来源:origin: org.eclipse.fx/org.eclipse.core.databinding

protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor

public void insertEntry ( final String key, final String value )
{
  this.dataMap.put ( key, value );
  this.dirtyValue.setValue ( true );
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.databinding

@Override
protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor

public void deleteEntry ( final String key )
{
  this.dataMap.remove ( key );
  this.dirtyValue.setValue ( true );
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.databinding

@Override
protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.recommenders.completion.rcp/calls

@Override
  public void selectionChanged(final SelectionChangedEvent event) {
    final Optional<Tuple<ClasspathEntryInfo, ModelArchiveMetadata<?, ?>>> e = RCPUtils.first(event
        .getSelection());
    mValue.setValue(e.get().getSecond());
    rValue.setValue(e.get().getFirst());
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.core.databinding

@Override
protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue<>(
        context.getValidationRealm(), Status.OK_STATUS,
        IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor

public void updateEntry ( final String oldKey, final String key, final String value )
{
  this.dataMap.setStale ( true );
  this.dataMap.remove ( oldKey );
  this.dataMap.put ( key, value );
  this.dataMap.setStale ( false );
  this.dirtyValue.setValue ( true );
}

代码示例来源:origin: org.eclipse.fx/org.eclipse.core.databinding

protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor

protected void setResult ( final ConfigurationInformation configurationInformation )
{
  this.dataMap.setStale ( true );
  this.dataMap.clear ();
  if ( configurationInformation != null )
  {
    this.dataMap.putAll ( configurationInformation.getData () );
  }
  this.dataMap.setStale ( false );
  this.dirtyValue.setValue ( false );
}

代码示例来源:origin: org.eclipse.fx/org.eclipse.core.databinding

protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue(context
        .getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.core.databinding

@Override
protected void preInit() {
  ObservableTracker.setIgnore(true);
  try {
    validationStatusObservable = new WritableValue<>(
        context.getValidationRealm(), Status.OK_STATUS, IStatus.class);
  } finally {
    ObservableTracker.setIgnore(false);
  }
}

相关文章