RCP application developement (some skills about RCP)
关键字: RCP1, Show Action only for specific perspectives
IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getService( IContextService.class );
In 3.2 and 3.3, you can create an actionSet with visibility false. Then use your perspective factory or org.eclipse.ui.perspectiveExtensions to activate that actionSet.
In 3.3, an actionSet generates a context with the equivalent ID, so it is available for core expressions like activeWhen, visibleWhen, and enabledWhen.
2, Creating a declarative security model for RCP applications
http://www.ibm.com/developerworks/opensource/library/os-ecl-rcpsec/?ca=dgr-lnxw16RCPbuilding
Thick client-based business applications require rigid security regulations where different classes of users receive a predetermined set of access rights. This article explains how to build a flexible security model for Rich-Client Platform (RCP) applications by leveraging features provided by the Eclipse platform.
3, Custom UI style
PlatformUI.getPreferenceStore().setDefault(
IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
PlatformUI.getPreferenceStore().setDefault(
IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR, IWorkbenchPreferenceConstants.TOP_LEFT);
4, Show view in the activie perspective
String viewId = "testView";
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewId);} catch (PartInitException e) {
MessageDialog.openInformation(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(),"Information","No this view!");
}
5, Show perspective
PlatformUI.getWorkbench().showPerspective(perspectiveId,
PlatformUI.getWorkbench().getActiveWorkbenchWindow());
6、generate coolbar
ToolBarManager commonbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
ToolBarContributionItem commonItem = new ToolBarContributionItem(commonbar, "common");
commonbar.add(exitAction);
//
coolBar.add(commonItem);
7、Window default size
Rectangle displayBounds = Display.getDefault().getPrimaryMonitor().getBounds();
configurer.setInitialSize(new Point(displayBounds.width,displayBounds.height));
8、RCP product parameters setting.
Specify the program and VM arguments to launch the product with. Platform-specific arguments should be entered on their respective tabs.
program arguments : -Dsystem.property=value
VM arguments : -Dfile.encoding=GBK
- 17:44
- 浏览 (417)
- 评论 (0)
- 分类: Eclipse/plugin/rcp
- 相关推荐
发表评论
- 浏览: 54584 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
我的相册
共 6 张
最新评论
-
一个数据库连接Java工具类 ...
不错,加油,能写成工具类就好了。
-- by dd2086 -
Hibernate和Access
我指的是方法一
-- by 黑暗浪子 -
Hibernate和Access
我测试一下,如果连接的是*.asa文件,好像就报"can't open conn ...
-- by 黑暗浪子 -
计算机/软件领域中的名人
Bruce Eckel和其他几位根本不是一个层次的人物。Marin Fowler ...
-- by turing -
《夜袭》和战争
电影拍的不好,有辱历史!
-- by ken1984






评论排行榜