本文整理汇总了Java中com.unnamed.b.atv.model.TreeNode.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.getValue方法的具体用法?Java TreeNode.getValue怎么用?Java TreeNode.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.unnamed.b.atv.model.TreeNode
的用法示例。
在下文中一共展示了TreeNode.getValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectedValues
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public <E> List<E> getSelectedValues(Class<E> clazz) {
List<E> result = new ArrayList<>();
List<TreeNode> selected = getSelected();
for (TreeNode n : selected) {
Object value = n.getValue();
if (value != null && value.getClass().equals(clazz)) {
result.add((E) value);
}
}
return result;
}
示例2: expandSrcDir
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandSrcDir(TreeNode root) {
if (mTreeView == null || mProjectFile == null) return;
TreeNode treeNode = root.getChildren().get(0);
mTreeView.expandNode(treeNode, false);
List<TreeNode> children = treeNode.getChildren();
for (TreeNode child : children) {
FolderHolder.TreeItem value = (FolderHolder.TreeItem) child.getValue();
File file = value.getFile();
if (file.getName().equals("src")) {
mTreeView.expandNode(child, true);
return;
}
}
}
示例3: findNodeById
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private TreeNode findNodeById(int id, TreeNode root) {
if (root.getValue() != null && ((ForumItemTree) root.getValue()).getId() == id) return root;
if (root.getChildren() == null && root.getChildren().isEmpty()) return null;
for (TreeNode item : root.getChildren()) {
TreeNode node = findNodeById(id, item);
if (node != null) return node;
}
return null;
}
示例4: nodeLongClick2
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void nodeLongClick2 (TreeNode node) {
final IconTreeItemHolder.IconTreeItem item =
(IconTreeItemHolder.IconTreeItem) node.getValue();
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
final LayoutInflater inflater =
(LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
final View Viewlayout = inflater.inflate(R.layout.dialog_custom2,
(ViewGroup) findViewById(R.id.layout_custom_dialog2));
final EditText titleEdit = (EditText) Viewlayout.findViewById(R.id.title2);
final EditText commentEdit = (EditText) Viewlayout.findViewById(R.id.comment2);
final PrintView icon1 = (PrintView) Viewlayout.findViewById(R.id.icon1);
final PrintView icon2 = (PrintView) Viewlayout.findViewById(R.id.icon2);
final PrintView icon3 = (PrintView) Viewlayout.findViewById(R.id.icon3);
final PrintView icon4 = (PrintView) Viewlayout.findViewById(R.id.icon4);
final IconTreeItemHolder holder = (IconTreeItemHolder) (node.getViewHolder());
titleEdit.setText(item.text);
commentEdit.setText(item.comment);
View.OnClickListener l = new View.OnClickListener() {
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.icon1:
item.icon = R.string.ic_drive_file;
break;
case R.id.icon2:
item.icon = R.string.ic_folder;
break;
case R.id.icon3:
item.icon = R.string.ic_photo;
break;
case R.id.icon4:
item.icon = R.string.ic_photo_library;
break;
}
holder.setIcon(item.icon);
}
};
icon1.setOnClickListener(l);
icon2.setOnClickListener(l);
icon3.setOnClickListener(l);
icon4.setOnClickListener(l);
builder.setTitle("Node Edit").setView(Viewlayout).setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
item.text = titleEdit.getText().toString();
item.comment = commentEdit.getText().toString();
holder.setText(item.text);
}
});
builder.create().show();
}