use of org.whole.lang.ui.editparts.LiteralDataEntityPart 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.ui.editparts.LiteralDataEntityPart 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.ui.editparts.LiteralDataEntityPart 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();
}
use of org.whole.lang.ui.editparts.LiteralDataEntityPart 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();
}
use of org.whole.lang.ui.editparts.LiteralDataEntityPart 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();
}
Aggregations