mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
obsolete code removed
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.intellij.facet.impl;
|
||||
|
||||
import com.intellij.facet.*;
|
||||
import com.intellij.facet.impl.ui.FacetEditorContextBase;
|
||||
import com.intellij.facet.impl.ui.FacetEditorImpl;
|
||||
import com.intellij.facet.impl.ui.FacetTreeModel;
|
||||
import com.intellij.facet.impl.ui.ProjectConfigurableContext;
|
||||
@@ -25,7 +24,6 @@ import com.intellij.facet.ui.FacetEditorContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ui.configuration.FacetsProvider;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationState;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModuleEditor;
|
||||
@@ -44,7 +42,7 @@ import java.util.*;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class ProjectFacetsConfigurator implements FacetsProvider, ModuleEditor.ChangeListener {
|
||||
public class ProjectFacetsConfigurator implements FacetsProvider {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.facet.impl.ProjectFacetsConfigurator");
|
||||
private final Map<Module, ModifiableFacetModel> myModifiableModels = new HashMap<Module, ModifiableFacetModel>();
|
||||
private final Map<Facet, FacetEditorImpl> myEditors = new HashMap<Facet, FacetEditorImpl>();
|
||||
@@ -170,11 +168,6 @@ public class ProjectFacetsConfigurator implements FacetsProvider, ModuleEditor.C
|
||||
ModifiableFacetModel model = myModifiableModels.get(module);
|
||||
if (model == null) {
|
||||
model = FacetManager.getInstance(module).createModifiableModel();
|
||||
model.addListener(new ModifiableFacetModel.Listener() {
|
||||
public void onChanged() {
|
||||
fireFacetModelChanged(module);
|
||||
}
|
||||
}, null);
|
||||
myModifiableModels.put(module, model);
|
||||
}
|
||||
return model;
|
||||
@@ -326,26 +319,6 @@ public class ProjectFacetsConfigurator implements FacetsProvider, ModuleEditor.C
|
||||
return getFacetModel(module).findFacet(type, name);
|
||||
}
|
||||
|
||||
public void moduleStateChanged(final ModifiableRootModel moduleRootModel) {
|
||||
Module module = moduleRootModel.getModule();
|
||||
Facet[] allFacets = getAllFacets(module);
|
||||
for (Facet facet : allFacets) {
|
||||
FacetEditorImpl facetEditor = myEditors.get(facet);
|
||||
if (facetEditor != null) {
|
||||
((FacetEditorContextBase)facetEditor.getContext()).fireModuleRootsChanged(moduleRootModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fireFacetModelChanged(Module module) {
|
||||
for (Facet facet : getAllFacets(module)) {
|
||||
FacetEditorImpl facetEditor = myEditors.get(facet);
|
||||
if (facetEditor != null) {
|
||||
((FacetEditorContextBase)facetEditor.getContext()).fireFacetModelChanged(module);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private UserDataHolder getProjectData() {
|
||||
if (myProjectData == null) {
|
||||
myProjectData = new UserDataHolderBase();
|
||||
|
||||
@@ -19,8 +19,6 @@ package com.intellij.facet.impl.ui;
|
||||
import com.intellij.facet.Facet;
|
||||
import com.intellij.facet.impl.DefaultFacetsProvider;
|
||||
import com.intellij.facet.ui.FacetEditorContext;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ModuleRootModel;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
@@ -33,7 +31,6 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -46,7 +43,6 @@ public abstract class FacetEditorContextBase extends UserDataHolderBase implemen
|
||||
private final ModulesProvider myModulesProvider;
|
||||
private final Facet myFacet;
|
||||
private final UserDataHolder mySharedModuleData;
|
||||
private final EventDispatcher<FacetContextChangeListener> myFacetContextChangeDispatcher = EventDispatcher.create(FacetContextChangeListener.class);
|
||||
private final UserDataHolder mySharedProjectData;
|
||||
|
||||
public FacetEditorContextBase(@NotNull Facet facet, final @Nullable FacetEditorContext parentContext, final @Nullable FacetsProvider facetsProvider,
|
||||
@@ -121,18 +117,6 @@ public abstract class FacetEditorContextBase extends UserDataHolderBase implemen
|
||||
return getModifiableRootModel();
|
||||
}
|
||||
|
||||
public void addFacetContextChangeListener(FacetContextChangeListener facetContextChangeListener) {
|
||||
myFacetContextChangeDispatcher.addListener(facetContextChangeListener);
|
||||
}
|
||||
|
||||
public void fireModuleRootsChanged(final ModifiableRootModel moduleRootModel) {
|
||||
myFacetContextChangeDispatcher.getMulticaster().moduleRootsChanged(moduleRootModel);
|
||||
}
|
||||
|
||||
public void fireFacetModelChanged(final Module module) {
|
||||
myFacetContextChangeDispatcher.getMulticaster().facetModelChanged(module);
|
||||
}
|
||||
|
||||
public abstract LibrariesContainer getContainer();
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
private StructureConfigurableContext myContext;
|
||||
private final List<ModuleEditor.ChangeListener> myAllModulesChangeListeners = new ArrayList<ModuleEditor.ChangeListener>();
|
||||
|
||||
public ModulesConfigurator(Project project, ProjectSdksModel projectJdksModel) {
|
||||
public ModulesConfigurator(Project project) {
|
||||
myProject = project;
|
||||
myModuleModel = ModuleManager.getInstance(myProject).getModifiableModel();
|
||||
}
|
||||
@@ -163,15 +163,13 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
}
|
||||
};
|
||||
|
||||
final ProjectFacetsConfigurator configurator = myFacetsConfigurator;
|
||||
moduleEditor.addChangeListener(configurator);
|
||||
myModuleEditors.add(moduleEditor);
|
||||
myModuleEditors.add(moduleEditor);
|
||||
|
||||
moduleEditor.addChangeListener(this);
|
||||
Disposer.register(moduleEditor, new Disposable() {
|
||||
public void dispose() {
|
||||
moduleEditor.removeChangeListener(ModulesConfigurator.this);
|
||||
moduleEditor.removeChangeListener(configurator);
|
||||
}
|
||||
});
|
||||
return moduleEditor;
|
||||
@@ -318,24 +316,9 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
finally {
|
||||
ModuleStructureConfigurable.getInstance(myProject).getFacetEditorFacade().clearMaps(false);
|
||||
|
||||
for (final ModuleEditor moduleEditor : myModuleEditors) {
|
||||
moduleEditor.removeChangeListener(myFacetsConfigurator);
|
||||
}
|
||||
|
||||
myFacetsConfigurator = createFacetsConfigurator();
|
||||
myModuleModel = ModuleManager.getInstance(myProject).getModifiableModel();
|
||||
myModuleModelCommitted = false;
|
||||
|
||||
final ProjectFacetsConfigurator configurator = myFacetsConfigurator;
|
||||
|
||||
for (final ModuleEditor moduleEditor : myModuleEditors) {
|
||||
moduleEditor.addChangeListener(configurator);
|
||||
Disposer.register(moduleEditor, new Disposable() {
|
||||
public void dispose() {
|
||||
moduleEditor.removeChangeListener(configurator);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
|
||||
myFacetStructureConfigurable = facetStructureConfigurable;
|
||||
myArtifactsStructureConfigurable = artifactsStructureConfigurable;
|
||||
|
||||
myModuleConfigurator = new ModulesConfigurator(myProject, myProjectJdksModel);
|
||||
myModuleConfigurator = new ModulesConfigurator(myProject);
|
||||
myContext = new StructureConfigurableContext(myProject, myModuleConfigurator);
|
||||
myModuleConfigurator.setContext(myContext);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user