use of org.whole.lang.ui.notations.styledtree.styling.IEntityStyling in project whole by wholeplatform.
the class AdaptiveEntityPart method createFigure.
protected IFigure createFigure() {
IEntityStyling entityStyling = getEntityStyling();
INotationStyling notationStyling = entityStyling.getNotationStyling();
switch(entityStyling.getKind()) {
case DATA:
switch(notationStyling.getEmbeddingStyle(stylingFactory, (IEntityPart) getParent(), getModelEntity())) {
case TABLE_CELL:
// TODO
case NONE:
default:
return new DataNodeFigure(entityStyling);
}
case SIMPLE:
return new SimpleTableNodeWithBranchesFigure(true, entityStyling);
case COMPOSITE:
default:
if (entityStyling.getLayoutStyle().equals(LayoutStyle.COMPOSITE_TABLE))
return new CompositeTableFigure(entityStyling);
else
return new NodeWithCompositeBranchFigure(entityStyling);
}
}
use of org.whole.lang.ui.notations.styledtree.styling.IEntityStyling 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.notations.styledtree.styling.IEntityStyling in project whole by wholeplatform.
the class StyledTreePartFactory method createEntityStyling.
public static IEntityStyling createEntityStyling(IEntityPart contextPart, EntityDescriptor<?> ed) {
EntityKinds kind = ed.getEntityKind();
LayoutStyle layoutStyle = getLayoutStyle(ed);
return new EntityStyling(ed.getURI(), kind, layoutStyle, getFeaturesStyling((kind.isComposite() && layoutStyle.equals(LayoutStyle.COMPOSITE_TABLE) ? ed.getEntityDescriptor(0) : ed).getEntityFeatureDescriptors()));
}
Aggregations