Difference between revisions of "Teams Winter 2011/team1/BlackBerry/Implement Edit Option"
Ladanzahir (talk | contribs) (→8. Implement Edit Student Option) |
Ladanzahir (talk | contribs) (→8. Implement Edit Student Option) |
||
Line 1: | Line 1: | ||
=== 8. Implement Edit Student Option === | === 8. Implement Edit Student Option === | ||
− | 8.1. In order to Implement the Edit Student menu option, firs we have to make sure that our Student class has all setters and getters we need, so we have to add the following methods to the <code>Student | + | 8.1. In order to Implement the Edit Student menu option, firs we have to make sure that our Student class has all setters and getters we need, so we have to add the following methods to the <code>Student</code>: |
<pre> | <pre> | ||
Line 24: | Line 24: | ||
</pre> | </pre> | ||
+ | |||
+ | 8.2. Then we should make sure that our StudentList class which extends SortedReadableList, can edit it's elements, so we have to add the following method to the class <code>StudentList</code>: | ||
+ | <pre> | ||
+ | |||
+ | void updateElement(Object oldElement, Object newElement){ | ||
+ | doUpdate(oldElement,newElement); | ||
+ | } | ||
+ | |||
+ | </pre> |
Revision as of 09:18, 22 March 2011
8. Implement Edit Student Option
8.1. In order to Implement the Edit Student menu option, firs we have to make sure that our Student class has all setters and getters we need, so we have to add the following methods to the Student
:
public String getFirstname(){ return this.firstName; } public String getLastName(){ return this.lastName; } public void setEmail(String email){ this.email = email; } public void setFirstName( String firstName){ this.firstName=firstName; } public void setLastName(String lastName){ this.lastName = lastName; }
8.2. Then we should make sure that our StudentList class which extends SortedReadableList, can edit it's elements, so we have to add the following method to the class StudentList
:
void updateElement(Object oldElement, Object newElement){ doUpdate(oldElement,newElement); }