/**
* @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
*/
public EditPart createEditPart(EditPart context, Object model) {
EditPart part = null;
// Creates edit part
if (model instanceof IDiagram) {
part = new DiagramEditpart();
} else if (model instanceof INode) {
part = new ProjectEditPart();
} else if (model instanceof IConnector) {
part = new UsesConnectorEditPart();
} else {
throw new IllegalStateException("No mapping found for " + ((model != null) ? model.getClass().getSimpleName() : "'null'")
+ " model within " + ((context != null) ? context.getClass().getSimpleName() : "'null'") + " EditPart context!");
}
if (logger.isLoggable(Level.FINE)) {
//$ANALYSIS-IGNORE
logger.fine(part.getClass().getSimpleName() + " created for model " + model.getClass().getSimpleName());
}
// sets the model
part.setModel(model);
return part;
}