blob: 93cfb88f68ecc54f708df7ea6ef5b29f21e9afd8 [file] [log] [blame]
/*
*
* Copyright (c) 2011, 2016 - 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
*
* Initial contribution:
* Loetz GmbH & Co. KG
*
*/
package org.eclipse.osbp.vaaclipse.addons.softwarefactory.systemsettings;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IContextFunction;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.osbp.ui.api.contextfunction.IVaadinDialogProvider;
import org.osgi.service.component.annotations.Component;
/**
* The Class UserFilterMenuContextFunction.
*/
@Component(service = IContextFunction.class, property = "service.context.key=SystemSettings")
@SuppressWarnings("all")
public class SystemSettingsContextFunction implements IContextFunction {
/* (non-Javadoc)
* @see org.eclipse.e4.core.contexts.IContextFunction#compute(org.eclipse.e4.core.contexts.IEclipseContext, java.lang.String)
*/
@Override
public Object compute(final IEclipseContext context, final String contextKey) {
MApplication application = context.get(MApplication.class);
IEclipseContext appCtx = application.getContext();
IVaadinDialogProvider provider = ContextInjectionFactory.make(SystemSettingsDialogProvider.class, appCtx);
appCtx.set(IVaadinDialogProvider.class, provider);
return provider;
}
}