org.apache.wicket.markup.Markup Java Examples

The following examples show how to use org.apache.wicket.markup.Markup. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtendedWicketTester.java    From pm-wicket-utils with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public IMarkupFragment getMarkup()
{
	IMarkupFragment calculatedMarkup = null;
	if (pageMarkup == null)
	{
		IMarkupFragment markup = super.getMarkup();
		if (markup != null && markup != Markup.NO_MARKUP)
		{
			calculatedMarkup = markup;
			pageMarkup = markup;
		}
	}
	else
	{
		calculatedMarkup = pageMarkup;
	}

	return calculatedMarkup;
}
 
Example #2
Source File: MultiMarkupCache.java    From yes-cart with Apache License 2.0 5 votes vote down vote up
/**
 * Custom implementation designed to be used with Spring IoC, so that we
 * can inject the required caches (e.g. Ehcache).
 *
 * @param markupCache cache to use for markup
 * @param markupKeyCache cache to use for markup cache keys
 */
public MultiMarkupCache(final ICache<String, Markup> markupCache,
                        final ICache<String, String> markupKeyCache) {
    super();
    /*
     * MarkupCache invokes same method ({@link #newCacheImplementation()}) for both
     * fields therefore it is very unreliable to depend on the order of execution.
     *
     * Instead we use reflection to inject the caches so that we know for sure that we are
     * using the right implementation for the right fields.
     */
    FieldUtils.setProtectedFieldValue("markupCache", this, markupCache);
    FieldUtils.setProtectedFieldValue("markupKeyCache", this, markupKeyCache);
}
 
Example #3
Source File: MarkupProvider.java    From Orienteer with Apache License 2.0 4 votes vote down vote up
@Override
public void registerMarkupContent(
		Class<? extends Component> componentClass, String content) {
	registerMarkupContent(componentClass, Markup.of(content));
}
 
Example #4
Source File: CodeEditorPanel.java    From Orienteer with Apache License 2.0 2 votes vote down vote up
/**
 * Create markup for {@link CodeEditorPanel} in different display modes.
 * @param mode {@link DisplayMode} if {@link DisplayMode#EDIT} editor configs for edit code
 *                                if {@link DisplayMode#VIEW} editor configs for view code
 * @return new {@link IMarkupFragment} for display correctly state of {@link CodeEditorPanel}
 */
protected IMarkupFragment createMarkup(DisplayMode mode) {
    return Markup.of("<textarea wicket:id='editor' class='form-control'></textarea>");
}