• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InMemoryTreeStateManager类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中pl.polidea.treeview.InMemoryTreeStateManager的典型用法代码示例。如果您正苦于以下问题:Java InMemoryTreeStateManager类的具体用法?Java InMemoryTreeStateManager怎么用?Java InMemoryTreeStateManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

InMemoryTreeStateManager类属于pl.polidea.treeview包,在下文中一共展示了InMemoryTreeStateManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doInBackground

点赞 3

import pl.polidea.treeview.InMemoryTreeStateManager; //导入依赖的package包/类
protected Integer doInBackground(Void...params){
	try{
		List<String> lines = new ArrayList<String>();
		TreeStateManager<Integer> treeStateManager=new InMemoryTreeStateManager<Integer>();
		TreeBuilder<Integer> treeBuilder = new TreeBuilder<Integer>(treeStateManager);
	
		PacketFormatter packetFormatter = new PacketFormatter(new StringBuilder(),treeBuilder,lines);
		int maxLevel=packetFormatter.analyzePacket(pcapPacket, referenceEpochTime);
		
		packetTreeAdapter= new PacketTreeAdapter(activity, treeStateManager,maxLevel+1,R.layout.item_packet_tree,lines);
	} catch (Exception e){
		e.printStackTrace();
		return -1;
	}
	return 0;
}
 

开发者ID:GlacialSoftware,
项目名称:PCAPReader,
代码行数:17,
代码来源:PacketDetailsFragment.java

示例2: onCreate

点赞 2

import pl.polidea.treeview.InMemoryTreeStateManager; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TreeType newTreeType = null;
    boolean newCollapsible;
    if (savedInstanceState == null) {
        manager = new InMemoryTreeStateManager<Long>();
        final TreeBuilder<Long> treeBuilder = new TreeBuilder<Long>(manager);
        for (int i = 0; i < DEMO_NODES.length; i++) {
            treeBuilder.sequentiallyAddNextNode((long) i, DEMO_NODES[i]);
        }
        Log.d(TAG, manager.toString());
        newTreeType = TreeType.SIMPLE;
        newCollapsible = true;
    } else {
        manager = (TreeStateManager<Long>) savedInstanceState
                .getSerializable("treeManager");
        newTreeType = (TreeType) savedInstanceState
                .getSerializable("treeType");
        newCollapsible = savedInstanceState.getBoolean("collapsible");
    }
    setContentView(R.layout.main_demo);
    treeView = (TreeViewList) findViewById(R.id.mainTreeView);
    fancyAdapter = new FancyColouredVariousSizesAdapter(this, selected,
            manager, LEVEL_NUMBER);
    simpleAdapter = new SimpleStandardAdapter(this, selected, manager,
            LEVEL_NUMBER);
    setTreeAdapter(newTreeType);
    setCollapsible(newCollapsible);
    registerForContextMenu(treeView);
}
 

开发者ID:t-arn,
项目名称:tomarn66-tree-view-list-android,
代码行数:33,
代码来源:TreeViewListDemo.java

示例3: onCreate

点赞 2

import pl.polidea.treeview.InMemoryTreeStateManager; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TreeType newTreeType = null;
    boolean newCollapsible;
    if (savedInstanceState == null) {
        manager = new InMemoryTreeStateManager<Long>();
        final TreeBuilder<Long> treeBuilder = new TreeBuilder<Long>(manager);
        for (int i = 0; i < DEMO_NODES.length; i++) {
            treeBuilder.sequentiallyAddNextNode((long) i, DEMO_NODES[i]);
        }
        Log.d(TAG, manager.toString());
        newTreeType = TreeType.SIMPLE;
        newCollapsible = true;
    } else {
        manager = (TreeStateManager<Long>) savedInstanceState
                .getSerializable("treeManager");
        if (manager == null) {
            manager = new InMemoryTreeStateManager<Long>();
        }
        newTreeType = (TreeType) savedInstanceState
                .getSerializable("treeType");
        if (newTreeType == null) {
            newTreeType = TreeType.SIMPLE;
        }
        newCollapsible = savedInstanceState.getBoolean("collapsible");
    }
    setContentView(R.layout.main_demo);
    treeView = (TreeViewList) findViewById(R.id.mainTreeView);
    fancyAdapter = new FancyColouredVariousSizesAdapter(this, selected,
            manager, LEVEL_NUMBER);
    simpleAdapter = new SimpleStandardAdapter(this, selected, manager,
            LEVEL_NUMBER);
    setTreeAdapter(newTreeType);
    setCollapsible(newCollapsible);
    registerForContextMenu(treeView);
}
 

开发者ID:rdeguzman,
项目名称:treeview-list-android,
代码行数:39,
代码来源:TreeViewListDemo.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)