| /******************************************************************************* |
| * Copyright (c) 2011-2014 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Johannes Faltermeier - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.emf.ecp.view.spi.stack.ui.swt; |
| |
| import java.util.Collection; |
| |
| import javax.inject.Inject; |
| |
| import org.eclipse.emf.ecp.view.spi.context.ViewModelContext; |
| import org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer; |
| import org.eclipse.emf.ecp.view.spi.model.VContainedElement; |
| import org.eclipse.emf.ecp.view.spi.stack.model.VStackItem; |
| import org.eclipse.emfforms.spi.common.report.ReportService; |
| import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding; |
| import org.eclipse.emfforms.spi.swt.core.EMFFormsRendererFactory; |
| |
| /** |
| * The SWT {@link VStackItem} renderer. |
| * |
| * @author jfaltermeier |
| * |
| */ |
| public class SWTStackItemRenderer extends ContainerSWTRenderer<VStackItem> { |
| |
| /** |
| * Default constructor. |
| * |
| * @param vElement the view model element to be rendered |
| * @param viewContext the view context |
| * @param reportService the {@link ReportService} |
| * @param factory the {@link EMFFormsRendererFactory} |
| * @param emfFormsDatabinding The {@link EMFFormsDatabinding} |
| * @since 1.6 |
| */ |
| @Inject |
| public SWTStackItemRenderer(VStackItem vElement, ViewModelContext viewContext, |
| ReportService reportService, |
| EMFFormsRendererFactory factory, EMFFormsDatabinding emfFormsDatabinding) { |
| super(vElement, viewContext, reportService, factory, emfFormsDatabinding); |
| } |
| |
| private static final String LAYOUT_STACK_ITEM = "org_eclipse_emf_ecp_ui_layout_stackitem"; //$NON-NLS-1$ |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer#getChildren() |
| */ |
| @Override |
| protected Collection<VContainedElement> getChildren() { |
| return getVElement().getChildren(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.emf.ecp.view.spi.core.swt.ContainerSWTRenderer#getCustomVariant() |
| */ |
| @Override |
| protected String getCustomVariant() { |
| return LAYOUT_STACK_ITEM; |
| } |
| |
| } |