mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
UnsupportedOperationException
This commit is contained in:
@@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -47,8 +48,9 @@ public class PlainModuleTemplatesFactory extends ProjectTemplatesFactory {
|
||||
return builder.getGroupName();
|
||||
}
|
||||
});
|
||||
groups.add(OTHER_GROUP);
|
||||
return ArrayUtil.toStringArray(groups);
|
||||
HashSet<String> set = new HashSet<String>(groups);
|
||||
set.add(OTHER_GROUP);
|
||||
return ArrayUtil.toStringArray(set);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+21
-21
@@ -58,29 +58,29 @@ public class LoadContextAction extends BaseTaskAction {
|
||||
DefaultActionGroup group = new DefaultActionGroup();
|
||||
final WorkingContextManager manager = WorkingContextManager.getInstance(project);
|
||||
List<ContextInfo> history = manager.getContextHistory();
|
||||
List<ContextHolder> infos = ContainerUtil.map2List(history, new Function<ContextInfo, ContextHolder>() {
|
||||
List<ContextHolder> infos = new ArrayList<ContextHolder>(ContainerUtil.map2List(history, new Function<ContextInfo, ContextHolder>() {
|
||||
public ContextHolder fun(final ContextInfo info) {
|
||||
return new ContextHolder() {
|
||||
@Override
|
||||
void load(final boolean clear) {
|
||||
LoadContextUndoableAction undoableAction = LoadContextUndoableAction.createAction(manager, clear, info.name);
|
||||
UndoableCommand.execute(project, undoableAction, "Load context " + info.comment, "Context");
|
||||
}
|
||||
@Override
|
||||
void load(final boolean clear) {
|
||||
LoadContextUndoableAction undoableAction = LoadContextUndoableAction.createAction(manager, clear, info.name);
|
||||
UndoableCommand.execute(project, undoableAction, "Load context " + info.comment, "Context");
|
||||
}
|
||||
|
||||
@Override
|
||||
void remove() {
|
||||
manager.removeContext(info.name);
|
||||
}
|
||||
@Override
|
||||
void remove() {
|
||||
manager.removeContext(info.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
Date getDate() {
|
||||
return new Date(info.date);
|
||||
}
|
||||
@Override
|
||||
Date getDate() {
|
||||
return new Date(info.date);
|
||||
}
|
||||
|
||||
@Override
|
||||
String getComment() {
|
||||
return info.comment;
|
||||
}
|
||||
@Override
|
||||
String getComment() {
|
||||
return info.comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
Icon getIcon() {
|
||||
@@ -88,7 +88,7 @@ public class LoadContextAction extends BaseTaskAction {
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}));
|
||||
final TaskManager taskManager = TaskManager.getManager(project);
|
||||
List<LocalTask> tasks = taskManager.getLocalTasks();
|
||||
infos.addAll(ContainerUtil.mapNotNull(tasks, new NullableFunction<LocalTask, ContextHolder>() {
|
||||
@@ -131,7 +131,7 @@ public class LoadContextAction extends BaseTaskAction {
|
||||
return o2.getDate().compareTo(o1.getDate());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
final Ref<Boolean> shiftPressed = Ref.create(false);
|
||||
boolean today = true;
|
||||
Calendar now = Calendar.getInstance();
|
||||
@@ -166,7 +166,7 @@ public class LoadContextAction extends BaseTaskAction {
|
||||
});
|
||||
popup.registerAction("invoke", KeyStroke.getKeyStroke("shift ENTER"), new AbstractAction() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
popup.handleSelect(true);
|
||||
popup.handleSelect(true);
|
||||
}
|
||||
});
|
||||
popup.addPopupListener(new JBPopupAdapter() {
|
||||
|
||||
@@ -215,12 +215,12 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
final MantisConnectPortType soap = createSoap();
|
||||
myProjects = new ArrayList<MantisProject>();
|
||||
ProjectData[] projectDatas = soap.mc_projects_get_user_accessible(getUsername(), getPassword());
|
||||
List<MantisProject> projects = ContainerUtil.map(projectDatas, new Function<ProjectData, MantisProject>() {
|
||||
List<MantisProject> projects = new ArrayList<MantisProject>(ContainerUtil.map(projectDatas, new Function<ProjectData, MantisProject>() {
|
||||
@Override
|
||||
public MantisProject fun(final ProjectData data) {
|
||||
return new MantisProject(data.getId().intValue(), data.getName());
|
||||
}
|
||||
});
|
||||
}));
|
||||
if (allProjectsAvailable(soap)){
|
||||
projects.add(0, MantisProject.ALL_PROJECTS);
|
||||
}
|
||||
|
||||
@@ -95,11 +95,12 @@ public class ComboControl extends BaseModifiableControl<JComboBox, String> {
|
||||
};
|
||||
final ResolvingConverter resolvingConverter = (ResolvingConverter)converter;
|
||||
final Collection<Object> variants = resolvingConverter.getVariants(context);
|
||||
final List<Pair<String, Icon>> all = ContainerUtil.map(variants, new Function<Object, Pair<String, Icon>>() {
|
||||
public Pair<String, Icon> fun(final Object s) {
|
||||
return Pair.create(ElementPresentationManager.getElementName(s), ElementPresentationManager.getIcon(s));
|
||||
}
|
||||
});
|
||||
final List<Pair<String, Icon>> all =
|
||||
new ArrayList<Pair<String, Icon>>(ContainerUtil.map(variants, new Function<Object, Pair<String, Icon>>() {
|
||||
public Pair<String, Icon> fun(final Object s) {
|
||||
return Pair.create(ElementPresentationManager.getElementName(s), ElementPresentationManager.getIcon(s));
|
||||
}
|
||||
}));
|
||||
all.addAll(ContainerUtil.map(resolvingConverter.getAdditionalVariants(context), new Function() {
|
||||
public Object fun(final Object s) {
|
||||
return new Pair(s, null);
|
||||
|
||||
Reference in New Issue
Block a user