src/Tools/jEdit/src/rendering.scala
changeset 55626 0e2b7f04c944
parent 55625 d8eb606cf321
child 55646 ec4651c697e3
     1.1 --- a/src/Tools/jEdit/src/rendering.scala	Thu Feb 20 17:57:26 2014 +0100
     1.2 +++ b/src/Tools/jEdit/src/rendering.scala	Thu Feb 20 18:23:32 2014 +0100
     1.3 @@ -227,7 +227,7 @@
     1.4      else None
     1.5  
     1.6  
     1.7 -  /* command overview */
     1.8 +  /* command status overview */
     1.9  
    1.10    val overview_limit = options.int("jedit_text_overview_limit")
    1.11  
    1.12 @@ -265,7 +265,7 @@
    1.13    }
    1.14  
    1.15  
    1.16 -  /* markup selectors */
    1.17 +  /* highlighted area */
    1.18  
    1.19    private val highlight_elements =
    1.20      Set(Markup.LANGUAGE, Markup.ML_TYPING, Markup.TOKEN_RANGE,
    1.21 @@ -282,6 +282,8 @@
    1.22    }
    1.23  
    1.24  
    1.25 +  /* hyperlinks */
    1.26 +
    1.27    private val hyperlink_elements =
    1.28      Set(Markup.ENTITY, Markup.PATH, Markup.POSITION, Markup.URL)
    1.29  
    1.30 @@ -342,6 +344,8 @@
    1.31    }
    1.32  
    1.33  
    1.34 +  /* active elements */
    1.35 +
    1.36    private val active_elements =
    1.37      Set(Markup.DIALOG, Markup.BROWSER, Markup.GRAPHVIEW, Markup.SENDBACK, Markup.SIMP_TRACE)
    1.38  
    1.39 @@ -369,6 +373,9 @@
    1.40      (Command.Results.empty /: results)(_ ++ _)
    1.41    }
    1.42  
    1.43 +
    1.44 +  /* tooltip messages */
    1.45 +
    1.46    private val tooltip_message_elements =
    1.47      Set(Markup.WRITELN, Markup.WARNING, Markup.ERROR, Markup.BAD)
    1.48  
    1.49 @@ -401,6 +408,8 @@
    1.50    }
    1.51  
    1.52  
    1.53 +  /* tooltips */
    1.54 +
    1.55    private val tooltips: Map[String, String] =
    1.56      Map(
    1.57        Markup.TOKEN_RANGE -> "inner syntax token",
    1.58 @@ -482,6 +491,8 @@
    1.59    lazy val tooltip_detach_icon = JEdit_Lib.load_icon(options.string("tooltip_detach_icon"))
    1.60  
    1.61  
    1.62 +  /* gutter icons */
    1.63 +
    1.64    private lazy val gutter_icons = Map(
    1.65      Rendering.information_pri -> JEdit_Lib.load_icon(options.string("gutter_information_icon")),
    1.66      Rendering.warning_pri -> JEdit_Lib.load_icon(options.string("gutter_warning_icon")),
    1.67 @@ -515,6 +526,8 @@
    1.68    }
    1.69  
    1.70  
    1.71 +  /* squiggly underline */
    1.72 +
    1.73    private val squiggly_colors = Map(
    1.74      Rendering.writeln_pri -> writeln_color,
    1.75      Rendering.information_pri -> information_color,
    1.76 @@ -541,6 +554,8 @@
    1.77    }
    1.78  
    1.79  
    1.80 +  /* message output */
    1.81 +
    1.82    private val message_colors = Map(
    1.83      Rendering.writeln_pri -> writeln_message_color,
    1.84      Rendering.information_pri -> information_message_color,
    1.85 @@ -575,11 +590,12 @@
    1.86      message_colors.get(pri).map((_, is_separator))
    1.87    }
    1.88  
    1.89 -
    1.90    def output_messages(st: Command.State): List[XML.Tree] =
    1.91      st.results.entries.map(_._2).filterNot(Protocol.is_result(_)).toList
    1.92  
    1.93  
    1.94 +  /* text background */
    1.95 +
    1.96    private val background1_elements =
    1.97      Protocol.command_status_markup + Markup.WRITELN_MESSAGE + Markup.TRACING_MESSAGE +
    1.98        Markup.WARNING_MESSAGE + Markup.ERROR_MESSAGE + Markup.BAD + Markup.INTENSIFY ++
    1.99 @@ -623,14 +639,11 @@
   1.100        } yield Text.Info(r, color)
   1.101    }
   1.102  
   1.103 -
   1.104    def background2(range: Text.Range): List[Text.Info[Color]] =
   1.105      snapshot.select_markup(range, Set(Markup.TOKEN_RANGE), _ => _ => Some(light_color))
   1.106  
   1.107  
   1.108 -  def bullet(range: Text.Range): List[Text.Info[Color]] =
   1.109 -    snapshot.select_markup(range, Set(Markup.BULLET), _ => _ => Some(bullet_color))
   1.110 -
   1.111 +  /* text foreground */
   1.112  
   1.113    private val foreground_elements =
   1.114      Set(Markup.STRING, Markup.ALTSTRING, Markup.VERBATIM, Markup.CARTOUCHE, Markup.ANTIQUOTED)
   1.115 @@ -643,6 +656,8 @@
   1.116        })
   1.117  
   1.118  
   1.119 +  /* text color */
   1.120 +
   1.121    private val text_colors: Map[String, Color] = Map(
   1.122        Markup.KEYWORD1 -> keyword1_color,
   1.123        Markup.KEYWORD2 -> keyword2_color,
   1.124 @@ -685,7 +700,13 @@
   1.125    }
   1.126  
   1.127  
   1.128 -  /* nested text structure -- folds */
   1.129 +  /* virtual bullets */
   1.130 +
   1.131 +  def bullet(range: Text.Range): List[Text.Info[Color]] =
   1.132 +    snapshot.select_markup(range, Set(Markup.BULLET), _ => _ => Some(bullet_color))
   1.133 +
   1.134 +
   1.135 +  /* text folds */
   1.136  
   1.137    private val fold_depth_elements =
   1.138      Set(Markup.TEXT_FOLD, Markup.GOAL, Markup.SUBGOAL)