SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.
Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg
by mvivanco » Wed Oct 29, 2008 11:41 am
I am trying to use the databinding features. However, nothing I do allows the designer to show my beans. Not thru the databinding popup window, nor thru the JFace Automatic Databinding. On the JFace Automatic Databinding, I click the down arrow on the Bean Class and nothing shows. I have a simple bean class for a person to test it out (see below). Shouldn't this bean show on the dropdown? I am using Eclipse 3.4.1 and WindowBuilder Pro 6.8.0
public class Person implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String firstName;
private String lastName;
private boolean married;
private String gender;
private Integer age;
public Person() {
}
public String getFirstName() {
return firstName;
}
public String getGender() {
return gender;
}
public String getLastName() {
return lastName;
}
public boolean isMarried() {
return married;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setGender(String gender) {
this.gender = gender;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setMarried(boolean isMarried) {
this.married = isMarried;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
-
mvivanco
-
- Posts: 3
- Joined: Wed Oct 29, 2008 11:36 am
by Eric Clayberg » Wed Oct 29, 2008 11:48 am
Click the "..." button next to the drop down arrow.
You should also confirm that the class is compiled, that a .class file exists for it on disk and that there are no exceptions in your Eclipse ".log" file.
-
Eric Clayberg
- Moderator
-
- Posts: 4503
- Joined: Tue Sep 30, 2003 6:39 am
- Location: Boston, MA USA
-
by mvivanco » Wed Oct 29, 2008 1:07 pm
So I clicked the "..." and entered "Person". Then after clicking the OK button, I see below the Databininds (note spelling mistake on that window) the error, " Choose bean class contains properties: java.lang.ClassNotFoundException: Error loading class DataBindTest.Person". That is literally the only file on the project. I created a new project just for this purpose. I have attached my project along with the eclipse .log file.
- Attachments
-
- MarkDataBindingTest.zip
- Here is my project along with the eclipse .log file.
- (6.83 KiB) Downloaded 54 times
-
mvivanco
-
- Posts: 3
- Joined: Wed Oct 29, 2008 11:36 am
by Eric Clayberg » Wed Oct 29, 2008 1:16 pm
See the FAQ for common causes and solutions for
ClassNotFoundException problems.
The
UnsupportedClassVersionError exception in your log would indicate a JDK mismatch problem.
-
Eric Clayberg
- Moderator
-
- Posts: 4503
- Joined: Tue Sep 30, 2003 6:39 am
- Location: Boston, MA USA
-
by mvivanco » Thu Oct 30, 2008 10:19 am
Thanks that was exactly it. There was a JDK mismatch. I am posting this here in the event it might help someone in the future. I use MyEclipse as a plugin to Eclipse. I usually choose to download a full version which includes Eclipse and it turns out, its own JRE. So after removing all but one JRE in my environment, it still didn't work. Then it occurred to me that Eclipse must use a JRE so what was it using. It wasn't using what I thought it should be using and that is when I found out that there was a JRE in the MyEclipse folder. I removed that one and then Eclipse wouldn't start. So then I knew I was on the right track. I modified the startup link to point to my JRE as the target and now all is good. I can finally start working with the Databinding features now. Thanks for the help.
-
mvivanco
-
- Posts: 3
- Joined: Wed Oct 29, 2008 11:36 am
by Eric Clayberg » Sat Nov 15, 2008 10:55 am
The JDK mismatch problem is tricky and not very well identified by the exceptions thrown by the VM.
-
Eric Clayberg
- Moderator
-
- Posts: 4503
- Joined: Tue Sep 30, 2003 6:39 am
- Location: Boston, MA USA
-
Return to SWT Designer
Who is online
Users browsing this forum: No registered users and 2 guests