Search in sources :

Example 1 with StringSeparatedCompositeColumnFigure

use of org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure in project whole by wholeplatform.

the class CartesianProductPart method createFigure.

protected IFigure createFigure() {
    IFigure figure = new StringSeparatedCompositeColumnFigure("\u00d7", 10);
    figure.setBorder(new RoundBracketsBorder());
    return figure;
}
Also used : StringSeparatedCompositeColumnFigure(org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure) RoundBracketsBorder(org.whole.lang.ui.figures.RoundBracketsBorder) IFigure(org.eclipse.draw2d.IFigure)

Example 2 with StringSeparatedCompositeColumnFigure

use of org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure in project whole by wholeplatform.

the class PointwiseProductPart method createFigure.

protected IFigure createFigure() {
    // \u2219
    IFigure figure = new StringSeparatedCompositeColumnFigure("\u2022", 10);
    figure.setBorder(new RoundBracketsBorder());
    return figure;
}
Also used : StringSeparatedCompositeColumnFigure(org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure) RoundBracketsBorder(org.whole.lang.ui.figures.RoundBracketsBorder) IFigure(org.eclipse.draw2d.IFigure)

Example 3 with StringSeparatedCompositeColumnFigure

use of org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure in project whole by wholeplatform.

the class GrammarBasedUIUtils method createCompositeFigure.

public static IEntityFigure createCompositeFigure(IEntity entity) {
    ILanguageKit lk = entity.wGetLanguageKit();
    EntityDescriptorEnum edEnum = lk.getEntityDescriptorEnum();
    FeatureDescriptorEnum fdEnum = lk.getFeatureDescriptorEnum();
    IEntity configuration = Matcher.findAncestor(edEnum.valueOf("CompositePart"), entity);
    IEntity multiline = configuration.wGet(fdEnum.valueOf("multiline"));
    boolean isMultiline = EntityUtils.safeBooleanValue(multiline, false);
    IEntity columns = configuration.wGet(fdEnum.valueOf("columns"));
    int columnsNum = EntityUtils.safeIntValue(columns, 0);
    IEntity separator = configuration.wGet(fdEnum.valueOf("separator"));
    IEntityFigure entityFigure;
    if (EntityUtils.isNotResolver(separator)) {
        String separatorText = GrammarBasedUIUtils.calculateSeparator(separator);
        CompositeFigure compositeFigure = isMultiline ? new StringSeparatedCompositeColumnFigure(separatorText, 10) : new StringSeparatedCompositeRowFigure(separatorText, 10);
        if (isMultiline)
            compositeFigure.getLayoutManager().withMinorAlignment(Alignment.LEADING);
        entityFigure = compositeFigure;
    } else if (columnsNum > 0) {
        TableFigure tableFigure = new TableFigure(columnsNum);
        tableFigure.setBorder(CompositePlaceHolderBorder.OPTIONAL_VERTICAL);
        entityFigure = tableFigure;
    } else
        entityFigure = new CompositeFigure(!isMultiline, true);
    return entityFigure;
}
Also used : CompositeFigure(org.whole.lang.ui.figures.CompositeFigure) StringSeparatedCompositeColumnFigure(org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure) IEntityFigure(org.whole.lang.ui.figures.IEntityFigure) TableFigure(org.whole.lang.ui.figures.TableFigure) EntityDescriptorEnum(org.whole.lang.reflect.EntityDescriptorEnum) FeatureDescriptorEnum(org.whole.lang.reflect.FeatureDescriptorEnum) IEntity(org.whole.lang.model.IEntity) StringSeparatedCompositeRowFigure(org.whole.lang.ui.figures.StringSeparatedCompositeRowFigure) ILanguageKit(org.whole.lang.reflect.ILanguageKit)

Example 4 with StringSeparatedCompositeColumnFigure

use of org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure in project whole by wholeplatform.

the class ProductTypePart method createFigure.

protected IFigure createFigure() {
    StringSeparatedCompositeColumnFigure f = new StringSeparatedCompositeColumnFigure();
    f.setBorder(new RoundBracketsBorder());
    return f;
}
Also used : StringSeparatedCompositeColumnFigure(org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure) RoundBracketsBorder(org.whole.lang.ui.figures.RoundBracketsBorder)

Aggregations

StringSeparatedCompositeColumnFigure (org.whole.lang.ui.figures.StringSeparatedCompositeColumnFigure)4 RoundBracketsBorder (org.whole.lang.ui.figures.RoundBracketsBorder)3 IFigure (org.eclipse.draw2d.IFigure)2 IEntity (org.whole.lang.model.IEntity)1 EntityDescriptorEnum (org.whole.lang.reflect.EntityDescriptorEnum)1 FeatureDescriptorEnum (org.whole.lang.reflect.FeatureDescriptorEnum)1 ILanguageKit (org.whole.lang.reflect.ILanguageKit)1 CompositeFigure (org.whole.lang.ui.figures.CompositeFigure)1 IEntityFigure (org.whole.lang.ui.figures.IEntityFigure)1 StringSeparatedCompositeRowFigure (org.whole.lang.ui.figures.StringSeparatedCompositeRowFigure)1 TableFigure (org.whole.lang.ui.figures.TableFigure)1