/** Returns whether the desktop is being recovered. */ private static final boolean isRecovering(Desktop desktop) { final Execution exec = desktop.getExecution(); return exec != null && ((ExecutionCtrl) exec).isRecovering(); }
private final Execution getExecution() { return _desktop != null ? _desktop.getExecution() : Executions.getCurrent(); }
protected String getEncodedSrc() { if (_src == null) { final Desktop dt = getDesktop(); return dt != null ? dt.getExecution().encodeURL("~./img/spacer.gif"): ""; } else { StringTokenizer st = new StringTokenizer(_src, "."); return Utils.getDynamicMediaURI(this, _medver++, st.nextToken(), _type.equals("jxl") ? "xls": _type); } } /**
private List<String> getEncodedSrc() { final Desktop dt = getDesktop(); List<String> list = new ArrayList<String>(); if (_audio != null) { list.add(getAudioSrc()); } else if (dt != null) { for (String src : _src) { list.add(dt.getExecution().encodeURL(src)); } } return list; }
/** Returns the encoded URL of the image (never null). */ private String getEncodedURL() { if (_src != null) { final Desktop dt = getDesktop(); if (dt != null) return dt.getExecution().encodeURL(_src); } return ""; }
private String getEncodedHref() { final Desktop dt = getDesktop(); return _auxinf != null && _auxinf.href != null && dt != null ? dt.getExecution().encodeURL(_auxinf.href) : null; //if desktop is null, it doesn't belong to any execution }
private String getEncodedHref() { final Desktop dt = getDesktop(); return _auxinf != null && _auxinf.href != null && dt != null ? dt.getExecution().encodeURL(_auxinf.href) : null; //if desktop is null, it doesn't belong to any execution }
private Execution getExecution() { Execution exec = _proc.getDesktop().getExecution(); return exec != null ? exec : Executions.getCurrent(); //just in case that the execution is dead first }
private String getEncodedSrcURL() { if (_src == null) return null; final Desktop dt = getDesktop(); //it might not belong to any desktop return dt != null ? dt.getExecution().encodeURL(_src) : null; }
private String getEncodedHref() { final Desktop dt = getDesktop(); return _auxinf != null && _auxinf.href != null && dt != null ? dt.getExecution().encodeURL(_auxinf.href) : null; //if desktop is null, it doesn't belong to any execution }
protected int canExpunge(int size, Value<Desktop> v) { if (v.getValue().getExecution() != null) return EXPUNGE_NO | EXPUNGE_CONTINUE; return super.canExpunge(size, v); }
private String getEncodedURL(String url) { final Desktop dt = getDesktop(); //it might not belong to any desktop return dt != null ? dt.getExecution().encodeURL(url): ""; } private class EncodedURL implements org.zkoss.zk.ui.util.DeferredValue {
private String getEncodedURL(String src) { final Desktop dt = getDesktop(); // it might not belong to any desktop return dt != null ? dt.getExecution().encodeURL(src != null ? src : "~./img/spacer.gif") : ""; }
private void _ngInvoke(Object... args) { AuInvoke rsp = new AuInvoke(this, "ngInvoke", args); getDesktop().getExecution().addAuResponse(rsp); } }
/** Returns the encoded src ({@link #getSrc}). */ protected String getEncodedSrc() { final Desktop dt = getDesktop(); return _media != null ? getMediaSrc() : //already encoded dt != null && _src != null ? dt.getExecution().encodeURL(_src) : ""; }
private String getEncodedSrc() { final Desktop dt = getDesktop(); return _media != null ? getMediaSrc() : //already encoded dt != null && _src != null ? dt.getExecution().encodeURL(_src) : ""; }
/** Returns the encoded URL of the hover image, or null if no hover image. */ private String getEncodedHoverURL() { if (_hoverimg != null) return Utils.getDynamicMediaURI(this, _hoverimgver, "h/" + _hoverimg.getName(), _hoverimg.getFormat()); final Desktop dt = getDesktop(); //it might not belong to any desktop return dt != null && _hoversrc != null ? dt.getExecution().encodeURL(_hoversrc) : null; }
/** Returns the encoded URL of the image (never null). */ private String getEncodedURL() { if (_image != null) return Utils.getDynamicMediaURI( //already encoded this, _imgver, "c/" + _image.getName(), _image.getFormat()); final Desktop dt = getDesktop(); //it might not belong to any desktop return dt != null ? dt.getExecution().encodeURL(_src != null ? _src : "~./img/spacer.gif") : ""; }
/** Returns the encoded URL for the hover image or null if not * available. */ private String getEncodedHoverURL() { if (_auxinf != null && _auxinf.hoverimg instanceof Image) { final Image image = (Image) _auxinf.hoverimg; return Utils.getDynamicMediaURI(this, _auxinf.hoverimgver, "h/" + image.getName(), image.getFormat()); } final Desktop dt = getDesktop(); //it might not belong to any desktop return dt != null && _auxinf != null && _auxinf.hoverimg != null ? dt.getExecution().encodeURL((String) _auxinf.hoverimg) : null; }
/** Setup this processor before processing the event by calling * {@link #process}. * * <p>Note: it doesn't invoke {@link ExecutionCtrl#onActivate} */ public void setup() { SessionsCtrl.setCurrent(_desktop.getSession()); final Execution exec = _desktop.getExecution(); ExecutionsCtrl.setCurrent(exec); ((ExecutionCtrl) exec).setCurrentPage(getPage()); }