Eclipse Platform
Release 3.1

org.eclipse.ui.console
Interface IPatternMatchListener

All Superinterfaces:
IPatternMatchListenerDelegate

public interface IPatternMatchListener
extends IPatternMatchListenerDelegate

A pattern match listener is registered with a TextConsole, and is notified when its pattern has been matched to contents in that console. A pattern match listener can be registered with a console programmatically or via the consolePatternMatchListeners extension point.

Following is an example console pattern match listener extension definition. <extension point="org.eclipse.ui.console.consolePatternMatchListeners"> <consolePatternMatchListener id="com.example.ConsolePatternMatcher" regex=".*foo.*" class="com.example.ConsolePatternMatcher"> </consolePatternMatchListener> </extension> Attributes are specified as follows:

Optionally a qualifier attribute may be specified to improve performance of regular expression matching. A qualifier specifies a simple regular expression used to qualify lines for the search. Lines that do not contain the qualifier are not considered.

Optionally an enablement expression may be provided to specify which console(s) a pattern matcher should be contributed to.

Clients may implement this interface directly if registering a pattern match listener with a text console programmatically. Clients contributing a pattern match listener via an extension implement IPatternMatchListenerDelegate instead.

Since:
3.1
See Also:
TextConsole

Method Summary
 int getCompilerFlags()
          Returns the flags to use when compiling this pattern match listener's regular expression, as defined by by Pattern.compile(String regex, int flags)
 String getLineQualifier()
          Returns a simple regular expression used to identify lines that may match this pattern matcher's complete pattern, or null.
 String getPattern()
          Returns the pattern to be used for matching.
 
Methods inherited from interface org.eclipse.ui.console.IPatternMatchListenerDelegate
connect, disconnect, matchFound
 

Method Detail

getPattern

public String getPattern()
Returns the pattern to be used for matching. The pattern is a string representing a regular expression.

Returns:
the regular expression to be used for matching

getCompilerFlags

public int getCompilerFlags()
Returns the flags to use when compiling this pattern match listener's regular expression, as defined by by Pattern.compile(String regex, int flags)

Returns:
the flags to use when compiling this pattern match listener's regular expression
See Also:
Pattern.compile(java.lang.String, int)

getLineQualifier

public String getLineQualifier()
Returns a simple regular expression used to identify lines that may match this pattern matcher's complete pattern, or null. Use of this attribute can improve performance by disqualifying lines from the search. When a line is found containing a match for this expression, the line is searched from the beginning for this pattern matcher's complete pattern. Lines not containing this pattern are discarded.

Returns:
a simple regular expression used to identify lines that may match this pattern matcher's complete pattern, or null

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.