/** * Without a markup type we can not search for a file and we can not construct the cacheKey. We * can not even load associated markup as required for Panels. Though every MarkupContainer can * provide it's own type, by default they refer to the Page. Hence, no markup type is an * indicator, that the component or any of its parents, has not yet been added. * * @param container * The MarkupContainer which markup type has to checked * @return true, if container.getMarkupType() != null */ protected final boolean checkMarkupType(final MarkupContainer container) { if (container.getMarkupType() == null) { log.debug("Markup file not loaded, since the markup type is not yet available: {}", container); return false; } return true; }
/** * Without a markup type we can not search for a file and we can not construct the cacheKey. We * can not even load associated markup as required for Panels. Though every MarkupContainer can * provide it's own type, by default they refer to the Page. Hence, no markup type is an * indicator, that the component or any of its parents, has not yet been added. * * @param container * The MarkupContainer which markup type has to checked * @return true, if container.getMarkupType() != null */ protected final boolean checkMarkupType(final MarkupContainer container) { if (container.getMarkupType() == null) { log.debug("Markup file not loaded, since the markup type is not yet available: {}", container); return false; } return true; }
private String getMarkupType(Component component) { String extension; if (component instanceof MarkupContainer) { extension = ((MarkupContainer)component).getMarkupType(); } else { extension = component.getParent().getMarkupType(); } return extension; } }
/** * * @param component * @return markup type */ private MarkupType getMarkupType(final Component component) { final MarkupType markupType; if (component instanceof MarkupContainer) { markupType = ((MarkupContainer)component).getMarkupType(); } else { markupType = component.getParent().getMarkupType(); } return markupType; } }
/** * * @param component * @return markup type */ private MarkupType getMarkupType(final Component component) { final MarkupType markupType; if (component instanceof MarkupContainer) { markupType = ((MarkupContainer)component).getMarkupType(); } else { markupType = component.getParent().getMarkupType(); } return markupType; } }
/** * * @param component * @return markup type */ private String getMarkupType(Component component) { String extension; if (component instanceof MarkupContainer) { extension = ((MarkupContainer)component).getMarkupType(); } else { extension = component.getParent().getMarkupType(); } return extension; } }
/** * Get the type of associated markup for this component. The markup type for a component is * independent of whether or not the component actually has an associated markup resource file * (which is determined at runtime). * * @return The type of associated markup for this component (for example, "html", "wml" or * "vxml"). If there is no markup type for a component, null may be returned, but this * means that no markup can be loaded for the class. Null is also returned if the * component, or any of its parents, has not been added to a Page. */ public MarkupType getMarkupType() { MarkupContainer parent = getParent(); if (parent != null) { return parent.getMarkupType(); } return null; }
/** * Get the type of associated markup for this component. The markup type for a component is * independent of whether or not the component actually has an associated markup resource file * (which is determined at runtime). * * @return The type of associated markup for this component (for example, "html", "wml" or * "vxml"). If there is no markup type for a component, null may be returned, but this * means that no markup can be loaded for the class. Null is also returned if the * component, or any of its parents, has not been added to a Page. */ public MarkupType getMarkupType() { MarkupContainer parent = getParent(); if (parent != null) { return parent.getMarkupType(); } return null; }
/** * Construct. * * @param container * The container to create the information from */ public ContainerInfo(final MarkupContainer container) { this(container.getClass(), container.getLocale(), container.getStyle(), null, container.getMarkupType()); }
/** * Construct. * * @param container * The container to create the information from */ public ContainerInfo(final MarkupContainer container) { this(container.getClass(), container.getLocale(), container.getStyle(), null, container .getMarkupType()); }
/** * Construct. * * @param container * The container to create the information from */ public ContainerInfo(final MarkupContainer container) { this(container.getClass(), container.getLocale(), container.getStyle(), container.getVariation(), container.getMarkupType()); }
/** * Construct. * * @param container * The container to create the information from */ public ContainerInfo(final MarkupContainer container) { this(container.getClass(), container.getLocale(), container.getStyle(), container.getVariation(), container.getMarkupType()); }
/** * Construct. * * @param containerClass * the real container class (could be a parent class) * @param container * The container to create the information from */ public ContainerInfo(final Class<?> containerClass, final MarkupContainer container) { this(containerClass != null ? containerClass : container.getClass(), container.getLocale(), container.getStyle(), container.getVariation(), container.getMarkupType()); }
/** * Construct. * * @param containerClass * the real container class (could be a parent class) * @param container * The container to create the information from */ public ContainerInfo(final Class<?> containerClass, final MarkupContainer container) { this(containerClass != null ? containerClass : container.getClass(), container.getLocale(), container.getStyle(), container.getVariation(), container.getMarkupType()); }
buffer.append('.').append(container.getMarkupType().getExtension()); return buffer.toString();
buffer.append('.').append(container.getMarkupType().getExtension()); return buffer.toString();
/** * Gets a fresh markup stream that contains the (immutable) markup resource for this class. * * @param throwException * If true, throw an exception, if markup could not be found * @return A stream of MarkupElement elements */ public MarkupStream getAssociatedMarkupStream(final boolean throwException) { IMarkupFragment markup = getAssociatedMarkup(); // If we found markup for this container if (markup != null) { return new MarkupStream(markup); } if (throwException == true) { // throw exception since there is no associated markup throw new MarkupNotFoundException( "Markup of type '" + getMarkupType().getExtension() + "' for component '" + getClass().getName() + "' not found." + " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: " + toString()); } return null; }
/** * Gets a fresh markup stream that contains the (immutable) markup resource for this class. * * @param throwException * If true, throw an exception, if markup could not be found * @return A stream of MarkupElement elements */ public MarkupStream getAssociatedMarkupStream(final boolean throwException) { IMarkupFragment markup = getAssociatedMarkup(); // If we found markup for this container if (markup != null) { return new MarkupStream(markup); } if (throwException == true) { // throw exception since there is no associated markup throw new MarkupNotFoundException( "Markup of type '" + getMarkupType().getExtension() + "' for component '" + getClass().getName() + "' not found." + " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried.: " + toString()); } return null; }
/** * Gets a fresh markup stream that contains the (immutable) markup resource for this class. * * @param throwException * If true, throw an exception, if markup could not be found * @return A stream of MarkupElement elements */ public MarkupStream getAssociatedMarkupStream(final boolean throwException) { try { return getApplication().getMarkupSettings().getMarkupCache().getMarkupStream(this, false, throwException); } catch (MarkupException ex) { // re-throw it. The exception contains already all the information // required. throw ex; } catch (WicketRuntimeException ex) { // throw exception since there is no associated markup throw new MarkupNotFoundException( exceptionMessage("Markup of type '" + getMarkupType() + "' for component '" + getClass().getName() + "' not found." + " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried"), ex); } }
exceptionMessage("Markup of type '" + getMarkupType() + "' for component '" + getClass().getName() + "' not found." + " Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried"),