【问题标题】:Setting network options in a RCP Application在 RCP 应用程序中设置网络选项
【发布时间】:2012-06-25 16:59:24
【问题描述】:

我们有一个 RCP 应用程序,它有时会从 Internet 中的 URL 获取一些数据。我们的客户使用代理服务器,除非网络设置正确(设置代理的 IP 和端口号),否则我们无法获得所需的信息。

在 Eclipse(IDE)中,有 Preferences->General->Network Connections 对话框来设置这些设置。我设法包含了首选项对话框(menu.add(new OpenPreferencesAction(window));,甚至获得了“网络连接”选项(通过在插件设置中添加对org.eclipse.ui.net 的依赖项。)但是当我打开对话框时,它显示“当前显示的页面包含无效值。”我无法在那里设置任何值。

日志文件显示:(感谢 VonC)

!ENTRY org.eclipse.jface 4 2 2009-11-09 21:51:39.798 !MESSAGE 从插件调用代码时出现问题:“org.eclipse.jface”。 !堆栈 0 java.lang.NoClassDefFoundError: org/eclipse/core/internal/net/ProxySelector 在 org.eclipse.ui.internal.net.ProxyEntriesComposite.initializeValues(ProxyEntriesComposite.java:248) 在 org.eclipse.ui.internal.net.ProxyEntriesComposite.createWidgets(ProxyEntriesComposite.java:130) 在 org.eclipse.ui.internal.net.ProxyEntriesComposite.(ProxyEntriesComposite.java:57) 在 org.eclipse.ui.internal.net.ProxyPreferencePage.createProxyEntriesComposite(ProxyPreferencePage.java:81) 在 org.eclipse.ui.internal.net.ProxyPreferencePage.createContents(ProxyPreferencePage.java:54) 在 org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:235)

是否有人知道一种方法来告诉 eclipse-RCP 应用程序使用哪些网络设置,通过使用首选项页面、手动编码或使用一些配置文件?

【问题讨论】:

  • 错误日志中关于该异常的内容是什么?

标签: networking settings eclipse-rcp


【解决方案1】:

看来我终于明白了:

如何在 Windows 32 位的 RCP 应用程序中通过首选项页面设置网络配置:

  1. 将包 org.eclipse.ui.net、org.eclipse.core.net 和 org.eclipse.core.net.win32.x86 放入目标平台,并在 Manfifest 中为前两个添加依赖项。中频
  2. 确保您有兼容的版本(这是我的错误,我有一个旧版本的 org.eclipse.net.win32.x86)。例如,从 Galileo Eclipse IDE 中获取所有三个文件
  3. 在您的 ActionBarAdvisor 类中,添加:menu.add(new OpenPreferencesAction(getActionBarConfigurer().getWindowConfigurer() .getWindow()));

不必将一些 DLL 文件放在硬盘的某个位置!

【讨论】:

    【解决方案2】:

    如何在自己的插件中使用eclipse网络选项(测试win32): 添加罐子:org.eclipse.core.net 和 org.eclipse.ui.net 将 jWinHttp-1.0.0.dll(从 org.eclipse.core.net.win32.x86 提取)添加到目录 位于 windows 路径上(例如 c:\windows)。 也许也可以传递一个系统属性来搜索特定位置的dll。

    现在你可以使用net api了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 2014-03-02
      • 1970-01-01
      • 1970-01-01
      • 2012-12-26
      • 2015-07-31
      • 2012-01-13
      相关资源
      最近更新 更多