Advanced proprety sheet page for EClass [message #913378] |
Sat, 15 September 2012 08:46  |
Eclipse User |
|
|
|
Hello all,
i am actually trying to implement an advanced property sheet for EClasses. I took a look into the graphiti tutorial's plugin and based on the class "GraphitiEditPartToIPropertySourceAdapterFactory " i implemented the following factory
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.ui.editor.DiagramEditor;
import org.eclipse.graphiti.ui.platform.GraphitiShapeEditPart;
import org.eclipse.ui.views.properties.IPropertySource;
public class EditPartToIPropertySourceAdapterFactory implements IAdapterFactory {
public EditPartToIPropertySourceAdapterFactory(){
super();
}
public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
if (IPropertySource.class.equals(adapterType)) {
if (adaptableObject instanceof GraphitiShapeEditPart) {
GraphitiShapeEditPart editPart = (GraphitiShapeEditPart) adaptableObject;
PictogramElement pe = editPart.getPictogramElement();
Object object = editPart.getFeatureProvider().getBusinessObjectForPictogramElement(pe);
if (object instanceof EClass) {
return new EClassPropertySource((EClass)object);
}
}
}
return null;
}
@SuppressWarnings("rawtypes")
public Class[] getAdapterList() {
return new Class[] { IPropertySource.class };
}
But i get the following error :
The type org.eclipse.gef.editparts.AbstractGraphicalEditPart cannot be resolved. It is indirectly referenced from required .class files
It seems that the class GraphitiShapeEditPart causes this error.
Any idea?
or should i declare EClass as adaptabelType instead of GraphitiShapeEditPart ?
Many thanks in advance
Junior
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03732 seconds