Search in sources :

Example 6 with PlaceHolderPart

use of org.whole.lang.ui.editparts.PlaceHolderPart in project whole by wholeplatform.

the class TextPartFactory 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 CompositeEntityReferenceTextPart(ed);
                else
                    return new CompositeEntityTextPart(ed);
            case SIMPLE:
                return new SimpleEntityTextPart(ed);
        }
    return new PlaceHolderPart();
}
Also used : IEntity(org.whole.lang.model.IEntity) LiteralDataEntityPart(org.whole.lang.ui.editparts.LiteralDataEntityPart) PlaceHolderPart(org.whole.lang.ui.editparts.PlaceHolderPart) LiteralTextualEntityPart(org.whole.lang.ui.editparts.LiteralTextualEntityPart)

Example 7 with PlaceHolderPart

use of org.whole.lang.ui.editparts.PlaceHolderPart in project whole by wholeplatform.

the class OutlinePartFactory 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 CompositeEntityReferenceOutlinePart(ed);
                else
                    return new CompositeEntityOutlinePart(ed);
            case SIMPLE:
                return new SimpleEntityOutlinePart(ed);
        }
    return new PlaceHolderPart();
}
Also used : IEntity(org.whole.lang.model.IEntity) LiteralDataEntityPart(org.whole.lang.ui.editparts.LiteralDataEntityPart) PlaceHolderPart(org.whole.lang.ui.editparts.PlaceHolderPart) LiteralTextualEntityPart(org.whole.lang.ui.editparts.LiteralTextualEntityPart)

Aggregations

IEntity (org.whole.lang.model.IEntity)7 PlaceHolderPart (org.whole.lang.ui.editparts.PlaceHolderPart)7 LiteralDataEntityPart (org.whole.lang.ui.editparts.LiteralDataEntityPart)5 LiteralTextualEntityPart (org.whole.lang.ui.editparts.LiteralTextualEntityPart)5 CompositeColumnPart (org.whole.lang.ui.editparts.CompositeColumnPart)1 CompositeColumnWithPlaceholderPart (org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)1 ContentLightDataEntityPart (org.whole.lang.ui.editparts.ContentLightDataEntityPart)1 IEntityPart (org.whole.lang.ui.editparts.IEntityPart)1 PlaceHolderOptionalPart (org.whole.lang.ui.editparts.PlaceHolderOptionalPart)1 VariableDataEntityPart (org.whole.lang.ui.editparts.VariableDataEntityPart)1 IEntityStyling (org.whole.lang.ui.notations.styledtree.styling.IEntityStyling)1 CompositeEntityReferenceColumnPart (org.whole.lang.ui.notations.table.editparts.CompositeEntityReferenceColumnPart)1