當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.addItem方法代碼示例

本文整理匯總了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);
        }

    }
}
 
開發者ID:rah003,項目名稱:neat-tweaks,代碼行數:25,代碼來源:ConfigStatusPresenter.java

示例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;
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:17,代碼來源:WinLogView.java

示例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;
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:18,代碼來源:WinLogView.java

示例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);

        }
    }
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:38,代碼來源:WinLogView.java

示例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());
    }
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:15,代碼來源:WinLogView.java

示例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;
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:6,代碼來源:HierarchyTest.java

示例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);
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:5,代碼來源:FieldForm.java


注:本文中的com.vaadin.data.Container.addItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。