Gridarta Editor
TextAreaDefaults.java
Go to the documentation of this file.
1 /*
2  * TextAreaDefaults.java - Encapsulates default values for various settings
3  * Copyright (C) 1999 Slava Pestov
4  * Copyright (C) 2000-2015 The Gridarta Developers.
5  *
6  * You may use and modify this package for any purpose. Redistribution is
7  * permitted, in both source and binary form, provided that this notice
8  * remains intact in all source distributions of this package.
9  */
10 
11 package net.sf.gridarta.textedit.textarea;
12 
13 import java.awt.Color;
14 import javax.swing.JPopupMenu;
17 import org.jetbrains.annotations.NotNull;
18 import org.jetbrains.annotations.Nullable;
19 
26 public class TextAreaDefaults {
27 
28  @NotNull
29  private final InputHandler inputHandler;
30 
31  @Nullable
32  private final SyntaxDocument document = null;
33 
34  private final boolean editable = true;
35 
36  private final boolean caretVisible = true;
37 
38  private final boolean caretBlinks = true;
39 
40  private final boolean blockCaret = false;
41 
42  private final int electricScroll = 3;
43 
44  private final int cols = 80;
45 
46  private final int rows = 25;
47 
51  @NotNull
53 
54  @NotNull
55  private final Color caretColor = Color.red;
56 
57  @NotNull
58  private final Color selectionColor = new Color(0xccccff);
59 
60  @NotNull
61  private final Color lineHighlightColor = new Color(0xffff80);
62 
63  private final boolean lineHighlight = true;
64 
65  @NotNull
66  private final Color bracketHighlightColor = Color.gray;
67 
68  private final boolean bracketHighlight = true;
69 
70  @NotNull
71  private final Color eolMarkerColor = new Color(0x009999);
72 
73  private final boolean eolMarkers = false;
74 
75  private final boolean paintInvalid = true;
76 
77  @Nullable
78  private final JPopupMenu popup = null;
79 
86  public TextAreaDefaults(@NotNull final ScriptEditControl scriptEditControl, @NotNull final MenuEntries menuEntries) {
87  inputHandler = new DefaultInputHandler(scriptEditControl, menuEntries);
88  inputHandler.addDefaultKeyBindings();
89  }
90 
91  @NotNull
93  return inputHandler;
94  }
95 
96  @Nullable
98  return document;
99  }
100 
101  public boolean getEditable() {
102  return editable;
103  }
104 
105  public boolean getCaretVisible() {
106  return caretVisible;
107  }
108 
109  public boolean getCaretBlinks() {
110  return caretBlinks;
111  }
112 
113  public boolean getBlockCaret() {
114  return blockCaret;
115  }
116 
117  public int getElectricScroll() {
118  return electricScroll;
119  }
120 
121  public int getCols() {
122  return cols;
123  }
124 
125  public int getRows() {
126  return rows;
127  }
128 
133  @NotNull
135  return styles;
136  }
137 
138  @NotNull
139  public Color getCaretColor() {
140  return caretColor;
141  }
142 
143  @NotNull
144  public Color getSelectionColor() {
145  return selectionColor;
146  }
147 
148  @NotNull
149  public Color getLineHighlightColor() {
150  return lineHighlightColor;
151  }
152 
153  public boolean getLineHighlight() {
154  return lineHighlight;
155  }
156 
157  @NotNull
158  public Color getBracketHighlightColor() {
159  return bracketHighlightColor;
160  }
161 
162  public boolean getBracketHighlight() {
163  return bracketHighlight;
164  }
165 
166  @NotNull
167  public Color getEolMarkerColor() {
168  return eolMarkerColor;
169  }
170 
171  public boolean getEolMarkers() {
172  return eolMarkers;
173  }
174 
175  public boolean getPaintInvalid() {
176  return paintInvalid;
177  }
178 
179  @Nullable
180  public JPopupMenu getPopup() {
181  return popup;
182  }
183 
184 }
A document implementation that can be tokenized by the syntax highlighting system.
TextAreaDefaults(@NotNull final ScriptEditControl scriptEditControl, @NotNull final MenuEntries menuEntries)
Creates a new instance.
A set of SyntaxStyle instances for painting colorized text.
An input handler converts the user's key strokes into concrete actions.
Base package of all Gridarta classes.
This package contains the classes for the script editor used within the editor to create and modify P...
Definition: Actions.java:20
final SyntaxStyles styles
The syntax styles used to paint colorized text.
Class with several utility functions used by jEdit's syntax colorizing subsystem. ...
SyntaxStyles getStyles()
Returns the syntax styles used to paint colorized text.
ScriptEditControl - Manages events and data flow for the script editor entity.
abstract void addDefaultKeyBindings()
Adds the default key bindings to this input handler.
List of menu entries (all CFPython commands).
static SyntaxStyles getDefaultSyntaxStyles()
Returns the default styles.
Encapsulates default settings for a text area.