io.overcoded.grid.annotation.GridDialog Maven / Gradle / Ivy
Show all versions of grid-annotation Show documentation
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 dialog class of that type will be generated runtime.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface GridDialog {
/**
* defines the icon in the menu
* must be upper case and valid VaadinIcon
*
* @return string
*/
String icon();
/**
* defines the methods which are available for the users
*
* @return boolean
*/
GridMethod[] enabledMethods() default {C, R, U, D};
/**
* defines which roles have control over the dialog.
*
* empty, null or * means anybody can access the dialog, other
* values will be checked on runtime with the users roles.
*
* Important!
* Opening (read method) is always allowed for a dialog, 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 dialog
*
* @return string
*/
String description() default "";
/**
* if we want to organize context menu entries on grid and group the entries
* we can use this by specifying the name of the group
*
* @return string
*/
String menuGroup() default "";
/**
* if we want to configure icon for the menu group, where this dialog belongs,
* we can use this
*
* @return string
*/
String groupIcon() default "COG";
/**
* defines the order of the dialog in the context menu
*
* @return int
*/
int order() default Integer.MAX_VALUE;
}