本文整理汇总了Java中com.day.cq.wcm.api.WCMMode.DESIGN属性的典型用法代码示例。如果您正苦于以下问题:Java WCMMode.DESIGN属性的具体用法?Java WCMMode.DESIGN怎么用?Java WCMMode.DESIGN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.day.cq.wcm.api.WCMMode
的用法示例。
在下文中一共展示了WCMMode.DESIGN属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTag
@Override
public void doTag() throws JspException, IOException {
wcmEdit = WCMMode.fromRequest(getRequest()) == WCMMode.EDIT;
wcmDesign = WCMMode.fromRequest(getRequest()) == WCMMode.DESIGN;
wcmAuthor = !(WCMMode.fromRequest(getRequest()) == WCMMode.DISABLED);
getPageContext().setAttribute(JSP_ATTR_WCM_EDIT, wcmEdit);
getPageContext().setAttribute(JSP_ATTR_WCM_DESIGN, wcmDesign);
getPageContext().setAttribute(JSP_ATTR_WCM_AUTHOR, wcmAuthor);
}
示例2: isDesign
/**
* Determine if the current WCMMode is design mode.
*
* @param pageContext the current page context
* @return true if the WCMMode is design
*/
@Function
public static boolean isDesign(PageContext pageContext) {
if (pageContext == null) {
return false;
}
final ServletRequest request = pageContext.getRequest();
if (request == null) {
return false;
}
return WCMMode.fromRequest(request) == WCMMode.DESIGN;
}
示例3: getMode
@Override
protected WCMMode getMode() {
return WCMMode.DESIGN;
}
示例4: getCorrectMode
@Override
WCMMode getCorrectMode() {
return WCMMode.DESIGN;
}
示例5: isDesign
/**
* Checks if the request is in mode {@link WCMMode#DESIGN}
*
* @param request
* request to check
* @return true if the request is in design mode
*/
public static boolean isDesign(SlingHttpServletRequest request) {
return WCMMode.DESIGN == WCMMode.fromRequest(request);
}