mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-13275 Mark directory as template works differently in Project tool window and Project structure
This commit is contained in:
@@ -25,7 +25,6 @@ import com.jetbrains.python.packaging.PyPackageManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -114,5 +113,8 @@ public abstract class TemplatesService {
|
||||
public abstract void generateTemplates(@NotNull final TemplateSettingsHolder settings, VirtualFile baseDir);
|
||||
public abstract void installTemplateEngine(@NotNull final TemplateSettingsHolder settings, @NotNull final PyPackageManager packageManager,
|
||||
@NotNull final Project project, @NotNull final String prefix);
|
||||
|
||||
public abstract void addLanguageSelectedListener(Runnable listener);
|
||||
public abstract void removeLanguageSelectedListener(Runnable listener);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.jetbrains.python.module;
|
||||
|
||||
import com.intellij.facet.impl.ui.FacetErrorPanel;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
@@ -49,12 +50,14 @@ public class PyContentEntriesEditor extends CommonContentEntriesEditor {
|
||||
private final Module myModule;
|
||||
private Disposable myFilePointersDisposable;
|
||||
private MyContentEntryEditor myContentEntryEditor;
|
||||
private FacetErrorPanel myErrorPanel;
|
||||
|
||||
public PyContentEntriesEditor(Module module, ModuleConfigurationState moduleConfigurationState,
|
||||
JpsModuleSourceRootType<?>... rootTypes) {
|
||||
super(module.getName(), moduleConfigurationState, rootTypes);
|
||||
myRootTypeProviders = Extensions.getExtensions(PyRootTypeProvider.EP_NAME);
|
||||
myModule = module;
|
||||
myErrorPanel = new FacetErrorPanel();
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -286,4 +289,13 @@ public class PyContentEntriesEditor extends CommonContentEntriesEditor {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addAdditionalSettingsToPanel(JPanel mainPanel) {
|
||||
mainPanel.add(myErrorPanel.getComponent(), BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
public FacetErrorPanel getErrorPanel() {
|
||||
return myErrorPanel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,10 +123,12 @@ public abstract class PyRootTypeProvider {
|
||||
|
||||
private void addRoot(VirtualFilePointer root, PyContentEntriesEditor editor) {
|
||||
editor.getContentEntryEditor().addRoot(this, root);
|
||||
editor.getErrorPanel().getValidatorsManager().validate();
|
||||
}
|
||||
|
||||
protected void removeRoot(VirtualFile selectedFile, PyContentEntriesEditor editor, ModifiableRootModel model) {
|
||||
editor.getContentEntryEditor().removeRoot(null, selectedFile.getUrl(), this);
|
||||
editor.getErrorPanel().getValidatorsManager().validate();
|
||||
}
|
||||
|
||||
protected boolean hasRoot(VirtualFile file, PyContentEntriesEditor editor) {
|
||||
|
||||
Reference in New Issue
Block a user