本文整理汇总了Java中com.github.czyzby.lml.parser.tag.LmlTag.getActor方法的典型用法代码示例。如果您正苦于以下问题:Java LmlTag.getActor方法的具体用法?Java LmlTag.getActor怎么用?Java LmlTag.getActor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.czyzby.lml.parser.tag.LmlTag
的用法示例。
在下文中一共展示了LmlTag.getActor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRegularTag
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
/** @param tagName name of the tag to be parsed.
* @param rawTagData raw data of a regular widget tag. */
private void processRegularTag(final String tagName, final StringBuilder rawTagData) {
final LmlTagProvider tagProvider = syntax.getTagProvider(tagName);
if (tagProvider == null) {
throwError("No tag parser found for name: " + tagName);
}
final LmlTag tag = tagProvider.create(this, currentParentTag, rawTagData);
if (tag.isParent()) {
currentParentTag = tag;
} else {
// The tag is a child, so we're closing it immediately.
tag.closeTag();
if (currentParentTag != null) {
// Tag is child - adding to current parent:
currentParentTag.handleChild(tag);
} else {
// Tag is a root - adding to the result:
if (tag.getActor() != null) {
actors.add(tag.getActor());
}
}
mapActorById(tag.getActor());
}
}
示例2: handleChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
public void handleChild(final LmlTag childTag) {
if (childTag.isAttachable()) {
// Child tag is an attachable object that can be appended to any widget, even if it is not prepared to
// handle children. For example, tooltip tag can be nested inside a label and will be properly attached,
// even though label wouldn't know how to handle a normal child, like a button or another label.
if (actor != null) {
childTag.attachTo(this);
}
} else if (childTag.getActor() != null) {
final Tree.Node node = LmlUtilities.getTreeNode(actor);
if (node != null) {
// This actor is a tree node. Adding its child as a leaf.
Tree.Node childNode = LmlUtilities.getTreeNode(childTag.getActor());
if (childNode == null) {
childNode = new Tree.Node(childTag.getActor());
}
node.add(childNode);
} else {
handleValidChild(childTag);
}
}
}
示例3: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
final Actor child = childTag.getActor();
if (LmlUtilities.getLmlUserObject(child).getCell() == null) {
// Adds child to the table. Handles searching.
addChild(child);
} else {
// Actor was previously added to the cell before his tag was closed and this method was called. This is
// expected if the actor had any cell attributes - to change cell settings, the actor _needs_ to be in a
// table. This means that VisFormTable had this actor before it parsed its children.
if (child instanceof Group) {
// Finding all VisValidatableTextFields recursively:
getTable().findValidatables((Group) child);
}
}
}
示例4: attachTo
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
public void attachTo(final LmlTag tag) {
if (tag.getActor() instanceof DragPane) {
((DragPane) tag.getActor()).setDraggable(draggable);
} else {
draggable.attachTo(tag.getActor());
}
}
示例5: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
if (childTag.getActor() instanceof Table) {
addChild((Table) childTag.getActor());
} else {
addChild(wrapWithTable(childTag.getActor()));
}
}
示例6: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
if (childTag.getActor() instanceof Label) {
addListElement(((Label) childTag.getActor()).getText().toString());
} else if (childTag.getActor() instanceof TextButton) {
addListElement(((TextButton) childTag.getActor()).getText().toString());
} else {
getParser().throwErrorIfStrict(
"Lists can handle only text based children: Label and TextButton. Received child: "
+ childTag.getTagName() + " with actor: " + childTag.getActor());
}
}
示例7: appendActorAttributes
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected void appendActorAttributes(final LmlParser parser, final Appendable builder) throws IOException {
if (appendComments) {
builder.append("<!-- Actor tags' attributes: -->\n");
}
final ObjectMap<String, LmlTagProvider> actorTags = parser.getSyntax().getTags();
for (final Entry<String, LmlTagProvider> actorTag : actorTags) {
final ObjectMap<String, Object> attributes = GdxMaps.newObjectMap();
try {
final LmlTag tag = actorTag.value.create(parser, null, new StringBuilder(actorTag.key));
if (tag.getActor() == null) {
appendNonActorTagAttributes(tag, attributes, parser);
} else {
appendActorTagAttributes(tag, attributes, parser);
}
} catch (final Exception exception) {
Exceptions.ignore(exception);
log("Warning: unable to create an instance of actor mapped to '" + actorTag.key
+ "' tag name with provider: " + actorTag.value
+ ". Attributes list will not be complete. Is the provider properly implemented? Is a default style provided for the selected actor?");
attributes.putAll(
(ObjectMap<String, Object>) (Object) parser.getSyntax().getAttributesForActor(new Actor()));
attributes.putAll((ObjectMap<String, Object>) (Object) parser.getSyntax()
.getAttributesForBuilder(new LmlActorBuilder()));
}
appendDtdAttributes(builder, actorTag.key, attributes);
}
}
示例8: hasTreeParent
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
private static boolean hasTreeParent(LmlTag parent) {
while (parent != null) {
if (parent.getActor() instanceof Tree) {
return true;
}
parent = parent.getParent();
}
return false;
}
示例9: attachTo
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
public void attachTo(final LmlTag tag) {
if (tag.getActor() instanceof MenuItem) {
((MenuItem) tag.getActor()).setSubMenu(getPopupMenu());
} else {
// Technically, these menus could be attached to any widget with on-click listener, but let's leave that for
// now - this would require a custom listener + possibly a way to modify it.
getParser().throwError(
"Popup menus can currently be attached only to MenuItems as sub-menus. Popup menu was a child of: "
+ tag.getTagName());
}
}
示例10: getDialogParent
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
private static Dialog getDialogParent(final LmlTag tag) {
LmlTag parent = tag.getParent();
while (parent != null) {
if (parent.getActor() instanceof Dialog) {
return (Dialog) parent.getActor();
}
parent = parent.getParent();
}
return null;
}
示例11: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
if (childTag.getActor() instanceof VisTabTable) {
final VisTabTable child = (VisTabTable) childTag.getActor();
tabbedPane.add(child.getTab());
if (child.isDisabled()) {
tabbedPane.disableTab(child.getTab(), true);
}
} else {
getParser().throwErrorIfStrict(
"TabbedPane cannot handle all actors. It can contain only tab children. Found child: "
+ childTag.getActor() + " with tag name: " + childTag.getTagName());
}
}
示例12: getVisDialogParent
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
private static VisDialog getVisDialogParent(final LmlTag tag) {
LmlTag parent = tag.getParent();
while (parent != null) {
if (parent.getActor() instanceof VisDialog) {
return (VisDialog) parent.getActor();
}
parent = parent.getParent();
}
return null;
}
示例13: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
if (childTag.getActor() instanceof VisTabTable) {
final VisTabTable child = (VisTabTable) childTag.getActor();
getTabbedPane().add(child.getTab());
if (child.isDisabled()) {
getTabbedPane().disableTab(child.getTab(), true);
}
} else {
getParser().throwErrorIfStrict(
"TabbedPane cannot handle all actors. It can contain only tab children. Found child: "
+ childTag.getActor() + " with tag name: " + childTag.getTagName());
}
}
示例14: getFormParent
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
/** @param tag original tag of the widget.
* @return {@link VisFormTable} parent widget or null if not in a form. */
protected VisFormTable getFormParent(final LmlTag tag) {
LmlTag parent = tag.getParent();
while (parent != null) {
if (parent.getActor() instanceof VisFormTable) {
return (VisFormTable) parent.getActor();
}
parent = parent.getParent();
}
return null;
}
示例15: handleValidChild
import com.github.czyzby.lml.parser.tag.LmlTag; //导入方法依赖的package包/类
@Override
protected void handleValidChild(final LmlTag childTag) {
if (childTag.getActor() instanceof MenuItem) {
addMenuItem((MenuItem) childTag.getActor());
} else if (childTag.getActor() instanceof Separator) {
addSeparator((Separator) childTag.getActor());
} else {
getParser().throwErrorIfStrict("Menus can handle only menu item and separator children. Found child tag: "
+ childTag.getTagName() + " with actor: " + childTag.getActor());
}
}