0

I want to setup a Web Project utilizing the Eclipse RAP Framework.

My toolchain bases on Maven & Netbeans. The three work together, I am able to start a sample RAP Application. Now I want to add further stuff (images / resources, extensions etc.) and the FAQ seems to rely on the fact that one uses Eclipse. It references visual controls of the IDE on various places.

The question is where do the various configuration elements go if you never open Eclipse? I could not find the documentation on this.

Currently I try to figure out where the parameters for the build.properties go if you don't have one.

Also where does one place the plugin.xml for the extension configuration? Do I have to configure its location somewhere?

I would prefer a solution that includes a link to the original documentation. Alternatively a filetree containing the locations of configuration files would be much appreciated.

If you ask yourself why I don't use Eclipse, it crashes on my machine all the time. Also I don't like it.

4

2 回答 2

2

RAP 应用程序由 OSGi 包组成,可以使用任何 IDE 进行开发。

我假设您不想开发基于工作台的应用程序,是吗?工作台应用程序由 Eclipse 插件组成,基本上plugin.xml是带有扩展和扩展点的 OSGi 包。这些插件通常使用 PDE(Eclipse 插件开发环境)开发,但如果您plugin.xml手动编写并将它们包含在包中,您也可以使用其他 IDE 进行开发。

对于不使用工作台的应用程序,您不需要plugin.xml,您可以将您的注册ApplicationConfiguration为 OSGi 服务。您可以使用蓝图或 DS 以编程方式执行此操作。

build.properties是一个用于 PDE 构建的配置文件,由 Eclipse(以及 Tycho)使用。由于您使用 Maven,因此任何构建配置都会进入pom.xml. 正如您已经发现的那样,资源必须进入src/main/resources,否则 Maven 构建将不会将它们包含在包中。

如果您对如何改进RAP 开发人员指南以更好地帮助其他 IDE 的用户有具体建议,那么错误报告会很有帮助。

于 2014-02-04T09:49:03.273 回答
0

所以,第一部分 - 图像。它是如此微不足道,它很痛苦。

图像像往常一样进入resources文件夹,然后可以自然地通过getResourceAsStream.

示例文件树:

/src
    /main
         /resources
                   /images
                          /robot.gif

代码:

public class SimpleEntryPoint implements EntryPoint {

@Override
public int createUI() {
    Display display = new Display();

    InputStream instr = getClass().getResourceAsStream("/images/robot.gif");
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());
    Label label = new Label(shell, SWT.NONE);
    Image robotImage = new Image(display, instr); // tried to put "/images/robot.gif" here, but doesn't work.
    label.setImage(robotImage);
    shell.setSize(500, 400);
    shell.open();
    return 0;
}

}
于 2014-01-21T11:54:38.307 回答