Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called Sapphire 8 : Outline Decorations, by Konstantin Komissarchik

Title: Eclipse Community Forums
Subject: Sapphire 8 : Outline Decorations Author: Konstantin Komissarchik Date: Wed, 19 March 2014 17:38
Multiple text decorations can now be added to the nodes in the master-details editor page outline in order to show additional information in a way that is set apart from the main node label.

http://lh6.ggpht.com/-pq3J7JcNRmU/UyoNLhLdzYI/AAAAAAAAANo/4yF7hzMbJYk/OutlineDecorations%25255B2%25255D.png?imgmax=800

A definition of a text decoration is composed of text and an optional color. Both of these properties support Sapphire EL. When text is null, the decoration is not shown. Multiple decorations can be specified for one node.

<node-factory>
    <property>Categories</property>
    <case>
        <label>${ Name == null ? "Uncategorized" : Name }</label>
        <text-decoration>
            <text>${ ( Items.Size == 0 ? null : Concat( "(", Items.Size, ")" ) ) }</text>
        </text-decoration>
    </case>
</node-factory>


The framework API has changed accordingly.

@Label( standard = "text decoration" )
@XmlBinding( path = "text-decoration" )

public interface TextDecorationDef extends Element
{
    ElementType TYPE = new ElementType( TextDecorationDef.class );
    
    // *** Text ***
    
    @Type( base = Function.class )
    @Label( standard = "text" )
    @Required
    @XmlBinding( path = "text" )
    
    ValueProperty PROP_TEXT = new ValueProperty( TYPE, "Text" );
    
    Value<Function> getText();
    void setText( String value );
    void setText( Function value );
    
    // *** Color ***
    
    @Type( base = Function.class )
    @Label( standard = "color" )
    @DefaultValue( text = "#957D47")
    @XmlBinding( path = "color" )
    
    ValueProperty PROP_COLOR = new ValueProperty( TYPE, "Color" );
    
    Value<Function> getColor();
    void setColor( String value );
    void setColor( Function value );
}


public interface MasterDetailsContentNodeDef
{
    // *** Decorations ***
    
    @Type( base = TextDecorationDef.class )
    @Label( standard = "decorations" )
    @XmlListBinding( path = "" )
    
    ListProperty PROP_DECORATIONS = new ListProperty( TYPE, "Decorations" );
    
    ElementList<TextDecorationDef> getDecorations();
}


public final class TextDecoration
{
    public String text()
    public Color color()
}


public final class MasterDetailsContentNodePart
{
    public List<TextDecoration> decorations()
}
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top