String (Event event) { final CodeSnippet snippet = event.getSnippet(); if (event.getCauseSnippet() != null || snippet == null) { return ""; } final CodeSnippet.Status status = event.getStatus(); final CodeSnippet.Kind kind = snippet.getKind(); final CodeSnippet.SubKind subKind = snippet.getSubKind(); String presentation = snippet.getPresentation(); if (presentation == null || subKind == CodeSnippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND) { presentation = StringUtil.trim(snippet.getCodeText()); } String actionLabel; if (event.getPreviousStatus() == CodeSnippet.Status.NONEXISTENT && status.isDefined()) { if (subKind == CodeSnippet.SubKind.VAR_DECLARATION_WITH_INITIALIZER_SUBKIND || /*subKind == CodeSnippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND ||*/ !subKind.isExecutable()) { actionLabel = "Defined"; } else { actionLabel = ""; } } else if (status == CodeSnippet.Status.REJECTED){ actionLabel = "Rejected"; } else if (status == CodeSnippet.Status.DROPPED) { actionLabel = "Dropped"; } else if (status == CodeSnippet.Status.OVERWRITTEN) { actionLabel = "Overwritten"; } else { actionLabel = ""; } String kindLabel; if (kind == CodeSnippet.Kind.TYPE_DECL) { if (subKind == CodeSnippet.SubKind.INTERFACE_SUBKIND) { kindLabel = "interface"; } else if (subKind == CodeSnippet.SubKind.ENUM_SUBKIND) { kindLabel = "enum"; } else if (subKind == CodeSnippet.SubKind.ANNOTATION_TYPE_SUBKIND) { kindLabel = "annotation"; } else { kindLabel = "class"; } } else if (kind == CodeSnippet.Kind.VAR){ kindLabel = subKind == CodeSnippet.SubKind.TEMP_VAR_EXPRESSION_SUBKIND ? ""/*"temp var"*/ : "field"; } else if (kind == CodeSnippet.Kind.METHOD) { kindLabel = "method"; } else if (kind == CodeSnippet.Kind.IMPORT) { kindLabel = subKind == CodeSnippet.SubKind.STATIC_IMPORT_ON_DEMAND_SUBKIND || subKind == CodeSnippet.SubKind.SINGLE_STATIC_IMPORT_SUBKIND ? "static import" : "import"; } else { kindLabel = ""; } final StringBuilder descr = new StringBuilder(); descr.append(actionLabel); if (!actionLabel.isEmpty()) { descr.append(" "); } if (!kindLabel.isEmpty()) { descr.append(kindLabel).append(" "); } descr.append(presentation); return descr.toString(); }