180 val active_elements = |
180 val active_elements = |
181 Markup.Elements(Markup.DIALOG, Markup.BROWSER, Markup.GRAPHVIEW, |
181 Markup.Elements(Markup.DIALOG, Markup.BROWSER, Markup.GRAPHVIEW, |
182 Markup.SENDBACK, Markup.JEDIT_ACTION, Markup.SIMP_TRACE_PANEL) |
182 Markup.SENDBACK, Markup.JEDIT_ACTION, Markup.SIMP_TRACE_PANEL) |
183 |
183 |
184 val background_elements = |
184 val background_elements = |
185 Protocol.proper_status_elements + Markup.WRITELN_MESSAGE + |
185 Document_Status.Command_Status.proper_elements + Markup.WRITELN_MESSAGE + |
186 Markup.STATE_MESSAGE + Markup.INFORMATION_MESSAGE + |
186 Markup.STATE_MESSAGE + Markup.INFORMATION_MESSAGE + |
187 Markup.TRACING_MESSAGE + Markup.WARNING_MESSAGE + |
187 Markup.TRACING_MESSAGE + Markup.WARNING_MESSAGE + |
188 Markup.LEGACY_MESSAGE + Markup.ERROR_MESSAGE + |
188 Markup.LEGACY_MESSAGE + Markup.ERROR_MESSAGE + |
189 Markup.BAD + Markup.INTENSIFY + Markup.ENTITY + |
189 Markup.BAD + Markup.INTENSIFY + Markup.ENTITY + |
190 Markup.Markdown_Bullet.name ++ active_elements |
190 Markup.Markdown_Bullet.name ++ active_elements |
391 snapshot.cumulate[(List[Markup], Option[Rendering.Color.Value])]( |
391 snapshot.cumulate[(List[Markup], Option[Rendering.Color.Value])]( |
392 range, (List(Markup.Empty), None), Rendering.background_elements, |
392 range, (List(Markup.Empty), None), Rendering.background_elements, |
393 command_states => |
393 command_states => |
394 { |
394 { |
395 case (((markups, color), Text.Info(_, XML.Elem(markup, _)))) |
395 case (((markups, color), Text.Info(_, XML.Elem(markup, _)))) |
396 if markups.nonEmpty && Protocol.proper_status_elements(markup.name) => |
396 if markups.nonEmpty && Document_Status.Command_Status.proper_elements(markup.name) => |
397 Some((markup :: markups, color)) |
397 Some((markup :: markups, color)) |
398 case (_, Text.Info(_, XML.Elem(Markup(Markup.BAD, _), _))) => |
398 case (_, Text.Info(_, XML.Elem(Markup(Markup.BAD, _), _))) => |
399 Some((Nil, Some(Rendering.Color.bad))) |
399 Some((Nil, Some(Rendering.Color.bad))) |
400 case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) => |
400 case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) => |
401 Some((Nil, Some(Rendering.Color.intensify))) |
401 Some((Nil, Some(Rendering.Color.intensify))) |
429 else None |
429 else None |
430 }) |
430 }) |
431 color <- |
431 color <- |
432 (result match { |
432 (result match { |
433 case (markups, opt_color) if markups.nonEmpty => |
433 case (markups, opt_color) if markups.nonEmpty => |
434 val status = Protocol.Status.make(markups.iterator) |
434 val status = Document_Status.Command_Status.make(markups.iterator) |
435 if (status.is_unprocessed) Some(Rendering.Color.unprocessed1) |
435 if (status.is_unprocessed) Some(Rendering.Color.unprocessed1) |
436 else if (status.is_running) Some(Rendering.Color.running1) |
436 else if (status.is_running) Some(Rendering.Color.running1) |
437 else opt_color |
437 else opt_color |
438 case (_, opt_color) => opt_color |
438 case (_, opt_color) => opt_color |
439 }) |
439 }) |
646 def overview_color(range: Text.Range): Option[Rendering.Color.Value] = |
646 def overview_color(range: Text.Range): Option[Rendering.Color.Value] = |
647 { |
647 { |
648 if (snapshot.is_outdated) None |
648 if (snapshot.is_outdated) None |
649 else { |
649 else { |
650 val results = |
650 val results = |
651 snapshot.cumulate[List[Markup]](range, Nil, Protocol.liberal_status_elements, _ => |
651 snapshot.cumulate[List[Markup]](range, Nil, Document_Status.Command_Status.liberal_elements, |
652 { |
652 _ => |
653 case (status, Text.Info(_, elem)) => Some(elem.markup :: status) |
653 { |
654 }, status = true) |
654 case (status, Text.Info(_, elem)) => Some(elem.markup :: status) |
|
655 }, status = true) |
655 if (results.isEmpty) None |
656 if (results.isEmpty) None |
656 else { |
657 else { |
657 val status = Protocol.Status.make(results.iterator.flatMap(_.info)) |
658 val status = Document_Status.Command_Status.make(results.iterator.flatMap(_.info)) |
658 |
659 |
659 if (status.is_running) Some(Rendering.Color.running) |
660 if (status.is_running) Some(Rendering.Color.running) |
660 else if (status.is_failed) Some(Rendering.Color.error) |
661 else if (status.is_failed) Some(Rendering.Color.error) |
661 else if (status.is_warned) Some(Rendering.Color.warning) |
662 else if (status.is_warned) Some(Rendering.Color.warning) |
662 else if (status.is_unprocessed) Some(Rendering.Color.unprocessed) |
663 else if (status.is_unprocessed) Some(Rendering.Color.unprocessed) |