public CommandExecutionResult execute(List<String> lines) { final List<String> strings = StringUtils.removeEmptyColumns(lines.subList(1, lines.size() - 1)); if (strings.size() > 0) { final List<CharSequence> n = StringUtils.manageEmbededDiagrams(strings); final Link link = getSystem().getLastStateLink(); if (link == null) { return CommandExecutionResult.error("No link defined"); } Position position = Position.BOTTOM; final Matcher m = getStartingPattern().matcher(lines.get(0)); if (m.find()) { final String pos = m.group(1); if (pos != null) { position = Position.valueOf(pos.toUpperCase()); } } link.addNote(n, position); return CommandExecutionResult.ok(); } return CommandExecutionResult.error("No note defined"); }
private CommandExecutionResult executeInternal( SequenceDiagram system, final RegexResult line0, final List<String> in) { final AbstractMessage m = system.getLastMessage(); if (m != null) { final NotePosition position = NotePosition.valueOf(line0.get("POSITION", 0).toUpperCase()); List<CharSequence> strings = StringUtils.manageEmbededDiagrams(in); final Url url; if (strings.size() > 0) { url = StringUtils.extractUrl( system.getSkinParam().getValue("topurl"), strings.get(0).toString(), true); } else { url = null; } if (url != null) { strings = strings.subList(1, strings.size()); } m.setNote(strings, position, line0.get("COLOR", 0), url); } return CommandExecutionResult.ok(); }