blob: bb1d650404b45f03cedc91c3b318ecfe49f5c98c [file] [log] [blame]
/**
* Copyright (c) 2011, 2014 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.vaaclipse.addons.application.handler;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.e4.core.contexts.Active;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.MContext;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.osbp.vaaclipse.addons.common.api.di.Callback;
/**
* The enablement of this handler is controlled by the item itself.
*/
public class ExtViewCallbackHandlerer extends AbstractHandler {
/**
* Execute.
*
* @param context
* the context
* @param part
* the part
* @param command
* the command
*/
@Execute
public void execute(@Active MContext context, @Active MPart part,
ParameterizedCommand command) {
final IEclipseContext pmContext = createCallbackContext(context,
command.getCommand());
ContextInjectionFactory.invoke(part.getObject(), Callback.class,
pmContext, null);
}
}