星空网 > 软件开发 > Java

[Java][RCP] 记 ProgressView的使用

进度条效果图

[Java][RCP] 记 ProgressView的使用

As a part of the process of decoupling Eclipse services from workbench, the Progress View has been extracted to a separate plug-in and refactored in order to be available for Eclipse4 applications.

ProgressView已经作为一个独立的plug-in存在了

Currently, the Progress View plug-in is not shipped with Eclipse SDK packages, but it can be installed from update site: https://hudson.eclipse.org/platform/job/eclipse4-progress-view/lastSuccessfulBuild/artifact/releng/org.eclipse.e4.ui.progress.update/target/repository/

Step1: Add plug-in

URL is :

https://hudson.eclipse.org/platform/job/eclipse4-progress-view/lastSuccessfulBuild/artifact/releng/org.eclipse.e4.ui.progress.update/target/repository/

[Java][RCP] 记 ProgressView的使用 

Step2: 新建Eclipse RCP项目ProgressViewModel

[Java][RCP] 记 ProgressView的使用 

[Java][RCP] 记 ProgressView的使用

这里只是测试ProgressView,check Create Simple Content

[Java][RCP] 记 ProgressView的使用Step 3: 在项目中引入plug-in

[Java][RCP] 记 ProgressView的使用Step 4:添加一个Add-ons,Class URI绑定为bundleclass://org.eclipse.e4.ui.progress/org.eclipse.e4.ui.progress.ProgressViewAddon(Find不到的话就直接写上去)

让它随项目的启动而初始化

[Java][RCP] 记 ProgressView的使用Step5: 添加一个Part, URI绑定为:bundleclass://org.eclipse.e4.ui.progress/org.eclipse.e4.ui.progress.ProgressView(Find不到的话就直接写上去),让它显示进度条

[Java][RCP] 记 ProgressView的使用 

Step6: 实例化一个Job,Code as follows,至于Job应该研究一下(http://www.vogella.com/tutorials/EclipseJobs/article.html#prerequisite)

button.addSelectionListener(new SelectionListener() {            @Override      public void widgetSelected(SelectionEvent arg0) {        Job job = Job.create("Runing Job", monitor -> {          SubMonitor subMonitor = SubMonitor.convert(monitor);          subMonitor.beginTask("Beging Task...", 5000);          for (int i = 0; i < 50; i++) {            try {              Thread.sleep(500L);            } catch (Exception e) {              e.printStackTrace();            }            subMonitor.worked(100);          }          return Status.OK_STATUS;        });        job.schedule();      }      @Override      public void widgetDefaultSelected(SelectionEvent arg0) {}    });

效果如下:

[Java][RCP] 记 ProgressView的使用




原标题:[Java][RCP] 记 ProgressView的使用

关键词:JAVA

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

AMS仓:https://www.goluckyvip.com/tag/9475.html
海外仓的费用大致包括:https://www.goluckyvip.com/tag/94751.html
海外仓 仓储收费标准:https://www.goluckyvip.com/tag/94753.html
加拿大海外仓报价:https://www.goluckyvip.com/tag/94755.html
海外仓服务报价:https://www.goluckyvip.com/tag/94756.html
海外仓的费用包括哪些:https://www.goluckyvip.com/tag/94758.html
​TikTok发生了什么?美区增长首次停滞,准入管理力度加大:https://www.kjdsnews.com/a/1836407.html
2024年如何找到在TikTok上发帖的最佳时间:https://www.kjdsnews.com/a/1836408.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流