-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from /issues/26
Experiments to fix inconsistent project setup issues
- Loading branch information
Showing
4 changed files
with
67 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/internal/IProjectChangedListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.incquerylabs.v4md.internal; | ||
|
||
import com.google.common.collect.ArrayListMultimap; | ||
import com.nomagic.magicdraw.core.Project; | ||
|
||
public interface IProjectChangedListener { | ||
void modelSetUpdated(); | ||
|
||
public static final Manager MANAGER = new Manager(); | ||
|
||
public class Manager { | ||
ArrayListMultimap<Project, IProjectChangedListener> listenerMap = ArrayListMultimap.create(); | ||
|
||
|
||
private Manager() { | ||
// Private constructor for singleton class | ||
} | ||
|
||
public void notifyProjectListeners(Project project) { | ||
for (IProjectChangedListener listener : listenerMap.get(project)) { | ||
listener.modelSetUpdated(); | ||
} | ||
} | ||
|
||
public boolean addProjectChangeListener(Project project, IProjectChangedListener listener) { | ||
return listenerMap.put(project, listener); | ||
} | ||
|
||
public boolean removeProjectChangeListener(Project project, IProjectChangedListener listener) { | ||
return listenerMap.remove(project, listener); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters