mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-22 11:29:28 +07:00
- allow to create content entries editor with borders and enable border in configurables - remove redundant borders around splitter - move delete icons to 3px right - replace Insets with JBUI.insets
42 lines
1.9 KiB
Java
42 lines
1.9 KiB
Java
/*
|
|
* Copyright 2000-2016 JetBrains s.r.o.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
package com.jetbrains.python.module;
|
|
|
|
import com.intellij.openapi.module.Module;
|
|
import com.intellij.openapi.module.ModuleConfigurationEditor;
|
|
import com.intellij.openapi.module.ModuleType;
|
|
import com.intellij.openapi.roots.ui.configuration.DefaultModuleConfigurationEditorFactory;
|
|
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationEditorProvider;
|
|
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationState;
|
|
import org.jetbrains.jps.model.java.JavaSourceRootType;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author yole
|
|
*/
|
|
public class PythonModuleConfigurationEditorProvider implements ModuleConfigurationEditorProvider {
|
|
public ModuleConfigurationEditor[] createEditors(final ModuleConfigurationState state) {
|
|
final Module module = state.getRootModel().getModule();
|
|
if (!(ModuleType.get(module) instanceof PythonModuleType)) return ModuleConfigurationEditor.EMPTY;
|
|
final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
|
|
final List<ModuleConfigurationEditor> editors = new ArrayList<>();
|
|
editors.add(new PyContentEntriesEditor(module, state, false, JavaSourceRootType.SOURCE));
|
|
editors.add(editorFactory.createClasspathEditor(state));
|
|
return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
|
|
}
|
|
} |