当前位置: 首页>>代码示例>>Java>>正文


Java Property类代码示例

本文整理汇总了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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:18,代码来源:DefaultPropertyBoxProperty.java

示例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));
				}
			}
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:26,代码来源:ItemPropertyValueChangeListener.java

示例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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:9,代码来源:AbstractViewComponent.java

示例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;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:25,代码来源:InsensitiveStringFilter.java

示例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);
	}
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:21,代码来源:BindSecurityGroupWindow.java

示例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();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:22,代码来源:TextOverlay.java

示例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();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:27,代码来源:SendService.java

示例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);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:CubaTreeTable.java

示例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();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:DataGridIndexedCollectionDsWrapper.java

示例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);
        }
    };
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:WebLookupField.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:24,代码来源:AttributeContainer.java

示例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;
	}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:22,代码来源:GitStatusContainer.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:24,代码来源:PDPPIPContainer.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:17,代码来源:AttributeValueContainer.java

示例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);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:23,代码来源:ChartEditor.java


注:本文中的com.vaadin.data.Property类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。