本文整理匯總了Java中com.vaadin.data.Container.addItem方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.addItem方法的具體用法?Java Container.addItem怎麽用?Java Container.addItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.data.Container
的用法示例。
在下文中一共展示了Container.addItem方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sourceData
import com.vaadin.data.Container; //導入方法依賴的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: getServiceList
import com.vaadin.data.Container; //導入方法依賴的package包/類
private Container getServiceList(Container container) {
ComponentService componentService = BeanContext.getBean(ComponentService.class);
if (cmbMyCloud.getValue() != null) {
Long farmNo = (Long) cmbMyCloud.getValue();
List<ComponentDto> componentDtos;
componentDtos = componentService.getComponents(farmNo);
for (ComponentDto componentDto : componentDtos) {
Item item;
item = container.addItem(componentDto.getComponent().getComponentNo());
item.getItemProperty("serviceName").setValue(componentDto.getComponent().getComponentName());
}
}
return container;
}
示例3: getServerList
import com.vaadin.data.Container; //導入方法依賴的package包/類
private Container getServerList(Container container) {
InstanceService instanceService = BeanContext.getBean(InstanceService.class);
if (cmbMyCloud.getValue() != null) {
Long farmNo = (Long) cmbMyCloud.getValue();
List<InstanceDto> instanceDtos;
instanceDtos = instanceService.getInstances(farmNo);
for (InstanceDto instanceDto : instanceDtos) {
Item item;
item = container.addItem(instanceDto.getInstance().getInstanceNo());
item.getItemProperty("serverName").setValue(instanceDto.getInstance().getInstanceName());
}
}
return container;
}
示例4: setMyCloudList
import com.vaadin.data.Container; //導入方法依賴的package包/類
private void setMyCloudList(Container container) {
List<FarmDto> farms;
// ユーザ番號
Long userNo = ViewContext.getUserNo();
if (userNo != null) {
// クラウド情報を取得
FarmService farmService = BeanContext.getBean(FarmService.class);
farms = farmService.getFarms(userNo);
List<Long> farmNos = new ArrayList<Long>();
for (int i = 0; i < farms.size(); i++) {
FarmDto farm = farms.get(i);
Item item = container.addItem(farm.getFarm().getFarmNo());
item.getItemProperty("FarmName").setValue(farm.getFarm().getFarmName());
farmNos.add(farm.getFarm().getFarmNo());
}
if (!farmNos.contains(cmbMyCloud.getValue())) {
cmbMyCloud.setValue(null);
}
cmbMyCloud.setContainerDataSource(container);
if (cmbService != null && cmbServer != null) {
Container serviceContainer = cmbService.getContainerDataSource();
serviceContainer.removeAllItems();
cmbService.setContainerDataSource(getServiceList(serviceContainer));
cmbService.select(null);
Container serverContainer = cmbServer.getContainerDataSource();
serverContainer.removeAllItems();
cmbServer.setContainerDataSource(getServerList(serverContainer));
cmbServer.select(null);
}
}
}
示例5: fillContainer
import com.vaadin.data.Container; //導入方法依賴的package包/類
void fillContainer(Container container, List<EventLog> eventLogs) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
int i = 0;
for (EventLog eventLog : eventLogs) {
String id = String.valueOf(i++);
Item item = container.addItem(id);
item.getItemProperty("DateTime").setValue(simpleDateFormat.format(eventLog.getLogDate()));
item.getItemProperty("LogLevel").setValue(transformLogLevel(eventLog.getLogLevel()));
item.getItemProperty("myCloud").setValue(eventLog.getFarmName());
item.getItemProperty("Service").setValue(eventLog.getComponentName());
item.getItemProperty("Server").setValue(eventLog.getInstanceName());
item.getItemProperty("Message").setValue(eventLog.getMessage());
}
}
示例6: addItem
import com.vaadin.data.Container; //導入方法依賴的package包/類
private Item addItem(Object itemId, Container container) {
Item item = container.addItem(itemId);
item.getItemProperty(PROPERTY_NAME).setValue(itemId);
return item;
}
示例7: addItem
import com.vaadin.data.Container; //導入方法依賴的package包/類
private void addItem(Container container, Object id, String caption) {
Item item = container.addItem(id);
item.getItemProperty(NAME).setValue(caption);
}