blob: c3507d887483567e3b9c065711d327677c1f54c2 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others.
*
* 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:
* Lucas Koehler - initial API and implementation
******************************************************************************/
package org.eclipse.emf.ecp.view.spi.groupedgrid.swt;
import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
import org.eclipse.emf.ecp.view.spi.groupedgrid.model.VGroupedGrid;
import org.eclipse.emf.ecp.view.spi.model.VElement;
import org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer;
import org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService;
import org.osgi.service.component.annotations.Component;
/**
* {@link EMFFormsDIRendererService DI renderer service} for {@link GroupedGridSWTRenderer}.
*
* @author Lucas Koehler
*
*/
@Component(name = "GroupedGridSWTRendererService")
public class GroupedGridSWTRendererService implements EMFFormsDIRendererService<VGroupedGrid> {
/**
* {@inheritDoc}
*
* @see org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService#isApplicable(org.eclipse.emf.ecp.view.spi.model.VElement,
* org.eclipse.emf.ecp.view.spi.context.ViewModelContext)
*/
@Override
public double isApplicable(VElement vElement, ViewModelContext viewModelContext) {
if (VGroupedGrid.class.isInstance(vElement)) {
return 1d;
}
return NOT_APPLICABLE;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService#getRendererClass()
*/
@Override
public Class<? extends AbstractSWTRenderer<VGroupedGrid>> getRendererClass() {
return GroupedGridSWTRenderer.class;
}
}