本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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;
}