| /** |
| * 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.contexts.ContextInjectionFactory; |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.e4.core.di.annotations.CanExecute; |
| 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.Load; |
| |
| /** |
| * The Class OpenBrowserHandler. |
| */ |
| public class OpenBrowserHandler 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(), Load.class, pmContext, |
| null); |
| } |
| |
| /** |
| * Can execute. |
| * |
| * @return true, if successful |
| */ |
| @CanExecute |
| public boolean canExecute() { |
| return true; |
| } |
| } |