Lines 44-49
Link Here
|
44 |
package org.netbeans.spi.editor.bracesmatching; |
44 |
package org.netbeans.spi.editor.bracesmatching; |
45 |
|
45 |
|
46 |
import javax.swing.text.BadLocationException; |
46 |
import javax.swing.text.BadLocationException; |
|
|
47 |
import javax.swing.text.Position; |
47 |
|
48 |
|
48 |
/** |
49 |
/** |
49 |
* The common interface for all matchers. Implementations of this interface |
50 |
* The common interface for all matchers. Implementations of this interface |
Lines 168-171
Link Here
|
168 |
* @throws javax.swing.text.BadLocationException If a document operation fails. |
169 |
* @throws javax.swing.text.BadLocationException If a document operation fails. |
169 |
*/ |
170 |
*/ |
170 |
public int [] findMatches() throws InterruptedException, BadLocationException; |
171 |
public int [] findMatches() throws InterruptedException, BadLocationException; |
|
|
172 |
|
173 |
/** |
174 |
* Mixin interface, which provides context ranges for brace matches. |
175 |
* The interface is expected to be implemented on the {@link BracesMatcher} instances |
176 |
* produced by {@link BracesMatcherFactory}. If implemented, the infrastructure may |
177 |
* call the method to obtain additional context for display along with brace highlight. |
178 |
* See the {@link BraceContext} for more information. |
179 |
*/ |
180 |
public interface ContextLocator { |
181 |
/** |
182 |
* Obtains context for the given text position. At this moment, only start offset |
183 |
* of the origin will be passed in, but the implementation should be prepared to |
184 |
* handle (or ignore) each of the starting offsets reported by {@link #findOrigin()} or |
185 |
* {@link #findMatches()}. |
186 |
* |
187 |
* @param originOrMatchPosition position of 'origin' or 'match' brace |
188 |
* @return context information or {@code null} if the context cannot be provided. |
189 |
*/ |
190 |
public BraceContext findContext(int originOrMatchPosition); |
191 |
} |
171 |
} |
192 |
} |