本文整理汇总了Java中org.onosproject.ui.table.TableModel类的典型用法代码示例。如果您正苦于以下问题:Java TableModel类的具体用法?Java TableModel怎么用?Java TableModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableModel类属于org.onosproject.ui.table包,在下文中一共展示了TableModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, Device dev,
DeviceService ds, MastershipService ms) {
DeviceId id = dev.id();
boolean available = ds.isAvailable(id);
String iconId = available ? ICON_ID_ONLINE : ICON_ID_OFFLINE;
row.cell(ID, id)
.cell(NAME, deviceName(dev))
.cell(AVAILABLE, available)
.cell(AVAILABLE_IID, iconId)
.cell(TYPE_IID, getTypeIconId(dev))
.cell(MFR, dev.manufacturer())
.cell(HW, dev.hwVersion())
.cell(SW, dev.swVersion())
.cell(PROTOCOL, deviceProtocol(dev))
.cell(NUM_PORTS, ds.getPorts(id).size())
.cell(MASTER_ID, ms.getMasterFor(id));
}
示例2: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, Application app,
ApplicationService as) {
ApplicationId id = app.id();
ApplicationState state = as.getState(id);
String iconId = state == ACTIVE ? ICON_ID_ACTIVE : ICON_ID_INACTIVE;
row.cell(STATE, state)
.cell(STATE_IID, iconId)
.cell(ID, id.name())
.cell(ICON, id.name())
.cell(VERSION, app.version())
.cell(CATEGORY, app.category())
.cell(ORIGIN, app.origin())
.cell(TITLE, app.title())
.cell(DESC, app.description())
.cell(URL, app.url());
}
示例3: populateTable
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
// === NOTE: the table model supplied here will have been created
// via a call to createTableModel(). To assign non-default
// cell formatters or comparators to the table model, override
// createTableModel() and set them there.
// === retrieve table row items from some service...
// SomeService ss = get(SomeService.class);
// List<Item> items = ss.getItems()
// fake data for demonstration purposes...
List<Item> items = getItems();
for (Item item: items) {
populateRow(tm.addRow(), item);
}
}
示例4: createTableModel
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexLongFormatter.INSTANCE);
tm.setFormatter(STATE, EnumFormatter.INSTANCE);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(DURATION, NumberFormatter.INTEGER);
tm.setFormatter(SELECTOR_C, new SelectorShortFormatter());
tm.setFormatter(SELECTOR, new SelectorFormatter());
tm.setFormatter(TREATMENT_C, new TreatmentShortFormatter());
tm.setFormatter(TREATMENT, new TreatmentFormatter());
tm.setFormatter(TABLE_NAME, DefaultCellFormatter.INSTANCE);
return tm;
}
示例5: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, FlowEntry flow,
Map<Short, ApplicationId> lookup) {
row.cell(ID, flow.id().value())
.cell(STATE, flow.state())
.cell(BYTES, flow.bytes())
.cell(PACKETS, flow.packets())
.cell(DURATION, flow.life())
.cell(PRIORITY, flow.priority())
.cell(TABLE_NAME, flow.table())
.cell(APP_ID, flow.appId())
.cell(APP_NAME, makeAppName(flow.appId(), lookup))
.cell(GROUP_ID, flow.groupId().id())
.cell(IDLE_TIMEOUT, flow.timeout())
.cell(PERMANENT, flow.isPermanent())
.cell(SELECTOR_C, flow)
.cell(SELECTOR, flow)
.cell(TREATMENT_C, flow)
.cell(TREATMENT, flow);
}
示例6: populateTable
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
String uri = string(payload, "devId");
boolean nz = bool(payload, NZ);
boolean delta = bool(payload, DELTA);
if (!Strings.isNullOrEmpty(uri)) {
DeviceId deviceId = DeviceId.deviceId(uri);
DeviceService ds = get(DeviceService.class);
List<PortStatistics> stats = delta ?
ds.getPortDeltaStatistics(deviceId) :
ds.getPortStatistics(deviceId);
for (PortStatistics stat : stats) {
if (nz && stat.isZero()) {
continue;
}
populateRow(tm.addRow(), stat);
}
}
}
示例7: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, Port port, DeviceId deviceId) {
PortNumber portNum = port.number();
getFrequencyLimit(deviceId, portNum);
row.cell(ID, portNum.toLong())
.cell(TYPE, port.type())
.cell(ENABLED, port.isEnabled())
.cell(NAME, RoadmUtil.getAnnotation(port.annotations(), AnnotationKeys.PORT_NAME))
.cell(MIN_FREQ, RoadmUtil.asTHz(minFreq))
.cell(MAX_FREQ, RoadmUtil.asTHz(maxFreq))
.cell(GRID, RoadmUtil.asGHz(channelSpacing))
.cell(POWER_RANGE, getPowerRange(deviceId, portNum))
.cell(CURRENT_POWER, getCurrentPower(deviceId, portNum))
.cell(SERVICE_STATE, getPortServiceState(deviceId, portNum))
.cell(TARGET_POWER, getTargetPower(deviceId, portNum))
.cell(HAS_TARGET_POWER, roadmService.hasPortTargetPower(deviceId, portNum));
}
示例8: createTableModel
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ONE, ConnectPointFormatter.INSTANCE);
tm.setFormatter(TWO, ConnectPointFormatter.INSTANCE);
tm.setFormatter(TYPE, EnumFormatter.INSTANCE);
return tm;
}
示例9: populateTable
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
LinkService ls = get(LinkService.class);
BaseLinkMap linkMap = new BaseLinkMap();
ls.getLinks().forEach(linkMap::add);
linkMap.biLinks().forEach(blink -> populateRow(tm.addRow(), blink));
}
示例10: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, BaseLink blink) {
row.cell(ONE, blink.one().src())
.cell(TWO, blink.one().dst())
.cell(TYPE, linkType(blink))
.cell(STATE, linkState(blink))
.cell(DIRECTION, linkDir(blink))
.cell(DURABLE, blink.one().isDurable());
}
示例11: populateTable
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
DeviceService ds = get(DeviceService.class);
MastershipService ms = get(MastershipService.class);
for (Device dev : ds.getDevices()) {
populateRow(tm.addRow(), dev, ds, ms);
}
}
示例12: createTableModel
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexLongFormatter.INSTANCE);
tm.setFormatter(GROUP_ID, HexFormatter.INSTANCE);
tm.setFormatter(STATE, EnumFormatter.INSTANCE);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(SELECTOR, new SelectorFormatter());
tm.setFormatter(TREATMENT, new TreatmentFormatter());
return tm;
}
示例13: populateTable
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
@Override
protected void populateTable(TableModel tm, ObjectNode payload) {
String uri = string(payload, "devId");
if (!Strings.isNullOrEmpty(uri)) {
DeviceId deviceId = DeviceId.deviceId(uri);
FlowRuleService frs = get(FlowRuleService.class);
for (FlowEntry flow : frs.getFlowEntries(deviceId)) {
populateRow(tm.addRow(), flow);
}
}
}
示例14: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, FlowEntry flow) {
row.cell(ID, flow.id().value())
.cell(APP_ID, flow.appId())
.cell(GROUP_ID, flow.groupId().id())
.cell(TABLE_ID, flow.tableId())
.cell(PRIORITY, flow.priority())
.cell(TIMEOUT, flow.timeout())
.cell(PERMANENT, flow.isPermanent())
.cell(STATE, flow.state())
.cell(PACKETS, flow.packets())
.cell(BYTES, flow.bytes())
.cell(SELECTOR, flow)
.cell(TREATMENT, flow);
}
示例15: populateRow
import org.onosproject.ui.table.TableModel; //导入依赖的package包/类
private void populateRow(TableModel.Row row, PacketProcessorEntry entry) {
row.cell(ID, entry.priority())
.cell(TYPE, processorType(entry.priority()))
.cell(PRIORITY, processorPriority(entry.priority()))
.cell(PROCESSOR, entry.processor().getClass().getName())
.cell(PACKETS, entry.invocations())
.cell(AVG_MS, (double) entry.averageNanos() / NANOS_IN_MS);
}