blob: 17d1ce38239fca8f70d09943df91998b2e56004f [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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* 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.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
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.IE4Constants;
import org.eclipse.osbp.vaaclipse.addons.common.api.help.IHelpViewService;
/**
* Opens the field help view.
*/
public class ShowFieldHelpForECViewHandler extends AbstractHandler {
/**
* Execute.
*
* @param context
* the context
* @param part
* the part
* @param command
* the command
* @param helpService
* the help service
*/
@Execute
public void execute(@Active MContext context, @Active MPart part,
ParameterizedCommand command, @Optional IHelpViewService helpService) {
if (helpService == null) {
return;
}
String fieldId = part.getElementId() + ":"
+ command.getParameterMap().get(IE4Constants.KEYSTROKE_TARGET);
helpService.openFieldHelp(fieldId, part.getContext());
}
/* (non-Javadoc)
* @see org.eclipse.osbp.vaaclipse.addons.application.handler.AbstractHandler#canExecute(org.eclipse.e4.ui.model.application.ui.MContext, org.eclipse.e4.ui.model.application.ui.basic.MPart, org.eclipse.core.commands.ParameterizedCommand)
*/
@CanExecute
public boolean canExecute(@Active MContext context, @Active MPart part,
ParameterizedCommand command) {
return true;
}
}