Search in sources :

Example 1 with CompositeEntityReferenceColumnPart

use of org.whole.lang.ui.notations.table.editparts.CompositeEntityReferenceColumnPart in project whole by wholeplatform.

the class DefaultTextualPartFactory method createEditPart.

public EditPart createEditPart(EditPart context, Object modelEntity) {
    IEntity entity = (IEntity) modelEntity;
    EntityDescriptor<?> ed = entity.wGetEntityDescriptor();
    if (!ed.equals(CommonsEntityDescriptorEnum.Resolver))
        switch(entity.wGetEntityKind()) {
            case DATA:
                switch(ed.getDataKind()) {
                    case STRING:
                        return new LiteralTextualEntityPart();
                    default:
                        return new LiteralDataEntityPart();
                }
            case COMPOSITE:
                if (ed.getEntityFeatureDescriptor(0).isReference())
                    return new CompositeEntityReferenceColumnPart(ed);
                else
                    return new CompositeColumnPart();
            case SIMPLE:
                return new SimpleEntityTextPart(ed);
        }
    return new PlaceHolderPart();
}
Also used : IEntity(org.whole.lang.model.IEntity) LiteralDataEntityPart(org.whole.lang.ui.editparts.LiteralDataEntityPart) CompositeEntityReferenceColumnPart(org.whole.lang.ui.notations.table.editparts.CompositeEntityReferenceColumnPart) CompositeColumnPart(org.whole.lang.ui.editparts.CompositeColumnPart) PlaceHolderPart(org.whole.lang.ui.editparts.PlaceHolderPart) LiteralTextualEntityPart(org.whole.lang.ui.editparts.LiteralTextualEntityPart)

Aggregations

IEntity (org.whole.lang.model.IEntity)1 CompositeColumnPart (org.whole.lang.ui.editparts.CompositeColumnPart)1 LiteralDataEntityPart (org.whole.lang.ui.editparts.LiteralDataEntityPart)1 LiteralTextualEntityPart (org.whole.lang.ui.editparts.LiteralTextualEntityPart)1 PlaceHolderPart (org.whole.lang.ui.editparts.PlaceHolderPart)1 CompositeEntityReferenceColumnPart (org.whole.lang.ui.notations.table.editparts.CompositeEntityReferenceColumnPart)1