• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TreeViewList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCreate

import pl.polidea.treeview.TreeViewList; //导入依赖的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


示例2: onCreate

import pl.polidea.treeview.TreeViewList; //导入依赖的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


示例3: onStart

import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@Override
public void onStart (){
	super.onStart();
   
      treeViewList = (TreeViewList) getView().findViewById(R.id.packetTreeView);
}
 
开发者ID:GlacialSoftware,项目名称:PCAPReader,代码行数:7,代码来源:PacketDetailsFragment.java


示例4: onCreate

import pl.polidea.treeview.TreeViewList; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	Bundle state = savedInstanceState;

	if (state == null)
		state = this.getIntent().getBundleExtra(Const.KEY_SAVED_INSTANCE_STATE);

	super.onCreate(state);
	
	if (state != null) {
		manager = (DownloadTreeStateManager) state.getSerializable(STATE_KEY_TREE_MANAGER);
	}
	if (manager == null)
		manager = new DownloadTreeStateManager();
	builder = new TreeBuilder<RemoteFile>(manager);

	setContentView(R.layout.activity_map_download);

	ActionBar actionBar = getSupportActionBar();
	actionBar.setDisplayHomeAsUpEnabled(true);

	downloadProgress = (ProgressBar) findViewById(R.id.downloadProgress);
	downloadErrorLayout = (LinearLayout) findViewById(R.id.downloadErrorLayout);
	downloadRetry = (Button) findViewById(R.id.downloadRetry);
	treeView = (TreeViewList) findViewById(R.id.downloadList);
	/*
	 * FIXME: Android wants the number of distinct layouts, which here is the same as the number of
	 * levels and in theory unlimited. Using more levels than specified here will cause exceptions which
	 * are beyond our control (only system functions in the call stack) and semi-random (creating more
	 * levels than specified will work initially but the code will barf sometime later, e.g. on scroll).
	 * 
	 * The maximum number of levels is currently 4 (multilingual/continent/country/region.map),
	 * therefore 5 is safe even if another one level is added. However, if the layout on the server ever
	 * changes and goes beyond that, we'll get semi-random crashes.
	 */
	treeViewAdapter = new DownloadTreeViewAdapter(this, manager, 5);
	treeView.setAdapter(treeViewAdapter);
	treeView.setCollapsible(true);
	treeView.setCollapsedDrawable(getResources().getDrawable(R.drawable.ic_expand_more));
	treeView.setExpandedDrawable(getResources().getDrawable(R.drawable.ic_expand_less));
	treeView.setIndentWidth(24);
	
	downloadErrorLayout.setVisibility(View.GONE);

	OnClickListener clis = new OnClickListener () {
		@Override
		public void onClick(View v) {
			if (v == downloadRetry) {
				treeView.setVisibility(View.GONE);
				downloadErrorLayout.setVisibility(View.GONE);
				downloadProgress.setVisibility(View.VISIBLE);
				// get data from server
				dirListTask = new RemoteDirListTask(MapDownloadActivity.this, null);
				dirListTask.execute(MAP_DOWNLOAD_BASE_URL);
			}
		}
	};
	downloadRetry.setOnClickListener(clis);

	List<RemoteFile> topItems = manager.getChildren(null);
	if ((topItems == null) || (topItems.size() == 0)) {
		treeView.setVisibility(View.GONE);
		downloadProgress.setVisibility(View.VISIBLE);
		// get data from server
		dirListTask = new RemoteDirListTask(this, null);
		dirListTask.execute(MAP_DOWNLOAD_BASE_URL);
	}
	
	treeViewAdapter.registerIntentReceiver();
}
 
开发者ID:mvglasow,项目名称:satstat,代码行数:71,代码来源:MapDownloadActivity.java



注:本文中的pl.polidea.treeview.TreeViewList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DocumentImpl类代码示例发布时间:2022-05-22
下一篇:
Java FailedSanityCheckException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap