mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-120544 13.1 EAP (134.1007): impossible to add empty Web module to the project
This commit is contained in:
@@ -25,8 +25,8 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.platform.ProjectTemplate;
|
||||
import com.intellij.platform.templates.ArchivedProjectTemplate;
|
||||
import com.intellij.ui.CollectionListModel;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.SingleSelectionModel;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.popup.list.GroupedItemsListRenderer;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -99,7 +99,7 @@ public class ProjectTemplateList extends JPanel {
|
||||
}
|
||||
};
|
||||
myList.setCellRenderer(renderer);
|
||||
|
||||
myList.setSelectionModel(new SingleSelectionModel());
|
||||
myList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.intellij.platform.templates.RemoteTemplatesFactory;
|
||||
import com.intellij.ui.CollectionListModel;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.SingleSelectionModel;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.*;
|
||||
@@ -125,6 +126,7 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable {
|
||||
List<TemplatesGroup> groups = fillTemplatesMap(context);
|
||||
|
||||
myProjectTypeList.setModel(new CollectionListModel<TemplatesGroup>(groups));
|
||||
myProjectTypeList.setSelectionModel(new SingleSelectionModel());
|
||||
myProjectTypeList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
@@ -178,6 +180,7 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable {
|
||||
projectTypeChanged();
|
||||
}
|
||||
});
|
||||
|
||||
myTemplatesList.addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
@@ -236,7 +239,7 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable {
|
||||
else {
|
||||
TemplatesGroup group = new TemplatesGroup(builder);
|
||||
groupMap.put(group.getName(), group);
|
||||
myTemplatesMap.put(group, new ArrayList<ProjectTemplate>());
|
||||
myTemplatesMap.put(group, new ArrayList<ProjectTemplate>(Collections.singletonList(template)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.ui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
public class SingleSelectionModel extends DefaultListSelectionModel {
|
||||
{
|
||||
setSelectionMode(SINGLE_SELECTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearSelection() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSelectionInterval(int index0, int index1) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user