KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > commands > IExecutionListener


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.core.commands;
13
14 /**
15  * <p>
16  * A listener to the execution of commands. This listener will be notified if a
17  * command is about to execute, and when that execution completes. It is not
18  * possible for the listener to prevent the execution, only to respond to it in
19  * some way.
20  * </p>
21  *
22  * @since 3.1
23  */

24 public interface IExecutionListener {
25
26     /**
27      * Notifies the listener that an attempt was made to execute a command with
28      * no handler.
29      *
30      * @param commandId
31      * The identifier of command that is not handled; never
32      * <code>null</code>
33      * @param exception
34      * The exception that occurred; never <code>null</code>.
35      */

36     public void notHandled(String JavaDoc commandId, NotHandledException exception);
37
38     /**
39      * Notifies the listener that a command has failed to complete execution.
40      *
41      * @param commandId
42      * The identifier of the command that has executed; never
43      * <code>null</code>.
44      * @param exception
45      * The exception that occurred; never <code>null</code>.
46      */

47     public void postExecuteFailure(String JavaDoc commandId,
48             ExecutionException exception);
49
50     /**
51      * Notifies the listener that a command has completed execution
52      * successfully.
53      *
54      * @param commandId
55      * The identifier of the command that has executed; never
56      * <code>null</code>.
57      * @param returnValue
58      * The return value from the command; may be <code>null</code>.
59      */

60     public void postExecuteSuccess(String JavaDoc commandId, Object JavaDoc returnValue);
61
62     /**
63      * Notifies the listener that a command is about to execute.
64      *
65      * @param commandId
66      * The identifier of the command that is about to execute, never
67      * <code>null</code>.
68      * @param event
69      * The event that will be passed to the <code>execute</code>
70      * method; never <code>null</code>.
71      */

72     public void preExecute(String JavaDoc commandId, ExecutionEvent event);
73 }
74
Popular Tags