MCPcopy Create free account
hub / github.com/BaseXdb/basex / TextPanel

Class TextPanel

basex-core/src/main/java/org/basex/gui/text/TextPanel.java:36–1149  ·  view source on GitHub ↗

Renders and provides edit capabilities for text. @author BaseX Team, BSD License @author Christian Gruen

Source from the content-addressed store, hash-verified

34 * @author Christian Gruen
35 */
36public class TextPanel extends BaseXPanel {
37 /** Text caret. */
38 private final Timer caretTimer;
39
40 /** Editor action. */
41 public enum Action {
42 /** Check for changes; do nothing if input has not changed. */
43 CHECK,
44 /** Enforce parsing of input. */
45 PARSE,
46 /** Enforce execution of input. */
47 EXECUTE,
48 /** Enforce testing of input. */
49 TEST
50 }
51
52 /** Text editor. */
53 public final TextEditor editor;
54 /** Undo history. */
55 public final History hist;
56
57 /** Renderer reference. */
58 private final TextRenderer rend;
59 /** Scrollbar reference. */
60 private final BaseXScrollBar scroll;
61 /** Editable flag. */
62 private final boolean editable;
63
64 /** Search bar. */
65 protected SearchBar search;
66 /** Link listener. */
67 private LinkListener linkListener;
68
69 /** Last number of mouse clicks. */
70 private int clicks;
71
72 /**
73 * Default constructor.
74 * @param win parent window
75 * @param editable editable flag
76 */
77 public TextPanel(final BaseXWindow win, final boolean editable) {
78 this(win, "", editable);
79 }
80
81 /**
82 * Default constructor.
83 * @param win parent window
84 * @param text initial text
85 * @param editable editable flag
86 */
87 public TextPanel(final BaseXWindow win, final String text, final boolean editable) {
88 super(win);
89 this.editable = editable;
90 editor = new TextEditor(gui);
91
92 setFocusable(true);
93 setFocusTraversalKeysEnabled(!editable);

Callers

nothing calls this directly

Calls 8

propertiesMethod · 0.95
stringMethod · 0.95
prefixIdMethod · 0.80
addMethod · 0.65
getMethod · 0.65
acceptMethod · 0.65
valuesMethod · 0.45
uriMethod · 0.45

Tested by

no test coverage detected