Search in sources :

Example 1 with CompositeColumnWithPlaceholderPart

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

the class TablePartFactory 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 if (embedChildren(entity))
                    return new CompositeEntityTablePart(ed);
                else
                    return new CompositeColumnWithPlaceholderPart();
            case SIMPLE:
                if (isEmbedded(entity))
                    return new SimpleEntityTableRowPart(ed);
                else
                    return new SimpleEntityTablePart(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) CompositeColumnWithPlaceholderPart(org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)

Example 2 with CompositeColumnWithPlaceholderPart

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

the class ArtifactsOutlinePartFactoryVisitor method visit.

@Override
public void visit(Artifacts entity) {
    super.visit(entity);
    part = new CompositeColumnWithPlaceholderPart();
}
Also used : CompositeColumnWithPlaceholderPart(org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)

Example 3 with CompositeColumnWithPlaceholderPart

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

the class QueriesPartFactoryVisitor method visit.

@Override
public void visit(Expressions entity) {
    IEntity parent = entity.wGetParent();
    if (EntityUtils.hasParent(entity)) {
        if (Matcher.match(QueriesEntityDescriptorEnum.EntityTemplate, parent)) {
            part = new CompositeColumnWithPlaceholderPart();
            return;
        } else if (Matcher.match(QueriesEntityDescriptorEnum.UnionAll, parent) || Matcher.isAssignableAsIsFrom(QueriesEntityDescriptorEnum.CollectByExpression, parent)) {
            part = new CommaSeparatedCompositeColumnPart();
            return;
        }
    }
    part = new CommaSeparatedCompositeFlowPart();
}
Also used : IEntity(org.whole.lang.model.IEntity) CommaSeparatedCompositeFlowPart(org.whole.lang.ui.editparts.CommaSeparatedCompositeFlowPart) CommaSeparatedCompositeColumnPart(org.whole.lang.ui.editparts.CommaSeparatedCompositeColumnPart) CompositeColumnWithPlaceholderPart(org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)

Aggregations

CompositeColumnWithPlaceholderPart (org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)3 IEntity (org.whole.lang.model.IEntity)2 CommaSeparatedCompositeColumnPart (org.whole.lang.ui.editparts.CommaSeparatedCompositeColumnPart)1 CommaSeparatedCompositeFlowPart (org.whole.lang.ui.editparts.CommaSeparatedCompositeFlowPart)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