KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > client > listeners > ICommandOutputListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.team.internal.ccvs.core.client.listeners;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.team.internal.ccvs.core.*;
16 import org.eclipse.team.internal.ccvs.core.CVSStatus;
17 import org.eclipse.team.internal.ccvs.core.ICVSFolder;
18 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
19
20 /**
21  * Instances of this interface can be passed to the <code>Command#execute</code> methods
22  * and will receive notification when M or E messages are received from the server.
23  */

24 public interface ICommandOutputListener {
25     
26     /*** Status to be returned when no error or warning occured ***/
27     public static final IStatus OK = new CVSStatus(IStatus.OK, CVSMessages.ok);
28     
29     public static final String JavaDoc SERVER_PREFIX = "server: "; //$NON-NLS-1$
30
public static final String JavaDoc SERVER_ABORTED_PREFIX = "[server aborted]: "; //$NON-NLS-1$
31
public static final String JavaDoc RTAG_PREFIX = "rtag: "; //$NON-NLS-1$
32

33     /**
34      * Invoked when a message line is received from the server.
35      * <p>
36      * Any status other than ICommandOutputListener.OK will be accumulated
37      * by the command and returned. The severity of the status matches those of
38      * IStatus and must indicate whether this is a warning, error, or informational
39      * text.while the code should be one of the codes provided by CVSStatus.
40      * The status code must not be CVSStatus.SERVER_ERROR.
41      * </p>
42      *
43      * @param line the line of message text sent by the server
44      * @param commandRoot the root directory of the command
45      * @param monitor the progress monitor
46      * @return a status indicating success or failure based on the text
47      */

48     public IStatus messageLine(String JavaDoc line,
49         ICVSRepositoryLocation location,
50         ICVSFolder commandRoot,
51         IProgressMonitor monitor);
52
53     /**
54      * Invoked when an error line is received from the server.
55      * <p>
56      * Any status other than ICommandOutputListener.OK will be accumulated
57      * by the command and returned. The severity of the status matches those of
58      * IStatus and must indicate whether this is a warning, error, or informational
59      * text.while the code should be one of the codes provided by CVSStatus.
60      * The status code must not be CVSStatus.SERVER_ERROR.
61      * </p>
62      *
63      * @param line the line of error text sent by the server
64      * @param commandRoot the root directory of the command
65      * @param monitor the progress monitor
66      * @return a status indicating success or failure based on the text
67      */

68     public IStatus errorLine(String JavaDoc line,
69         ICVSRepositoryLocation location,
70         ICVSFolder commandRoot,
71         IProgressMonitor monitor);
72 }
73
Popular Tags