Commit 86b6b716 authored by jayherron's avatar jayherron

Documentation and TODO cleanup

parent a354e91b
......@@ -5,6 +5,7 @@ import org.eclipse.jface.text.rules.*;
/**
* This is a rule that simply detects the input character in any context.
*
* @author jay
*
*/
......
......@@ -9,7 +9,7 @@ import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
/**
* Standard color manager from template editor plugin.
* Standard color manager. This is from the default editor plugin stub.
*
* @author jay
*
......
......@@ -4,7 +4,7 @@ import org.eclipse.swt.graphics.RGB;
/**
* The colors to highlight the text with. These are intended to match the SkySpark Func app axon
* editor as closely as possible.
* editor by default.
*
* @author jay
*
......
......@@ -9,6 +9,13 @@ import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
/**
* Class that configures the editor and scanner. By extending TextSourceViewerConfiguration,
* we respect all the default text editor preferences.
*
* @author jay
*
*/
public class TrioConfiguration extends TextSourceViewerConfiguration {
private TrioScanner scanner;
private ColorManager colorManager;
......
......@@ -3,6 +3,13 @@ package org.jayherron.trioeditor.editors;
import org.eclipse.jface.text.source.DefaultCharacterPairMatcher;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
/**
* This defines the editor and collects different aspects like configuration, document provider, etc
*
* @author jay
*
*/
public class TrioEditor extends TextEditor {
private ColorManager colorManager;
......@@ -12,12 +19,6 @@ public class TrioEditor extends TextEditor {
public TrioEditor() {
super();
// TODO How can I set spaces for tabs
//this.EDITOR_SPACES_FOR_TABS = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS;
//this.EDITOR_TAB_WIDTH = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
//this.getPreferenceStore().setValue(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, true);
//this.getPreferenceStore().setValue(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 2);
colorManager = new ColorManager();
setSourceViewerConfiguration(new TrioConfiguration(colorManager));
setDocumentProvider(new TrioDocumentProvider());
......@@ -26,14 +27,13 @@ public class TrioEditor extends TextEditor {
public void dispose() {
colorManager.dispose();
pairsMatcher.dispose();
super.dispose();
}
@Override
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
support.setCharacterPairMatcher(pairsMatcher);
// We must set up a preference page to support this, because the default text editor does not...
// We must set up a preference page to support bracket-matching, because the default text editor does not...
//support.setMatchingCharacterPainterPreferenceKeys(JavaPreferences.EDITOR_MATCHING_BRACKETS,
// JsonPreferences.EDITOR_MATCHING_BRACKETS_COLOR);
super.configureSourceViewerDecorationSupport(support);
......
......@@ -2,6 +2,14 @@ package org.jayherron.trioeditor.editors;
import org.eclipse.jface.text.rules.*;
/**
* The parition scanner allows us to define different functionality in
* different parts of the file. This is from the default
* editor plugin stub, and is not currently used.
*
* @author jay
*
*/
public class TrioPartitionScanner extends RuleBasedPartitionScanner {
public final static String TRIO_RECORD = "__trio_record";
......
......@@ -5,6 +5,7 @@ import org.eclipse.jface.text.*;
/**
* Defines the rules by which the Trio editor will operate.
*
* @author jay
*
*/
......@@ -25,13 +26,13 @@ public class TrioScanner extends RuleBasedScanner {
// Multi-line rules
// Comment
rules[0] = new MultiLineRule("/*", "*/", comment);
// Multi-line string
rules[1] = new MultiLineRule("\"\"\"", "\"\"\"", string);
rules[0] = new MultiLineRule("/*", "*/", comment, '\\');
// String: triple-quoted
rules[1] = new MultiLineRule("\"\"\"", "\"\"\"", string, '\\');
// End-of-line rules
// Comment
rules[2] = new EndOfLineRule("//", comment);
rules[2] = new EndOfLineRule("//", comment, '\\');
// Single-line rules
// Rec split
......
......@@ -2,6 +2,13 @@ package org.jayherron.trioeditor.editors;
import org.eclipse.jface.text.rules.IWhitespaceDetector;
/**
* Detects whether a given character is whitespace. This is from the default
* editor plugin stub, and is not currently used.
*
* @author jay
*
*/
public class TrioWhitespaceDetector implements IWhitespaceDetector {
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment