mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
plugins: sort by installed status: take enable/disable; incompatibility into account (IDEA-83782)
This commit is contained in:
@@ -641,6 +641,14 @@ public class InstalledPluginsTableModel extends PluginTableModel {
|
||||
@Override
|
||||
public int compare(IdeaPluginDescriptor o1, IdeaPluginDescriptor o2) {
|
||||
if (isSortByStatus()) {
|
||||
final boolean incompatible1 = PluginManager.isIncompatible(o1);
|
||||
final boolean incompatible2 = PluginManager.isIncompatible(o2);
|
||||
if (incompatible1) {
|
||||
if (incompatible2) return comparator.compare(o1, o2);
|
||||
return -1;
|
||||
}
|
||||
if (incompatible2) return 1;
|
||||
|
||||
final boolean hasNewerVersion1 = hasNewerVersion(o1.getPluginId());
|
||||
final boolean hasNewerVersion2 = hasNewerVersion(o2.getPluginId());
|
||||
if (hasNewerVersion1) {
|
||||
@@ -673,6 +681,11 @@ public class InstalledPluginsTableModel extends PluginTableModel {
|
||||
return -1;
|
||||
}
|
||||
if (deleted2) return 1;
|
||||
|
||||
final boolean enabled1 = isEnabled(o1.getPluginId());
|
||||
final boolean enabled2 = isEnabled(o2.getPluginId());
|
||||
if (enabled1 && !enabled2) return -1;
|
||||
if (enabled2 && !enabled1) return 1;
|
||||
}
|
||||
return comparator.compare(o1, o2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user