/** Reloads the client-side messages in the specified locale. * It is used if you allow the user to change the locale dynamically. * * <p>Notice that this method only reloads the <i>standard</i> messages. * The application has to update the component's content (such as labels) * manually if necessary. * * <p>Limitation: it reloads only the messages of ZK Client Engine * and ZUL components. It does not reload messages loaded by your * own JavaScript codes. * * @param locale the locale. If null, {@link org.zkoss.util.Locales#getCurrent} * is assumed. * @exception UnsupportedOperationException if the device is not ajax. * @since 3.6.3 */ public static final void reloadMessages(Locale locale) throws java.io.IOException { Executions.getCurrent().getDesktop().getDevice().reloadMessages(locale); }
/** Generates the unavailable message in HTML tags, if any. * @param exec the execution (never null) */ public static String outUnavailable(Execution exec) { if (exec.getAttribute(ATTR_UNAVAILABLE_GENED) == null && !exec.isAsyncUpdate(null)) { exec.setAttribute(ATTR_UNAVAILABLE_GENED, Boolean.TRUE); final Device device = exec.getDesktop().getDevice(); String s = device.getUnavailableMessage(); return s != null ? "<noscript>\n" + s + "\n</noscript>" : ""; } return ""; //nothing to generate }
/** Sets the content type to the specified execution for the given page. * @param exec the execution (never null) */ public static final void setContentType(Execution exec, Page page) { String contentType = ((PageCtrl) page).getContentType(); if (contentType == null) { contentType = page.getDesktop().getDevice().getContentType(); if (contentType == null) contentType = ""; } final int j = contentType.indexOf(';'); if (j < 0) { final String cs = page.getDesktop().getWebApp().getConfiguration().getResponseCharset(); if (cs != null && cs.length() > 0) contentType += ";charset=" + cs; } ((ExecutionCtrl) exec).setContentType(contentType); }
/** Returns the doc type, or null if not available. * It is null or <!DOCTYPE ...>. */ public static final String outDocType(Execution exec, Page page) { if (exec.getAttribute(DOCTYPE_GENED) == null && !exec.isAsyncUpdate(null)) { exec.setAttribute(DOCTYPE_GENED, Boolean.TRUE); final String docType = ((PageCtrl) page).getDocType(); return trimAndLF(docType != null ? docType : page.getDesktop().getDevice().getDocType()); } return ""; }
: _desktop.getDevice().isCacheable(); if (!cacheable) {
exec.getDesktop().getDevice().isCacheable(); if(!cacheable) { try {