Eclipse RCP start tips
FuqiangWang
2014年从msn space存档中重新恢复出来!
The blog has not been updated for such a long long time, so today, let’s say something…
写点儿有关RCP的小tips吧,反正也不知写些什么东西,无意间翻硬盘看到这个freemind文件,故此,罗列与此:
Open View Tip
如果要在RCP中打开相应的View,你需要通过类似一下代码:
window.getActivePage().showView(viewId, IWorkbenchPage.VIEW_ACTIVATE);
不过,如果不在Perspective先行指定要打开的view所在位置的话,RCP应该不会知道你想让他帮你把该View放到什么位置,所以,我们还需要在Perspective中指定View的位置:
.createPlaceholderFolder("panelFolder",IPageLayout.TOP,IPageLayout.NULL_RATIO,layout.getEditorArea()).addPlaceholder(AdministrationView.ID);
layout(Perspective.java)
How to Add Widget onto Table Cell
= new Table(top, SWT.NONE);
Table table .setHeaderVisible(true);
table.setLinesVisible(true);
table.setBounds(new org.eclipse.swt.graphics.Rectangle(47,67,190,70));
tableTableColumn tableColumn = new TableColumn(table, SWT.NONE);
.setWidth(100);
tableColumn.setText("Check Column");
tableColumn
TableColumn tableColumn1 = new TableColumn(table, SWT.NONE);
.setWidth(100);
tableColumn1.setText("Combo Column");
tableColumn1
=new TableItem(table,SWT.NONE);
TableItem tableItem= new TableEditor (table);
TableEditor editor
Button checkButton = new Button(table, SWT.CHECK);
.pack();
checkButton
.minimumWidth = checkButton.getSize ().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(checkButton, tableItem, 0);
editor= new TableEditor (table);
editor
= new Combo(table, SWT.CHECK);
Combo combo .pack();
combo
.minimumWidth = combo.getSize ().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(combo, tableItem, 1); editor
How to get the Shell reference from ViewPart?!
viewPart.getViewSite().getShell()
how to restart eclipse RCP application in program?!
PlatformUI.getWorkbench().restart();
View和Editor的title圆润风格如何显示?
在RCP的product配置文件中(注意preferenceCustomization属性):
extension
< id="product"
point="org.eclipse.core.runtime.products">
product
< application="cn.bestwiz.jhf.dealer.demo.application"
name="Dealer Demo">
property
< name="windowImages"
value="/cn.bestwiz.jhf.dealer.demo/icons/letian.GIF"/>
property
< name="preferenceCustomization"
value="plugin_customization.ini"/>
product>
</extension> </
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=false org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false org.eclipse.ui/defaultPerspectiveId=cn.bestwiz.jhf.dealerdesk.perspective org.eclipse.update.core/org.eclipse.update.core.updateVersions=compatible
OK,that’s all, if something new comes , append it later.
「为AI疯狂」星球上,扶墙老师正在和朋友们讨论有趣的AI话题,你要不要⼀起来呀?^-^
这里
- 不但有及时新鲜的AI资讯和深度探讨
- 还分享AI工具、产品方法和商业机会
- 更有体系化精品付费内容等着你,加入星球(https://t.zsxq.com/0dI3ZA0sL) 即可免费领取。(加入之后一定记得看置顶消息呀!)

存量的时代,省钱就是赚钱。
在增量的时代,省钱其实是亏钱。
避坑儿是省钱的一种形式,更是真正聪明人的选择!
弯路虽然也是路,但还是能少走就少走,背后都是高昂的试错成本。
订阅「福报」,少踩坑,少走弯路,多走一步,就是不一样的胜率!
