PageRenderTime 91ms CodeModel.GetById 82ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/RubyPlugin/src/org/jedit/ruby/utils/EditorView.java

#
Java | 132 lines | 86 code | 43 blank | 3 comment | 0 complexity | 8c6e3c29e86f98d57ab2fc7ff5163c97 MD5 | raw file
  1package org.jedit.ruby.utils;
  2
  3import org.gjt.sp.jedit.View;
  4import org.jedit.ruby.ast.RubyMembers;
  5import org.jedit.ruby.ast.Member;
  6
  7import java.util.List;
  8
  9/**
 10 * @author robmckinnon at users.sourceforge.net
 11 */
 12public interface EditorView {
 13
 14    public final static EditorView NULL = new NullEditorView();
 15
 16    String getLineUpToCaret();
 17
 18    String getLineUpToCaretLeftTrimmed();
 19
 20    String getText(int start, int length);
 21
 22    int getLength();
 23
 24    String getTextWithoutLine();
 25
 26    View getView();
 27
 28    int getCaretPosition();
 29
 30    RubyMembers getMembers();
 31
 32    Member getMemberAtCaretPosition();
 33
 34    int getNonSpaceStartOffset(int line);
 35
 36    int getEndOffset(int line);
 37
 38    int getEndOfFileOffset();
 39
 40    int getStartOffset(int line);
 41
 42    int getLineAtOffset(int offset);
 43
 44    int getLineAtCaret();
 45
 46    int getTextLength();
 47
 48    List<String> getKeywords();
 49
 50    List<String> getWords(String partialName);
 51
 52    int getCaretOffsetInLine();
 53
 54    public static class NullEditorView implements EditorView {
 55
 56        public String getLineUpToCaret() {
 57            return null;
 58        }
 59
 60        public final String getLineUpToCaretLeftTrimmed() {
 61            return null;
 62        }
 63
 64        public String getText(int start, int length) {
 65            return null;
 66        }
 67
 68        public int getLength() {
 69            return 0;
 70        }
 71
 72        public final String getTextWithoutLine() {
 73            return null;
 74        }
 75
 76        public final View getView() {
 77            return null;
 78        }
 79
 80        public int getCaretPosition() {
 81            return 0;
 82        }
 83
 84        public final RubyMembers getMembers() {
 85            return null;
 86        }
 87
 88        public final Member getMemberAtCaretPosition() {
 89            return null;
 90        }
 91
 92        public final int getNonSpaceStartOffset(int line) {
 93            return 0;
 94        }
 95
 96        public final int getEndOffset(int line) {
 97            return 0;
 98        }
 99
100        public final int getEndOfFileOffset() {
101            return 0;
102        }
103
104        public final int getStartOffset(int line) {
105            return 0;
106        }
107
108        public final int getLineAtOffset(int offset) {
109            return 0;
110        }
111
112        public final int getLineAtCaret() {
113            return 0;
114        }
115
116        public final int getTextLength() {
117            return 0;
118        }
119
120        public List<String> getKeywords() {
121            return null;
122        }
123
124        public int getCaretOffsetInLine() {
125            return 0;
126        }
127
128        public List<String> getWords(String partialName) {
129            return null;
130        }
131    }
132}