update copyrights
[fedora-idea.git] / platform / lang-api / src / com / intellij / facet / FacetModificationTrackingService.java
blob88ac8f6ee8f1673925fea40655d67e3dbe7d80a8
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.intellij.facet;
19 import org.jetbrains.annotations.NotNull;
20 import com.intellij.openapi.module.Module;
21 import com.intellij.openapi.module.ModuleServiceManager;
22 import com.intellij.openapi.util.ModificationTracker;
23 import com.intellij.openapi.util.ModificationTrackerListener;
24 import com.intellij.openapi.Disposable;
26 /**
27 * @author nik
29 public abstract class FacetModificationTrackingService {
31 public static FacetModificationTrackingService getInstance(@NotNull Module module) {
32 return ModuleServiceManager.getService(module, FacetModificationTrackingService.class);
35 public static FacetModificationTrackingService getInstance(@NotNull Facet facet) {
36 return ModuleServiceManager.getService(facet.getModule(), FacetModificationTrackingService.class);
39 @NotNull
40 public abstract ModificationTracker getFacetModificationTracker(@NotNull Facet facet);
42 public abstract void incFacetModificationTracker(@NotNull Facet facet);
44 public abstract <T extends Facet> void addModificationTrackerListener(final T facet, final ModificationTrackerListener<? super T> listener, final Disposable parent);
46 public abstract void removeModificationTrackerListener(final Facet facet, final ModificationTrackerListener<?> listener);