Search in sources :

Example 6 with EntityLabel

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

the class UnboundedPart method createFigure.

public IFigure createFigure() {
    EntityLabel label = LabelFactory.createContent();
    label.setText("*");
    return label;
}
Also used : EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Example 7 with EntityLabel

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

the class SmallContentTextualEntityPart method createFigure.

protected IFigure createFigure() {
    EntityLabel label = LabelFactory.createMonospaceSmall();
    label.setForegroundColor(FigureConstants.contentColor);
    return new TextualFigure(label);
}
Also used : TextualFigure(org.whole.lang.ui.figures.TextualFigure) EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Example 8 with EntityLabel

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

the class GrammarBasedUIUtils method createEntityLabel.

public static EntityLabel createEntityLabel(IEntity entity) {
    String category = DataTypeUtils.getAsPresentationString(entity);
    EntityLabel label = null;
    if ("KEYWORD".equals(category))
        label = LabelFactory.createKeyword();
    else if ("DELIMITER".equals(category))
        label = LabelFactory.createLiteral();
    else if ("IDENTIFIER".equals(category))
        label = LabelFactory.createIdentifier();
    else if ("LITERAL".equals(category))
        label = LabelFactory.createContent();
    else if ("OPERATOR".equals(category))
        label = LabelFactory.createContentLight();
    else if ("PARENTHESIS".equals(category))
        label = LabelFactory.createContentLighter();
    else if ("SEPARATOR".equals(category))
        // FIXME missing label category
        label = LabelFactory.createLiteral();
    return label;
}
Also used : EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Example 9 with EntityLabel

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

the class GrammarBasedUIUtils method createTerminalFigure.

public static IEntityFigure createTerminalFigure(IEntity entity) {
    FeatureDescriptorEnum fdEnum = entity.wGetLanguageKit().getFeatureDescriptorEnum();
    IEntity category = entity.wGet(fdEnum.valueOf("category"));
    IEntity literal = entity.wGet(fdEnum.valueOf("literal"));
    EntityLabel label = createEntityLabel(category);
    label.setText(StringUtils.unescapeString(DataTypeUtils.getAsPresentationString(literal)));
    return label;
}
Also used : FeatureDescriptorEnum(org.whole.lang.reflect.FeatureDescriptorEnum) IEntity(org.whole.lang.model.IEntity) EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Example 10 with EntityLabel

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

the class XsiDataElementPart method createLabel.

protected EntityLabel createLabel() {
    String tagName = MappingStrategyUtils.getElementNCName(getModelEntity());
    EntityLabel label = LabelFactory.createContent(tagName);
    label.setIcon(NotationImages.XML_TAG16);
    return label;
}
Also used : EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Aggregations

EntityLabel (org.whole.lang.ui.figures.EntityLabel)13 IFigure (org.eclipse.draw2d.IFigure)2 MarginBorder (org.eclipse.draw2d.MarginBorder)2 EntityFigure (org.whole.lang.ui.figures.EntityFigure)2 TextualFigure (org.whole.lang.ui.figures.TextualFigure)2 RowLayout (org.whole.lang.ui.layout.RowLayout)2 Graphics (org.eclipse.draw2d.Graphics)1 Point (org.eclipse.draw2d.geometry.Point)1 Image (org.eclipse.swt.graphics.Image)1 IEntity (org.whole.lang.model.IEntity)1 FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)1 FeatureDescriptorEnum (org.whole.lang.reflect.FeatureDescriptorEnum)1 EntityButton (org.whole.lang.ui.figures.EntityButton)1 EntityToggle (org.whole.lang.ui.figures.EntityToggle)1 ColumnLayout (org.whole.lang.ui.layout.ColumnLayout)1 Operation (org.whole.lang.workflows.model.Operation)1