blob: 2091195313e0d78f0bf243a9cc5ee7e0b75ce5a1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2013 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:
* Eugen Neufeld - initial API and implementation
******************************************************************************/
package org.eclipse.emf.ecp.view.custom.ui.swt.test;
import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.emf.ecp.view.spi.custom.model.ECPHardcodedReferences;
import org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT;
import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
import org.eclipse.emf.ecp.view.spi.model.VFeaturePathDomainModelReference;
import org.eclipse.emf.ecp.view.spi.model.VViewFactory;
import org.eclipse.emf.ecp.view.spi.renderer.NoPropertyDescriptorFoundExeption;
import org.eclipse.emf.ecp.view.spi.renderer.NoRendererFoundException;
import org.eclipse.emf.emfstore.bowling.BowlingPackage;
import org.eclipse.emfforms.spi.swt.core.layout.GridDescriptionFactory;
import org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell;
import org.eclipse.emfforms.spi.swt.core.layout.SWTGridDescription;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* @author Eugen Neufeld
*
*/
public class ValidationCustomControl extends ECPAbstractCustomControlSWT implements ECPHardcodedReferences {
private final Set<VDomainModelReference> features = new LinkedHashSet<VDomainModelReference>();
/**
* Default constructor.
*/
public ValidationCustomControl() {
super();
// TODO Auto-generated constructor stub
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#handleContentValidation()
*/
@Override
protected void handleContentValidation() {
// TODO Auto-generated method stub
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#getGridDescription()
*/
@Override
public SWTGridDescription getGridDescription() {
// TODO Auto-generated method stub
return GridDescriptionFactory.INSTANCE.createSimpleGrid(1, 1, null);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
* org.eclipse.swt.widgets.Composite)
*/
@Override
public Control renderControl(SWTGridCell cell, Composite parent) throws NoRendererFoundException,
NoPropertyDescriptorFoundExeption {
if (cell.getColumn() == 0) {
return new Composite(parent, SWT.NONE);
}
return null;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.ecp.view.spi.custom.ui.ECPAbstractCustomControl#disposeCustomControl()
*/
@Override
protected void disposeCustomControl() {
// TODO Auto-generated method stub
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.ecp.view.spi.custom.model.ECPHardcodedReferences#getNeededDomainModelReferences()
*/
@Override
public Set<VDomainModelReference> getNeededDomainModelReferences() {
final VFeaturePathDomainModelReference feature = VViewFactory.eINSTANCE.createFeaturePathDomainModelReference();
feature.setDomainModelEFeature(
BowlingPackage.eINSTANCE.getPlayer_EMails());
features.add(feature);
return features;
}
}