I just purchased GWT designer and I would like to use it on a existing project. A lot of my projects classes are working in the designer, but for example the ForumNewPost class does not
The ForumNewPost class:
- Code: Select all
package polgarhaz.jb.client.components.forum;
import polgarhaz.jb.persistent.Forumpost;
import com.google.gwt.user.client.ui.Button;
...
public class ForumNewPost extends Composite
{
private ForumPostAction submitAction;
private Forumpost forumpost;
private TextArea postMsg;
/**
* @wbp.parser.constructor
*/
public ForumNewPost()
{
FlowPanel fp = new FlowPanel();
FlowPanel fpButtons = new FlowPanel();
postMsg = new TextArea();
fp.add(postMsg);
CheckBox isAnswer = new CheckBox("Answer post ");
Button post = new Button("Submit post");
fpButtons.add(isAnswer);
fpButtons.add(post);
fp.add(postMsg);
fp.add(fpButtons);
postMsg.setSize("300px", "180px");
post.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
submitPost();
}
});
initWidget(fp);
}
public ForumNewPost(Forumpost forumpost)
{
this();
this.forumpost = forumpost;
}
public Forumpost getForumpost()
{
return this.forumpost;
}
public String getText()
{
return this.postMsg.getText();
}
private void submitPost()
{
if (submitAction != null)
{
this.forumpost.setText(this.postMsg.getText());
this.submitAction.doAction(this);
}
}
public void setSubmitAction(ForumPostAction submitAction) {
this.submitAction = submitAction;
}
}
The Forumpost.java class is as follows (it is used by ForumNewPost):
- Code: Select all
package polgarhaz.jb.persistent;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* Forumpost generated by hbm2java
*/
public class Forumpost implements java.io.Serializable {
private long id;
private Date timestamp;
private Forumpost forumpost;
private Event event;
private User user;
private String text;
private boolean isquestion;
private Set<Forumpost> forumposts = new HashSet<Forumpost>(0);
private Set<Abuse> abuses = new HashSet<Abuse>(0);
public Forumpost() {
}
public Forumpost(long id) {
this.id = id;
}
public Forumpost(long id, Forumpost forumpost, Event event, User user, String text, boolean isquestion, Set<Forumpost> forumposts, Set<Abuse> abuses) {
this.id = id;
this.forumpost = forumpost;
this.event = event;
this.user = user;
this.text = text;
this.isquestion = isquestion;
this.forumposts = forumposts;
this.abuses = abuses;
}
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
public Date getTimestamp() {
return this.timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Forumpost getForumpost() {
return this.forumpost;
}
public void setForumpost(Forumpost forumpost) {
this.forumpost = forumpost;
}
public Event getEvent() {
return this.event;
}
public void setEvent(Event event) {
this.event = event;
}
public User getUser() {
return this.user;
}
public void setUser(User user) {
this.user = user;
}
public String getText() {
return this.text;
}
public void setText(String text) {
this.text = text;
}
public boolean getIsquestion() {
return this.isquestion;
}
public void setIsquestion(boolean isquestion) {
this.isquestion = isquestion;
}
public Set<Forumpost> getForumposts() {
return this.forumposts;
}
public void setForumposts(Set<Forumpost> forumposts) {
this.forumposts = forumposts;
}
public Set<Abuse> getAbuses() {
return this.abuses;
}
public void setAbuses(Set<Abuse> abuses) {
this.abuses = abuses;
}
}
ForumPostAction is just a simple interface
- Code: Select all
package polgarhaz.jb.client.components.forum;
public interface ForumPostAction
{
public void doAction(ForumNewPost post);
}
If this class is used in another compoiste, the designer can show it, but cannot open it directly. Instead it throws the folloeing exception:
Does anybody know what can be the problem?
Best regards - István Szoboszlai