1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.debug.ui.console; 12 13 14 import org.eclipse.jface.text.IRegion; 15 16 /** 17 * Notified of lines appended to the console. A line tracker is defined in 18 * <code>plugin.xml</code>. A line tracker is associated with a type of 19 * process. Following is an example definition of a console line tracker 20 * extension. 21 * <pre> 22 * <extension point="org.eclipse.debug.ui.consoleLineTrackers"> 23 * <consoleLineTracker 24 * id="com.example.ExampleConsoleLineTracker" 25 * class="com.example.ExampleConsoleLineTrackerClass" 26 * processType="ExampleProcessType"> 27 * </consoleLineTracker> 28 * </extension> 29 * </pre> 30 * The attributes are specified as follows: 31 * <ul> 32 * <li><code>id</code> specifies a unique identifier for this line tracker.</li> 33 * <li><code>class</code> specifies a fully qualified name of a Java class 34 * that implements <code>IConsoleLineTracker</code>.</li> 35 * <li><code>processType</code> specifies the identifier of the process type 36 * this line tracker is associated with (which corresponds to the 37 * <code>ATTR_PROCESS_TYPE</code> attribute on a process).</li> 38 * </ul> 39 * <p> 40 * Clients may implement this interface. 41 * </p> 42 * @since 2.1 43 */ 44 public interface IConsoleLineTracker { 45 46 /** 47 * Notification that a console document has been created for which this 48 * listener is registered. 49 * 50 * @param console console that has been created 51 */ 52 public void init(IConsole console); 53 54 /** 55 * Notification that a line of text has been appended to the console. The 56 * given region describes the offset and length of the line appended to the 57 * console, excluding the line delimiter. 58 * 59 * @param line region describing the offset and length of line appended to 60 * the console, excluding the line delimiter 61 */ 62 public void lineAppended(IRegion line); 63 64 /** 65 * Disposes this console line tracker. 66 */ 67 public void dispose(); 68 } 69