use of com.intellij.facet.ui.FacetEditor in project intellij-community by JetBrains.
the class MultipleFacetEditorHelperImpl method bind.
@Override
public void bind(@NotNull JComboBox common, @NotNull FacetEditor[] editors, @NotNull NotNullFunction<FacetEditor, JComboBox> fun) {
List<JComboBox> componentsList = new ArrayList<>();
for (FacetEditor editor : editors) {
componentsList.add(fun.fun(editor));
}
CombobBoxBinding binding = new CombobBoxBinding(common, componentsList);
myBindings.add(binding);
}
use of com.intellij.facet.ui.FacetEditor in project intellij-community by JetBrains.
the class MultipleFacetEditorHelperImpl method bind.
@Override
public void bind(@NotNull JTextField common, @NotNull FacetEditor[] editors, @NotNull NotNullFunction<FacetEditor, JTextField> fun) {
List<JTextField> componentsList = new ArrayList<>();
for (FacetEditor editor : editors) {
componentsList.add(fun.fun(editor));
}
TextFieldBinding binding = new TextFieldBinding(common, componentsList);
myBindings.add(binding);
}
use of com.intellij.facet.ui.FacetEditor in project intellij-community by JetBrains.
the class MultipleFacetEditorHelperImpl method bind.
@Override
public void bind(@NotNull ThreeStateCheckBox common, @NotNull FacetEditor[] editors, @NotNull NotNullFunction<FacetEditor, JCheckBox> fun) {
List<JCheckBox> checkBoxesList = new ArrayList<>();
for (FacetEditor editor : editors) {
checkBoxesList.add(fun.fun(editor));
}
CheckBoxBinding checkBoxBinding = new CheckBoxBinding(common, checkBoxesList);
myBindings.add(checkBoxBinding);
}
use of com.intellij.facet.ui.FacetEditor in project intellij-community by JetBrains.
the class FacetStructureConfigurable method updateMultiSelection.
public boolean updateMultiSelection(final List<NamedConfigurable> selectedConfigurables, final DetailsComponent detailsComponent) {
FacetType selectedFacetType = null;
List<FacetEditor> facetEditors = new ArrayList<>();
for (NamedConfigurable selectedConfigurable : selectedConfigurables) {
if (selectedConfigurable instanceof FacetConfigurable) {
FacetConfigurable facetConfigurable = (FacetConfigurable) selectedConfigurable;
FacetType facetType = facetConfigurable.getEditableObject().getType();
if (selectedFacetType != null && selectedFacetType != facetType) {
return false;
}
selectedFacetType = facetType;
facetEditors.add(facetConfigurable.getEditor());
}
}
if (facetEditors.size() <= 1 || selectedFacetType == null) {
return false;
}
FacetEditor[] selectedEditors = facetEditors.toArray(new FacetEditor[facetEditors.size()]);
MultipleFacetSettingsEditor editor = selectedFacetType.createMultipleConfigurationsEditor(myProject, selectedEditors);
if (editor == null) {
return false;
}
setSelectedNode(null);
myCurrentMultipleSettingsEditor = editor;
detailsComponent.setText(ProjectBundle.message("multiple.facets.banner.0.1.facets", selectedEditors.length, selectedFacetType.getPresentableName()));
detailsComponent.setContent(editor.createComponent());
return true;
}
use of com.intellij.facet.ui.FacetEditor in project intellij-community by JetBrains.
the class FacetTypeEditor method createAllFacetsEditor.
@Nullable
private MultipleFacetSettingsEditor createAllFacetsEditor() {
ProjectFacetsConfigurator facetsConfigurator = myContext.myModulesConfigurator.getFacetsConfigurator();
List<Facet> facets = new ArrayList<>();
for (Module module : myContext.getModules()) {
facets.addAll(facetsConfigurator.getFacetsByType(module, myFacetType.getId()));
}
if (!facets.isEmpty()) {
final FacetEditor[] editors = new FacetEditor[facets.size()];
for (int i = 0; i < facets.size(); i++) {
editors[i] = facetsConfigurator.getOrCreateEditor(facets.get(i));
}
return myFacetType.createMultipleConfigurationsEditor(myProject, editors);
}
return null;
}
Aggregations