From: Xuan B. <med...@us...> - 2008-01-22 21:13:11
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20129/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicScope.java Log Message: Fix BasicScope.internalAddScopingTopic such that it also works for scopes where the user is not yet known. Index: BasicScope.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicScope.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicScope.java 21 Jan 2008 11:13:44 -0000 1.1 --- BasicScope.java 22 Jan 2008 21:13:02 -0000 1.2 *************** *** 15,18 **** --- 15,22 ---- protected Set<BasicTopic> scope; + public boolean internalAddScopingTopic(BasicScopeable user,BasicTopic scopingTopic,BasicTopicMapConstruct eventListenerProvider) { + return internalAddScopingTopic(user,scopingTopic,false,eventListenerProvider); + } + public boolean internalAddScopingTopic(BasicScopeable user,BasicTopic scopingTopic) { return internalAddScopingTopic(user,scopingTopic,false); *************** *** 20,25 **** protected boolean internalAddScopingTopic(BasicScopeable user,BasicTopic scopingTopic,boolean notifyListener) { if (scope==null) { ! scope = user.createSet(); } --- 24,33 ---- protected boolean internalAddScopingTopic(BasicScopeable user,BasicTopic scopingTopic,boolean notifyListener) { + return internalAddScopingTopic(user,scopingTopic,notifyListener,user); + } + + protected boolean internalAddScopingTopic(BasicScopeable user,BasicTopic scopingTopic,boolean notifyListener,BasicTopicMapConstruct eventListenerProvider) { if (scope==null) { ! scope = eventListenerProvider.createSet(); } *************** *** 28,32 **** if (notifyListener) { if (success) { ! user.getEventListener().notifyScopingTopicAdded(user.getContainingTopicMap(),user,scopingTopic); } } --- 36,40 ---- if (notifyListener) { if (success) { ! eventListenerProvider.getEventListener().notifyScopingTopicAdded(user.getContainingTopicMap(),user,scopingTopic); } } |