fixed after IDEA-CR-5228

This commit is contained in:
liana.bakradze
2015-10-02 11:57:38 +03:00
parent c3fe8824ba
commit 81da8e42e3
2 changed files with 15 additions and 8 deletions
@@ -50,14 +50,14 @@ public class PyContentEntriesEditor extends CommonContentEntriesEditor {
private final Module myModule;
private Disposable myFilePointersDisposable;
private MyContentEntryEditor myContentEntryEditor;
private FacetErrorPanel myErrorPanel;
private FacetErrorPanel myWarningPanel;
public PyContentEntriesEditor(Module module, ModuleConfigurationState moduleConfigurationState,
JpsModuleSourceRootType<?>... rootTypes) {
super(module.getName(), moduleConfigurationState, rootTypes);
myRootTypeProviders = Extensions.getExtensions(PyRootTypeProvider.EP_NAME);
myModule = module;
myErrorPanel = new FacetErrorPanel();
myWarningPanel = new FacetErrorPanel();
reset();
}
@@ -105,6 +105,10 @@ public class PyContentEntriesEditor extends CommonContentEntriesEditor {
if (myFilePointersDisposable != null) {
Disposer.dispose(myFilePointersDisposable);
}
for (PyRootTypeProvider provider : myRootTypeProviders) {
provider.disposeUIResources(myModule);
}
}
@Override
@@ -292,10 +296,10 @@ public class PyContentEntriesEditor extends CommonContentEntriesEditor {
@Override
protected void addAdditionalSettingsToPanel(JPanel mainPanel) {
mainPanel.add(myErrorPanel.getComponent(), BorderLayout.SOUTH);
mainPanel.add(myWarningPanel.getComponent(), BorderLayout.SOUTH);
}
public FacetErrorPanel getErrorPanel() {
return myErrorPanel;
public FacetErrorPanel getWarningPanel() {
return myWarningPanel;
}
}
@@ -48,7 +48,7 @@ public abstract class PyRootTypeProvider {
}
};
public abstract void reset(@NotNull final Disposable disposable, PyContentEntriesEditor editor, Module module);
public abstract void reset(@NotNull final Disposable disposable, PyContentEntriesEditor editor, @NotNull Module module);
public abstract void apply(Module module);
@@ -76,6 +76,9 @@ public abstract class PyRootTypeProvider {
return null;
}
public void disposeUIResources(@NotNull Module module) {
}
protected class RootEntryEditingAction extends ContentEntryEditingAction {
private final Disposable myDisposable;
@@ -123,12 +126,12 @@ public abstract class PyRootTypeProvider {
private void addRoot(VirtualFilePointer root, PyContentEntriesEditor editor) {
editor.getContentEntryEditor().addRoot(this, root);
editor.getErrorPanel().getValidatorsManager().validate();
editor.getWarningPanel().getValidatorsManager().validate();
}
protected void removeRoot(VirtualFile selectedFile, PyContentEntriesEditor editor, ModifiableRootModel model) {
editor.getContentEntryEditor().removeRoot(null, selectedFile.getUrl(), this);
editor.getErrorPanel().getValidatorsManager().validate();
editor.getWarningPanel().getValidatorsManager().validate();
}
protected boolean hasRoot(VirtualFile file, PyContentEntriesEditor editor) {