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


Java Table.addItem方法代碼示例

本文整理匯總了Java中com.vaadin.ui.Table.addItem方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.addItem方法的具體用法?Java Table.addItem怎麽用?Java Table.addItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.Table的用法示例。


在下文中一共展示了Table.addItem方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing email table with empty values
    table.addItem(new Object[] { "Outgoing Mail Server (SMTP): ", "" }, new Integer(1));
    table.addItem(new Object[] { "Port: ", "" }, new Integer(2));
    table.addItem(new Object[] { "Email Id: ", "" }, new Integer(3));

    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:21,代碼來源:EmailLayout.java

示例2: createNetworkTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createNetworkTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "IPv4 Address: ", "" }, new Integer(1));
    table.addItem(new Object[] { "Netmask:", "" }, new Integer(2));
    table.addItem(new Object[] { "Default Gateway: ", "" }, new Integer(3));
    table.addItem(new Object[] { "Primary DNS Server: ", "" }, new Integer(4));
    table.addItem(new Object[] { "Secondary DNS Server: ", "" }, new Integer(5));
    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:22,代碼來源:NetworkLayout.java

示例3: createNATTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createNATTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "Public IPv4 Address: ", "" }, new Integer(1));
    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:18,代碼來源:NetworkLayout.java

示例4: addCommonTableItems

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private void addCommonTableItems(Table statusTable) {
    statusTable.setImmediate(true);
    statusTable.setStyleName(ValoTheme.TABLE_COMPACT);

    statusTable.addContainerProperty("Property", String.class, "");
    statusTable.addContainerProperty("Value", String.class, "");
    statusTable.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    statusTable.setPageLength(0);
    statusTable.setReadOnly(true);

    statusTable.addItem(new Object[] { "Name: ", "" }, new Integer(1));
    statusTable.addItem(new Object[] { "Local IP: ", "" }, new Integer(2));
    statusTable.addItem(new Object[] { "Public IP: ", "" }, new Integer(3));
    statusTable.addItem(new Object[] { "V.Server: ", "" }, new Integer(4));
    statusTable.addItem(new Object[] { "Manager IP: ", "" }, new Integer(5));
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:AgentStatusWindow.java

示例5: createTableStatusNotProvided

import com.vaadin.ui.Table; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private Table createTableStatusNotProvided(AgentStatusResponse res) {
    Table statusTable = new Table();
    // initializing network table with empty values
    addCommonTableItems(statusTable);
    addCommonTableItemValues(res, statusTable);
    statusTable.addItem(new Object[] { "Status: ", "" }, new Integer(6));
    statusTable.getItem(6).getItemProperty("Value").setValue(res.getStatusLines().get(0));
    return statusTable;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:11,代碼來源:AgentStatusWindow.java

示例6: addTaskItem

import com.vaadin.ui.Table; //導入方法依賴的package包/類
protected void addTaskItem(HistoricTaskInstance task, Table taskTable) {
  Item item = taskTable.addItem(task.getId());
  
  if(task.getEndTime() != null) {
    item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_FINISHED_22));
  } else {
    item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_22));
  }
  
  item.getItemProperty("name").setValue(task.getName());
  item.getItemProperty("priority").setValue(task.getPriority());
  
  item.getItemProperty("startDate").setValue(new PrettyTimeLabel(task.getStartTime(), true));
  item.getItemProperty("endDate").setValue(new PrettyTimeLabel(task.getEndTime(), true));
  
  if(task.getDueDate() != null) {
    Label dueDateLabel = new PrettyTimeLabel(task.getEndTime(), i18nManager.getMessage(Messages.TASK_NOT_FINISHED_YET), true); 
    item.getItemProperty("dueDate").setValue(dueDateLabel);
  }
  
  if(task.getAssignee() != null) {
    Component taskAssigneeComponent = getTaskAssigneeComponent(task.getAssignee());
    if(taskAssigneeComponent != null) {
      item.getItemProperty("assignee").setValue(taskAssigneeComponent);
    }
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:28,代碼來源:ProcessInstanceDetailPanel.java

示例7: addVariables

import com.vaadin.ui.Table; //導入方法依賴的package包/類
protected void addVariables() {
  Label header = new Label(i18nManager.getMessage(Messages.PROCESS_INSTANCE_HEADER_VARIABLES));
  header.addStyleName(ExplorerLayout.STYLE_H3);
  header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
  header.addStyleName(ExplorerLayout.STYLE_NO_LINE);
  panelLayout.addComponent(header);
  
  panelLayout.addComponent(new Label(" ", Label.CONTENT_XHTML));
  
  // variable sorting is done in-memory (which is ok, since normally there aren't that many vars)
  Map<String, Object> variables = new TreeMap<String, Object>(runtimeService.getVariables(processInstance.getId())); 
  
  if(variables.size() > 0) {
    
    Table variablesTable = new Table();
    variablesTable.setWidth(60, UNITS_PERCENTAGE);
    variablesTable.addStyleName(ExplorerLayout.STYLE_PROCESS_INSTANCE_TASK_LIST);
    
    variablesTable.addContainerProperty("name", String.class, null, i18nManager.getMessage(Messages.PROCESS_INSTANCE_VARIABLE_NAME), null, Table.ALIGN_LEFT);
    variablesTable.addContainerProperty("value", String.class, null, i18nManager.getMessage(Messages.PROCESS_INSTANCE_VARIABLE_VALUE), null, Table.ALIGN_LEFT);
    
    for (String variable : variables.keySet()) {
      Item variableItem = variablesTable.addItem(variable);
      variableItem.getItemProperty("name").setValue(variable);
      
      // Get string value to show
      String theValue = variableRendererManager.getStringRepresentation(variables.get(variable));
      variableItem.getItemProperty("value").setValue(theValue);
    }
    
    variablesTable.setPageLength(variables.size());
    panelLayout.addComponent(variablesTable);
  } else {
    Label noVariablesLabel = new Label(i18nManager.getMessage(Messages.PROCESS_INSTANCE_NO_VARIABLES));
    panelLayout.addComponent(noVariablesLabel);
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:38,代碼來源:ProcessInstanceDetailPanel.java

示例8: createTableStatusProvided

import com.vaadin.ui.Table; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private Table createTableStatusProvided(AgentStatusResponse res) {

    Table statusTable = new Table();

    // initializing network table with empty values
    addCommonTableItems(statusTable);
    statusTable.addItem(new Object[] { "Uptime: ", "" }, new Integer(6));
    statusTable.addItem(new Object[] { "DPA PID: ", "" }, new Integer(7));
    statusTable.addItem(new Object[] { "DPA Info: ", "" }, new Integer(8));
    statusTable.addItem(new Object[] { "DPA Stats: ", "" }, new Integer(9));
    statusTable.addItem(new Object[] { "Discovered: ", "" }, new Integer(10));
    statusTable.addItem(new Object[] { "Inspection Ready: ", "" }, new Integer(11));

    if (null != res.getVersion()) {
        statusTable.getItem(6).getItemProperty("Value").setValue(res.getCurrentServerTime().toString());
    } else {
        statusTable.getItem(6).getItemProperty("Value").setValue("Not Available due to communication error.");
    }

    try {
        addCommonTableItemValues(res, statusTable);

        if (null != res.getVersion()) {
            statusTable.getItem(7).getItemProperty("Value")
            .setValue(res.getAgentDpaInfo().netXDpaRuntimeInfo.dpaPid);
            statusTable.getItem(8).getItemProperty("Value")
            .setValue(
                    "IPC Ver:" + res.getAgentDpaInfo().dpaStaticInfo.ipcVersion + ", Name:"
                            + res.getAgentDpaInfo().dpaStaticInfo.dpaName + ", Version:"
                            + res.getAgentDpaInfo().dpaStaticInfo.dpaVersion);

            Long dropped = 0L;
            if (res.getAgentDpaInfo().netXDpaRuntimeInfo.dropResource != null) {
                dropped += res.getAgentDpaInfo().netXDpaRuntimeInfo.dropResource;
            }
            if (res.getAgentDpaInfo().netXDpaRuntimeInfo.dropSva != null) {
                dropped += res.getAgentDpaInfo().netXDpaRuntimeInfo.dropSva;
            }
            if (res.getAgentDpaInfo().netXDpaRuntimeInfo.dropError != null) {
                dropped += res.getAgentDpaInfo().netXDpaRuntimeInfo.dropError;
            }

            statusTable
            .getItem(9)
            .getItemProperty("Value")
            .setValue(
                    "Rx:" + res.getAgentDpaInfo().netXDpaRuntimeInfo.rx + ", Tx:"
                            + res.getAgentDpaInfo().netXDpaRuntimeInfo.txSva + ", Dropped:" + dropped
                            + ", Insp-If:" + res.getAgentDpaInfo().netXDpaRuntimeInfo.workloadInterfaces);
            statusTable.getItem(10).getItemProperty("Value")
            .setValue(Boolean.valueOf(res.isDiscovered()).toString());
            statusTable.getItem(11).getItemProperty("Value")
            .setValue(Boolean.valueOf(res.isInspectionReady()).toString());
        }
    } catch (Exception e) {
        log.error("Fail to retrieve agent info", e);

        statusTable.getItem(6).getItemProperty("Value").setValue("Not Available due to communication error.");
    }

    return statusTable;

}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:65,代碼來源:AgentStatusWindow.java


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