use of com.intellij.openapi.module.ModuleConfigurationEditor in project android by JetBrains.
the class AndroidModuleEditor method getPanel.
@NotNull
public JComponent getPanel() {
Module module = GradleUtil.findModuleByGradlePath(myProject, myName);
if (module == null || GradleUtil.getGradleBuildFile(module) == null) {
return new JPanel();
}
final NamedObjectPanel.PanelGroup panelGroup = new NamedObjectPanel.PanelGroup();
if (myGenericSettingsPanel == null) {
myEditors.clear();
if (AndroidPluginGeneration.find(module) == COMPONENT) {
myEditors.add(new GenericEditor<>("Information", DslNotSupportedPanel::new));
} else {
AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null && facet.requiresAndroidModel() && isBuildWithGradle(module)) {
myEditors.add(new GenericEditor<>("Properties", () -> {
SingleObjectPanel panel = new SingleObjectPanel(myProject, myName, null, BUILD_FILE_GENERIC_PROPERTIES);
panel.init();
return panel;
}));
myEditors.add(new GenericEditor<>(SIGNING_TAB_TITLE, () -> {
NamedObjectPanel panel = new NamedObjectPanel(myProject, myName, BuildFileKey.SIGNING_CONFIGS, "config", panelGroup);
panel.init();
return panel;
}));
myEditors.add(new GenericEditor<>(FLAVORS_TAB_TITLE, () -> {
NamedObjectPanel panel = new NamedObjectPanel(myProject, myName, BuildFileKey.FLAVORS, "flavor", panelGroup);
panel.init();
return panel;
}));
myEditors.add(new GenericEditor<>(BUILD_TYPES_TAB_TITLE, () -> {
NamedObjectPanel panel = new NamedObjectPanel(myProject, myName, BuildFileKey.BUILD_TYPES, "buildType", panelGroup);
panel.init();
return panel;
}));
}
}
myEditors.add(new GenericEditor<>(ProjectBundle.message("modules.classpath.title"), () -> new ModuleDependenciesPanel(myProject, myName)));
myTabbedPane = new JBTabbedPane(TOP);
for (ModuleConfigurationEditor editor : myEditors) {
JComponent component = editor.createComponent();
if (component != null) {
myTabbedPane.addTab(editor.getDisplayName(), component);
editor.reset();
}
}
myTabbedPane.addChangeListener(e -> {
String tabName = myEditors.get(myTabbedPane.getSelectedIndex()).getDisplayName();
String appId = getApplicationId(myProject);
if (appId != null) {
UsageTracker.getInstance().log(AndroidStudioEvent.newBuilder().setCategory(AndroidStudioEvent.EventCategory.PROJECT_STRUCTURE_DIALOG).setKind(AndroidStudioEvent.EventKind.PROJECT_STRUCTURE_DIALOG_TOP_TAB_CLICK).setProjectId(AndroidStudioUsageTracker.anonymizeUtf8(appId)));
}
});
myGenericSettingsPanel = myTabbedPane;
}
return myGenericSettingsPanel;
}
use of com.intellij.openapi.module.ModuleConfigurationEditor in project Intellij-Plugin by getgauge.
the class GaugeModuleConfigurationProvider method createEditors.
@Override
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
final Module module = state.getRootModel().getModule();
final ModuleType moduleType = ModuleType.get(module);
if (!(moduleType instanceof GaugeModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}
final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
List<ModuleConfigurationEditor> editors = new ArrayList<>();
editors.add(editorFactory.createModuleContentRootsEditor(state));
editors.add(editorFactory.createOutputEditor(state));
editors.add(editorFactory.createClasspathEditor(state));
return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
use of com.intellij.openapi.module.ModuleConfigurationEditor in project intellij-community by JetBrains.
the class TabbedModuleEditor method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
myTabbedPane = new TabbedPaneWrapper(this);
for (ModuleConfigurationEditor editor : myEditors) {
myTabbedPane.addTab(editor.getDisplayName(), editor.createComponent());
editor.reset();
}
restoreSelectedEditor();
myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
saveSelectedEditor();
if (myHistory != null) {
myHistory.pushQueryPlace();
}
}
});
return myTabbedPane.getComponent();
}
use of com.intellij.openapi.module.ModuleConfigurationEditor in project intellij-community by JetBrains.
the class DefaultModuleEditorsProvider method createEditors.
@Override
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
ModifiableRootModel rootModel = state.getRootModel();
Module module = rootModel.getModule();
if (!(ModuleType.get(module) instanceof JavaModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}
String moduleName = module.getName();
List<ModuleConfigurationEditor> editors = new ArrayList<>();
editors.add(new ContentEntriesEditor(moduleName, state));
editors.add(new OutputEditor(state));
editors.add(new ClasspathEditor(state));
return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
use of com.intellij.openapi.module.ModuleConfigurationEditor in project intellij-community by JetBrains.
the class HeaderHidingTabbedModuleEditor method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
ModuleConfigurationEditor singleEditor = getSingleEditor();
if (singleEditor != null) {
final JComponent component = singleEditor.createComponent();
singleEditor.reset();
return component;
} else {
return super.createCenterPanel();
}
}
Aggregations