1
edit
Changes
→Add Model
==== Add Model Class(s) ====
<code>Student.java </code> to <code> true </code>.
<source lang=java>
package cs.ecl.rcp.simplercp.model;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
public class Student {
private String id;
private String firstName;
private String lastName;
private String program;
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
public Student(){
}
public Student(String id, String firstName, String lastName, String program){
super();
this.id= id;
this.firstName= firstName;
this.lastName= lastName;
this.program= program;
}
public void addPropertyChangeListener(String propertyName,PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
}
public String getId() {
return id;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getProgram() {
return program;
}
public void setId(String id) {
propertyChangeSupport.firePropertyChange("id", this.id,
this.id = id);
}
public void setFirstName(String firstName) {
propertyChangeSupport.firePropertyChange("firstName", this.firstName,
this.firstName = firstName);
}
public void setLastName(String lastName) {
propertyChangeSupport.firePropertyChange("lastName", this.lastName,
this.lastName = lastName);
}
public void setProgram(String program) {
propertyChangeSupport.firePropertyChange("program", this.program,
this.program = program);
}
public String toString() {
return id +" "+firstName + " " + lastName + " "+ program ;
}
}
</source>
==== Add Model Provider ====