blob: e016ae2c60c1acf94d371adb7502e67ada652127 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.e4.core.commands;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.e4.core.contexts.IEclipseContext;
/**
*/
public interface EHandlerService {
public IEclipseContext getContext();
public void activateHandler(String commandId, Object handler);
public void deactivateHandler(String commandId, Object handler);
public Object executeHandler(ParameterizedCommand command);
public boolean canExecute(ParameterizedCommand command);
/**
* Execute a handler for the command.
*
* @param command
* Must not be <code>null</code>
* @param staticContext
* Must not be <code>null</code>
* @return the command return value.
*/
public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext);
/**
* Check if a command can be executed.
*
* @param command
* Must not be <code>null</code>.
* @param staticContext
* Must not be <code>null</code>.
* @return true if the command can be executed.
*/
public boolean canExecute(ParameterizedCommand command, IEclipseContext staticContext);
}