package ca.ualberta.CMPUT301W15T06;

public class ClaimantTagListController {

	private User user=null;
	
	public ClaimantTagListController(User u) {
		// TODO Auto-generated constructor stub
		user=u;
	}

	public void addTag(String tagName) throws NetWorkException {
		// TODO Auto-generated method stub
		Tag tag=new Tag(tagName);
		user.getTagList().add(tag);
		tag.addModelListener(new Listener() {
			
			@Override
			public void update() throws NetWorkException {
				// TODO Auto-generated method stub
				user.notifyListeners();
			}
		});
		user.getFilterTagIDList().add(tag.getID());
		
		user.notifyListeners();
	}

	public void delete(Tag tag) throws NetWorkException {
		// TODO Auto-generated method stub
		for (Claim claim:user.getClaimList()){
			claim.getTagIDList().remove(tag.getID());
		}
		user.getFilterTagIDList().remove(tag.getID());
		user.getTagList().remove(tag);
		user.notifyListeners();
	}

	public void edit(Tag tag, String string) throws NetWorkException {
		// TODO Auto-generated method stub
		tag.setName(string);
	}

}

@@ -1,209 +1,1649 @@
-package ca.ualberta.CMPUT301W15T06;%0A%0Apublic class ClaimantTagListController %7B%0A%0A%09private User user=null;%0A%09%0A%09public ClaimantTagListController(User u) %7B%0A%09%09// TODO Auto-generated constructor stub%0A%09%09user=u;%0A%09%7D%0A
+/*%0AUA CMPUT 301 Project Group: CMPUT301W15T06%0ACopyright %7B2015%7D %7BJingjiao Ni%0A              Tianqi Xiao%0A              Jiafeng Wu%0A              Xinyi Pan %0A              Xinyi Wu%0A              Han Wang%7D%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 %0AUnless required by applicable law or agreed to in writing, software distributed under %0Athe License is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF %0AANY KIND, either express or implied. See the License for the specific language %0Agoverning permissions and limitations under the License.%0A */%0A%0Apackage ca.ualberta.CMPUT301W15T06;%0A%0A/**%0A * This %3Ccode%3E ClaimantTagListController%3C/code%3E is a controller class%0A * of %3Ccode%3ETag%3C/code%3E and %3Ccode%3E ClaimantTagListActivity%3C/code%3E. By calling this class, %0A * user(claimant) can add a new tag, delete or change an existing %0A * tag to an %3Ccode%3EItem%3C/code%3E.%0A * %0A * @author CMPUT301W15T06%0A * @version 04/07/2015%0A */%0Apublic class ClaimantTagListController %7B%0A%0A%09/**%0A%09 * Set a User object user who is currenly using the application.%0A%09 */%0A%09private User user=null;%0A%09%0A%09/**%0A%09 * General Constructor. Set the user to an exsiting user.%0A%09 * %0A%09 * @param u  a User object who is currenly using the application%0A%09 */%0A%09public ClaimantTagListController(User u) %7B%0A%09%09// TODO Auto-generated constructor stub%0A%09%09user=u;%0A%09%7D%0A%0A%09/**%0A%09 * Add new tag to the item and notify all the Listener in the listeners and modelListeners. %0A%09 * %0A%09 * @param tagName  the name of the tag%0A%09 * @throws NetWorkException%0A%09 */
 %0A%09pu
@@ -2052,32 +2052,219 @@
 isteners();%0A%09%7D%0A%0A
+%09/**%0A%09 * Delete a existing tag to the item and notify all the Listener in the listeners and modelListeners. %0A%09 * %0A%09 * @param tag  an existing tag object%0A%09 * @throws NetWorkException%0A%09 */%0A
 %09public void del
@@ -2540,16 +2540,139 @@
 s();%0A%09%7D%0A
+%09%0A%09/**%0A%09 * Edit an existing tag to the item. %0A%09 * %0A%09 * @param tag  an existing tag object%0A%09 * @throws NetWorkException%0A%09 */
 %0A%09public

Update ClaimantTagListController.java