mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added extension for communication between different framework support providers
This commit is contained in:
+6
-1
@@ -26,6 +26,7 @@ import com.intellij.facet.ui.libraries.RemoteRepositoryInfo;
|
||||
import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable;
|
||||
import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurableListener;
|
||||
import com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider;
|
||||
import com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportCommunicator;
|
||||
import com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportModelImpl;
|
||||
import com.intellij.ide.util.projectWizard.ModuleBuilder;
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -341,9 +342,10 @@ public class AddSupportForFrameworksPanel implements Disposable {
|
||||
List<Library> addedLibraries = new ArrayList<Library>();
|
||||
List<FrameworkSupportNode> selectedFrameworks = getFrameworkNodes(true);
|
||||
sortFrameworks(selectedFrameworks);
|
||||
|
||||
List<FrameworkSupportConfigurable> selectedConfigurables = new ArrayList<FrameworkSupportConfigurable>();
|
||||
for (FrameworkSupportNode node : selectedFrameworks) {
|
||||
FrameworkSupportConfigurable configurable = node.getConfigurable();
|
||||
selectedConfigurables.add(configurable);
|
||||
final LibraryCompositionSettings settings = node.getLibraryCompositionSettings();
|
||||
Library library = settings != null ? settings.addLibraries(rootModel, addedLibraries) : null;
|
||||
configurable.addSupport(module, rootModel, library);
|
||||
@@ -354,6 +356,9 @@ public class AddSupportForFrameworksPanel implements Disposable {
|
||||
((FacetBasedFrameworkSupportProvider)provider).processAddedLibraries(module, addedLibraries);
|
||||
}
|
||||
}
|
||||
for (FrameworkSupportCommunicator communicator : FrameworkSupportCommunicator.EP_NAME.getExtensions()) {
|
||||
communicator.onFrameworkSupportAdded(module, rootModel, selectedConfigurables, myModel);
|
||||
}
|
||||
}
|
||||
|
||||
private void sortFrameworks(final List<FrameworkSupportNode> nodes) {
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2000-2010 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.intellij.ide.util.newProjectWizard.impl;
|
||||
|
||||
import com.intellij.ide.util.frameworkSupport.FrameworkSupportConfigurable;
|
||||
import com.intellij.ide.util.frameworkSupport.FrameworkSupportModel;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class FrameworkSupportCommunicator {
|
||||
public static final ExtensionPointName<FrameworkSupportCommunicator> EP_NAME = ExtensionPointName.create("com.intellij.frameworkSupportCommunicator");
|
||||
|
||||
public abstract void onFrameworkSupportAdded(Module module, ModifiableRootModel rootModel,
|
||||
List<FrameworkSupportConfigurable> selectedFrameworks,
|
||||
FrameworkSupportModel model);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public abstract class FacetBasedFrameworkSupportProvider<F extends Facet> extend
|
||||
myFacetType = facetType;
|
||||
}
|
||||
|
||||
protected static String getProviderId(final FacetType facetType) {
|
||||
public static String getProviderId(final FacetType facetType) {
|
||||
return FACET_SUPPORT_PREFIX + facetType.getStringId();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
interface="com.intellij.codeInsight.generation.surroundWith.JavaExpressionSurrounder"/>
|
||||
|
||||
<extensionPoint name="frameworkSupport" interface="com.intellij.ide.util.frameworkSupport.FrameworkSupportProvider"/>
|
||||
<extensionPoint name="frameworkSupportCommunicator" interface="com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportCommunicator"/>
|
||||
|
||||
<!--new project wizard-->
|
||||
<extensionPoint name="wizardMode" interface="com.intellij.ide.util.newProjectWizard.modes.WizardMode"/>
|
||||
|
||||
Reference in New Issue
Block a user