Package name.abuchen.portfolio.model

Examples of name.abuchen.portfolio.model.Attributable


    }

    @Override
    public boolean canEdit(Object element)
    {
        Attributable attributable = Adaptor.adapt(Attributable.class, element);
        if (attributable == null)
            return false;

        return attribute.supports(attributable.getClass());
    }
View Full Code Here


        }

        @Override
        public int compare(Object o1, Object o2)
        {
            Attributable a1 = Adaptor.adapt(Attributable.class, o1);
            Attributable a2 = Adaptor.adapt(Attributable.class, o2);

            if (a1 == null && a2 == null)
                return 0;
            else if (a1 == null)
                return -1;
            else if (a2 == null)
                return 1;

            Object v1 = a1.getAttributes().get(attribute);
            Object v2 = a2.getAttributes().get(attribute);

            return attribute.getComparator().compare(v1, v2);
        }
View Full Code Here

        }

        @Override
        public String getText(Object element)
        {
            Attributable attributable = Adaptor.adapt(Attributable.class, element);
            if (attributable == null)
                return null;

            Attributes attributes = attributable.getAttributes();

            Object value = attributes.get(attribute);
            return attribute.getConverter().toString(value);
        }
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.model.Attributable

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.