本文整理汇总了Java中com.vaadin.data.Property.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Property.setValue方法的具体用法?Java Property.setValue怎么用?Java Property.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.Property
的用法示例。
在下文中一共展示了Property.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateSentStatus
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public <BT extends ISendAwareBean> void updateSentStatus(final BeanItem<BT> item)
{
final BT bean = item.getBean();
final boolean sent = bean.checkSent();
@SuppressWarnings("unchecked")
final Property<Boolean> sentProperty = item.getItemProperty(ProductQtyReport.PROPERTY_Sent);
if (sentProperty.getValue() == sent)
{
return;
}
sentProperty.setValue(sent);
//
// Adjust the not-sent counter
if (sent)
{
decrementNotSentCounter();
}
else
{
incrementNotSentCounter();
}
}
示例2: moveItem
import com.vaadin.data.Property; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected void moveItem(boolean moveUp) {
if (this.serviceTable.getValue() != null) {
long selectedItemId = (long) this.serviceTable.getValue();
Property<Long> selectedItemChainProperty = this.serviceTable.getContainerProperty(selectedItemId,
PROPERTY_ID_CHAIN_ORDER);
Long currentOrderValue = selectedItemChainProperty.getValue();
Object nextItemIdObj = this.serviceTable.nextItemId(selectedItemId);
Object previousItemIdObj = this.serviceTable.prevItemId(selectedItemId);
if (moveUp && previousItemIdObj != null) {
Property<Long> previousItemChainProperty = this.serviceTable.getContainerProperty(previousItemIdObj,
PROPERTY_ID_CHAIN_ORDER);
Long previousItemOrderValue = previousItemChainProperty.getValue();
selectedItemChainProperty.setValue(previousItemOrderValue);
previousItemChainProperty.setValue(currentOrderValue);
sortByChainOrder();
} else if (!moveUp && nextItemIdObj != null) {
Property<Long> nextItemChainProperty = this.serviceTable.getContainerProperty(nextItemIdObj,
PROPERTY_ID_CHAIN_ORDER);
Long nextItemOrderValue = nextItemChainProperty.getValue();
selectedItemChainProperty.setValue(nextItemOrderValue);
nextItemChainProperty.setValue(currentOrderValue);
sortByChainOrder();
}
}
}
示例3: fillContainer
import com.vaadin.data.Property; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void fillContainer(HierarchicalContainer container, List<MenuItem> items, MenuItem parent) {
for (MenuItem item : items) {
Item containerItem = container.addItem(item);
Property<String> caption = containerItem.getItemProperty(PROPERTY_CAPTION);
caption.setValue(samplesMenuConfig.getMenuItemCaption(item.getId()));
container.setParent(item, parent);
if (item.isMenu()) {
fillContainer(container, item.getChildren(), item);
} else {
container.setChildrenAllowed(item, false);
}
}
}
示例4: onNextWeekTrendButtonPressed
import com.vaadin.data.Property; //导入方法依赖的package包/类
private void onNextWeekTrendButtonPressed(final Trend nextWeekTrend)
{
@SuppressWarnings("unchecked")
final Property<Trend> nextWeekTrendProperty = weekQtyReportItem.getItemProperty(WeekProductQtyReport.PROPERTY_NextWeekTrend);
nextWeekTrendProperty.setValue(nextWeekTrend);
updateUI_NextWeekTrand();
}
示例5: addQty
import com.vaadin.data.Property; //导入方法依赖的package包/类
private final void addQty(final BeanItem<WeekProductQtyReport> weekQtyReportItem, final BigDecimal qtyToAdd)
{
@SuppressWarnings("unchecked")
final Property<BigDecimal> qtyProperty = weekQtyReportItem.getItemProperty(WeekProductQtyReport.PROPERTY_Qty);
final BigDecimal qtyOld = qtyProperty.getValue();
final BigDecimal qtyNew = qtyOld.add(qtyToAdd);
qtyProperty.setValue(qtyNew);
}
示例6: setNextWeekTrend
import com.vaadin.data.Property; //导入方法依赖的package包/类
public void setNextWeekTrend(final Product product, final Trend nextWeekTrend)
{
final BeanItem<WeekProductQtyReport> weekQtyReportItem = getCreateItemByProduct(product);
@SuppressWarnings("unchecked")
final Property<Trend> nextWeekTrendProperty = weekQtyReportItem.getItemProperty(WeekProductQtyReport.PROPERTY_NextWeekTrend);
nextWeekTrendProperty.setValue(nextWeekTrend);
}
示例7: addCaptionedItem
import com.vaadin.data.Property; //导入方法依赖的package包/类
private void addCaptionedItem(String caption, Object parent, String id) {
// add item, let tree decide id
this.availableModelsTree.addItem(id);
// get the created item
final Item item = this.availableModelsTree.getItem(id);
// set our "caption" property
final Property p = item.getItemProperty(CAPTION_PROPERTY);
p.setValue(caption);
if (parent != null) {
this.availableModelsTree.setChildrenAllowed(parent, true);
this.availableModelsTree.setParent(id, parent);
}
}
示例8: setValue
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setValue(T newValue) throws ReadOnlyException {
if (value == newValue || value != null && value.equals(newValue)) {
fireValueChange(true);
} else {
this.value = newValue;
fireValueChange(false);
}
Property p = getPropertyDataSource();
if (p != null) p.setValue(value);
}
示例9: setFieldValue
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setFieldValue(FormInstance formInstance, AbstractComponent field, Object value) {
Property prop = (Property) field;
boolean last = prop.isReadOnly();
prop.setReadOnly(false);
prop.setValue(value);
prop.setReadOnly(last);
}
示例10: getPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Property getPropertyDataSource() {
Property result = super.getPropertyDataSource();
if (result != null) {
Object newValue = result.getValue();
if (fromField.getValue() != null && toField.getValue() != null && newValue instanceof Interval) {
Interval interval = new Interval(fromField.getValue().getTime(), toField.getValue().getTime());
result.setValue(interval);
}
}
return result;
}
示例11: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
Object value = newDataSource.getValue();
if (value == null) {
newDataSource.setValue(StatusI18nEnum.Open.name());
}
super.setPropertyDataSource(newDataSource);
}
示例12: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
Object value = newDataSource.getValue();
if (value == null) {
newDataSource.setValue(MilestoneStatus.InProgress.name());
}
super.setPropertyDataSource(newDataSource);
}
示例13: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
Object value = newDataSource.getValue();
if (value == null) {
newDataSource.setValue(OptionI18nEnum.BugSeverity.Major.name());
}
super.setPropertyDataSource(newDataSource);
}
示例14: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
Object value = newDataSource.getValue();
if (value == null) {
newDataSource.setValue(Priority.Medium.name());
}
super.setPropertyDataSource(newDataSource);
}
示例15: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
Double value = (Double) newDataSource.getValue();
if (value != null) {
double roundValue = Math.ceil(value / 10) * 10;
newDataSource.setValue(roundValue);
slider.setPropertyDataSource(newDataSource);
progressLbl.setValue(roundValue + "%");
}
super.setPropertyDataSource(newDataSource);
}