Question

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.

Was it helpful?

Solution 2

So, first part - images. It was so trivial it hurts.

Images go to the resources folder as usual and can be addressed then naturally by getResourceAsStream.

Example Filetree:

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

Code:

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;
}

}

OTHER TIPS

RAP applications consist of OSGi bundles and can be developed with any IDE.

I assume that you don't want to develop a workbench-based application, do you? Workbench applications consist of Eclipse plug-ins, basically OSGi bundles with a plugin.xml that contain extensions and extension points. Those plug-ins are usually developed with PDE (Eclipse Plug-in Development Environment), but you can also do that with other IDEs if you write your plugin.xml manually and include them in the bundle.

For applications that do not use the workbench, you don't need a plugin.xml, you can register your ApplicationConfiguration as an OSGi service. You can do that programmatically, using blueprint, or using DS.

The build.properties is a configuration file for the PDE build, that is used by Eclipse (and also Tycho). Since you use Maven, any build configuration go into the pom.xml. As you already found out, resources have to go in src/main/resources, otherwise a Maven build will not include them in the bundle.

If you have specific suggestions how the RAP Developer's Guide can be improved to help users of other IDEs better, a bug report would be helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top