本文整理汇总了Java中com.vaadin.data.Property类的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于com.vaadin.data包,在下文中一共展示了Property类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValue
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public void setValue(T newValue) throws com.vaadin.data.Property.ReadOnlyException {
// Check read-only
if (isReadOnly()) {
throw new Property.ReadOnlyException();
}
try {
getPropertyBox().setValue(getPropertyId(), newValue);
} catch (@SuppressWarnings("unused") PropertyReadOnlyException e) {
throw new com.vaadin.data.Property.ReadOnlyException("Property is read-only: " + getPropertyId());
}
// fire value change event
fireValueChange();
}
示例2: ItemPropertyValueChangeListener
import com.vaadin.data.Property; //导入依赖的package包/类
/**
* Constructor
* @param item Item
* @param itemStore Item store
*/
public ItemPropertyValueChangeListener(Item item, ItemStore<Item> itemStore) {
super();
this.item = new WeakReference<>(item);
this.itemStore = itemStore;
if (item != null) {
// add value change listener to track property modifications
Collection<?> itemPropertyIds = item.getItemPropertyIds();
if (itemPropertyIds != null) {
trackedItemProperties = new HashSet<>(itemPropertyIds.size());
for (Object itemPropertyId : itemPropertyIds) {
Property<?> itemProperty = item.getItemProperty(itemPropertyId);
if (itemProperty instanceof ValueChangeNotifier) {
((ValueChangeNotifier) itemProperty).addValueChangeListener(this);
trackedItemProperties.add(new WeakReference<>(itemProperty));
}
}
}
}
}
示例3: setValue
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public void setValue(T newValue) throws com.vaadin.data.Property.ReadOnlyException {
this.value = newValue;
// update internal component
updateValue(newValue);
// fire value change
fireValueChange(newValue);
}
示例4: 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;
}
示例5: 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);
}
}
示例6: setPropertyDataSource
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void setPropertyDataSource(final Property newDataSource)
{
// Stops listening the old data source changes
if (dataSource instanceof Property.ValueChangeNotifier)
{
((Property.ValueChangeNotifier)dataSource).removeValueChangeListener(propertyListener);
}
dataSource = newDataSource;
updateTextFromDataSource();
// Listens the new data source if possible
if (dataSource instanceof Property.ValueChangeNotifier)
{
((Property.ValueChangeNotifier)dataSource).addValueChangeListener(propertyListener);
}
markAsDirty();
}
示例7: 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();
}
}
示例8: getPropertyValue
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
protected Object getPropertyValue(Object rowId, Object colId,
Property property) {
if (isColumnEditable(colId, isEditable()) && fieldFactory != null) {
final Field<?> f = fieldFactory.createField(
getContainerDataSource(), rowId, colId, this);
if (f != null) {
// Remember that we have made this association so we can remove
// it when the component is removed
associatedProperties.put(f, property);
if (autowirePropertyDsForFields) {
bindPropertyToField(rowId, colId, property, f);
}
return f;
}
}
return formatPropertyValue(rowId, colId, property);
}
示例9: itemPropertyChanged
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public void itemPropertyChanged(Datasource.ItemPropertyChangeEvent e) {
Item wrapper = getItemWrapper(e.getItem());
// MetaProperty worked wrong with properties from inherited superclasses
MetaClass metaClass = datasource.getMetaClass();
String property = e.getProperty();
MetaPropertyPath metaPropertyPath = metaClass.getPropertyPath(property);
if (metaPropertyPath == null && DynamicAttributesUtils.isDynamicAttribute(property)) {
metaPropertyPath = DynamicAttributesUtils.getMetaPropertyPath(metaClass, property);
}
if (metaPropertyPath == null) {
return;
}
Property itemProperty = wrapper.getItemProperty(metaPropertyPath);
if (itemProperty instanceof PropertyWrapper) {
((PropertyWrapper) itemProperty).fireValueChangeEvent();
}
}
示例10: createComponent
import com.vaadin.data.Property; //导入依赖的package包/类
protected void createComponent() {
this.component = new CubaComboBox() {
@Override
public void setPropertyDataSource(Property newDataSource) {
if (newDataSource == null)
super.setPropertyDataSource(null);
else
super.setPropertyDataSource(new LookupPropertyAdapter(newDataSource));
}
@Override
public void setComponentError(ErrorMessage componentError) {
boolean handled = false;
if (componentErrorHandler != null)
handled = componentErrorHandler.handleError(componentError);
if (!handled)
super.setComponentError(componentError);
}
};
}
示例11: getContainerProperty
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (this.isObjectSupported(itemId) == false) {
return null;
}
if (propertyId.equals(PROPERTY_ID)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeItem(itemId), ATTRIBUTEITEM_ID, null);
}
if (propertyId.equals(PROPERTY_CATEGORY)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeItem(itemId), ATTRIBUTEITEM_CATEGORY, null);
}
if (propertyId.equals(PROPERTY_DATATYPE)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeItem(itemId), ATTRIBUTEITEM_DATATYPE, null);
}
if (propertyId.equals(PROPERTY_VALUES)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeItem(itemId), ATTRIBUTEITEM_VALUES, null);
}
return null;
}
示例12: getContainerProperty
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public Property<Object> getContainerProperty(Object itemId, Object propertyId) {
GitEntry entry = this.map.get(itemId);
if (entry == null) {
// logger.error("unknown itemId: " + itemId);
return null;
}
if (propertyId.equals(PROPERTY_NAME)) {
return new MethodProperty<Object>(getType(propertyId),
new StatusItem(entry), GITSTATUSITEM_NAME, null);
}
if (propertyId.equals(PROPERTY_STATUS)) {
return new MethodProperty<Object>(getType(propertyId),
new StatusItem(entry), GITSTATUSITEM_STATUS, null);
}
if (propertyId.equals(PROPERTY_ENTRY)) {
return new MethodProperty<Object>(getType(propertyId),
new StatusItem(entry), GITSTATUSITEM_ENTRY, null);
}
return null;
}
示例13: getContainerProperty
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (this.isSupported(itemId) == false) {
return null;
}
if (propertyId.equals(PROPERTY_ID)) {
return new MethodProperty<Object>(getType(propertyId),
new PDPPIPItem(itemId), PDPPIPITEM_ID, null);
}
if (propertyId.equals(PROPERTY_NAME)) {
return new MethodProperty<Object>(getType(propertyId),
new PDPPIPItem(itemId), PDPPIPITEM_NAME, null);
}
if (propertyId.equals(PROPERTY_DESCRIPTION)) {
return new MethodProperty<Object>(getType(propertyId),
new PDPPIPItem(itemId), PDPPIPITEM_DESCRIPTION, null);
}
return null;
}
示例14: getContainerProperty
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (this.isObjectSupported(itemId) == false) {
return null;
}
if (propertyId.equals(PROPERTY_VALUE)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeValueItem((ContainerAttribute) itemId), ATTRIBUTEVALUEITEM_VALUE, null);
}
if (propertyId.equals(PROPERTY_SOURCE)) {
return new MethodProperty<Object>(getType(propertyId),
new AttributeValueItem((ContainerAttribute) itemId), ATTRIBUTEVALUEITEM_SOURCE, null);
}
return null;
}
示例15: valueChange
import com.vaadin.data.Property; //导入依赖的package包/类
@Override
public void valueChange(Property.ValueChangeEvent event) {
if (chartConfigurationLayoutLayout != null && Objects.equals(designEditorLayout, chartConfigurationLayoutLayout.getParent())) {
designEditorLayout.removeComponent(chartConfigurationLayoutLayout);
}
DiagrammeChartType chartType = DiagrammeChartType.valueOf(event.getProperty().getValue().toString());
chartConfigurationLayoutLayout = chartType.createConfigLayout(preferences);
designEditorLayout.addComponent(chartConfigurationLayoutLayout);
designEditorLayout.setExpandRatio(chartConfigurationLayoutLayout, 1f);
refreshChartConfigurationLayout();
if (bandLayout != null && Objects.equals(designEditorLayout, bandLayout.getParent())) {
designEditorLayout.removeComponent(bandLayout);
}
if (Objects.equals(chartType, DiagrammeChartType.GAUGE)) {
bandLayout = chartType.getColorLayout(preferences);
bandLayout.bindConfigurationValues();
designEditorLayout.addComponent(bandLayout);
designEditorLayout.setExpandRatio(bandLayout, 1f);
}
}