use of org.whole.lang.model.IEntity in project whole by wholeplatform.
the class SimpleEntityStyledTreePart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
IFeatureStyling[] featuresStyling = entityStyling.getFeaturesStyling();
int size = featuresStyling.length;
if (size == 0)
return Collections.emptyList();
else {
IEntity entity = getModelEntity();
EntityDescriptor<?> ed = entity.wGetEntityDescriptor();
FeatureDescriptorEnum fdEnum = ed.getFeatureDescriptorEnum();
List<IEntity> list = new ArrayList<IEntity>(size);
for (int i = 0; i < size; i++) list.add(entity.wGet(ed.getEntityFeatureDescriptor(fdEnum.valueOf(featuresStyling[i].getName()))));
return list;
}
}
use of org.whole.lang.model.IEntity in project whole by wholeplatform.
the class DefaultOutlinePartFactory method createEditPart.
public EditPart createEditPart(EditPart context, Object modelEntity) {
this.context = context;
IEntity entity = (IEntity) modelEntity;
if (entity.wIsAdapter())
return part = new PlaceHolderPart();
switch(entity.wGetEntityKind()) {
case SIMPLE:
return part = new OutlinePart(OutlineUIProvider.instance().getPartDataProvider(entity));
default:
return part = DefaultTextualPartFactory.instance().createEditPart(context, modelEntity);
}
}
use of org.whole.lang.model.IEntity 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);
}
}
}
}
use of org.whole.lang.model.IEntity 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();
}
use of org.whole.lang.model.IEntity in project whole by wholeplatform.
the class TreeRightPartFactory 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:
return createDataEntityPart(context, entity);
case COMPOSITE:
return createCompositeEntityPart(context, entity);
case SIMPLE:
return createSimpleEntityPart(context, entity);
}
return createPlaceHolderPart(context, entity);
}
Aggregations