01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.handlers;
11:
12: import org.eclipse.core.commands.AbstractHandler;
13: import org.eclipse.core.runtime.CoreException;
14: import org.eclipse.core.runtime.IConfigurationElement;
15: import org.eclipse.core.runtime.IExecutableExtension;
16:
17: /**
18: * A handler that is intended to be defined in XML. These handlers support the
19: * concept of executable extensions, defined by Platform Core. It is okay for
20: * subclasses to never be used as executable extension. This default
21: * implementation of <code>setInitializationData</code> is only intended as a
22: * convenience for developers.
23: *
24: * @since 3.1
25: */
26: public abstract class ExecutableExtensionHandler extends
27: AbstractHandler implements IExecutableExtension {
28:
29: /**
30: * Initializes this handler with data provided from XML. By default, an
31: * <code>ExecutableExtensionHandler</code> will do nothing with this
32: * information. Subclasses should override if they expect parameters from
33: * XML.
34: *
35: * @param config
36: * the configuration element used to trigger this execution. It
37: * can be queried by the executable extension for specific
38: * configuration properties
39: * @param propertyName
40: * the name of an attribute of the configuration element used on
41: * the <code>createExecutableExtension(String)</code> call.
42: * This argument can be used in the cases where a single
43: * configuration element is used to define multiple executable
44: * extensions.
45: * @param data
46: * adapter data in the form of a <code>String</code>, a
47: * <code>Hashtable</code>, or <code>null</code>.
48: * @throws CoreException
49: * if error(s) detected during initialization processing
50: *
51: * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
52: * java.lang.String, java.lang.Object)
53: */
54: public void setInitializationData(
55: final IConfigurationElement config,
56: final String propertyName, final Object data)
57: throws CoreException {
58: // Do nothing, by default
59: }
60: }
|