在应用程序运行时使用SWT的较新版本

在应用程序运行时使用SWT的较新版本

本文介绍了强制Eclipse(Helios)在应用程序运行时使用SWT的较新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse-Helios开发RCP项目。

I'm developing an RCP project using Eclipse-Helios.

已安装的SWT版本(在plugins目录中)为[org.eclipse.swt -win32-3.6.2,& org.eclipse.swt.jar]

The version of SWT that is installed (in the plugins directory) is [org.eclipse.swt-win32-3.6.2, & org.eclipse.swt.jar]

我需要新的API功能,该功能仅在swt-3.8中可用。 (特别是,我希望在打开之前为SWT颜色对话框设置自定义颜色。)

I require new API functionality that is only available from swt-3.8. (specifically, I wish to set the custom colours, for an SWT color dialog before opening.)

我已经从SWT / Eclipse下载站点下载了3.8.1 [ a href = http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT rel = nofollow> http://download.eclipse.org/eclipse/downloads/drops /R-3.8-201206081200/#SWT ]

I have downloaded 3.8.1 from the SWT/Eclipse downloads site [ http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT ]


  • SWT下载不是一个插件(几个jar,src。 zip和一些自述文件),所以我无法将其添加到目标平台(即使在位置中添加了包含目录之后,它也没有显示为可用的jar)

  • 我找不到SWT的更新站点(或任何我可以获得较新版本插件的站点)

如果我将swt.3.8.jar添加到我的类路径中(然后在项目构建路径中增加它的顺序优先级),则可以从我的代码访问新的api功能(并查看源代码)。
但是,当我运行应用程序时,似乎运行时仍在使用旧的SWT jar,因为在尝试访问更新的功能时遇到未知的方法错误。

If I add the swt.3.8.jar to my classpath (and then increase it's order-priority in the project build-path), I am able to access the newer api functionality from my code (as well as view the source).When I run the application however, it seems as though the runtime is still using the older SWT jar, as i get an unknown method error, when attempting to access the newer functionality.

问题:


  1. 是否有一个SWT存储库位置,可用于使用Eclipse下载SWT的较新版本安装管理器?

  2. 如果没有,是否可以强制我运行时忽略旧版本(我假设通过plugin.xml)?

  3. 是否有更好的方法来实现我要执行的操作?

  4. 当前在helios插件目录中的两个SWT jar之间有什么区别(因为3.8下载仅包含win -32版本)?

  1. Is there an SWT repository location that I can use to download a newer version of SWT using the eclipse install manager?
  2. If not, is there a way I can force the runtime to ignore the older version (I assume via plugin.xml)?
  3. Is there a better way to achieve what I am trying to do?
  4. What is the difference between the two SWT jars currently in the helios plugins directory (as the 3.8 download only contains the win-32 version)?

预先感谢。

推荐答案

SWT可作为单独的插件在此处下载:

SWT is downloadable as a separate plugin here:
http://download.eclipse.org/eclipse/downloads/drops/R-3.8-201206081200/#SWT

Eclipse 3.8包含常规插件,包括SWT(特定于Win32以及通用 org.eclipse.swt_.jar)。我当前使用的是3.8版本,它们作为插件出现。

Eclipse 3.8 contains regular plugins including the SWT (the win32 specific as well as the generic "org.eclipse.swt_.jar"). I am currently using the 3.8 version and they appear as plugins.

我也有Eclipse 3.6(Helios),并且可以使用文件- >导入->插件开发->插件和片段向导。我只是指定了eclipse 3.8目录,并且可以将它们导入我的工作区中。一旦导入,我当然可以将它们包含在运行时环境中。 Eclipse应该自动使用最新版本。

I also have Eclipse 3.6 (Helios) and I was able to import the swt plugins using the "File->Import->Plug-in Development->Plug-ins and Fragments" wizard. I just specified the eclipse 3.8 directory and could import them in my workspace. Once imported I can of-course use them to be included in the runtime environment. Eclipse should use the latest version automatically.

这篇关于强制Eclipse(Helios)在应用程序运行时使用SWT的较新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:51