[英]configure RAP without Eclipse
I want to setup a Web Project utilizing the Eclipse RAP Framework. 我想使用Eclipse RAP Framework设置Web项目。
My toolchain bases on Maven & Netbeans. 我的工具链基于Maven和Netbeans。 The three work together, I am able to start a sample RAP Application.
这三个一起工作,我能够启动一个示例RAP应用程序。 Now I want to add further stuff (images / resources, extensions etc.) and the FAQ seems to rely on the fact that one uses Eclipse.
现在我想添加更多东西(图像/资源,扩展等),而FAQ似乎依赖于使用Eclipse的事实。 It references visual controls of the IDE on various places.
它引用了IDE在各个地方的可视控件。
The question is where do the various configuration elements go if you never open Eclipse? 问题是,如果您从未打开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. 目前我试图找出
build.properties
的参数在哪里没有。
Also where does one place the plugin.xml
for the extension configuration? 还有哪里将
plugin.xml
放在扩展配置中? 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 . 如果你问自己为什么我不使用Eclipse, 它会一直在我的机器上崩溃 。 Also I don't like it.
我也不喜欢它。
RAP applications consist of OSGi bundles and can be developed with any IDE. RAP应用程序由OSGi包组成,可以使用任何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. Workbench应用程序由Eclipse插件组成,基本上是OSGi包,其中包含一个包含扩展和扩展点的
plugin.xml
。 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. 这些插件通常使用PDE(Eclipse插件开发环境)开发,但如果您手动编写
plugin.xml
并将其包含在捆绑包中,您也可以使用其他IDE执行此操作。
For applications that do not use the workbench, you don't need a plugin.xml
, you can register your ApplicationConfiguration
as an OSGi service. 对于不使用工作台的应用程序,您不需要
plugin.xml
,可以将ApplicationConfiguration
注册为OSGi服务。 You can do that programmatically, using blueprint, or using DS. 您可以使用蓝图或使用DS以编程方式执行此操作。
The build.properties
is a configuration file for the PDE build, that is used by Eclipse (and also Tycho). build.properties
是PDE构建的配置文件,由Eclipse(以及Tycho)使用。 Since you use Maven, any build configuration go into the pom.xml
. 由于您使用Maven,因此任何构建配置都会进入
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. 正如您已经发现的那样,资源必须放在
src/main/resources
,否则Maven构建将不会将它们包含在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. 如果您有具体的建议如何改进RAP开发人员指南以更好地帮助其他IDE用户,那么错误报告将会有所帮助。
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
. 图像像往常一样转到
resources
文件夹,然后可以通过getResourceAsStream
自然地解决。
Example Filetree: 示例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;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.