89 private def apply_query() |
89 private def apply_query() |
90 { |
90 { |
91 query_operation.apply_query(List(limit.text, allow_dups.selected.toString, query.getText)) |
91 query_operation.apply_query(List(limit.text, allow_dups.selected.toString, query.getText)) |
92 } |
92 } |
93 |
93 |
94 private val query_label = new Label("Search criteria:") { |
94 private val query_label = new Label("Query:") { |
95 tooltip = |
95 tooltip = |
96 GUI.tooltip_lines( |
96 GUI.tooltip_lines( |
97 "Search criteria for find operation, e.g.\n\"_ = _\" \"op +\" name: Group -name: monoid") |
97 "Search criteria for find operation, e.g.\n\"_ = _\" \"op +\" name: Group -name: monoid") |
98 } |
98 } |
99 |
99 |
118 private val apply_button = new Button("Apply") { |
118 private val apply_button = new Button("Apply") { |
119 tooltip = "Find theorems meeting specified criteria" |
119 tooltip = "Find theorems meeting specified criteria" |
120 reactions += { case ButtonClicked(_) => apply_query() } |
120 reactions += { case ButtonClicked(_) => apply_query() } |
121 } |
121 } |
122 |
122 |
123 private val detach = pretty_text_area.make_detach_button |
|
124 |
|
125 private val control_panel = |
123 private val control_panel = |
126 new Wrap_Panel(Wrap_Panel.Alignment.Right)( |
124 new Wrap_Panel(Wrap_Panel.Alignment.Right)( |
127 query_label, Component.wrap(query), limit, allow_dups, |
125 query_label, Component.wrap(query), limit, allow_dups, |
128 process_indicator.component, apply_button, detach) |
126 process_indicator.component, apply_button, |
|
127 pretty_text_area.search_label, pretty_text_area.search_pattern, |
|
128 pretty_text_area.detach_button) |
129 |
129 |
130 def select { control_panel.contents += zoom } |
130 def select { control_panel.contents += zoom } |
131 |
131 |
132 val page = |
132 val page = |
133 new TabbedPane.Page("Find Theorems", new BorderPanel { |
133 new TabbedPane.Page("Find Theorems", new BorderPanel { |
154 private def apply_query() |
154 private def apply_query() |
155 { |
155 { |
156 query_operation.apply_query(List(query.getText)) |
156 query_operation.apply_query(List(query.getText)) |
157 } |
157 } |
158 |
158 |
159 private val query_label = new Label("Search criteria:") { |
159 private val query_label = new Label("Query:") { |
160 tooltip = GUI.tooltip_lines("Name / type patterns for constants") |
160 tooltip = GUI.tooltip_lines("Name / type patterns for constants") |
161 } |
161 } |
162 |
162 |
163 val query = make_query("isabelle-find-consts", query_label.tooltip, apply_query _) |
163 val query = make_query("isabelle-find-consts", query_label.tooltip, apply_query _) |
164 |
164 |
168 private val apply_button = new Button("Apply") { |
168 private val apply_button = new Button("Apply") { |
169 tooltip = "Find constants by name / type patterns" |
169 tooltip = "Find constants by name / type patterns" |
170 reactions += { case ButtonClicked(_) => apply_query() } |
170 reactions += { case ButtonClicked(_) => apply_query() } |
171 } |
171 } |
172 |
172 |
173 private val detach = pretty_text_area.make_detach_button |
|
174 |
|
175 private val control_panel = |
173 private val control_panel = |
176 new Wrap_Panel(Wrap_Panel.Alignment.Right)( |
174 new Wrap_Panel(Wrap_Panel.Alignment.Right)( |
177 query_label, Component.wrap(query), process_indicator.component, apply_button, detach) |
175 query_label, Component.wrap(query), process_indicator.component, apply_button, |
|
176 pretty_text_area.search_label, pretty_text_area.search_pattern, |
|
177 pretty_text_area.detach_button) |
178 |
178 |
179 def select { control_panel.contents += zoom } |
179 def select { control_panel.contents += zoom } |
180 |
180 |
181 val page = |
181 val page = |
182 new TabbedPane.Page("Find Constants", new BorderPanel { |
182 new TabbedPane.Page("Find Constants", new BorderPanel { |
250 private val apply_button = new Button("Apply") { |
250 private val apply_button = new Button("Apply") { |
251 tooltip = "Apply to current context" |
251 tooltip = "Apply to current context" |
252 reactions += { case ButtonClicked(_) => apply_query() } |
252 reactions += { case ButtonClicked(_) => apply_query() } |
253 } |
253 } |
254 |
254 |
255 private val detach = pretty_text_area.make_detach_button |
|
256 |
|
257 private val control_panel = new Wrap_Panel(Wrap_Panel.Alignment.Right)() |
255 private val control_panel = new Wrap_Panel(Wrap_Panel.Alignment.Right)() |
258 |
256 |
259 def select |
257 def select |
260 { |
258 { |
261 set_selector() |
259 set_selector() |
262 control_panel.contents.clear |
260 control_panel.contents.clear |
263 control_panel.contents ++= List(query_label, selector, apply_button, detach, zoom) |
261 control_panel.contents ++= |
|
262 List(query_label, selector, apply_button, |
|
263 pretty_text_area.search_label, pretty_text_area.search_pattern, |
|
264 pretty_text_area.detach_button, zoom) |
264 } |
265 } |
265 |
266 |
266 val page = |
267 val page = |
267 new TabbedPane.Page("Print Context", new BorderPanel { |
268 new TabbedPane.Page("Print Context", new BorderPanel { |
268 add(control_panel, BorderPanel.Position.North) |
269 add(control_panel, BorderPanel.Position.North) |