blob: f568fa1b58f117f83a086a86f61b811402c805df [file] [log] [blame]
/*******************************************************************************
* 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 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:
* 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.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}
* @since 1.6
*/
@Inject
public SWTStackItemRenderer(VStackItem vElement, ViewModelContext viewContext,
ReportService reportService,
EMFFormsRendererFactory factory) {
super(vElement, viewContext, reportService, factory);
}
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;
}
}