public RemoveByAcceptanceCriteria( AcceptCondition acceptCondition, LogDataTableModel dataTableModel, Icon icon, StatusObserver observer) { this.acceptCondition = acceptCondition; this.dataTableModel = dataTableModel; this.observer = observer; putValue(NAME, acceptCondition.getName()); putValue(SHORT_DESCRIPTION, acceptCondition.getDescription()); if (icon == null && acceptCondition instanceof HasIcon) { icon = ((HasIcon) acceptCondition).getIcon(); } putValue(SMALL_ICON, icon); }
@Override public void actionPerformed(ActionEvent arg0) { int removeRows = dataTableModel.removeRows(acceptCondition); if (observer != null) { observer.updateStatus( String.format("Removed %d rows using \"%s\"", removeRows, acceptCondition.getName())); } }