本文整理汇总了Java中com.vaadin.data.util.ObjectProperty类的典型用法代码示例。如果您正苦于以下问题:Java ObjectProperty类的具体用法?Java ObjectProperty怎么用?Java ObjectProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectProperty类属于com.vaadin.data.util包,在下文中一共展示了ObjectProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sourceData
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
protected void sourceData(String key, Object val) {
if (val instanceof String) {
if (viewData.getItemProperty(key) == null) {
viewData.addItemProperty(key, new ObjectProperty<String>((String) val));
} else {
viewData.getItemProperty(key).setValue(val);
}
} else {
// Creates the options container and add given options to it
final Container c = new IndexedContainer();
if (val != null) {
c.addContainerProperty("name", String.class, "");
for (final Iterator<?> i = ((List) val).iterator(); i.hasNext();) {
Item item = c.addItem(i.next());
}
}
if (viewData.getItemProperty(key) == null) {
viewData.addItemProperty(key, new ObjectProperty<Container>(c));
} else {
viewData.getItemProperty(key).setValue(c);
}
}
}
示例2: AlfrescoProcessInstanceTableItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public AlfrescoProcessInstanceTableItem(final ProcessInstance processInstance) {
addItemProperty(PROPERTY_ID, new ObjectProperty<String>(processInstance.getId(), String.class));
if (processInstance.getBusinessKey() != null) {
addItemProperty(PROPERTY_BUSINESSKEY, new ObjectProperty<String>(processInstance.getBusinessKey(), String.class));
}
Button viewProcessInstanceButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_ACTION_VIEW));
viewProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK);
viewProcessInstanceButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showProcessInstancePage(processInstance.getId());
}
});
viewProcessInstanceButton.setIcon(Images.MAGNIFIER_16);
addItemProperty(PROPERTY_ACTIONS, new ObjectProperty<Component>(viewProcessInstanceButton, Component.class));
}
示例3: GroupItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public GroupItem(final Group group) {
Button idButton = new Button(group.getId());
idButton.addStyleName(Reindeer.BUTTON_LINK);
idButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showGroupPage(group.getId());
}
});
addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));
if (group.getName() != null) {
addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
}
if (group.getType() != null) {
addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
}
Embedded deleteIcon = new Embedded(null, Images.DELETE);
deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteIcon.addListener(new DeleteMembershipListener(identityService, userId, group.getId(), userDetailPanel));
addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
示例4: prepareView
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
protected void prepareView(SolrManagementAppView view) {
viewData.removeItemProperty(SOLR_SERVER_STATUS);
viewData.removeItemProperty(SOLR_SERVER_NUMBER_OF_DOCUMENTS);
String solrServerUrl = solrServerConfig.getBaseURL();
String solrServerStatus = i18n.translate("solr.app.serverInformation")
+ " " + solrServerUrl + " " +
(solrServerUp ? i18n.translate("solr.app.serverInformation.running") :
i18n.translate("solr.app.serverInformation.notRunning"));
viewData.addItemProperty(SOLR_SERVER_STATUS, new ObjectProperty<>(solrServerStatus));
String solrIndexSize = i18n.translate("solr.app.serverInformation.indexSizeUnknown");
if (solrServerUp) {
solrIndexSize = Long.toString(getNumberOfDocumentsInSolrIndex());
}
viewData.addItemProperty(SOLR_SERVER_NUMBER_OF_DOCUMENTS,
new ObjectProperty<>(solrIndexSize));
view.setDataSource(viewData);
view.setListener(this);
}
示例5: getFragment
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
@Override
public Component getFragment() {
VerticalLayout vl = new VerticalLayout();
Property<Integer> numberOfClicks = new ObjectProperty<>(0);
Label clickedTimes = new Label(numberOfClicks);
vl.addComponent(new Button("Click me", new Button.ClickListener() {
/**
*
*/
private static final long serialVersionUID = 7830684640567884545L;
@Override
public void buttonClick(ClickEvent event) {
Notification.show("Thank you for clicking!");
int oldNum = numberOfClicks.getValue();
numberOfClicks.setValue(++oldNum);
}
}));
vl.addComponent(clickedTimes);
return vl;
}
示例6: createSaleContent
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
/**
* Продажа процесса: наименование продажи.
* Возможно нужно сделать возможносьть создать продажу, если она еще не создана в рамкех БП.
*
* @return созданный контент
*/
private Component createSaleContent(final String processId) {
// Запрос данных
final Sale sale = querySale(processId);
if (sale != null) {
final SaleField saleField = new SaleField("Продажа");
saleField.setPropertyDataSource(new ObjectProperty(sale));
return saleField;
} else {
final Label label = new Label("Нет связанной с процессом продажи.");
label.setCaption("Продажа");
return label;
}
}
示例7: getProperty
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
private Property getProperty(final Object rootItemId, final Object propId) {
Property prop;
if (getTableHolder().isGeneratedColumn(propId)) {
prop = getTableHolder().getPropertyForGeneratedColumn(propId, rootItemId);
} else {
prop = getTableHolder().getContainerDataSource().getContainerProperty(rootItemId, propId);
if (useTableFormatPropertyValue) {
if (getTableHolder().isExportableFormattedProperty()) {
final String formattedProp = getTableHolder().getFormattedPropertyValue(rootItemId, propId, prop);
if (null == prop) {
prop = new ObjectProperty<String>(formattedProp, String.class);
} else {
final Object val = prop.getValue();
if (null == val) {
prop = new ObjectProperty<String>(formattedProp, String.class);
} else {
if (!val.toString().equals(formattedProp)) {
prop = new ObjectProperty<String>(formattedProp, String.class);
}
}
}
}
}
}
return prop;
}
示例8: Main
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public Main(ObjectProperty<Example> currentExample){
this.currentExample = currentExample;
setSizeFull();
setStyleName("main");
currentExample.addValueChangeListener(new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
Example example = (Example)valueChangeEvent.getProperty().getValue();
if(example != null){
setExample(example);
}
else {
//since example is null, just show the home screen
removeAllComponents();
addComponent(homeView);
}
}
});
}
示例9: TestDataItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public TestDataItem(String code, String description, Integer sequence, int obsolete) {
super();
properties.put("code", new ObjectProperty<>(code, String.class));
properties.put("description", new ObjectProperty<>(description, String.class));
properties.put("sequence", new ObjectProperty<>(sequence, Integer.class));
properties.put("obsolete", new ObjectProperty<>(obsolete, int.class));
}
示例10: getItemProperty
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public Property getItemProperty(Object id) {
Object obj = map.get(id);
if (obj == null) {
return null;
}
return new ObjectProperty<Object>(obj);
}
示例11: DeploymentListitem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public DeploymentListitem(Deployment deployment) {
addItemProperty("id", new ObjectProperty<String>(deployment.getId(), String.class));
if(deployment.getName() != null) {
addItemProperty("name", new ObjectProperty<String>(deployment.getName(), String.class));
} else {
addItemProperty("name", new ObjectProperty<String>(ExplorerApp.get().getI18nManager().getMessage(Messages.DEPLOYMENT_NO_NAME), String.class));
}
}
示例12: GroupListItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public GroupListItem(Group group) {
addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class));
if (group.getName() != null) {
addItemProperty("name", new ObjectProperty<String>(group.getName()
+ " (" + group.getName() + ")", String.class));
} else {
addItemProperty("name", new ObjectProperty<String>("(" + group.getId() + ")", String.class));
}
}
示例13: GroupMemberItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public GroupMemberItem(final User user) {
// id
Button idButton = new Button(user.getId());
idButton.addStyleName(Reindeer.BUTTON_LINK);
idButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showUserPage(user.getId());
}
});
addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));
// name
if (user.getFirstName() != null) {
addItemProperty("firstName", new ObjectProperty<String>(user.getFirstName(), String.class));
}
if (user.getLastName() != null) {
addItemProperty("lastName", new ObjectProperty<String>(user.getLastName(), String.class));
}
// email
if (user.getEmail() != null) {
addItemProperty("email", new ObjectProperty<String>(user.getEmail(), String.class));
}
// Delete
Embedded deleteIcon = new Embedded(null, Images.DELETE);
deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteIcon.addListener(new DeleteMembershipListener(identityService, user.getId(), groupId, memberShipChangeListener));
addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
示例14: GroupSelectionItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
public GroupSelectionItem(Group group) {
addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class));
if (group.getName() != null) {
addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
}
if (group.getType() != null) {
addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
}
}
示例15: createItem
import com.vaadin.data.util.ObjectProperty; //导入依赖的package包/类
protected ProcessInstanceItem createItem(HistoricProcessInstance processInstance) {
ProcessInstanceItem item = new ProcessInstanceItem();
item.addItemProperty("id", new ObjectProperty<String>(processInstance.getId(), String.class));
ProcessDefinition processDefinition = getProcessDefinition(processInstance.getProcessDefinitionId());
String itemName = getProcessDisplayName(processDefinition) + " (" + processInstance.getId() + ")";
item.addItemProperty("name", new ObjectProperty<String>(itemName, String.class));
return item;
}