/** * Get component path relative to the parent container with associated markup * * @param component * @param parentWithAssociatedMarkup * @return the relative path */ private String getComponentRelativePath(final Component component, final MarkupContainer parentWithAssociatedMarkup) { final String componentPath = component.getParent().getPageRelativePath(); final String parentWithAssociatedMarkupPath = parentWithAssociatedMarkup.getPageRelativePath(); String relativePath = componentPath.substring(parentWithAssociatedMarkupPath.length()); if (relativePath.startsWith(":")) { relativePath = relativePath.substring(1); } return relativePath; } }
/** * Get component path relative to the parent container with associated markup * * @param component * @param parentWithAssociatedMarkup * @return the relative path */ private String getComponentRelativePath(final Component component, final MarkupContainer parentWithAssociatedMarkup) { final String componentPath = component.getParent().getPageRelativePath(); final String parentWithAssociatedMarkupPath = parentWithAssociatedMarkup .getPageRelativePath(); String relativePath = componentPath.substring(parentWithAssociatedMarkupPath.length()); if (relativePath.startsWith(":")) { relativePath = relativePath.substring(1); } return relativePath; } }
public static Optional<String> findContainerRelativePath(MarkupContainer container, String childId) { return WicketUtils.findFirstChild(container, Component.class, it -> it.getId().equals(childId)) .map(it -> it.getPageRelativePath()) .map(it -> it.substring(container.getPageRelativePath().length() + 1)); } }
public static Optional<String> findContainerRelativePath(MarkupContainer container, String childId) { return WicketUtils.findFirstChild(container, Component.class, it -> it.getId().equals(childId)) .map(it -> it.getPageRelativePath()) .map(it -> it.substring(container.getPageRelativePath().length() + 1)); } }
msg.append(this.toString()); msg.append("\n\tExpected: '"); msg.append(getPageRelativePath()); msg.append(PATH_SEPARATOR); msg.append(id);
msg.append(this.toString()); msg.append("\n\tExpected: '"); msg.append(getPageRelativePath()); msg.append(PATH_SEPARATOR); msg.append(id);
if ("cite:Lakes + a plus".equals(model)) { exists = true; path = c.getPageRelativePath();