use of com.intellij.facet.pointers.FacetPointerListener in project intellij-community by JetBrains.
the class FacetPointersManagerImpl method refreshPointers.
private void refreshPointers(@NotNull final Module module) {
//todo[nik] refresh only pointers related to renamed module/facet?
List<Pair<FacetPointerImpl, String>> changed = new ArrayList<>();
for (FacetPointerImpl pointer : myPointers.values()) {
final String oldId = pointer.getId();
pointer.refresh();
if (!oldId.equals(pointer.getId())) {
changed.add(Pair.create(pointer, oldId));
}
}
for (Pair<FacetPointerImpl, String> pair : changed) {
FacetPointerImpl pointer = pair.getFirst();
final Facet facet = pointer.getFacet();
Class facetClass = facet != null ? facet.getClass() : Facet.class;
while (facetClass != Object.class) {
final EventDispatcher<FacetPointerListener> dispatcher = myDispatchers.get(facetClass);
if (dispatcher != null) {
//noinspection unchecked
dispatcher.getMulticaster().pointerIdChanged(pointer, pair.getSecond());
}
facetClass = facetClass.getSuperclass();
}
}
}
Aggregations