Skip to content

Commit

Permalink
[READABILITY] Fix wrong camelCase namings and variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Jun 18, 2020
1 parent 10dda16 commit 921c83f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/simplejavatexteditor/AutoComplete.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public AutoComplete(UI ui, ArrayList<String> al) {
//Set the keywords
words = al;
kw = new SupportedKeywords();
brackets = kw.getbrackets();
bracketCompletions = kw.getbracketCompletions();
brackets = kw.getBrackets();
bracketCompletions = kw.getBracketCompletions();

//Access the editor
this.ui = ui;
Expand Down
10 changes: 5 additions & 5 deletions src/simplejavatexteditor/HighlightText.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public void highLight(JTextComponent textComp, String[] pattern) {
removeHighlights(textComp);

try {
Highlighter hilite = textComp.getHighlighter();
Highlighter highlighter = textComp.getHighlighter();
Document doc = textComp.getDocument();
String text = doc.getText(0, doc.getLength());
for (int i = 0; i < pattern.length; i++) {
int pos = 0;

while ((pos = text.indexOf(pattern[i], pos)) >= 0) {
hilite.addHighlight(pos, pos + pattern[i].length(), this);
highlighter.addHighlight(pos, pos + pattern[i].length(), this);
pos += pattern[i].length();
}
}
Expand All @@ -30,12 +30,12 @@ public void highLight(JTextComponent textComp, String[] pattern) {

public void removeHighlights(JTextComponent textComp) {

Highlighter hilite = textComp.getHighlighter();
Highlighter.Highlight[] hilites = hilite.getHighlights();
Highlighter highlighter = textComp.getHighlighter();
Highlighter.Highlight[] hilites = highlighter.getHighlights();

for (int i = 0; i < hilites.length; i++) {
if (hilites[i].getPainter() instanceof HighlightText) {
hilite.removeHighlight(hilites[i]);
highlighter.removeHighlight(hilites[i]);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/simplejavatexteditor/SupportedKeywords.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public String[] getJavaKeywords() {
public String[] getCppKeywords() {
return cpp;
}
public ArrayList<String> getbracketCompletions() {
public ArrayList<String> getBracketCompletions() {
ArrayList<String> al = new ArrayList<>();
for(String completion : bCompletions) {
al.add(completion);
}
return al;
}
public ArrayList<String> getbrackets() {
public ArrayList<String> getBrackets() {
ArrayList<String> al = new ArrayList<>();
for(String completion : brackets) {
al.add(completion);
Expand Down

0 comments on commit 921c83f

Please sign in to comment.