public static CellMetaInfo createCellMetaInfo(IdentifierNode identifier, IMetaInfo metaInfo, NodeType nodeType) { SimpleNodeUsage nodeUsage = new SimpleNodeUsage(identifier, metaInfo.getDisplayName(INamedThing.SHORT), metaInfo.getSourceUrl(), nodeType); return new CellMetaInfo(JavaOpenClass.STRING, false, Collections.singletonList(nodeUsage)); }
public String findUrl(ExplanationNumberValue<?> value, String parentUrl) { IMetaInfo mi = value.getMetaInfo(); String url = mi != null ? mi.getSourceUrl() : null; if (url == null) { return parentUrl; } return url; }
public String getName() { if (metaInfo == null) { return null; } return metaInfo.getDisplayName(IMetaInfo.LONG); }
@Override protected String getUrl(ITreeElement<?> element) { ExplanationNumberValue<?> explanationValue = (ExplanationNumberValue<?>) element; String url = explanationValue.getMetaInfo() == null ? null : explanationValue.getMetaInfo().getSourceUrl(); if (StringUtils.isNotBlank(url)) { return getUrlToElement(element, url); } return FacesUtils.getContextPath() + showTablePage; }
public String getName() { if (metaInfo == null) { return null; } return metaInfo.getDisplayName(IMetaInfo.LONG); }
private CellMetaInfo createMetaInfo(IdentifierNode identifier, IMetaInfo typeMeta) { if (typeMeta == null) { return null; } SimpleNodeUsage nodeUsage = new SimpleNodeUsage(identifier, typeMeta.getDisplayName(INamedThing.SHORT), typeMeta.getSourceUrl(), NodeType.DATATYPE); return new CellMetaInfo(JavaOpenClass.STRING, false, Collections.singletonList(nodeUsage)); }
Module getModuleForMember(IOpenMember member) { String sourceUrl = member.getDeclaringClass().getMetaInfo().getSourceUrl(); Module module = getModuleForSourceUrl(sourceUrl, modules); if (module != null) { return module; } throw new OpenlNotCheckedException("Module is not found"); }
public static String getName(ExplanationNumberValue<?> value) { IMetaInfo mi = value.getMetaInfo(); String name = mi != null ? mi.getDisplayName(IMetaInfo.LONG) : null; return name; }
private String resultValue(ExplanationNumberValue<?> explanationValue) { String value = getFormattedValue(explanationValue); IMetaInfo mi = explanationValue.getMetaInfo(); String name = mi != null ? mi.getDisplayName(IMetaInfo.LONG) : null; String url = mi != null ? mi.getSourceUrl() : null; if (url != null && name != null) { String href = WebContext.getContextPath() + "/faces/pages/modules/explain/showExplainTable.xhtml?uri=" + StringTool.encodeURL(url) + "&text=" + name; value = "<a href='" + href + "' title='Show in table' target='mainFrame' class='open'>" + value + "</a>"; } return value; }
Module getModuleForMember(IOpenMember member) { String sourceUrl = member.getDeclaringClass().getMetaInfo().getSourceUrl(); Module module = getModuleForSourceUrl(sourceUrl, modules); if (module != null) { return module; } throw new OpenlNotCheckedException("Module is not found."); }
public String getDisplayName(int mode) { switch (mode) { case SHORT: return printValue(); default: String name = metaInfo == null ? null : getMetaInfo().getDisplayName(mode); return name == null ? printValue() : name + "(" + printValue() + ")"; } }
private String resultValue(ExplanationNumberValue<?> explanationValue) { String value = getFormattedValue(explanationValue); IMetaInfo mi = explanationValue.getMetaInfo(); String name = mi != null ? mi.getDisplayName(IMetaInfo.LONG) : null; String url = mi != null ? mi.getSourceUrl() : null; if (url != null && name != null) { String href = WebContext.getContextPath() + "/faces/pages/modules/explain/showExplainTable.xhtml?uri=" + StringTool.encodeURL(url) + "&text=" + name; value = "<a href='" + href + "' title='Show in table' target='mainFrame' class='open'>" + value + "</a>"; } return value; }
Module getModuleForMember(IOpenMember member) { String sourceUrl = member.getDeclaringClass().getMetaInfo().getSourceUrl(); Module module = getModuleForSourceUrl(sourceUrl, modules); if (module != null) { return module; } throw new OpenlNotCheckedException("Module is not found."); }
public String getDisplayName(int mode) { switch (mode) { case SHORT: return printValue(); default: String name = metaInfo == null ? null : getMetaInfo().getDisplayName(mode); return name == null ? printValue() : name + "(" + printValue() + ")"; } }
/** * Sets the metainfo for the value */ public void setMetaInfo(IMetaInfo metaInfo) { if (metaInfo instanceof ValueMetaInfo) { setMetaInfo((ValueMetaInfo) metaInfo); } else { try { ValueMetaInfo valueMetaInfo = new ValueMetaInfo(metaInfo.getDisplayName(IMetaInfo.SHORT), metaInfo.getDisplayName(IMetaInfo.LONG), new URLSourceCodeModule(new URL(metaInfo.getSourceUrl()))); setMetaInfo(valueMetaInfo); } catch (Exception e) { log.debug("Failed to set meta info for StringValue \"{}\"", value, e); setMetaInfo((ValueMetaInfo) null); } } }
Module getModuleForMember(IOpenMember member) { String sourceUrl = member.getDeclaringClass().getMetaInfo().getSourceUrl(); Module module = getModuleForSourceUrl(sourceUrl, modules); if (module != null) { return module; } throw new OpenlNotCheckedException("Module is not found"); }
public String[] htmlTable(ExplanationNumberValue<?> explanationValue) { String value = getFormattedValue(explanationValue); String url = findUrl(explanationValue, null); IMetaInfo mi = explanationValue.getMetaInfo(); String name = mi != null ? mi.getDisplayName(IMetaInfo.LONG) : null; if (name == null) { name = ""; } else if (url != null) { name = HTMLHelper.urlLink(WebContext.getContextPath()+ "/faces/facelets/explain/showExplainTable.xhtml?uri=" + StringTool.encodeURL(url) + "&text=" + name, "show", name, "mainFrame"); } return new String[] { value, name, htmlString(explanationValue) }; }
/** * Sets the metainfo for the value */ public void setMetaInfo(IMetaInfo metaInfo) { if (metaInfo instanceof ValueMetaInfo) { setMetaInfo((ValueMetaInfo) metaInfo); } else { try { ValueMetaInfo valueMetaInfo = new ValueMetaInfo(metaInfo.getDisplayName(IMetaInfo.SHORT), metaInfo.getDisplayName(IMetaInfo.LONG), new URLSourceCodeModule(new URL(metaInfo.getSourceUrl()))); setMetaInfo(valueMetaInfo); } catch (Exception e) { log.debug("Failed to set meta info for StringValue \"{}\"", value, e); setMetaInfo((ValueMetaInfo) null); } } }
@Override String getUrl(ITreeElement<?> element) { ExplanationNumberValue<?> explanationValue = (ExplanationNumberValue<?>) element; String url = explanationValue == null || explanationValue.getMetaInfo() == null ? null : explanationValue.getMetaInfo().getSourceUrl(); if (StringUtils.isNotBlank(url)) { return getUrlToElement(element, url); } return FacesUtils.getContextPath() + showTablePage; }
if (metaInfo != null) { SimpleNodeUsage nodeUsage = new SimpleNodeUsage(paramNodes[0], metaInfo.getDisplayName(INamedThing.SHORT), metaInfo.getSourceUrl(), NodeType.DATATYPE);