/*
* (c) 2011 - 2013 University of Mannheim: Software Engineering Group
*/
package de.uni_mannheim.informatik.swt.models.plm.diagram.sheet;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.gmf.tooling.runtime.sheet.DefaultPropertySection;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
/**
* @generated
*/
public class PLMPropertySection extends DefaultPropertySection implements
IPropertySourceProvider {
/**
* @generated
*/
public IPropertySource getPropertySource(Object object) {
if (object instanceof IPropertySource) {
return (IPropertySource) object;
}
AdapterFactory af = getAdapterFactory(object);
if (af != null) {
IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
IItemPropertySource.class);
if (ips != null) {
//*****************************************
// Modified to fix emendation service.
// On focus lost no transaction is started.
//*****************************************
return new de.uni_mannheim.informatik.swt.models.plm.diagram.custom.propertysheet.PropertySourceExtension(
object, ips);
}
}
if (object instanceof IAdaptable) {
return (IPropertySource) ((IAdaptable) object)
.getAdapter(IPropertySource.class);
}
return null;
}
/**
* Modify/unwrap selection.
* @generated
*/
@Override
protected Object transformSelection(Object selected) {
selected = /*super.*/transformSelectionToDomain(selected);
return selected;
}
}