如何将一个自制的类导入我的 GWT 项目?

huangapple go评论64阅读模式
英文:

How can I import a selfmade class into my gwt project?

问题

我正在进行一个 GWT 教程的工作,现在我必须在我的 GWT 项目中导入一个类/项目。在我的 GWT 项目中,我有一个名为 "Sortierer-GWT" 的类,这是我的入口点。在这个类中,我想要调用另一个类中的一个方法。这个类是我自己编写的,叫做 "UserInput"。"UserInput" 类还需要其他类。所有这些类都在正确的文件夹中以供导入。但是,如果我像这样导入 "UserInput" 类:

import eingabe.UserInput;
// ...
UserInput read = new UserInput();

编译器会报错(没有可用于类型 eingabe.UserInput 的源代码;您是否忘记继承所需的模块?)。我应该导入用于 "UserInput" 的其他类,还是应该在我的 .XML 数据中编写一些内容来修复这个错误?

英文:

I am working at a gwt tutorial and now i must Import a class/Project on my gwt Project. In my gwt Project i have the class "Sortierer-GWT" where is my entry Point. In this class i want to call a method, which is in another class. This class is written by my own and is called "UserInput". The class UserInput also Needs other classes. All this classes are in the Right Folder for Import. But if i Import the UserInput class like this:

Import eingabe.UserInput;
……
UserInput read = new UserInput();

The Compiler says error (No source code is available for type eingabe.UserInput; did you forget to inherit a required module?). Should i Import the other classes which are used for UserInput or should i write something in my .XML data to fix this error?

答案1

得分: 1

这里有很多地方提供了许多有用的信息。在这里看一下:https://github.com/TDesjardins/gwt-knowledge,https://docs.google.com/presentation/d/1cr-rYGz58ngC6sgOy8c7oErhaj0VdLUHk9Y5mcvgrP0/edit#slide=id.p,https://dev.to/ibaca/modern-gwt-first-steps-509k,https://gwt.zeef.com/awesomegwt,当然还有 www.gwtproject.org

如果你想与其他 GWT 开发者取得联系,可以在这里:https://gitter.im/gwtproject/gwt

如果你想要创建一个“更大”的 GWT 项目,你可以尝试使用 Nalu 项目生成器:http://www.mvp4g.org/boot-starter-nalu/BootStarterNalu.html

(注意:由于 Domino-UI 中的更新,存在一个 bug,'setLeftAddon' -> 'addLeftAddOn')

该项目生成器将创建一个稍微较大的项目,这可能有助于你理解如何组织一个 GWT 项目。

关于你如何显示一个数组的问题:

  • GWT:http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCheckBox
  • Domino-UI:https://demo.dominokit.org/home

在这里,你会找到一个使用 Domino-UI、Domino-rest 和 Nalu 的示例项目。它是一个包含三个页面的项目,具有服务器访问功能,并显示数据列表:https://github.com/NaluKit/nalu-examples/tree/master/devkexample

英文:

There are many places with a lot of useful informations. Take a look here: https://github.com/TDesjardins/gwt-knowledge, https://docs.google.com/presentation/d/1cr-rYGz58ngC6sgOy8c7oErhaj0VdLUHk9Y5mcvgrP0/edit#slide=id.p, https://dev.to/ibaca/modern-gwt-first-steps-509k, https://gwt.zeef.com/awesomegwt and of course www.gwtproject.org.

And here you get in contact with other GWT developers: https://gitter.im/gwtproject/gwt

If you would like to create a 'larger' GWT-poject, you can try the Nalu Project Generator: http://www.mvp4g.org/boot-starter-nalu/BootStarterNalu.html

(Attention: there is a bug due to an update in Domino-UI 'setLeftAddon' -> 'addLeftAddOn')

The project generator will create a slightly larger project, that might help you to understand how to organize a GWT project.

Regarding your question on how to display an array:

And here, you will find an example project, using Domino-UI, Domino-rest and Nalu. It is a three pager, with server access and displaying a list of data: https://github.com/NaluKit/nalu-examples/tree/master/devkexample

huangapple
  • 本文由 发表于 2020年10月13日 20:29:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/64335286.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定