Package org.eclipse.sapphire

Examples of org.eclipse.sapphire.ValueProperty


    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final ValueProperty property = context.find( ValueProperty.class );
            return ( property != null && property.getTypeClass() == Date.class && property.hasAnnotation( Serialization.class ) );
        }
View Full Code Here


   
    @Override
    protected void initCollationService()
    {
        final ListProperty listProperty = context( ListProperty.class );
        final ValueProperty listMemberValueProperty = (ValueProperty) listProperty.getType().properties().first();
       
        this.base = listMemberValueProperty.service( CollationService.class );
       
        this.listener = new Listener()
        {
            @Override
            public void handle( final Event event )
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final ValueProperty property = context.find( ValueProperty.class );
            return ( property != null && property.getTypeClass() == Date.class && property.hasAnnotation( Serialization.class ) );
        }
View Full Code Here

public final class DefaultValueLabelService extends ValueLabelService
{
    @Override
    public String provide( final String text )
    {
        final ValueProperty property = context( ValueProperty.class );
        final String decoded = property.decodeKeywords( text );
       
        String label = decoded;
       
        final ValueKeyword keyword = property.getKeyword( property.encodeKeywords( decoded ) );
       
        if( keyword != null )
        {
            label = keyword.toDisplayString();
        }
        else if( property.hasAnnotation( NamedValues.class ) )
        {
            final LocalizationService localization = property.getLocalizationService();
           
            for( final NamedValue x : property.getAnnotation( NamedValues.class ).namedValues() )
            {
                if( decoded.equals( x.value() ) )
                {
                    label = localization.text( x.label(), CapitalizationType.NO_CAPS, false ) + " (" + x.value() + ")";
                    break;
View Full Code Here

    private final List<String> values = new ArrayList<String>();
   
    @Override
    protected void initPossibleValuesService()
    {
        final ValueProperty property = context( ValueProperty.class );
       
        final EnumValueType enumType = new EnumValueType( property.getTypeClass() );
        final MasterConversionService masterConversionService = property.service( MasterConversionService.class );
       
        for( Enum<?> item : enumType.getItems() )
        {
            this.values.add( masterConversionService.convert( item, String.class ) );
        }
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final ValueProperty property = context.find( ValueProperty.class );
            return ( property != null && Enum.class.isAssignableFrom( property.getTypeClass() ) );
        }
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final ValueProperty property = context.find( ValueProperty.class );
            final Element element = context.find( Element.class );
            return ( property != null && property.hasAnnotation( Unique.class ) && element.parent() instanceof ElementList );
        }
View Full Code Here

    public static final class Condition extends ServiceCondition
    {
        @Override
        public boolean applicable( final ServiceContext context )
        {
            final ValueProperty property = context.find( ValueProperty.class );
            return ( property != null && Enum.class.isAssignableFrom( property.getTypeClass() ) );
        }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ValueProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.