本文整理汇总了Java中com.unnamed.b.atv.model.TreeNode.isExpanded方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.isExpanded方法的具体用法?Java TreeNode.isExpanded怎么用?Java TreeNode.isExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.unnamed.b.atv.model.TreeNode
的用法示例。
在下文中一共展示了TreeNode.isExpanded方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void expandNode(final TreeNode node, boolean includeSubnodes) {
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().removeAllViews();
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
addNode(parentViewHolder.getNodeItemsView(), n);
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
if (mUseDefaultAnimation) {
expand(parentViewHolder.getNodeItemsView());
} else {
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
}
}
示例2: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().removeAllViews();
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
addNode(parentViewHolder.getNodeItemsView(), n);
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
if (mUseDefaultAnimation) {
expand(parentViewHolder.getNodeItemsView());
} else {
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
}
}
示例3: getSaveState
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void getSaveState(TreeNode root, StringBuilder sBuilder) {
for (TreeNode node : root.getChildren()) {
if (node.isExpanded()) {
sBuilder.append(node.getPath());
sBuilder.append(NODES_PATH_SEPARATOR);
getSaveState(node, sBuilder);
}
}
}
示例4: toggleNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void toggleNode(TreeNode node) {
if (node.isExpanded()) {
collapseNode(node, false);
} else {
expandNode(node, false);
}
}
示例5: toggleSelectionMode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void toggleSelectionMode(TreeNode parent, boolean mSelectionModeEnabled) {
toogleSelectionForNode(parent, mSelectionModeEnabled);
if (parent.isExpanded()) {
for (TreeNode node : parent.getChildren()) {
toggleSelectionMode(node, mSelectionModeEnabled);
}
}
}
示例6: selectNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void selectNode(TreeNode parent, boolean selected, boolean skipCollapsed) {
parent.setSelected(selected);
toogleSelectionForNode(parent, true);
boolean toContinue = skipCollapsed ? parent.isExpanded() : true;
if (toContinue) {
for (TreeNode node : parent.getChildren()) {
selectNode(node, selected, skipCollapsed);
}
}
}
示例7: addNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void addNode(TreeNode parent, final TreeNode nodeToAdd) {
parent.addChild(nodeToAdd);
if (parent.isExpanded()) {
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(parent);
addNode(parentViewHolder.getNodeItemsView(), nodeToAdd);
}
}
示例8: removeNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void removeNode(TreeNode node) {
if (node.getParent() != null) {
TreeNode parent = node.getParent();
int index = parent.deleteChild(node);
if (parent.isExpanded() && index >= 0) {
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(parent);
parentViewHolder.getNodeItemsView().removeViewAt(index);
}
}
}
示例9: toggleNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void toggleNode(TreeNode node) {
if (node.isExpanded()) {
collapseNode(node, false);
} else {
expandNode(node, false);
}
}
示例10: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
if (node.size() == 0) {
return;
}
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
if (!parentViewHolder.childrenInitialized()) {
final TreeNode.BaseNodeViewHolder viewHolder = getViewHolderForNode(n);
final View nodeView = viewHolder.getView();
parentViewHolder.getNodeItemsView().addView(nodeView);
if (mSelectionModeEnabled) {
viewHolder.toggleSelectionMode(mSelectionModeEnabled);
}
nodeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleNode(n);
if (n.getClickListener() != null) {
n.getClickListener().onClick(n, n.getValue());
} else if (nodeClickListener != null) {
nodeClickListener.onClick(n, n.getValue());
}
}
});
}
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
}
示例11: selectNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void selectNode(TreeNode parent, boolean selected, boolean skipCollapsed) {
parent.setSelected(selected);
toogleSelectionForNode(parent, true);
boolean toContinue = skipCollapsed ? parent.isExpanded() : true;
if (toContinue) {
for (TreeNode node : parent.getChildren()) {
if (getViewHolderForNode(node).childrenInitialized()) {
selectNode(node, selected, skipCollapsed);
}
}
}
}