Search in sources :

Example 1 with LiteralTextualEntityPart

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

the class StyledTreePartFactory method createEditPart.

public EditPart createEditPart(EditPart context, Object modelEntity) {
    IEntityPart contextPart = (IEntityPart) context;
    IEntity entity = (IEntity) modelEntity;
    EntityDescriptor<?> ed = entity.wGetEntityDescriptor();
    if (ed.equals(CommonsEntityDescriptorEnum.Resolver))
        return new PlaceHolderPart();
    else {
        IEntityStyling entityStyling = notationStyling.getEntityStyling(this, contextPart, entity);
        switch(ed.getEntityKind()) {
            case SIMPLE:
                return new SimpleEntityStyledTreePart(this, entityStyling);
            case COMPOSITE:
                return new CompositeEntityStyledTreePart(this, entityStyling);
            default:
            case DATA:
                // TODO test
                if (entity.wGetEntityDescriptor().getName().equals("SimpleName") && entity.wGetParent().wGetEntityDescriptor().getName().equals("Feature"))
                    entity.wGetEntityDescriptor();
                switch(notationStyling.getEmbeddingStyle(this, contextPart, entity)) {
                    case TABLE_CELL:
                        switch(// TODO replace with styling features
                        ed.getDataKind()) {
                            case STRING:
                                return new LiteralTextualEntityPart();
                            default:
                                return new LiteralDataEntityPart();
                        }
                    case NONE:
                    default:
                        return new DataEntityStyledTreePart(this, entityStyling);
                }
        }
    }
}
Also used : IEntity(org.whole.lang.model.IEntity) LiteralDataEntityPart(org.whole.lang.ui.editparts.LiteralDataEntityPart) IEntityStyling(org.whole.lang.ui.notations.styledtree.styling.IEntityStyling) PlaceHolderPart(org.whole.lang.ui.editparts.PlaceHolderPart) LiteralTextualEntityPart(org.whole.lang.ui.editparts.LiteralTextualEntityPart) IEntityPart(org.whole.lang.ui.editparts.IEntityPart)

Example 2 with LiteralTextualEntityPart

use of org.whole.lang.ui.editparts.LiteralTextualEntityPart 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 3 with LiteralTextualEntityPart

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

the class PatternsPartFactoryVisitor method visit.

@Override
public void visit(Name entity) {
    if (EntityUtils.hasParent(entity)) {
        IEntity parent = entity.wGetParent();
        int parentOrd = parent.wGetEntityDescriptor().getOrdinal();
        switch(parentOrd) {
            case PatternsEntityDescriptorEnum.Pattern_ord:
            case PatternsEntityDescriptorEnum.Repetition_ord:
            case PatternsEntityDescriptorEnum.Choice_ord:
            case PatternsEntityDescriptorEnum.Enumeration_ord:
            case PatternsEntityDescriptorEnum.Data_ord:
            case PatternsEntityDescriptorEnum.PatternApplication_ord:
            case PatternsEntityDescriptorEnum.PatternInstance_ord:
            case PatternsEntityDescriptorEnum.FunctionDeclaration_ord:
            case PatternsEntityDescriptorEnum.FunctionPoint_ord:
                part = new DeclarationTextualEntityPart();
                return;
            case PatternsEntityDescriptorEnum.PointcutDeclaration_ord:
                part = new PointcutStepPart();
                return;
            case PatternsEntityDescriptorEnum.GoalDeclaration_ord:
                part = new GoalStepPart();
                return;
            case PatternsEntityDescriptorEnum.VariablePoint_ord:
            case PatternsEntityDescriptorEnum.VariableDeclaration_ord:
            case PatternsEntityDescriptorEnum.VariantSelectionPoint_ord:
            case PatternsEntityDescriptorEnum.Variant_ord:
                part = new IdentifierTextualEntityPart();
                return;
            case PatternsEntityDescriptorEnum.JoinPointDeclaration_ord:
                part = new JoinPointStepPart();
                return;
            case PatternsEntityDescriptorEnum.VariantSelector_ord:
                part = new VariabilityNamePart();
                return;
            case PatternsEntityDescriptorEnum.JoinPoint_ord:
                part = new ContentTextualEntityPart();
                return;
            case PatternsEntityDescriptorEnum.PatternLanguage_ord:
            case PatternsEntityDescriptorEnum.Library_ord:
                part = new ModuleNameTextualEntityPart();
                return;
            case PatternsEntityDescriptorEnum.EnumValue_ord:
                part = new LiteralTextualEntityPart();
                return;
            case PatternsEntityDescriptorEnum.Binding_ord:
            case PatternsEntityDescriptorEnum.Slot_ord:
            case PatternsEntityDescriptorEnum.InsertionPoint_ord:
                part = new ContentTextualEntityPart();
                return;
        }
    }
    part = new ContentTextualEntityPart();
}
Also used : ModuleNameTextualEntityPart(org.whole.lang.ui.editparts.ModuleNameTextualEntityPart) ContentTextualEntityPart(org.whole.lang.ui.editparts.ContentTextualEntityPart) IEntity(org.whole.lang.model.IEntity) IdentifierTextualEntityPart(org.whole.lang.ui.editparts.IdentifierTextualEntityPart) LiteralTextualEntityPart(org.whole.lang.ui.editparts.LiteralTextualEntityPart) ScopePoint(org.whole.lang.patterns.model.ScopePoint) FunctionPoint(org.whole.lang.patterns.model.FunctionPoint) SelectionPoint(org.whole.lang.patterns.model.SelectionPoint) JoinPoint(org.whole.lang.patterns.model.JoinPoint) SequencePoint(org.whole.lang.patterns.model.SequencePoint) InlinePoint(org.whole.lang.patterns.model.InlinePoint) ConditionPoint(org.whole.lang.patterns.model.ConditionPoint) VariantSelectionPoint(org.whole.lang.patterns.model.VariantSelectionPoint) TemplatePoint(org.whole.lang.patterns.model.TemplatePoint) InsertionPoint(org.whole.lang.patterns.model.InsertionPoint) ResultPoint(org.whole.lang.patterns.model.ResultPoint) DerivationPoint(org.whole.lang.patterns.model.DerivationPoint) IterationPoint(org.whole.lang.patterns.model.IterationPoint) VariablePoint(org.whole.lang.patterns.model.VariablePoint) DeclarationTextualEntityPart(org.whole.lang.ui.editparts.DeclarationTextualEntityPart)

Example 4 with LiteralTextualEntityPart

use of org.whole.lang.ui.editparts.LiteralTextualEntityPart 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)

Example 5 with LiteralTextualEntityPart

use of org.whole.lang.ui.editparts.LiteralTextualEntityPart 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)

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