
com.github.czyzby.lml.parser.impl.attribute.container.ContainerAdjustPaddingLmlAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-lml Show documentation
Show all versions of gdx-lml Show documentation
Templates for LibGDX Scene2D UI with HTML-like syntax and FreeMarker-inspired macros.
package com.github.czyzby.lml.parser.impl.attribute.container;
import com.badlogic.gdx.scenes.scene2d.ui.Container;
import com.github.czyzby.lml.parser.LmlParser;
import com.github.czyzby.lml.parser.tag.LmlAttribute;
import com.github.czyzby.lml.parser.tag.LmlTag;
/** See {@link Container#setBackground(com.badlogic.gdx.scenes.scene2d.utils.Drawable, boolean)}. Expects a boolean.
* Mapped to "adjustPadding".
*
* @author MJ */
public class ContainerAdjustPaddingLmlAttribute implements LmlAttribute> {
@Override
@SuppressWarnings("unchecked")
public Class> getHandledType() {
// Double cast as there were a problem with generics - SomeClass.class cannot be returned as
// >, even though casting never throws ClassCastException in the end.
return (Class>) (Object) Container.class;
}
@Override
public void process(final LmlParser parser, final LmlTag tag, final Container> actor,
final String rawAttributeData) {
actor.setBackground(actor.getBackground(), parser.parseBoolean(rawAttributeData, actor));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy