本文整理汇总了Java中org.eclipse.core.databinding.observable.value.IObservableValue.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java IObservableValue.getValue方法的具体用法?Java IObservableValue.getValue怎么用?Java IObservableValue.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.databinding.observable.value.IObservableValue
的用法示例。
在下文中一共展示了IObservableValue.getValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: coalesceElements
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
@Override
protected Object coalesceElements(Collection elements) {
Date earliest = null;
Date latest = null;
for (Object o : elements) {
IObservableValue v = (IObservableValue) o;
Date value = (Date) v.getValue();
if (value == null) {
continue;
}
if (earliest == null || value.before(earliest)) {
earliest = value;
}
if (latest == null || value.after(latest)) {
latest = value;
}
}
if (latest == null || earliest == null) {
return Amount.valueOf(0L, SI.MILLI(SI.SECOND));
}
return Amount.valueOf(latest.getTime() - earliest.getTime(), SI.MILLI(SI.SECOND));
}
示例2: coalesceElements
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected Object coalesceElements(Collection elements) {
final EMap<ADEffectKey, ComputableAmount> effects = ActivityDictionaryFactory.eINSTANCE.createADEffectMember().getEffects();
for (Object element : elements) {
IObservableValue v = (IObservableValue) element;
final EMap elementEffects = (EMap) v.getValue();
Set entrySet = new HashSet(elementEffects.entrySet());
for (Object e : entrySet) {
Entry<ADEffectKey, ComputableAmount> entry = (Entry<ADEffectKey, ComputableAmount>) e;
ADEffectKey key = entry.getKey();
if (effects.containsKey(key)) {
Amount<?> currentValue = EMFUtils.copy(entry.getValue()).getAmount();
Amount<?> subTotal = EMFUtils.copy(effects.get(key)).getAmount();
subTotal = subTotal.plus(currentValue);
ComputableAmount totalCA = JScienceFactory.eINSTANCE.createComputableAmount(subTotal, ComputingState.COMPLETE);
effects.put(key, totalCA);
} else {
effects.put(EMFUtils.copy(key), EMFUtils.copy(entry.getValue()));
}
}
}
return effects;
}
示例3: coalesceElements
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
@Override
protected Object coalesceElements(Collection elements) {
Amount total = null;
for (Object o : elements) {
IObservableValue v = (IObservableValue) o;
Object value = v.getValue();
Amount<?> current = null;
if (value instanceof ComputableAmount) {
current = ((ComputableAmount)value).getAmount();
} else if (value instanceof Amount) {
current = (Amount<?>) value;
} else {
continue;
}
if (current != null) {
if (total == null) {
total = current;
} else {
total = total.plus(current);
}
}
}
return total;
}
示例4: getDeployArtifactPathValidationStatus
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
private static IStatus getDeployArtifactPathValidationStatus(
AppEngineDeployPreferencesPanel panel) {
DataBindingContext context = panel.getDataBindingContext();
for (Object provider : context.getValidationStatusProviders()) {
if (provider instanceof DeployArtifactValidator) {
IObservableValue value = ((DeployArtifactValidator) provider).getValidationStatus();
return (IStatus) value.getValue();
}
}
return null;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:12,代码来源:FlexExistingArtifactDeployPreferencesPanelTest.java
示例5: getAppYamlPathValidationStatus
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
private static IStatus getAppYamlPathValidationStatus(FlexDeployPreferencesPanel panel) {
DataBindingContext context = panel.getDataBindingContext();
for (Object provider : context.getValidationStatusProviders()) {
if (provider instanceof AppYamlValidator) {
IObservableValue value = ((AppYamlValidator) provider).getValidationStatus();
return (IStatus) value.getValue();
}
}
return null;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:11,代码来源:FlexDeployPreferencesPanelTest.java
示例6: fillDefaults
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
@Override
protected void fillDefaults(IObservableValue source, IObservableValue destination) {
lastSetValue = destination.getValue();
super.fillDefaults(source, destination);
}
示例7: initDataBindings
import org.eclipse.core.databinding.observable.value.IObservableValue; //导入方法依赖的package包/类
protected void initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
WizardPageSupport.create(this, bindingContext);
IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(dbNameText);
final IObservableValue dbNameModelValue = BeanProperties.value("dbName").observe(dbModel);
bindingContext.bindValue(widgetValue, dbNameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(dbModel);
bindingContext.bindValue(widgetValue, instanceModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
final IObservableValue hostModelValue = BeanProperties.value("host").observe(dbModel);
bindingContext.bindValue(widgetValue, hostModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
final IObservableValue protModelValue = BeanProperties.value("port").observe(dbModel);
bindingContext.bindValue(widgetValue, protModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(dbModel);
bindingContext.bindValue(widgetValue, locationModelValue, null, null);
//
widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(dbModel);
bindingContext.bindValue(widgetValue, usernameModelValue, null, null);
widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
final IObservableValue passwordModelValue = BeanProperties.value("password").observe(dbModel);
bindingContext.bindValue(widgetValue, passwordModelValue, null, null);
MultiValidator myValidator = new MultiValidator() {
@Override
protected IStatus validate() {
dbNameModelValue.getValue();
instanceModelValue.getValue();
hostModelValue.getValue();
protModelValue.getValue();
locationModelValue.getValue();
usernameModelValue.getValue();
passwordModelValue.getValue();
return validator();
}
};
bindingContext.addValidationStatusProvider(myValidator);
}