本文整理汇总了Java中com.vaadin.data.Property.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getValue方法的具体用法?Java Property.getValue怎么用?Java Property.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.Property
的用法示例。
在下文中一共展示了Property.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: passesFilter
import com.vaadin.data.Property; //导入方法依赖的package包/类
/**
* Pass le filtre
*
* @param itemId
* @param item
* @return true si filtre ok
*/
@Override
public boolean passesFilter(Object itemId, Item item) {
final Property<?> p = item.getItemProperty(propertyId);
if (p == null) {
return false;
}
Object propertyValue = p.getValue();
if (propertyValue == null) {
return false;
}
final String value = stripAccents(propertyValue.toString());
if (!value.contains(filterString)) {
return false;
}
return true;
}
示例2: serviceTableClicked
import com.vaadin.data.Property; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private void serviceTableClicked(long itemId) {
ComboBox policyComboBox = (ComboBox) this.serviceTable.getContainerProperty(itemId, PROPERTY_ID_POLICY)
.getValue();
ComboBox failurePolicyComboBox = (ComboBox) this.serviceTable
.getContainerProperty(itemId, PROPERTY_ID_FAILURE_POLICY).getValue();
Property itemProperty = this.serviceTable.getContainerProperty(itemId, PROPERTY_ID_ENABLED);
boolean currentValue = (boolean) itemProperty.getValue();
if (policyComboBox.getContainerDataSource().size() > 0) {
if (isBindedWithMultiplePolicies(itemId)) {
policyComboBox.setEnabled(false);
} else {
policyComboBox.setEnabled(currentValue);
}
}
if (failurePolicyComboBox.getData() != null) {
failurePolicyComboBox.setEnabled(currentValue);
}
}
示例3: 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();
}
}
示例4: passesFilter
import com.vaadin.data.Property; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {
for (String property : properties) {
Property prop = item.getItemProperty(property);
if (prop != null) {
String value = null;
if (prop.getValue() != null) {
value = prop.getValue().toString();
}
if (StringUtils.containsIgnoreCase(value, text)) {
return true;
}
} else {
throw new RuntimeException("Property " + property + " does not exist in item, valid properties are: " + item.getItemPropertyIds());
}
}
return false;
}
示例5: execute
import com.vaadin.data.Property; //导入方法依赖的package包/类
public Undoer execute(final List<VertexRef> targets, final OperationContext operationContext) {
String ipAddr = "";
int port = 22;
if (targets != null) {
for(final VertexRef target : targets) {
final Item vertexItem = operationContext.getGraphContainer().getBaseTopology().getVertex(target).getItem();
if (vertexItem != null) {
final Property ipAddrProperty = vertexItem.getItemProperty("ipAddr");
ipAddr = ipAddrProperty == null ? "" : (String) ipAddrProperty.getValue();
//Property portProperty = operationContext.getGraphContainer().getVertexItem(target).getItemProperty("port");
port = 22; //portProperty == null ? -1 : (Integer) portProperty.getValue();
}
}
}
operationContext.getMainWindow().addWindow(new AuthWindow(ipAddr, port));
return null;
}
示例6: 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();
}
}
}
示例7: formatPropertyValue
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
protected String formatPropertyValue(final Object rowId,
final Object colId, final Property<?> property) {
String result = super.formatPropertyValue(rowId, colId, property);
if (colId.equals("revenue")) {
if (property != null && property.getValue() != null) {
Double r = (Double) property.getValue();
String ret = new DecimalFormat("#.##").format(r);
result = "$" + ret;
} else {
result = "";
}
}
return result;
}
示例8: passesFilter
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {
Property property = item.getItemProperty(propertyId);
if (property == null || !property.getType().equals(String.class))
return false;
String value = (String) property.getValue();
return match(value) || checkParents((MenuItem) itemId);
}
示例9: 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);
}
示例10: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource)
{
super.setPropertyDataSource(newDataSource);
if (newDataSource != null) {
layout.removeAllComponents();
Component value = (Component) newDataSource.getValue();
if (value != null) {
layout.addComponent(value);
}
}
}
示例11: generateCell
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public Object generateCell(com.vaadin.ui.Table source, Object itemId, Object columnId) {
final Property property = source.getItem(itemId).getItemProperty(columnId);
final Object value = property.getValue();
if (value == null) {
return null;
}
String stringValue = value.toString();
if (columnId instanceof MetaPropertyPath) {
MetaProperty metaProperty = ((MetaPropertyPath) columnId).getMetaProperty();
if (DynamicAttributesUtils.isDynamicAttribute(metaProperty))
stringValue = DynamicAttributesUtils.getDynamicAttributeValueAsString(metaProperty, value);
}
String cellValue = stringValue;
boolean isMultiLineCell = StringUtils.contains(stringValue, "\n");
if (isMultiLineCell) {
cellValue = StringUtils.replace(cellValue, "\n", " ");
}
int maxTextLength = column.getMaxTextLength();
if (stringValue.length() > maxTextLength + MAX_TEXT_LENGTH_GAP || isMultiLineCell) {
return StringUtils.abbreviate(cellValue, maxTextLength);
} else {
return cellValue;
}
}
示例12: formatPropertyValue
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
protected String formatPropertyValue(Object rowId, Object colId,
Property property) {
if (colId.equals("stockCount")) {
Integer stock = (Integer) property.getValue();
if (stock.equals(0)) {
return "-";
} else {
return stock.toString();
}
}
return super.formatPropertyValue(rowId, colId, property);
}
示例13: formatPropertyValue
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
protected String formatPropertyValue(Object rowId, Object colId, Property<?> property) {
if (property.getValue() != null) {
if (property.getType() == Date.class) {
return CommonUiUtils.formatDateTime((Date) property.getValue());
}
}
return super.formatPropertyValue(rowId, colId, property);
}
示例14: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void setPropertyDataSource(Property newDataSource) {
String value = (String) newDataSource.getValue();
if (value != null) {
TimezoneVal timezoneVal = new TimezoneVal(value);
areaSelection.setValue(timezoneVal.getArea());
timezoneSelection.setValue(value);
}
super.setPropertyDataSource(newDataSource);
}
示例15: generateCell
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Property property = source.getContainerProperty(itemId, columnId);
if (property == null || property.getValue() == null) {
return null;
} else {
return ((OnmsServiceType)property.getValue()).getName();
}
}