简体   繁体   English

在Win7上为SWT / RCP应用程序设置ApplicationId

[英]Set ApplicationId on Win7 for SWT/RCP application

Win7 uses applicationId for the grouping and according to this Win7使用applicationId进行分组,并根据此

https://bugs.eclipse.org/bugs/show_bug.cgi?id=294827 (comment #4 and comment #8) https://bugs.eclipse.org/bugs/show_bug.cgi?id=294827 (评论4和评论8)

Display.setAppName() should have set the application id in the first time. Display.setAppName()应该在第一次设置应用程序ID。

With Eclipse 3.7, I try to call Display.setAppName() before PlatformUI.createDisplay() like the below. 使用Eclipse 3.7,我尝试在PlatformUI.createDisplay()之前调用Display.setAppName(),如下所示。 Still, all shells dumped to one taskbar icon: 尽管如此,所有的shell都转储到一个任务栏图标上:

Display.setAppName(id); // id is ready from a file and different for every session
Display display = PlatformUI.createDisplay();

Use case 用例

The same binary is used for various purpose (eg UAT vs PROD) and run on the same PC. 相同的二进制文件可用于多种用途(例如UAT与PROD),并在同一台PC上运行。 It is much easier to manage if properly grouped in the taskbar. 如果在任务栏中正确分组,则管理起来会容易得多。 This is especially useful as we tweak all detached views to have its top-level shell, ie separate item on the taskbar. 当我们调整所有分离的视图以使其具有顶层外壳(即任务栏上的单独项目)时,此功能特别有用。

Any help is appreciated. 任何帮助表示赞赏。

Use Display.setAppName() to control the grouping BEFORE calling PlatformUI.createDisplay(). 在调用PlatformUI.createDisplay()之前,请使用Display.setAppName()控制分组。

Display.setAppName("MyApp");
Display display = Display.getDefault();
PlatformUI.createDisplay();

Pre-create display so that display is created customized app name, which controls task-bar grouping under Win7. 预创建显示,以便为显示创建自定义的应用程序名称,该名称控制Win7下的任务栏分组。 PlatformUI.createDisplay() will grap the same display for internal image initialization as long as they are called with the same thread. 只要使用同一线程调用PlatformUI.createDisplay(),它们就会为内部图像初始化获取相同的显示。 Calling PlatformUI.createDisplay() directly uses app name and version from product info with no customization available. 调用PlatformUI.createDisplay()直接使用产品信息中的应用名称和版本,而无需进行自定义。

Display with the same app name will be grouped under the same icon in Win7 taskbar. 具有相同应用程序名称的显示将被分组在Win7任务栏中的相同图标下。
Display.setAppVersion() is simply ignored. Display.setAppVersion()只是被忽略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM