/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.eef.mapping.settings.providers;
import org.eclipse.emf.eef.mapping.settings.parts.SettingsViewsRepository;
import org.eclipse.emf.eef.mapping.settings.parts.forms.SettingsPropertiesEditionPartForm;
import org.eclipse.emf.eef.mapping.settings.parts.impl.SettingsPropertiesEditionPartImpl;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPartProvider;
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*
*/
public class SettingsPropertiesEditionPartProvider implements IPropertiesEditionPartProvider {
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPartProvider#provides(java.lang.Object)
*
*/
public boolean provides(Object key) {
return key == SettingsViewsRepository.class;
}
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPartProvider#getPropertiesEditionPart(java.lang.Object, int, org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent)
*
*/
public IPropertiesEditionPart getPropertiesEditionPart(Object key, int kind, IPropertiesEditionComponent component) {
if (key == SettingsViewsRepository.Settings_.class) {
if (kind == SettingsViewsRepository.SWT_KIND)
return new SettingsPropertiesEditionPartImpl(component);
if (kind == SettingsViewsRepository.FORM_KIND)
return new SettingsPropertiesEditionPartForm(component);
}
return null;
}
}