OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 94 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 156
Line 134... Line 134...
134
                }
134
                }
135
                final char[] te = actualText.toCharArray();
135
                final char[] te = actualText.toCharArray();
136
                final int stop = text.length();
136
                final int stop = text.length();
137
                for (int i = 0; i < stop; i++) {
137
                for (int i = 0; i < stop; i++) {
138
                    int position = i + offset;
138
                    int position = i + offset;
-
 
139
                    if (position < te.length) {
139
                    te[position] = text.charAt(i);
140
                        te[position] = text.charAt(i);
-
 
141
                    }
140
                }
142
                }
141
                for (int i = 0; i < stop; i++) {
143
                for (int i = 0; i < stop; i++) {
142
                    int position = i + offset;
144
                    int position = i + offset;
143
                    final char c = text.charAt(i);
145
                    final char c = text.charAt(i);
144
                    if (!isCharValid(c, position, te)) {
146
                    if (!isCharValid(c, position, te)) {
Line 154... Line 156...
154
            }
156
            }
155
 
157
 
156
        });
158
        });
157
        // Move cusor to not be on ':'
159
        // Move cusor to not be on ':'
158
        this.setNavigationFilter(new NavigationFilter() {
160
        this.setNavigationFilter(new NavigationFilter() {
-
 
161
 
159
            @Override
162
            @Override
160
            public int getNextVisualPositionFrom(JTextComponent text, int pos, Bias bias, int direction, Bias[] biasRet) throws BadLocationException {
163
            public int getNextVisualPositionFrom(JTextComponent text, int pos, Bias bias, int direction, Bias[] biasRet) throws BadLocationException {
161
                if (pos == 1 && direction == SwingConstants.EAST) {
164
                if (pos == 1 && direction == SwingConstants.EAST) {
162
                    pos++;
165
                    pos++;
163
                }
166
                }