private RowDef getRowDef(final int rowIndex) { return m_view.getRows().get(rowIndex); }
public int getRowCount() { return m_view.getRows().size(); }
public int getRowCount() { return m_view.getRows().size(); }
private RowDef getRowDef(final int rowIndex) { return m_view.getRows().get(rowIndex); }
@Override public SurveillanceStatus[][] doInTransaction(TransactionStatus transactionStatus) { final SurveillanceStatus[][] cellStatus = new SurveillanceStatus[view.getRows().size()][view.getColumns().size()]; for (int rowIndex = 0; rowIndex < view.getRows().size(); rowIndex++) { for (int colIndex = 0; colIndex < view.getColumns().size(); colIndex++) { final Collection<OnmsCategory> rowCategories = getOnmsCategoriesFromViewCategories(view.getRows().get(rowIndex).getCategories()); final Collection<OnmsCategory> columnCategories = getOnmsCategoriesFromViewCategories(view.getColumns().get(colIndex).getCategories()); final SurveillanceStatus status = m_nodeDao.findSurveillanceStatusByCategoryLists(rowCategories, columnCategories); cellStatus[rowIndex][colIndex] = status; } } return cellStatus; } });
@Override public SurveillanceStatus[][] doInTransaction(TransactionStatus transactionStatus) { final SurveillanceStatus[][] cellStatus = new SurveillanceStatus[view.getRows().size()][view.getColumns().size()]; for (int rowIndex = 0; rowIndex < view.getRows().size(); rowIndex++) { for (int colIndex = 0; colIndex < view.getColumns().size(); colIndex++) { final Collection<OnmsCategory> rowCategories = getOnmsCategoriesFromViewCategories(view.getRows().get(rowIndex).getCategories()); final Collection<OnmsCategory> columnCategories = getOnmsCategoriesFromViewCategories(view.getColumns().get(colIndex).getCategories()); final SurveillanceStatus status = m_nodeDao.findSurveillanceStatusByCategoryLists(rowCategories, columnCategories); cellStatus[rowIndex][colIndex] = status; } } return cellStatus; } });
public Object generateCell(Table source, final Object itemId, Object columnId) { final Optional<RowDef> rowDef = view.getRowDef((String) itemId); final Optional<ColumnDef> columnDef = view.getColumnDef((String) columnId); int rowIndex = view.getRows().indexOf(rowDef.orElse(null)); int colIndex = view.getColumns().indexOf(columnDef.orElse(null)); SurveillanceStatus surveillanceStatus = m_cells[rowIndex][colIndex]; Label label = new Label(surveillanceStatus.getDownEntityCount() + " of " + surveillanceStatus.getTotalEntityCount()); label.setSizeFull(); label.addStyleName(surveillanceStatus.getStatus().toLowerCase()); return label; } });
public Object generateCell(Table source, final Object itemId, Object columnId) { final Optional<RowDef> rowDef = view.getRowDef((String) itemId); final Optional<ColumnDef> columnDef = view.getColumnDef((String) columnId); int rowIndex = view.getRows().indexOf(rowDef.orElse(null)); int colIndex = view.getColumns().indexOf(columnDef.orElse(null)); SurveillanceStatus surveillanceStatus = m_cells[rowIndex][colIndex]; Label label = new Label(surveillanceStatus.getDownEntityCount() + " of " + surveillanceStatus.getTotalEntityCount()); label.setSizeFull(); label.addStyleName(surveillanceStatus.getStatus().toLowerCase()); return label; } });
@Override public void buttonClick(Button.ClickEvent event) { if (!titleField.isValid()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "Please use an unique title", Notification.Type.ERROR_MESSAGE); return; } if (!refreshSecondsField.isValid()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "Please enter a valid number in the \"Refresh seconds\" field", Notification.Type.ERROR_MESSAGE); return; } if (columns.getItemIds().isEmpty() || rows.getItemIds().isEmpty()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "You must define at least one row category and one column category", Notification.Type.ERROR_MESSAGE); return; } View finalView = new View(); for (ColumnDef columnDef : columns.getItemIds()) { finalView.getColumns().add(columnDef); } for (RowDef rowDef : rows.getItemIds()) { finalView.getRows().add(rowDef); } finalView.setName(titleField.getValue()); finalView.setRefreshSeconds(Integer.parseInt(refreshSecondsField.getValue())); saveActionListener.save(finalView); close(); } });
@Override public void buttonClick(Button.ClickEvent event) { if (!titleField.isValid()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "Please use an unique title", Notification.Type.ERROR_MESSAGE); return; } if (!refreshSecondsField.isValid()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "Please enter a valid number in the \"Refresh seconds\" field", Notification.Type.ERROR_MESSAGE); return; } if (columns.getItemIds().isEmpty() || rows.getItemIds().isEmpty()) { ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Error", "You must define at least one row category and one column category", Notification.Type.ERROR_MESSAGE); return; } View finalView = new View(); for (ColumnDef columnDef : columns.getItemIds()) { finalView.getColumns().add(columnDef); } for (RowDef rowDef : rows.getItemIds()) { finalView.getRows().add(rowDef); } finalView.setName(titleField.getValue()); finalView.setRefreshSeconds(Integer.parseInt(refreshSecondsField.getValue())); saveActionListener.save(finalView); close(); } });
for (RowDef rowDef : view.getRows()) { m_allRowCategories.addAll(getOnmsCategoriesForNames(rowDef.getCategoryNames()));
for (RowDef rowDef : view.getRows()) { m_allRowCategories.addAll(getOnmsCategoriesForNames(rowDef.getCategoryNames()));