001    package org.trails.descriptor.annotation;
002    
003    import java.lang.annotation.ElementType;
004    import java.lang.annotation.Retention;
005    import java.lang.annotation.RetentionPolicy;
006    import java.lang.annotation.Target;
007    
008    import org.trails.descriptor.IPropertyDescriptor;
009    
010    @Retention(RetentionPolicy.RUNTIME)
011    @Target({ElementType.FIELD, ElementType.METHOD})
012    @DescriptorAnnotation(PropertyDescriptorAnnotationHandler.class)
013    public @interface PropertyDescriptor
014    {
015            public static final String DEFAULT_displayName = "";
016            public static final int DEFAULT_index = IPropertyDescriptor.UNDEFINED_INDEX;
017            public static final String DEFAULT_format = "no_format";
018    
019            /**
020             * Specifies if a property should appear on the list page.
021             *
022             * @return
023             */
024            boolean summary() default true;
025    
026            /**
027             * Specifies if a property should appear on both edit and list pages
028             *
029             * @return
030             * @see org.trails.descriptor.IDescriptor#isHidden()
031             */
032            boolean hidden() default false;
033    
034    
035            boolean readOnly() default false;
036    
037            /**
038             * Specifies if property should appear on search pages
039             *
040             * @return
041             */
042            boolean searchable() default true;
043    
044            /**
045             * Specifies if property can contain html.
046             *
047             * @return
048             */
049            boolean richText() default false;
050    
051            /**
052             * Override the default label text
053             *
054             * @return
055             */
056            String displayName() default "";
057    
058            String shortDescription() default "";
059    
060            /**
061             * A format pattern string
062             *
063             * @return
064             * @see java.text.SimpleDateFormat
065             * @see java.text.NumberFormat
066             */
067            String format() default "no_format";
068    
069            int index() default IPropertyDescriptor.UNDEFINED_INDEX;
070    }