KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > commands > IHandler


1 /*******************************************************************************
2  * Copyright (c) 2003, 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.ui.commands;
12
13 import java.util.Map JavaDoc;
14
15 /**
16  * A handler is the pluggable piece of a command that handles execution. Each
17  * command can have zero or more handlers associated with it (in general), of
18  * which only one will be active at any given moment in time. When the command
19  * is asked to execute, it will simply pass that request on to its active
20  * handler, if any.
21  * <p>
22  * This interface is not intended to be extended by clients.
23  * </p>
24  *
25  * @since 3.0
26  * @deprecated Please use the "org.eclipse.core.commands" plug-in instead.
27  * @see org.eclipse.core.commands.IHandler
28  */

29 public interface IHandler {
30
31     /**
32      * Registers an instance of <code>IHandlerListener</code> to listen for
33      * changes to properties of this instance.
34      *
35      * @param handlerListener
36      * the instance to register. Must not be <code>null</code>. If
37      * an attempt is made to register an instance which is already
38      * registered with this instance, no operation is performed.
39      */

40     void addHandlerListener(IHandlerListener handlerListener);
41
42     /**
43      * Disposes of this handler. This method is run once when the object is no
44      * longer referenced. This can be used as an opportunity to unhook listeners
45      * from other objects.
46      */

47     public void dispose();
48
49     /**
50      * Executes with the map of parameter values by name.
51      *
52      * @param parameterValuesByName
53      * the map of parameter values by name. Reserved for future use,
54      * must be <code>null</code>.
55      * @return the result of the execution. Reserved for future use, must be
56      * <code>null</code>.
57      * @throws ExecutionException
58      * if an exception occurred during execution.
59      */

60     Object JavaDoc execute(Map JavaDoc parameterValuesByName) throws ExecutionException;
61
62     /**
63      * Returns the map of attribute values by name.
64      * <p>
65      * Notification is sent to all registered listeners if this property
66      * changes.
67      * </p>
68      *
69      * @return the map of attribute values by name. This map may be empty, but
70      * is guaranteed not to be <code>null</code>. If this map is not
71      * empty, its collection of keys is guaranteed to only contain
72      * instances of <code>String</code>.
73      */

74     Map JavaDoc getAttributeValuesByName();
75
76     /**
77      * Unregisters an instance of <code>IPropertyListener</code> listening for
78      * changes to properties of this instance.
79      *
80      * @param handlerListener
81      * the instance to unregister. Must not be <code>null</code>.
82      * If an attempt is made to unregister an instance which is not
83      * already registered with this instance, no operation is
84      * performed.
85      */

86     void removeHandlerListener(IHandlerListener handlerListener);
87 }
88
Popular Tags