io.overcoded.grid.annotation.GridView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grid-annotation Show documentation
Show all versions of grid-annotation Show documentation
An annotation library to help generate views, dialogs, and grids.
package io.overcoded.grid.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static io.overcoded.grid.annotation.GridMethod.*;
/**
* You can put it on a type and the view class of that type will be generated runtime.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface GridView {
/**
* defines the icon in the menu
*
* @return string
*/
String icon();
/**
* defines the path of the menu (base path will be inherited from package)
* must starts with `/`
*
* @return string
*/
String path();
/**
* defines the order of the view in the menu
*
* @return int
*/
int order() default Integer.MAX_VALUE;
/**
* If false, the view will get it's on entry in the navigation sidebar,
* if true, the view will appear as a submenu (e.g.: vertical navigation bar) once
* the user opened the main menu for this group.
* The grouping based on prefix.
* Like `CountryDescription` can be grouped under `Country`.
*
* @return boolean
*/
boolean grouping() default false;
/**
* defines the methods which are available for the users
* Empty or null array means CRUD!
*
* @return boolean
*/
GridMethod[] enabledMethods() default {C, R, U, D};
/**
* defines which roles have control over the view.
*
* empty, null or * means anybody can access the view, other
* values will be checked on runtime with the users roles.
*
* Important!
* Opening (read method) is always allowed for a view, but other methods
* are disabled for users which not have the required role.
*
* @return String[]
*/
String[] enabledFor() default {};
/**
* if we want to display some information for the content editors above the grid
* we can do it by specifying this description for the view
*
* @return string
*/
String description() default "";
}