@Inject @Optional private void whenKeywordCallIsConverted( @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_CONVERTED) final Event event) { final RobotCase testCase = Events.get(event, IEventBroker.DATA, RobotCase.class); final RobotKeywordCall call = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, RobotKeywordCall.class); if (testCase != null && testCase.getSuiteFile() == fileModel) { sortModel.clear(); selectionLayerAccessor.selectElementPreservingSelectedColumnsAfterOperation( call, tableInputIsReplaced()); } }
@Inject @Optional private void whenCaseIsAdded(@UIEventTopic(RobotModelEvents.ROBOT_CASE_ADDED) final Event event) { final RobotCasesSection section = Events.get(event, IEventBroker.DATA, RobotCasesSection.class); if (section != null && section.getSuiteFile() == fileModel) { sortModel.clear(); RobotCase testCase = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, RobotCase.class); if (testCase == null) { final List<?> keywords = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, List.class); testCase = (RobotCase) keywords.get(keywords.size() - 1); } selectionLayerAccessor.selectElementInFirstCellAfterOperation( testCase, tableInputIsReplaced()); } }
@Inject @Optional private void whenKeywordCallIsAdded( @UIEventTopic(RobotModelEvents.ROBOT_KEYWORD_CALL_ADDED) final Event event) { final RobotCase testCase = Events.get(event, IEventBroker.DATA, RobotCase.class); final RobotKeywordCall keywordCall = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, RobotKeywordCall.class); if (testCase != null && testCase.getSuiteFile() == fileModel) { sortModel.clear(); if (keywordCall != null) { selectionLayerAccessor.selectElementInFirstCellAfterOperation( keywordCall, tableInputIsReplaced()); } else { final List<?> calls = Events.get(event, RobotModelEvents.ADDITIONAL_DATA, List.class); final RobotKeywordCall lastCall = (RobotKeywordCall) calls.get(calls.size() - 1); selectionLayerAccessor.selectElementInFirstCellAfterOperation( lastCall, tableInputIsReplaced()); } } }