if (isContextRelative()) { link.setModule(null); link.setModuleRelative(false); }
link.setModuleRelative(isModuleRelative()); link.setContextRelative(isContextRelative());
    protected Layout getLayout(Object object, Class type) {        return new Layout() {            @Override            public HtmlComponent createComponent(Object object, Class type) {                Object usedObject = getTargetObject(object);                if (usedObject == null) {                    return new HtmlText();                }                HtmlLink link = getLink(usedObject);                String text = getLinkText();                if (text != null) {                    link.setText(text);                } else {                    link.setBody(getLinkBody(object));                }                return link;            }            public HtmlComponent getLinkBody(Object object) {                Schema findSchema = RenderKit.getInstance().findSchema(getSubSchema());                return renderValue(object, findSchema, getSubLayout());            }            private String getLinkText() {                if (getText() != null) {                    return getText();                }                if (getKey() == null) {                    return null;                }                return RenderUtils.getResourceString(getBundle(), getKey());            }            private HtmlLink getLink(Object usedObject) {                HtmlLink link = new HtmlLink();                String url;                if (getDestination() != null) {                    ViewDestination destination = getContext().getViewState().getDestination(                            getDestination());                    if (destination != null) {                        link.setModule(destination.getModule());                        url = destination.getPath();                    } else {                        url = "#";                    }                } else {                    if (getLinkFormat() != null) {                        url = getLinkFormat();                    } else {                        url = "#";                    }                }                link.setUrl(RenderUtils.getFormattedProperties(url, usedObject));                if (isContextRelative()) {                    link.setModule(null);                    link.setModuleRelative(false);                }                return link;            }            private Object getTargetObject(Object object) {                if (isUseParent()) {                    if (getContext().getParentContext() != null) {                        return getContext().getParentContext().getMetaObject().getObject();                    } else {                        return null;                    }                } else {                    return object;                }            }        };    }