eclipse RCP 插件开发

本文介绍了Eclipse插件开发中的几个实用技巧,包括如何使用相对路径调用本地资源、如何利用Window shell在后台调用默认浏览器打开指定网页以及如何设置定时器定时刷新页面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1避免使用绝对路径,使用打成jar文件后的插件的相对路径来调用本地资源。

譬如使用icon时

static Image image= AbstractUIPlugin.imageDescriptorFromPlugin("Plugin Name", "icon/icon.png").createImage();

Label temp=new label();

temp.setImage(temp);

 

 

2.利用Window shell 在后台调用默认浏览器,弹出窗口,打开指定网页

String cmd = "rundll32 url.dll,FileProtocolHandler http://xiezezhun.blogbus.com/ ,nil, nil, SW_SHOW";

Runtime.getRuntime().exec(cmd);

 

 

3.设置定时timer,定时刷新页面

int timer=1000*60*15;

parent.getDisplay().timerExec(timer, new Runnable()
{

   public void run()
   {

       refresh();

       System.out.print("I am refreshing");

       parent.getDisplay().timerExec(timer, this);

   }

});

 

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://xiezezhun.blogbus.com/logs/44005713.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值