Search in sources :

Example 6 with LiteralTextualEntityPart

use of org.whole.lang.ui.editparts.LiteralTextualEntityPart 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)6 LiteralTextualEntityPart (org.whole.lang.ui.editparts.LiteralTextualEntityPart)6 LiteralDataEntityPart (org.whole.lang.ui.editparts.LiteralDataEntityPart)5 PlaceHolderPart (org.whole.lang.ui.editparts.PlaceHolderPart)5 ConditionPoint (org.whole.lang.patterns.model.ConditionPoint)1 DerivationPoint (org.whole.lang.patterns.model.DerivationPoint)1 FunctionPoint (org.whole.lang.patterns.model.FunctionPoint)1 InlinePoint (org.whole.lang.patterns.model.InlinePoint)1 InsertionPoint (org.whole.lang.patterns.model.InsertionPoint)1 IterationPoint (org.whole.lang.patterns.model.IterationPoint)1 JoinPoint (org.whole.lang.patterns.model.JoinPoint)1 ResultPoint (org.whole.lang.patterns.model.ResultPoint)1 ScopePoint (org.whole.lang.patterns.model.ScopePoint)1 SelectionPoint (org.whole.lang.patterns.model.SelectionPoint)1 SequencePoint (org.whole.lang.patterns.model.SequencePoint)1 TemplatePoint (org.whole.lang.patterns.model.TemplatePoint)1 VariablePoint (org.whole.lang.patterns.model.VariablePoint)1 VariantSelectionPoint (org.whole.lang.patterns.model.VariantSelectionPoint)1 CompositeColumnPart (org.whole.lang.ui.editparts.CompositeColumnPart)1 CompositeColumnWithPlaceholderPart (org.whole.lang.ui.editparts.CompositeColumnWithPlaceholderPart)1