clarified default: avoid copies;
authorwenzelm
Tue, 19 Nov 2024 22:55:09 +0100
changeset 81496 76f360c63dfe
parent 81495 57dc2c8ba7c6
child 81497 da807cf1e461
clarified default: avoid copies;
src/Pure/GUI/tree_view.scala
src/Tools/jEdit/src/output_area.scala
--- a/src/Pure/GUI/tree_view.scala	Tue Nov 19 22:48:18 2024 +0100
+++ b/src/Pure/GUI/tree_view.scala	Tue Nov 19 22:55:09 2024 +0100
@@ -24,6 +24,10 @@
         case _ => None
       }
   }
+
+  def render_tree_cell(renderer: DefaultTreeCellRenderer): Unit = {
+    renderer.setIcon(null)
+  }
 }
 
 class Tree_View(
@@ -53,9 +57,8 @@
 
   /* cell renderer */
 
-  def render_tree_cell(renderer: DefaultTreeCellRenderer): Unit = {
-    renderer.setIcon(null)
-  }
+  def render_tree_cell(renderer: DefaultTreeCellRenderer): Unit =
+    Tree_View.render_tree_cell(renderer)
 
   private val tree_cell_renderer: TreeCellRenderer = new DefaultTreeCellRenderer {
     override def getTreeCellRendererComponent(
--- a/src/Tools/jEdit/src/output_area.scala	Tue Nov 19 22:48:18 2024 +0100
+++ b/src/Tools/jEdit/src/output_area.scala	Tue Nov 19 22:55:09 2024 +0100
@@ -37,9 +37,8 @@
         output_area.render_tree_cell(renderer)
     }
 
-  def render_tree_cell(renderer: DefaultTreeCellRenderer): Unit = {
-    renderer.setIcon(null)
-  }
+  def render_tree_cell(renderer: DefaultTreeCellRenderer): Unit =
+    Tree_View.render_tree_cell(renderer)
 
   def handle_search(search: Pretty_Text_Area.Search_Results): Unit = {
     tree.init_model { for (result <- search.results) tree.root.add(Tree_View.Node(result)) }