将 DXL 与 eclipse/notes 关联并启动处理

发布于 2024-08-11 06:41:34 字数 515 浏览 4 评论 0原文

我需要能够双击桌面上的文件并让 Eclipse(或更具体地说 Lotus Notes)启动我的自定义操作,以处理和显示它。我发现

http://www.developer.com/java/other/article.php/3648736/Eclipse-Tip-Define-Custom-Content-Types-to-Identify-Your-Data- Files.htm

描述了如何在 Eclipse 中设置内容类型并将其绑定到编辑器。这不完全是我所需要的。我们将电子邮件存储为 DXL (Domino XML),虽然我可以在内部打开它们(通过我的自定义函数),但我找不到有关如何完成从外部启动它们的信息。我希望以前有人这样做过。

I need to be able to double click on a file on the desktop and have Eclipse (or more specifically Lotus Notes) kick off my custom action, to process and display it. I've found

http://www.developer.com/java/other/article.php/3648736/Eclipse-Tip-Define-Custom-Content-Types-to-Identify-Your-Data-Files.htm

which describes how to setup a content type in eclipse and bind it to an editor. This is not quite what I need. We have emails stored as DXL (Domino XML), and while I can open them internally (through my custom functions), I can't find information on how to accomplish launching them externally. I'm hoping someone has done this before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最初的梦 2024-08-18 06:41:34

我以前没有这样做过,但是......在您的帮助下,

EclipseEnvironmentInfo.getDefault().getCommandLineArgs()

您可以获取 eclipse 启动的命令行参数(“org.eclipse.core.runtime.internal.adaptor.EclipseEnvironmentInfo”是一个内部类,但您可以无论如何访问它......风险自负;))。快速测试表明,如果您使用 eclipse 启动一个文件,最后一个参数是该文件的路径。

正常启动:

-os, win32, -ws, win32, -arch, x86, -product, org.eclipse.epp.package.rcp.product

使用文件:

-os, win32, -ws, win32, -arch, x86, -product, org.eclipse.epp.package.rcp.product, D:\Programme\Eclipse3.5-RCP\readme\readme_eclipse.html

可以扩展扩展指向“org.eclipse.ui.startup”并执行“org.eclipse.ui.IStartup”来检查命令行参数并调用您自己的命令。

这是我的测试课:

import java.util.Arrays;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.internal.adaptor.EclipseEnvironmentInfo;
import org.eclipse.ui.IStartup;

import test.Activator;

public class Test implements IStartup {

 @Override
 public void earlyStartup() {
  String message = "Arguments: " + Arrays.toString(EclipseEnvironmentInfo.getDefault().getCommandLineArgs());
  Activator.getDefault().getLog().log(new Status(IStatus.INFO, "Test", message));
 }

}

I havn't done it before but ... with the help of

EclipseEnvironmentInfo.getDefault().getCommandLineArgs()

you can get at the command line arguments eclipse is started with ("org.eclipse.core.runtime.internal.adaptor.EclipseEnvironmentInfo" is an internal class but you can access it anyhow ... at your own risk ;) ). A quick test shows that if you start a file with eclipse, the last argument is the path to that file.

Normal startup:

-os, win32, -ws, win32, -arch, x86, -product, org.eclipse.epp.package.rcp.product

With file:

-os, win32, -ws, win32, -arch, x86, -product, org.eclipse.epp.package.rcp.product, D:\Programme\Eclipse3.5-RCP\readme\readme_eclipse.html

You can extend the extension point "org.eclipse.ui.startup" and implement "org.eclipse.ui.IStartup" to check the command line Arguments and invoke your own command.

Heres my test class:

import java.util.Arrays;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.internal.adaptor.EclipseEnvironmentInfo;
import org.eclipse.ui.IStartup;

import test.Activator;

public class Test implements IStartup {

 @Override
 public void earlyStartup() {
  String message = "Arguments: " + Arrays.toString(EclipseEnvironmentInfo.getDefault().getCommandLineArgs());
  Activator.getDefault().getLog().log(new Status(IStatus.INFO, "Test", message));
 }

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文