当前位置: 首页>>代码示例>>Java>>正文


Java TreeNode.getValue方法代码示例

本文整理汇总了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;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:12,代码来源:AndroidTreeView.java

示例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;
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:15,代码来源:FolderStructureFragment.java

示例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;
}
 
开发者ID:RadiationX,项目名称:ForPDA,代码行数:10,代码来源:ForumFragment.java

示例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();
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:62,代码来源:MainActivity.java


注:本文中的com.unnamed.b.atv.model.TreeNode.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。