Search in sources :

Example 1 with VariableDataEntityPart

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

the class CommonsPartFactoryVisitor method createEditPart.

public EditPart createEditPart(EditPart context, Object modelEntity) {
    IEntity entity = (IEntity) modelEntity;
    switch(entity.wGetEntityDescriptor().getOrdinal()) {
        case CommonsEntityDescriptorEnum.RootFragment_ord:
            return new RootFragmentPart();
        // return new StageUpFragmentVerbosePart();
        case CommonsEntityDescriptorEnum.SameStageFragment_ord:
            return new SameStageFragmentPart();
        case CommonsEntityDescriptorEnum.StageDownFragment_ord:
            return new StageDownFragmentPart();
        case CommonsEntityDescriptorEnum.StageUpFragment_ord:
            return new StageUpFragmentPart();
        case CommonsEntityDescriptorEnum.TemplateFragment_ord:
            return new TemplateFragmentPart();
        case CommonsEntityDescriptorEnum.BaseFragment_ord:
            return new BaseFragmentPart();
        case CommonsEntityDescriptorEnum.Phase_ord:
            return new VariableDataEntityPart();
        case CommonsEntityDescriptorEnum.Variable_ord:
            return new VariablePart();
        case CommonsEntityDescriptorEnum.InlineVariable_ord:
            return new InlineVariablePart();
        case CommonsEntityDescriptorEnum.VarName_ord:
            return new VariableDataEntityPart();
        case CommonsEntityDescriptorEnum.VarType_ord:
            return new VarTypePart();
        case CommonsEntityDescriptorEnum.Quantifier_ord:
            return new ContentLightDataEntityPart();
        case CommonsEntityDescriptorEnum.Resolver_ord:
        default:
            if (context != null) {
                IEntity parentEntity = ((IEntity) context.getModel()).wGetAdaptee(false);
                int index = parentEntity.wIndexOf(entity);
                if (index >= 0 && parentEntity.wGetFeatureDescriptor(index).isOptional())
                    return new PlaceHolderOptionalPart();
            }
            return new PlaceHolderPart();
    }
}
Also used : VariableDataEntityPart(org.whole.lang.ui.editparts.VariableDataEntityPart) IEntity(org.whole.lang.model.IEntity) ContentLightDataEntityPart(org.whole.lang.ui.editparts.ContentLightDataEntityPart) PlaceHolderOptionalPart(org.whole.lang.ui.editparts.PlaceHolderOptionalPart) PlaceHolderPart(org.whole.lang.ui.editparts.PlaceHolderPart)

Aggregations

IEntity (org.whole.lang.model.IEntity)1 ContentLightDataEntityPart (org.whole.lang.ui.editparts.ContentLightDataEntityPart)1 PlaceHolderOptionalPart (org.whole.lang.ui.editparts.PlaceHolderOptionalPart)1 PlaceHolderPart (org.whole.lang.ui.editparts.PlaceHolderPart)1 VariableDataEntityPart (org.whole.lang.ui.editparts.VariableDataEntityPart)1