Search in sources :

Example 11 with EntityLabel

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

the class XsiSimpleElementPart method createLabel.

protected EntityLabel createLabel() {
    if (tagName == null)
        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)

Example 12 with EntityLabel

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

the class DataEntityTreeTableFigure method createDataFigure.

protected IEntityFigure createDataFigure() {
    EntityLabel figure = LabelFactory.createLiteral();
    figure.setBorder(new MarginBorder(1, 5, 1, 5));
    return figure;
}
Also used : MarginBorder(org.eclipse.draw2d.MarginBorder) EntityLabel(org.whole.lang.ui.figures.EntityLabel)

Example 13 with EntityLabel

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

the class TreeNotationUtils method createTitleFigureWithAlpha.

public static EntityFigure createTitleFigureWithAlpha(String title, Toggle toggle) {
    EntityFigure titleFigure = new EntityFigure(new RowLayout().withSpacing(4).withMargin(2, 4, 2, 12));
    if (toggle != null)
        titleFigure.add(toggle);
    EntityLabel label = new EntityLabel() {

        public Color getLocalForegroundColor() {
            return FigureConstants.declarationsColor;
        }

        public Font getLocalFont() {
            return FigureConstants.declarationsFont;
        }

        @Override
        protected void paintFigure(Graphics g) {
            int oldAlpha = g.getAlpha();
            g.setAlpha(60);
            super.paintFigure(g);
            g.setAlpha(oldAlpha);
        }
    };
    label.setText(title);
    titleFigure.add(label);
    return titleFigure;
}
Also used : Graphics(org.eclipse.draw2d.Graphics) EntityFigure(org.whole.lang.ui.figures.EntityFigure) RowLayout(org.whole.lang.ui.layout.RowLayout) 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