mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[NPW] cleanup: removed platform code for the old new project wizard
The new version of the new project wizard has been stable for more than a year. Anymore, we don't need fallback to old one. GitOrigin-RevId: ac90eef05671f96d4c13f823fd9e8bc671efa184
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ed08f7311e
commit
d9ae234063
@@ -12,7 +12,6 @@ import com.intellij.ide.projectWizard.NewProjectWizardCollector
|
||||
import com.intellij.ide.util.newProjectWizard.AbstractProjectWizard
|
||||
import com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogger
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.Experiments
|
||||
import com.intellij.openapi.application.ModalityState
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
import com.intellij.openapi.components.StorageScheme
|
||||
@@ -61,20 +60,14 @@ object NewProjectUtil {
|
||||
val proceed = ProgressManager.getInstance().runProcessWithProgressSynchronously(warmUp, title, true, null)
|
||||
var time = 0L
|
||||
val context = wizard.wizardContext
|
||||
if (isNewWizard) {
|
||||
time = System.nanoTime()
|
||||
NewProjectWizardCollector.logOpen(context)
|
||||
}
|
||||
time = System.nanoTime()
|
||||
NewProjectWizardCollector.logOpen(context)
|
||||
if (proceed && wizard.showAndGet()) {
|
||||
createFromWizard(wizard)
|
||||
if (isNewWizard) {
|
||||
NewProjectWizardCollector.logFinish(context, true, TimeoutUtil.getDurationMillis(time))
|
||||
}
|
||||
NewProjectWizardCollector.logFinish(context, true, TimeoutUtil.getDurationMillis(time))
|
||||
return
|
||||
}
|
||||
if (isNewWizard) {
|
||||
NewProjectWizardCollector.logFinish(context, false, TimeoutUtil.getDurationMillis(time))
|
||||
}
|
||||
NewProjectWizardCollector.logFinish(context, false, TimeoutUtil.getDurationMillis(time))
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
@@ -84,9 +77,7 @@ object NewProjectUtil {
|
||||
val newProject = doCreate(wizard, projectToClose)
|
||||
@Suppress("DEPRECATION", "removal")
|
||||
FUCounterUsageLogger.getInstance().logEvent(newProject, "new.project.wizard", "project.created")
|
||||
if (isNewWizard) {
|
||||
NewProjectWizardCollector.logProjectCreated(newProject, wizard.wizardContext)
|
||||
}
|
||||
NewProjectWizardCollector.logProjectCreated(newProject, wizard.wizardContext)
|
||||
newProject
|
||||
}
|
||||
catch (e: IOException) {
|
||||
@@ -230,7 +221,4 @@ object NewProjectUtil {
|
||||
fun applyJdkToProject(project: Project, jdk: Sdk) {
|
||||
JavaSdkUtil.applyJdkToProject(project, jdk)
|
||||
}
|
||||
|
||||
private val isNewWizard: Boolean
|
||||
get() = Experiments.getInstance().isFeatureEnabled("new.project.wizard")
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import com.intellij.openapi.actionSystem.AnActionResult;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.actionSystem.ex.AnActionListener;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Experiments;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.module.GeneralModuleType;
|
||||
import com.intellij.openapi.module.ModifiableModuleModel;
|
||||
@@ -60,7 +59,7 @@ public final class GeneralModuleTypeForIdea extends GeneralModuleType {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return !isNewWizard();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,10 +123,6 @@ public final class GeneralModuleTypeForIdea extends GeneralModuleType {
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean isNewWizard() {
|
||||
return Experiments.getInstance().isFeatureEnabled("new.project.wizard");
|
||||
}
|
||||
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence)
|
||||
@Override
|
||||
public @NotNull String getDescription() {
|
||||
|
||||
@@ -4,7 +4,6 @@ package com.intellij.ide.projectWizard;
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
import com.intellij.ide.util.newProjectWizard.SelectTemplateSettings;
|
||||
import com.intellij.ide.util.projectWizard.*;
|
||||
import com.intellij.openapi.application.Experiments;
|
||||
import com.intellij.openapi.components.StorageScheme;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
@@ -75,10 +74,6 @@ public class ProjectSettingsStep extends ModuleWizardStep implements SettingsSte
|
||||
return myExpertPlaceholder;
|
||||
}
|
||||
|
||||
private static boolean isNewWizard() {
|
||||
return Experiments.getInstance().isFeatureEnabled("new.project.wizard");
|
||||
}
|
||||
|
||||
private JPanel getModulePanel() {
|
||||
return myModuleNameLocationComponent.getModulePanel();
|
||||
}
|
||||
@@ -109,9 +104,7 @@ public class ProjectSettingsStep extends ModuleWizardStep implements SettingsSte
|
||||
}
|
||||
mySettingsPanel.revalidate();
|
||||
mySettingsPanel.repaint();
|
||||
if (isNewWizard()) {
|
||||
myPanel.setBorder(JBUI.Borders.empty(10));
|
||||
}
|
||||
myPanel.setBorder(JBUI.Borders.empty(10));
|
||||
}
|
||||
|
||||
private static void restorePanel(JPanel component, int i) {
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogg
|
||||
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Experiments;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.module.Module;
|
||||
@@ -131,7 +130,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
|
||||
myWizard = wizard;
|
||||
|
||||
myTemplatesMap = isNewWizard() ? MultiMap.createLinked() : MultiMap.createConcurrent();
|
||||
myTemplatesMap = MultiMap.createLinked();
|
||||
final List<TemplatesGroup> groups = fillTemplatesMap(context);
|
||||
LOG.debug("groups=" + groups);
|
||||
|
||||
@@ -140,42 +139,38 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
myProjectTypeList.setSelectionModel(new SingleSelectionModel());
|
||||
myProjectTypeList.setCellRenderer(new ProjectTypeListRenderer(groups));
|
||||
|
||||
if (isNewWizard()) {
|
||||
GridLayoutManager layout = (GridLayoutManager)myPanel.getLayout();
|
||||
layout.setHGap(0);
|
||||
myPanel.setLayout(layout);
|
||||
GridLayoutManager layout = (GridLayoutManager)myPanel.getLayout();
|
||||
layout.setHGap(0);
|
||||
myPanel.setLayout(layout);
|
||||
|
||||
myProjectTypePanel.setMinimumSize(new Dimension(240, 100));
|
||||
myProjectTypePanel.setMinimumSize(new Dimension(240, 100));
|
||||
|
||||
JBSplitter splitter = new OnePixelSplitter(false, 0.25f);
|
||||
splitter.setHonorComponentsMinimumSize(true);
|
||||
splitter.setFirstComponent(myProjectTypePanel);
|
||||
splitter.setSecondComponent(mySettingsPanel);
|
||||
JBSplitter splitter = new OnePixelSplitter(false, 0.25f);
|
||||
splitter.setHonorComponentsMinimumSize(true);
|
||||
splitter.setFirstComponent(myProjectTypePanel);
|
||||
splitter.setSecondComponent(mySettingsPanel);
|
||||
|
||||
myPanel.removeAll();
|
||||
myPanel.add(splitter, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH,
|
||||
GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
null, null, null));
|
||||
myPanel.removeAll();
|
||||
myPanel.add(splitter, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH,
|
||||
GridConstraints.FILL_BOTH,
|
||||
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
|
||||
GridConstraints.SIZEPOLICY_WANT_GROW,
|
||||
null, null, null));
|
||||
|
||||
String emptyCard = "emptyCard";
|
||||
ProjectTypeListWithSearch<TemplatesGroup> listWithFilter = new ProjectTypeListWithSearch<>(
|
||||
myContext, myProjectTypeList, new JBScrollPane(myProjectTypeList), getNamer(), () -> {
|
||||
showCard(emptyCard);
|
||||
wizard.updateButtons(true, false, true);
|
||||
});
|
||||
String emptyCard = "emptyCard";
|
||||
ProjectTypeListWithSearch<TemplatesGroup> listWithFilter = new ProjectTypeListWithSearch<>(
|
||||
myContext, myProjectTypeList, new JBScrollPane(myProjectTypeList), getNamer(), () -> {
|
||||
showCard(emptyCard);
|
||||
wizard.updateButtons(true, false, true);
|
||||
});
|
||||
|
||||
myProjectTypePanel.add(listWithFilter);
|
||||
myProjectTypePanel.add(listWithFilter);
|
||||
|
||||
myOptionsPanel.add(new JBPanelWithEmptyText().withEmptyText(JavaUiBundle.message("label.select.project.type.to.configure")), emptyCard);
|
||||
myOptionsPanel.add(new JBPanelWithEmptyText().withEmptyText(JavaUiBundle.message("label.select.project.type.to.configure")), emptyCard);
|
||||
|
||||
Border border = JBUI.Borders.customLine(JBColor.border(), 1, 0, 1, 0);
|
||||
listWithFilter.setBorder(border);
|
||||
mySettingsPanel.setBorder(border);
|
||||
} else {
|
||||
myProjectTypePanel.add(BorderLayout.CENTER, new JBScrollPane(myProjectTypeList));
|
||||
}
|
||||
Border border = JBUI.Borders.customLine(JBColor.border(), 1, 0, 1, 0);
|
||||
listWithFilter.setBorder(border);
|
||||
mySettingsPanel.setBorder(border);
|
||||
|
||||
myModulesProvider = modulesProvider;
|
||||
Project project = context.getProject();
|
||||
@@ -293,7 +288,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
for (ProjectTemplatesFactory factory : factories) {
|
||||
for (String group : factory.getGroups()) {
|
||||
//don't add "User-defined" node for new project wizard
|
||||
if (isNewWizard() && factory instanceof ArchivedTemplatesFactory) {
|
||||
if (factory instanceof ArchivedTemplatesFactory) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -317,11 +312,6 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
|
||||
private @NotNull List<TemplatesGroup> fillTemplatesMap(@NotNull WizardContext context) {
|
||||
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
|
||||
if (context.isCreatingNewProject()) {
|
||||
if (!isNewWizard()) {
|
||||
builders.add(new EmptyModuleBuilder());
|
||||
}
|
||||
}
|
||||
|
||||
//add them later for new wizard, after sorting
|
||||
builders.removeIf(
|
||||
@@ -415,30 +405,24 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewWizard()) {
|
||||
var newWizardGroups = new ArrayList<TemplatesGroup>();
|
||||
var newWizardUserGroups = new ArrayList<TemplatesGroup>();
|
||||
if (context.isCreatingNewProject()) {
|
||||
newWizardGroups.add(new TemplatesGroup(new NewProjectBuilder()));
|
||||
newWizardGroups.add(new TemplatesGroup(new NewEmptyProjectBuilder()));
|
||||
newWizardUserGroups.addAll(getUserTemplatesMap(context));
|
||||
}
|
||||
else {
|
||||
newWizardGroups.add(new TemplatesGroup(new NewModuleBuilder()));
|
||||
}
|
||||
groups.addAll(0, newWizardGroups);
|
||||
groups.addAll(newWizardUserGroups);
|
||||
newWizardGroups.forEach(it -> myTemplatesMap.put(it, new ArrayList<>()));
|
||||
newWizardUserGroups.forEach(it -> myTemplatesMap.put(it, new ArrayList<>()));
|
||||
var newWizardGroups = new ArrayList<TemplatesGroup>();
|
||||
var newWizardUserGroups = new ArrayList<TemplatesGroup>();
|
||||
if (context.isCreatingNewProject()) {
|
||||
newWizardGroups.add(new TemplatesGroup(new NewProjectBuilder()));
|
||||
newWizardGroups.add(new TemplatesGroup(new NewEmptyProjectBuilder()));
|
||||
newWizardUserGroups.addAll(getUserTemplatesMap(context));
|
||||
}
|
||||
else {
|
||||
newWizardGroups.add(new TemplatesGroup(new NewModuleBuilder()));
|
||||
}
|
||||
groups.addAll(0, newWizardGroups);
|
||||
groups.addAll(newWizardUserGroups);
|
||||
newWizardGroups.forEach(it -> myTemplatesMap.put(it, new ArrayList<>()));
|
||||
newWizardUserGroups.forEach(it -> myTemplatesMap.put(it, new ArrayList<>()));
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
private static boolean isNewWizard() {
|
||||
return Experiments.getInstance().isFeatureEnabled("new.project.wizard");
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@Nullable
|
||||
ModuleWizardStep getSettingsStep() {
|
||||
@@ -448,7 +432,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
// new TemplatesGroup selected
|
||||
private void projectTypeChanged() {
|
||||
TemplatesGroup group = getSelectedGroup();
|
||||
if (group == null || !isNewWizard() && group == myLastSelectedGroup) {
|
||||
if (group == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -465,7 +449,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
mySettingsStep = groupModuleBuilder.modifyProjectTypeStep(this);
|
||||
}
|
||||
|
||||
if (groupModuleBuilder == null || (!isNewWizard() && groupModuleBuilder.isTemplateBased())) {
|
||||
if (groupModuleBuilder == null) {
|
||||
showTemplates(group);
|
||||
}
|
||||
else if (!showCustomOptions(groupModuleBuilder)){
|
||||
@@ -546,7 +530,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
ModuleWizardStep step = myCustomSteps.get(card);
|
||||
if (step == null) {
|
||||
step = builder.getCustomOptionsStep(myContext, this);
|
||||
if (isNewWizard() && builder instanceof TemplateModuleBuilder) {
|
||||
if (builder instanceof TemplateModuleBuilder) {
|
||||
step = new ProjectSettingsStep(myContext);
|
||||
myContext.setProjectBuilder(builder);
|
||||
NewProjectWizardCollector.logCustomTemplateSelected(myContext);
|
||||
@@ -558,7 +542,7 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
step.updateStep();
|
||||
|
||||
JComponent component = step.getComponent();
|
||||
if (isNewWizard() && !(builder instanceof PromoModuleBuilder)) {
|
||||
if (!(builder instanceof PromoModuleBuilder)) {
|
||||
component = new JBScrollPane(component);
|
||||
component.setBorder(JBUI.Borders.empty());
|
||||
}
|
||||
@@ -908,11 +892,9 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
|
||||
@Override
|
||||
public String getCaptionAboveOf(TemplatesGroup value) {
|
||||
return isNewWizard()
|
||||
? value.getModuleBuilder() instanceof TemplateModuleBuilder
|
||||
? UIBundle.message("list.caption.group.templates")
|
||||
: UIBundle.message("list.caption.group.generators")
|
||||
: super.getCaptionAboveOf(value);
|
||||
return value.getModuleBuilder() instanceof TemplateModuleBuilder
|
||||
? UIBundle.message("list.caption.group.templates")
|
||||
: UIBundle.message("list.caption.group.generators");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -920,18 +902,12 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
int index = groups.indexOf(value);
|
||||
if (index < 1) return false;
|
||||
TemplatesGroup upper = groups.get(index - 1);
|
||||
if (isNewWizard()) {
|
||||
if (value.getModuleBuilder() instanceof TemplateModuleBuilder && !(upper.getModuleBuilder() instanceof TemplateModuleBuilder)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ModuleBuilder builder = upper.getModuleBuilder();
|
||||
return builder instanceof NewEmptyProjectBuilder || builder instanceof NewModuleBuilder;
|
||||
if (value.getModuleBuilder() instanceof TemplateModuleBuilder && !(upper.getModuleBuilder() instanceof TemplateModuleBuilder)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (upper.getParentGroup() == null && value.getParentGroup() == null) return true;
|
||||
return !Objects.equals(upper.getParentGroup(), value.getParentGroup()) &&
|
||||
!Objects.equals(upper.getName(), value.getParentGroup());
|
||||
ModuleBuilder builder = upper.getModuleBuilder();
|
||||
return builder instanceof NewEmptyProjectBuilder || builder instanceof NewModuleBuilder;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -950,15 +926,12 @@ public final class ProjectTypeStep extends ModuleWizardStep implements SettingsS
|
||||
@Override
|
||||
protected JComponent createItemComponent() {
|
||||
JComponent component = super.createItemComponent();
|
||||
myTextLabel.setBorder(!isNewWizard() ? JBUI.Borders.empty(3) : JBUI.Borders.empty(5, 0));
|
||||
myTextLabel.setBorder(JBUI.Borders.empty(5, 0));
|
||||
return component;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SeparatorWithText createSeparator() {
|
||||
if (!isNewWizard()) {
|
||||
return super.createSeparator();
|
||||
}
|
||||
SeparatorWithText separator = createSeparatorComponent();
|
||||
separator.setBorder(JBUI.Borders.empty(20, 8, 5, 0));
|
||||
separator.setCaptionCentered(false);
|
||||
|
||||
@@ -244,10 +244,8 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
|
||||
}
|
||||
step.onStepLeaving();
|
||||
super.doNextAction();
|
||||
if (isNewWizard()) {
|
||||
NewProjectWizardCollector.logNext(myWizardContext, -1);
|
||||
myWizardContext.setScreen(2);
|
||||
}
|
||||
myWizardContext.setScreen(2);
|
||||
NewProjectWizardCollector.logNext(myWizardContext, -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,9 +279,7 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
|
||||
((StepWithSubSteps)step).doPreviousAction();
|
||||
}
|
||||
super.doPreviousAction();
|
||||
if (isNewWizard()) {
|
||||
NewProjectWizardCollector.logPrev(myWizardContext, -1);
|
||||
}
|
||||
NewProjectWizardCollector.logPrev(myWizardContext, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,8 +300,7 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
|
||||
}
|
||||
|
||||
private boolean isLastStep(int step) {
|
||||
if (AbstractWizard.isNewWizard()
|
||||
&& mySteps.get(getNextStep(step)) instanceof ProjectSettingsStep
|
||||
if (mySteps.get(getNextStep(step)) instanceof ProjectSettingsStep
|
||||
&& myWizardContext.getProjectBuilder() instanceof TemplateModuleBuilder) {
|
||||
return true;
|
||||
}
|
||||
@@ -367,8 +362,6 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
|
||||
@Override
|
||||
protected void doHelpAction() {
|
||||
super.doHelpAction();
|
||||
if (isNewWizard()) {
|
||||
NewProjectWizardCollector.logHelpNavigation(myWizardContext);
|
||||
}
|
||||
NewProjectWizardCollector.logHelpNavigation(myWizardContext);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.intellij.ide.util.projectWizard.ProjectTemplateParameterFactory
|
||||
import com.intellij.mock.MockProgressIndicator
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.application.Experiments
|
||||
import com.intellij.openapi.components.StorageScheme
|
||||
import com.intellij.openapi.module.BasePackageParameterFactory
|
||||
import com.intellij.openapi.module.Module
|
||||
@@ -20,7 +19,6 @@ import com.intellij.openapi.roots.ModuleRootManager
|
||||
import com.intellij.openapi.roots.ProjectRootManager
|
||||
import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.openapi.vfs.VfsUtilCore
|
||||
import com.intellij.platform.ProjectTemplatesFactory
|
||||
import com.intellij.platform.templates.ArchivedTemplatesFactory
|
||||
import com.intellij.platform.templates.LocalArchivedTemplate
|
||||
import com.intellij.platform.templates.SaveProjectAsTemplateAction
|
||||
@@ -115,16 +113,11 @@ public class Bar {
|
||||
assertThat(zipFile.fileName.toString()).isEqualTo("foo.zip")
|
||||
assertThat(Files.size(zipFile)).isGreaterThan(0)
|
||||
val fromTemplate = withContext(Dispatchers.EDT) {
|
||||
if (Experiments.getInstance().isFeatureEnabled("new.project.wizard")) {
|
||||
createProject { step ->
|
||||
if (step is ProjectTypeStep) {
|
||||
assertTrue(step.setSelectedTemplate("foo", null))
|
||||
}
|
||||
createProject { step ->
|
||||
if (step is ProjectTypeStep) {
|
||||
assertTrue(step.setSelectedTemplate("foo", null))
|
||||
}
|
||||
}
|
||||
else {
|
||||
createProjectFromTemplate(ProjectTemplatesFactory.CUSTOM_GROUP, "foo", null)
|
||||
}
|
||||
}
|
||||
val descriptionFile = SaveProjectAsTemplateAction.getDescriptionFile(fromTemplate, LocalArchivedTemplate.DESCRIPTION_PATH)
|
||||
assertThat(descriptionFile).isNotNull
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.application.ApplicationInfo;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Experiments;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.help.HelpManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -78,7 +77,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
myPreviousButton = new JButton(IdeBundle.message("button.wizard.previous"));
|
||||
myNextButton = new JButton(IdeBundle.message("button.wizard.next"));
|
||||
myCancelButton = new JButton(CommonBundle.getCancelButtonText());
|
||||
myHelpButton = isNewWizard() ? createHelpButton(JBInsets.emptyInsets()) : new JButton(CommonBundle.getHelpButtonText());
|
||||
myHelpButton = createHelpButton(JBInsets.emptyInsets());
|
||||
myContentPanel = new JPanel(new JBCardLayout());
|
||||
|
||||
myIcon = new TallImageComponent(null);
|
||||
@@ -116,10 +115,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
if (getStyle() == DialogStyle.COMPACT) {
|
||||
int inset = isNewWizard() ? 15 : 0;
|
||||
panel.setBorder(isNewWizard()
|
||||
? BorderFactory.createEmptyBorder(4, inset, 4, inset)
|
||||
: BorderFactory.createEmptyBorder(8, inset, 0, inset));
|
||||
panel.setBorder(BorderFactory.createEmptyBorder(4, 15, 4, 15));
|
||||
}
|
||||
|
||||
JPanel buttonPanel = new JPanel();
|
||||
@@ -171,14 +167,10 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
}
|
||||
add(hGroup, vGroup, buttons, myNextButton, myCancelButton);
|
||||
if (helpAvailable) {
|
||||
if (isNewWizard()) {
|
||||
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||
if (ApplicationInfo.contextHelpAvailable()) {
|
||||
leftPanel.add(myHelpButton);
|
||||
panel.add(leftPanel, BorderLayout.WEST);
|
||||
}
|
||||
} else {
|
||||
add(hGroup, vGroup, buttons, myHelpButton);
|
||||
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||
if (ApplicationInfo.contextHelpAvailable()) {
|
||||
leftPanel.add(myHelpButton);
|
||||
panel.add(leftPanel, BorderLayout.WEST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,15 +202,6 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
}
|
||||
);
|
||||
|
||||
if (!isNewWizard()) {
|
||||
myHelpButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
helpAction();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@@ -534,8 +517,8 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
public void updateButtons(boolean lastStep, boolean canGoNext, boolean firstStep) {
|
||||
if (lastStep) {
|
||||
if (mySteps.size() > 1) {
|
||||
myNextButton.setText(UIUtil.removeMnemonic(IdeBundle.message(isNewWizard() ? "button.create" : "button.finish")));
|
||||
myNextButton.setMnemonic(isNewWizard() ? KeyEvent.VK_C : KeyEvent.VK_F);
|
||||
myNextButton.setText(UIUtil.removeMnemonic(IdeBundle.message("button.create")));
|
||||
myNextButton.setMnemonic(KeyEvent.VK_C);
|
||||
}
|
||||
else {
|
||||
myNextButton.setText(IdeBundle.message("button.ok"));
|
||||
@@ -552,13 +535,16 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
}
|
||||
|
||||
myPreviousButton.setEnabled(!firstStep);
|
||||
if (isNewWizard()) {
|
||||
myPreviousButton.setVisible(!firstStep);
|
||||
}
|
||||
myPreviousButton.setVisible(!firstStep);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated new version of new project wizard cannot be disabled
|
||||
*/
|
||||
@SuppressWarnings("unused") // Used externally
|
||||
@Deprecated
|
||||
public static boolean isNewWizard() {
|
||||
return Experiments.getInstance().isFeatureEnabled("new.project.wizard");
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isFirstStep() {
|
||||
|
||||
-2
@@ -2,7 +2,6 @@
|
||||
package com.intellij.ide.wizard
|
||||
|
||||
import com.intellij.ide.util.projectWizard.WizardContext
|
||||
import com.intellij.openapi.application.Experiments
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import javax.swing.Icon
|
||||
|
||||
@@ -17,7 +16,6 @@ abstract class GeneratorNewProjectWizardBuilderAdapter(val wizard: GeneratorNewP
|
||||
override fun getGroupName(): String = wizard.groupName ?: super.getGroupName()
|
||||
override fun getNodeIcon(): Icon = wizard.icon
|
||||
override fun createStep(context: WizardContext): NewProjectWizardStep = wizard.createStep(context)
|
||||
override fun isAvailable(): Boolean = Experiments.getInstance().isFeatureEnabled("new.project.wizard")
|
||||
|
||||
companion object {
|
||||
/**
|
||||
|
||||
@@ -7,11 +7,10 @@ import com.intellij.ide.util.projectWizard.ProjectBuilder
|
||||
import com.intellij.ide.util.projectWizard.WizardContext
|
||||
import com.intellij.ide.wizard.NewProjectWizardChainStep.Companion.nextStep
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.Experiments
|
||||
import com.intellij.openapi.application.invokeAndWaitIfNeeded
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectManager
|
||||
import com.intellij.openapi.startup.StartupManager
|
||||
@@ -122,15 +121,8 @@ private fun isRowLabel(label: JLabel): Boolean {
|
||||
}
|
||||
|
||||
fun DialogPanel.withVisualPadding(topField: Boolean = false): DialogPanel {
|
||||
if (Experiments.getInstance().isFeatureEnabled("new.project.wizard")) {
|
||||
val top = if (topField) 20 else 15
|
||||
border = IdeBorderFactory.createEmptyBorder(JBInsets(top, 20, 20, 20))
|
||||
}
|
||||
else {
|
||||
val top = if (topField) 15 else 5
|
||||
border = IdeBorderFactory.createEmptyBorder(JBInsets(top, 5, 0, 5))
|
||||
}
|
||||
|
||||
val top = if (topField) 20 else 15
|
||||
border = IdeBorderFactory.createEmptyBorder(JBInsets(top, 20, 20, 20))
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static com.intellij.ide.wizard.AbstractWizard.isNewWizard;
|
||||
import static com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager.getProjectsBackground;
|
||||
|
||||
public final class ActionGroupPanelWrapper {
|
||||
@@ -86,7 +85,7 @@ public final class ActionGroupPanelWrapper {
|
||||
@Override
|
||||
protected JComponent createItemComponent() {
|
||||
JComponent component = super.createItemComponent();
|
||||
myTextLabel.setBorder(!isNewWizard() ? JBUI.Borders.empty(3) : JBUI.Borders.empty(5, 0));
|
||||
myTextLabel.setBorder(JBUI.Borders.empty(5, 0));
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package com.intellij.ui.wizard;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.application.Experiments;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -52,7 +51,7 @@ public abstract class WizardAction extends AbstractAction {
|
||||
public static final class Finish extends WizardAction {
|
||||
|
||||
public Finish(WizardModel model) {
|
||||
super(IdeBundle.message(Experiments.getInstance().isFeatureEnabled("new.project.wizard") ? "button.create" : "button.finish"), model);
|
||||
super(IdeBundle.message("button.create"), model);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1255,10 +1255,6 @@
|
||||
<description>Use mixed list of results on All tab in Search Everywhere (instead of Files/Classes/Actions groups)</description>
|
||||
</experimentalFeature>
|
||||
|
||||
<experimentalFeature id="new.project.wizard" percentOfUsers="100">
|
||||
<description>New project wizard</description>
|
||||
</experimentalFeature>
|
||||
|
||||
<applicationService serviceInterface="com.intellij.ide.ui.ToolbarSettings"
|
||||
serviceImplementation="com.intellij.ide.ui.experimental.toolbar.ExperimentalToolbarSettings"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user