本文整理汇总了Java中com.vaadin.spring.annotation.SpringView类的典型用法代码示例。如果您正苦于以下问题:Java SpringView类的具体用法?Java SpringView怎么用?Java SpringView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpringView类属于com.vaadin.spring.annotation包,在下文中一共展示了SpringView类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: viewsEnterAdvisor
import com.vaadin.spring.annotation.SpringView; //导入依赖的package包/类
/**
* @return customizableTraceInterceptor sur les méthodes enter des vues
*/
@Bean
public Advisor viewsEnterAdvisor() {
return new StaticMethodMatcherPointcutAdvisor(customizableTraceInterceptor()) {
/**serialVersionUID**/
private static final long serialVersionUID = 3484525172356507679L;
@Override
public boolean matches(Method method, Class<?> clazz) {
return clazz.isAnnotationPresent(SpringView.class) && "enter".equals(method.getName());
}
};
}
示例2: viewsEnterAdvisor
import com.vaadin.spring.annotation.SpringView; //导入依赖的package包/类
/**
* @return customizableTraceInterceptor sur les méthodes enter des vues
*/
@Bean
public Advisor viewsEnterAdvisor() {
return new StaticMethodMatcherPointcutAdvisor(customizableTraceInterceptor()) {
/**serialVersionUID**/
private static final long serialVersionUID = -1111119064011020300L;
@Override
public boolean matches(Method method, Class<?> clazz) {
return clazz.isAnnotationPresent(SpringView.class) && "enter".equals(method.getName());
}
};
}
示例3: scanForItems
import com.vaadin.spring.annotation.SpringView; //导入依赖的package包/类
private void scanForItems() {
logger.debug("Scanning for side bar items");
String[] beanNames = applicationContext.getBeanNamesForAnnotation(SideBarItem.class);
for (String beanName : beanNames) {
logger.debug("Bean [{}] declares a side bar item", beanName);
Class<?> beanType = applicationContext.getType(beanName);
if (Runnable.class.isAssignableFrom(beanType)) {
logger.debug("Adding side bar item for action [{}]", beanType);
this.items.add(new SideBarItemDescriptor.ActionItemDescriptor(beanName, applicationContext));
} else if (View.class.isAssignableFrom(beanType) && beanType.isAnnotationPresent(SpringView.class)) {
logger.debug("Adding side bar item for view [{}]", beanType);
this.items.add(new SideBarItemDescriptor.ViewItemDescriptor(beanName, applicationContext));
}
}
}
示例4: isAccessGranted
import com.vaadin.spring.annotation.SpringView; //导入依赖的package包/类
@Override
public boolean isAccessGranted(UI ui, String beanName) {
final SpringView annotation = applicationContext.findAnnotationOnBean(beanName, SpringView.class);
if (annotation != null) {
return allowedViews.contains(annotation.name());
} else {
return false;
}
}
示例5: ViewItemDescriptor
import com.vaadin.spring.annotation.SpringView; //导入依赖的package包/类
/**
* You should never need to create instances of this class directly.
*
* @param beanName the name of the bean that implements the view to go to, must not be {@code null}.
* @param applicationContext the application context to use when looking up beans, must not be {@code null}.
*/
public ViewItemDescriptor(String beanName, ApplicationContext applicationContext) {
super(beanName, applicationContext);
this.vaadinView = applicationContext.findAnnotationOnBean(beanName, SpringView.class);
}